Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

PBS

Please login with a confirmed email address before reporting spam

Hello

Im am trying to configure Comsol 4.2 for parallel computing on Linux using PBS. And i was wondering where can i see exemples for command files?

2 Replies Last Post 06.03.2012, 11:03 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 06.03.2012, 10:55 GMT-5
Here is a script that can be customised to your needs. It works fine with PBS on our RH5 LINUX cluster.

Best regards,

Alain Glière


#!/bin/bash
#
# submit a parallel COMSOL job on SUMMER cluster

# ##############################################################################

if [ $# -ne 3 -o "$1" = "-help" ]
then
echo " "
echo "Usage: qCOMSOL4parallel nn np comsolFile[.mph]"
echo " nn is the number of computer nodes"
echo " np is the number of cores per computer node"
echo " comsolFile.mph is the input file name"
echo " "
exit
fi

# process the command line arguments

export nn=$1
export perhost=$2
export input_file=$3

# job parameters

export queue_name=yourQueue
export output_file=out_${input_file}
export basename=${input_file%.mph}
export job_name=${basename}
export tmp_dir=~/tmp
export work_dir=~/COMSOL4
export comsol_dir=/opt/comsol/comsol42a/bin

# submit the job

qsub -V -l nodes=${nn}:ppn=${perhost} -q ${queue_name} -N ${job_name} -r n -o ${tmp_dir}/${basename}_$$.log -e ${tmp_dir}/${basename}_$$.err <<\[EOF]

echo "------------------------------------------------------------------------------"
echo "--- Starting job at: `date`"
echo

cd ${work_dir}
echo "--- Current working directory is: `pwd`"

# run COMSOL in parallel (i.e. boot mpd, run comsol and exit mpd)

total=$(wc -l < $PBS_NODEFILE)
echo "--- Running on ${total} processes (cores) on the following nodes:"
uniq -c $PBS_NODEFILE

echo "--- mpd BOOT"
${comsol_dir}/comsol -nn ${nn} mpd boot -f $PBS_NODEFILE -mpirsh ssh --verbose

echo "--- mpd TRACE"
${comsol_dir}/comsol mpd trace -l

echo "--- Parallel COMSOL RUN"
${comsol_dir}/comsol -nn ${nn} -np ${perhost} batch -inputfile ${input_file} -outputfile ${output_file} -batchlog ${basename}.log

echo "--- mpd ALLEXIT"
${comsol_dir}/comsol mpd allexit

echo
echo "--- Job finished at: `date`"
echo "------------------------------------------------------------------------------"

[EOF]
Here is a script that can be customised to your needs. It works fine with PBS on our RH5 LINUX cluster. Best regards, Alain Glière #!/bin/bash # # submit a parallel COMSOL job on SUMMER cluster # ############################################################################## if [ $# -ne 3 -o "$1" = "-help" ] then echo " " echo "Usage: qCOMSOL4parallel nn np comsolFile[.mph]" echo " nn is the number of computer nodes" echo " np is the number of cores per computer node" echo " comsolFile.mph is the input file name" echo " " exit fi # process the command line arguments export nn=$1 export perhost=$2 export input_file=$3 # job parameters export queue_name=yourQueue export output_file=out_${input_file} export basename=${input_file%.mph} export job_name=${basename} export tmp_dir=~/tmp export work_dir=~/COMSOL4 export comsol_dir=/opt/comsol/comsol42a/bin # submit the job qsub -V -l nodes=${nn}:ppn=${perhost} -q ${queue_name} -N ${job_name} -r n -o ${tmp_dir}/${basename}_$$.log -e ${tmp_dir}/${basename}_$$.err

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 06.03.2012, 11:03 GMT-5
thank you very much
i will try it
thank you very much i will try it

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.