MATLAB: Running individual matlab scripts in parallel

parallelparallel computing

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!

Best Answer

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'))