Hi,

I have not tried integrating MATLAB's distributed computing
into SGE (6.2u5 on our Rocks 5.4.2/6.0 clusters) but I have
had enough success with Parallel Computing Toolbox that I'm
comfortable sharing the notes:

  1. MATLAB R2011b is installed under

     /share/apps/matlab/R2011b/


  2. MATLAB R2011b can use up to 8 cores/processors
     within the same physical node. It does not, however,
     work with cores/processors from physically different
     nodes.

     MATLAB R2012b can do the same up to 12 cores/processors.

     This number, 8 or 12, kind of sets the upper limit for 

       matlabpool open N

     line in #3 below. Also, see #5.


  3. A sample .m file that uses 'parfor' loops is as follows.
     I call it 'eigen_parfor.m':


% Open the MATLABPOOL with 2 workers
matlabpool open 2

% Start the timer
tic

% Initialize variables
N = 5000; 
a = zeros(N, 1);

% Start parallel for loop 
parfor (i = 1:N)
  a(i) = max(abs(eig(rand(300))));
end
% End parallel for loop

% Stop the timer
toc

% Close the MATLABPOOL
matlabpool close


  4. A SGE script to submit the above .m file to
     the queue would look as follows. I call it
     'eigen_parfor.sh'

#! /bin/bash
# 
#$ -cwd
#$ -j y
#$ -S /bin/bash
#$ -M EMAIL_ADDRESS
#$ -m abes
#$ -pe mpich 3
#$ -q [email protected]

# MATLAB (R2011b) settings
export MATLAB="/share/apps/matlab/R2011b"
export PATH="${PATH}:${MATLAB}/bin"

# Run MATLAB R2011b (parallel)
$MATLAB/bin/matlab -nodisplay -nosplash -r eigen_parfor


  5. A somewhat important thing to note is that if
     eigen_parfor.m file has

       matlabpool open N

     then eigen_parfor.sh has

       #$ -pe mpich N+1


     Reason being, when called in batch mode, MATLAB
     uses one instance to monitor the 'slaves' (I have
     verified this with MATLAB folks in person). This
     will make sure that SGE is aware of the extra
     MATLAB process running on a given node.

     This also limits the maximum value of N that can
     be used in

       matlabpool open N

     to 

     minimum of '1 less than the total number of cores 
     available in that compute node' and '8' 
     (for MATLAB R2011b)

     minimum of '1 less than the total number of cores
     available in that compute node' and '12'
     (for MATLAB R2012b)

     That is to say, if your compute node has a 4 total
     cores, then you can only use

       matlabpool open 3 (for either version of MATLAB)

     If your compute node has a total of 8 cores, then
     you can only use 

       matlabpool open 7 (for either version of MATLAB)

     If your compute node has a total of 16 cores, then
     you can use

       matlabpool open 8  (for MATLAB R2011b)
       matlabpool open 12 (for MATLAB R2012b)



Hope this helps.

Best,
g

--
Gowtham
Information Technology Services
Michigan Technological University

(906) 487/3593
http://www.it.mtu.edu/


On Sun, 21 Oct 2012, Semi wrote:

| Anybody have experience with 
| 
| PARALLEL COMPUTING TOOLBOX AND MATLAB DISTRIBUTED COMPUTING SERVER
| 
| integration under SGE?
| 
| http://www.mathworks.com/products/distriben/supported/index.html
| 
| 
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to