Hello everyone,
I am fairly new to matlab parallel functions and I would like some advice and help.
I have two individual matlab scripts (do not need any communication between them) and I would like to run both at the same time (in parallel).
At the moment I tried to run these scripts by calling the commands below:
j = batch('SimplifiedNet1', 'Profile', 'local','matlabpool', 2);
k = batch('SimplifiedNet2', 'Profile', 'local','matlabpool', 2);
When I check in the job monitor I can see that the first job is running while the second is queued until the first finishes.
How can I run both of the scripts at the same time?
Thank you!

 채택된 답변

Edric Ellis
Edric Ellis 2014년 12월 12일

1 개 추천

Do your scripts call PARFOR or other parallel language features? By specifying "...'matlabpool', 2" in your batch command, each job is taking up 3 workers - so you're probably running out of workers. If the scripts don't need to use PARFOR, then simply omit those arguments.
You can check how many workers your local cluster can support simply by displaying the object:
disp(parcluster('local'))

댓글 수: 1

Many thanks for the reply! I was running out of workers. Now it works fine!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2014년 12월 12일

1 개 추천

doc createJob
doc createTask
Create one job and then attach the two scripts to it as tasks (slightly lower-level api than batch but gives you this kind of control).

질문:

2014년 12월 11일

댓글:

2014년 12월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by