Hi,
I was running a matlab code on a cluster with parfor to speed up my code, but I was wondering if parfor is actually run. So the piece of code that use parfor is the following
parfor ii = 1 : size( stateind , 1 )
disp( ii ) ;
Ibra = stateind( ii , : ) ; % Ordered set of indices for the bra state
for jj = ii : size( stateind , 1 )
I will print out ii for each parfor. In my local computer, I will get some random output as parfor randomly assign the loop to different workers. However, I got the following serial output on the cluster
Starting parallel pool (parpool) using the 'local' profile ...
63504
63503
63502
63501
63500
63499
63498
63497
63496
63495
63494
63493
63492
63491
63490
63489
63488
As a result, I am confused if parfor is actually run on the cluster or not. By the way, I didn’t specify the profile of the parpool, how should I properly do that?
UPDATE: When I replace parfor with for, indeed, the code seems run slower on the cluster. However, I still fell something is not correct here...
Thanks!