RESCOMP Archives

April 2006

RESCOMP@LISTSERV.MIAMIOH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
jaime combariza <[log in to unmask]>
Reply To:
Research Computing Support <[log in to unmask]>, jaime combariza <[log in to unmask]>
Date:
Fri, 7 Apr 2006 15:41:32 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (78 lines)
Well I got it working but the script is not pretty. I may need to do 
some cleaning.


1 - to be able to use MatlabMPI add this file in your $HOME/matlab 
directory and call it startup.m

addpath /software/MatlabMPI/src

2 - to run matlab in batch mode use this script:

#!/bin/tcsh

#PBS -N matlabmpi
#PBS -l nodes=4:ppn=2
#PBS -j oe
#PBS -m eab

#PBS -q parallel
#PBS -V

module load matlab

# get the host names (add quotes to the compute nodes names)
sed -e "s/c/\'\c/g" -e 's/$/E/' -e "s/E/\'\ /g" $PBS_NODEFILE > M5

# set machine names for matlab input file
cat machines M5 endmachines  >  M55

# join all lines into one line (apparently required by matlabMPI)
sed -f join-lines M55 > M66

# final input file for matlabMPI
cat M66 RUN.m > RUN1.m

#run matlabMPI
matlab -nojvm -nosplash -display null < RUN1.m

----------------------

######machines contains: (no quotes)
  "machines ={"
########endmachines contains:
"};"

############the script join-lines is simply:

     /./{H; $!d;}             # Put each paragraph into hold space
      x;                       # Swap hold space and pattern space
      s/^\(\n\)\(..*\)$/\2\1/; # Move leading \n to end of PatSpace
      s/\n\(.\)/ \1/g;         # Replace all other \n with 1 space

#######RUN.m contains::

% Abort left over jobs.
MPI_Abort;
pause(2.0);

% Delete left over MPI directory
MatMPI_Delete_all;
pause(2.0);

% Example scripts.
eval( MPI_Run('probe',      8,machines) );

##### make sure the number 8 is replaced by the number of processes 
you want to use)

##### the file probe.m must exist in your current working dir and 
contains all matlab/MPI commands


Jaime E. Combariza, Ph.D.
Assistant Director Research Computing
http://www.muohio.edu/researchcomputing
Miami University
(513) 529-5080  

ATOM RSS1 RSS2