I am using spmd
to distribute two different tasks into the two processors of the computer. The code is something similar to:
spmd
if labindex==1
TASK_ONE;
end
if labindex==2
TASK_TWO;
end
end
Each task opens a file and processes it, storing the results. The loop continues while there still are files to process. My problem is that TASK_ONE
has fewer files to process, and when it finishes, the code stops (it exits the spmd
block). Thus, TASK_TWO
does not finish processing all of its files. Is there a way to make that spmd
keeps running until TASK_TWO
finishes, even if TASK_ONE
has already finished?