sgeParallelWrapper.sh

#!/bin/sh
# Ensure that under SGE, we're in /bin/sh too:
#$ -S /bin/sh

# The previous line ensures that all required environment variables are
# forwarded from the client MATLAB session through the scheduler to the cluster
# 
# This script uses the following environment variables set by the submit M-code
# MDCE_CMR            - the value of ClusterMatlabRoot (may be empty)
# MDCE_MATLAB_EXE     - the MATLAB executable to use
# MDCE_MATLAB_ARGS    - the MATLAB args to use
#
# The following environment variables are forwarded through mpiexec:
# MDCE_DECODE_FUNCTION     - the decode function to use
# MDCE_STORAGE_LOCATION    - used by decode function 
# MDCE_STORAGE_CONSTRUCTOR - used by decode function 
# MDCE_JOB_LOCATION        - used by decode function 


#export MLM_LICENSE_FILE=27000@eddie01
#echo "MLM_LICENSE_FILE=$MLM_LICENSE_FILE"

FULL_MPIEXEC=${MDCE_CMR:+${MDCE_CMR}/bin/}mw_mpiexec
MPIEXEC_CODE=0

SMPD_PORT=`expr $JOB_ID % 5000 + 20000`
MACHINE_ARG="-n ${NSLOTS} -machinefile ${TMPDIR}/machines"

echo \"${FULL_MPIEXEC}\" -phrase MATLAB -port ${SMPD_PORT} \
        -l ${MACHINE_ARG} -genvlist \
        MDCE_DECODE_FUNCTION,MDCE_STORAGE_LOCATION,MDCE_STORAGE_CONSTRUCTOR,MDC
E_JOB_LOCATION \
        \"${MDCE_MATLAB_EXE}\" ${MDCE_MATLAB_ARGS}
    

eval \"${FULL_MPIEXEC}\" -phrase MATLAB -port ${SMPD_PORT} \
        -l ${MACHINE_ARG} -genvlist \
        MDCE_DECODE_FUNCTION,MDCE_STORAGE_LOCATION,MDCE_STORAGE_CONSTRUCTOR,MDC
E_JOB_LOCATION \
        \"${MDCE_MATLAB_EXE}\" ${MDCE_MATLAB_ARGS}

exit ${?}

sgeParallelWrapper.sh (windows) (last edited 2007-11-12 14:30:56 by Yuan WAN)