Running individual matlab scripts in parallel?

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!

 Respuesta aceptada

Edric Ellis
Edric Ellis el 12 de Dic. de 2014
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 comentario

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

Iniciar sesión para comentar.

Más respuestas (1)

Sean de Wolski
Sean de Wolski el 12 de Dic. de 2014
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).

Preguntada:

el 11 de Dic. de 2014

Comentada:

el 17 de Dic. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by