문제

I want to launch a number of parallel jobs in matlab exploiting the power of gnu-parallel.

In my folder I have the test.m file:

function test(a)
while 1
disp(a);
end
exit;

I'm used to launching multiple parallel session of matlab in this way:

for i in `seq 1 10`; do
  nohup matlab -singleCompThread -nodesktop -nosplash -r "test($i,43))" &
done

but what if I want to adapt this script to gnu-parallel? I've tried with:

parallel "matlab -nodisplay -nodesktop -nojvm -nosplash -r 'test({1})'" ::: 1 2 3 4

but this doesn't work at all. Using gnu-parallel for me should be of great help because it's able to balance computation and processes much better than my previous solution does.

Some ideas?

도움이 되었습니까?

해결책

This ought to work (I do not have access to a matlab installation):

seq 1 10 | parallel 'matlab -singleCompThread -nodesktop -nosplash -r "test({},43))"'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top