Changing the size of SPMD
Show older comments
I need to close spmd and open another spmd of a smaller size repeatedly, but I receive this error that there exists an active spmd. I need to open and close spmds in a loop. What I am actually doing to get my code working is closing and opening the pool every time at the beginning of the loop, which is really inefficient. Also, I am using 2012b and it does not recognize "delete(gcp)".
I would appreciate your help!
1 Comment
Answers (1)
Edric Ellis
on 26 Jan 2015
1 vote
You probably have existing distributed arrays or Composite objects in your workspace - these prevent you from changing the size of the active SPMD context. If you clear all those from your workspace, you should be able to proceed.
4 Comments
Mehdi
on 26 Jan 2015
Mehdi
on 26 Jan 2015
micholeodon
on 13 Oct 2020
Edited: Rik
on 14 Oct 2020
Here you can find a way to clear all Composites in your workspace.
Edit Rik:
The contents of that page show this solution:
D = whos();
D = D(arrayfun(@(d) strcmp(d.class,'yourclassname'),D));
clear(D.name)
micholeodon
on 13 Oct 2020
Also avoid syntax with tildas like:
[outvar1, ~] = some_function(arg1, arg2);
do instead
outvar1 = some_function(arg1, arg2);
because it can trigger context error as well.
Categories
Find more on Software Development in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!