Last active
May 26, 2018 10:32
-
-
Save alchem0x2A/2c28aca707d751c1cc10e1eff6022f3b to your computer and use it in GitHub Desktop.
Template submission script for comsol in lsf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Generic script for submitting comsol job | |
#usage: sub_job.sh [COMSOL_IN_NAME] [optional:MEM] | |
INFILE=$1 | |
OUTFILE=$(echo $INFILE | cut -f 1 -d ".") | |
OUTFILE+="_out.mph" | |
#Memory alloc | |
MEM=4096 | |
if [ $# -ge 2 ]; then | |
MEM=$2 | |
fi | |
#cores | |
NP=4 | |
if [ $# -ge 3 ]; then | |
NP=$3 | |
fi | |
JOB_STRING="comsol batch -np $3 -inputfile $INFILE -outputfile $OUTFILE" | |
#Now the submission line | |
SUB_STRING="bsub -n $3 -W 24:00 -R \"rusage[mem=$MEM]\" \"$JOB_STRING\"" | |
echo "Final check:" $SUB_STRING | |
while true; do | |
read -p "Ready for sumission?[y/n]" OPTION | |
case $OPTION in | |
[Yy]* ) eval $SUB_STRING; break;; | |
[Nn]* ) break;; | |
* ) echo "y or n?";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment