user3802704
user3802704

Reputation: 11

gnu parallel with matlab parfor loop

I am running a matlab function through a bash script using gnu parallel. The matlab function takes as input a single file which I am passing in using the find command in bash:

find $path -name *.nc | parallel - j 8 "echo{} | matlab -nojvm -nosplash -r matlab_function"

The matlab function uses a parfor loop and I am having trouble determining if this is really even working or not because it seems like it is going slower than if I simply run the function manually in the matlab gui. I mean it is definitely executing, but I am concerned that because the bash script is opening 8 instances of matlab, each of them running a parfor loop, that maybe they are not actually able to run parfors? Can anyone help me at least determine whether or not this is actually running correctly in parallel?

Oh and I currently have two terminal instances open running the script on different portions of data so really I believe there are 16 matlab instances running.

Thank you

Upvotes: 1

Views: 580

Answers (1)

Ole Tange
Ole Tange

Reputation: 33685

You do not write how many CPU cores you have. If you only have 8, then you will not be able to tell the difference. So try running fewer jobs in parallel and see in top if the processes use > 100%.

Upvotes: 0

Related Questions