Say I have something like this:
myfun[dataA,X1,Y1,Z1,W1];
myfun[dataB,X2,Y2,Z2];
myfun[dataC,X3,Y3,Z3];
(* with many more of the same *)
Each would take about 5 to 10 minuets to run. The function takes many arguments, some have default values.
With lots of these functions, I am currently dividing them into 4 different notebooks, then run them on different kernels, so that I am using 4 cores fully. But I think there is a better way to do this?
I want to know how to group them and run them at the same time?
Say with 16 different calls to myfun
, can I ask Mathematica, to use all 4 cores?
If one core finishes a single run, then move on to the next run? So there are always 4 cores running?
Thanks!
myfun
are different. Do I have to setup a table in some way? $\endgroup$ParallelMap
orParallelSubmit
your jobs. I would suggest you try some of the documentation examples to get an idea. As for the number of cores, parallelization works on kernels. Where each kernel will run is a different story (which works out fine usually,though). TryAbsoluteTiming[ParallelMap[Pause, {1, 1, 1,1}]]
... $\endgroup$