Cannot execute matlabpool close on the labs.

Hi:
I'm just starting doing parallel programing and till now everything went fine, but now I get an error I don't understand.
*Error using ==> parallel_function at 598 Error in ==> matlabpool at 135 Cannot execute matlabpool close on the labs.
Error in ==> getallbiggervecs at 43 parfor i=1:m
Error in ==> getallbiggervecs at 36 y=[y;getallbiggervecs(Y,Xvar,nucleos)];
*
It's just my intuition, but I think that parallelism doesn't work fine with recursive functions.
Here's the routine (I added an extra if to use normal for.loop and compare):

3 comentarios

Sean de Wolski
Sean de Wolski el 9 de Jun. de 2011
Your intuition is correct.
Sean de Wolski
Sean de Wolski el 9 de Jun. de 2011
what is 'safestarmatlabpool'?
kira
kira el 9 de Jun. de 2011
safestarmatlabpool it's just a little routine that ask if matlabpool is open, before trying opennig...

Iniciar sesión para comentar.

Respuestas (1)

Edric Ellis
Edric Ellis el 9 de Jun. de 2011

1 voto

You can nest a PARFOR loop invoke another PARFOR loop, but you will not get any additional parallelism. (due to a current limitation, the inner PARFOR loop cannot occur directly in the text of the outer PARFOR loop) There is no extra parallelism because you cannot open or close another MATLABPOOL on the workers. (One way to tell if you're on a worker is to ask "isempty(getCurrentJob)")

6 comentarios

kira
kira el 9 de Jun. de 2011
I see. But what if for example, I have 4 workers available and I just start matlabpool with 2. Shouldn't the inner parfor-loop use the 2 unused workers?
Walter Roberson
Walter Roberson el 9 de Jun. de 2011
Kira, you can do that by calling a function that opens the new pool and has a PARFOR. The limitation is on directly nested PARFOR.
kira
kira el 11 de Jun. de 2011
I see, so if the "inner" function use a parfor, there should be no problem, i mean, if i only have 4 cores, and i'm using them in the outer loop, the inner function can use them as well?
Walter Roberson
Walter Roberson el 11 de Jun. de 2011
I have not worked in that area, but my understanding is that if you want the inner PARFOR to actually run distributed, it has to run in a different pool.
kira
kira el 13 de Jun. de 2011
i see... I'll check some routines and see what happens...
kira
kira el 14 de Jun. de 2011
Hi again:
After some experiments, i have this:
a parfor that calls a function that also has a parfor:
- the inner function works fine if executed by itself
- the parfor works fine if the inner function use a for-loop instead of a parfor
- nothing happens (ie, the program is not executed) if the inner function use the parfor... the error i get is the one i posted...
So, the problem is not with the function being recursive by itself, since it works. But executed inside the parfor-loop it can't be done... why, i don't now...

Iniciar sesión para comentar.

Categorías

Preguntada:

el 9 de Jun. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by