Changing the size of SPMD
Mostrar comentarios más antiguos
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 comentario
Respuestas (1)
Edric Ellis
el 26 de En. de 2015
1 voto
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 comentarios
Mehdi
el 26 de En. de 2015
Mehdi
el 26 de En. de 2015
micholeodon
el 13 de Oct. de 2020
Editada: Rik
el 14 de Oct. de 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
el 13 de Oct. de 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.
Categorías
Más información sobre Software Development en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!