Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TheBrazilianGuy

macrumors regular
Original poster
Jul 26, 2006
149
0
We have a executable file that compiles independent pieces of code (in this case fortran) :

g77 -O2 code1.f
g77 -O2 code2.f
...
g77 -O2 codeN.f

Does someone know how to execute this file using all possible cores in a Macpro ? I mean, splitting and executing this file in 8 would be a nice speed up.

Thxs!
 

TheBrazilianGuy

macrumors regular
Original poster
Jul 26, 2006
149
0
What is this "executable file"?

Oh, my fault. This is something we came up to avoid typing all
N commands over and over. All g77 commands are inside a single
file we call "CompileAll". After setting this file as executable,
we just type :

./CompileAll

and everything is done after a mug of coffee.

Being all N codes independent, I was going to split CompileAll and execute
it in all cores at the same time. That's when I decided to see if someone
has a better idea...(actually, the best solution might well be to
use "make" with the option "-j")
 

cube

Suspended
May 10, 2004
17,011
4,973
That's what I wanted to hear. Yes, replace this CompileAll script with "make -j 8"
 

cube

Suspended
May 10, 2004
17,011
4,973
Just make it so that there are several matches at the same time. Don't write g77 commands for each file one below the other in one rule.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.