Subject: | |
From: | |
Reply To: | |
Date: | Fri, 7 Apr 2006 15:41:32 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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
|
|
|