1
votes

I have studied pages and discussion on matlab processing, but I still don't know how to distribute my program over several nodes(not cores). In the cluster which I am using, there are 10 nodes available, and inside each node there are 8 cores available. When Using "parfor" inside each node (locally between 8 cores), the parallel-ization works fine. But when using several nodes, I think that (not sure how to verify this) it doesn't work well. Here is a piece of program which I run on the cluster:

function testPool2()
disp('This is a comment')
disp(['matlab number of cores : '   num2str(feature('numCores'))])

matlabpool('open',5);
disp('This is another comment!!')
tic; 
for i=1:10000 
    b = rand(1,1000);
end;
toc
tic; 
parfor i=1:10000 
    b = rand(1,1000);
end;
toc

end

And the outputs is :

This is a comment
matlab number of cores : 8
Starting matlabpool using the 'local' profile ... connected to 5 labs.
This is another comment!!
Elapsed time is 0.165569 seconds.
Elapsed time is 0.649951 seconds.
{Warning: Objects of distcomp.abstractstorage class exist - not clearing this
class
or any of its super-classes} 
{Warning: Objects of distcomp.filestorage class exist - not clearing this class
or any of its super-classes} 
{Warning: Objects of distcomp.serializer class exist - not clearing this class
or any of its super-classes} 
{Warning: Objects of distcomp.fileserializer class exist - not clearing this
class
or any of its 

super-classes}

The program is first compiled using "mcc -o out testPool2.m" and then transferred to an scratch drive of a server. Then I submit the job using Microsoft HPC pack 2008 R2. Also note that I don't have access to the graphical interface of the MATLAB installed on each of the nodes. I can only submit jobs using MSR HPC Job Manager (see this: http://blogs.technet.com/b/hpc_and_azure_observations_and_hints/archive/2011/12/12/running-matlab-in-parallel-on-a-windows-cluster-using-compiled-matlab-code-and-the-matlab-compiler-runtime-mcr.aspx )

Based on the above output we can see that, the number of the available cores is 8; so I infer that the "matlabpool" only works for local cores in a machine; not between nodes (separate computers connected to each other)

So, any ideas how I can generalize my for loop ("parfor") to nodes ?

PS. I have no idea what are the warnings at the end of the output !

1

1 Answers

1
votes

In order to run MATLAB on multiple nodes, the distributed computing server is needed in addition to the parallel computing toolbox. The distributing computing server must be installed and correctly configured on all of the nodes in the cluster. Normally MATLAB distributed server comes with shell scripts for launching parallel MATLAB jobs on, multiple nodes based on scheduler and cluster setup.

Without access to the distributed computing server, MATLAB can only be run on a single node. It would be valuable to verify with the cluster administrator that the distributed computing server is setup and running correctly; in some cases the administrators of these servers even have example scripts for launching and running jobs common to their user base, e.g. MATLAB

Here is a link to documentation on the Distributed Computing Server: http://www.mathworks.com/help/mdce/index.html?searchHighlight=distributed%20computing%20server