pratikm
pratikm

Reputation: 4254

non-blocking spmd

Is there a way to run code in spmd without blocking the client process? I was hoping to use the client as a master that gives parameters to the labs so that they can then solve it.

Upvotes: 0

Views: 227

Answers (1)

Edric
Edric

Reputation: 25140

You can run a parallel job asynchronously - however, there's overhead to this, and you'll need to pass your data in and out each time, so it may not be so convenient. For example

s = findResource(...);
j = createParallelJob( s, ... );
t = createTask( j, @myFcn, nOut, { ... } );
submit(j);
% do other stuff
waitForState(j); % wait for completion
argsOut = getAllOutputArguments(j);

Doc here: http://www.mathworks.co.uk/help/toolbox/distcomp/bqur75w-7.html

Upvotes: 1

Related Questions