#!/bin/ksh ################################################################### # # # Script ksh pour lancer un calcul Q-Chem en batch # # # ################################################################### nodename=$1 ; [ 0 = $# ] || shift filename=$1 ; [ 0 = $# ] || shift nodeslist="node0 node1 node2 node4 node5 node6 node7" jobtime=800:0:0 if [ -z "$filename" ] || [ -z "$jobtime" ] then clear echo " " echo "===========================================" echo " submitQChem " echo " Pour toutes questions contacter : " echo " A.R. Allouche allouche@lasim.univ-lyon1.fr" echo "===========================================" echo "vous devez fournir :" echo " - le nom du noeud ($nodeslist)" echo " - le nom du fichier(y compris l'extension .in)" echo "-------------------------------------------" echo "Exemple:" echo " submitQChem node7 h2.in " echo " fichier de donnees : h2.in" echo "===========================================" echo " " exit 1 fi ok="false" for item in $nodeslist ; do if [ $nodename = $item ] then ok="true" break fi done if [ $ok = "false" ] then echo "================================================================" echo "Sorry $ndoename is not a supported node" echo "Here is the list of supported nodes : $nodeslist" echo "================================================================" exit 1 fi filecom=$filename filename=${filecom%.in} [ "$filename" = "$filecom" ] && filename=${filecom%.inp} fileout=$filename.out DEFAULTDIR=`pwd` TEMPDIR=/tmp nameUser=$LOGNAME if test ! -s "$filecom" then echo " " echo "============================================" echo "le fichier $filecom est introuvable(ou vide)" echo "============================================" echo " " exit 2 fi endof=EOF cat > $filename.pbs <<EOF #!/bin/sh #PBS -l nodes=$nodename #PBS -j oe #PBS -N $filename #PBS -l walltime=$jobtime #PBS -o $filename.pbsout export QC=/home/theochem/rabillou/QChem; if [ -e \$QC/bin/qchem.setup.sh ] ; then . \$QC/bin/qchem.setup.sh fi export QCAUX=\$QC/aux; #export ONEEXE="-DONEEXE"; #export QCLOCALSCR= $PBSTMPDIR; mkdir /tmp/$USER rm -fr /tmp/$USER/$filename mkdir /tmp/$USER/$filename export QCSCRATCH=/tmp/$USER/$filename cd $DEFAULTDIR \$QC/bin/qchem $filecom $fileout EOF qsub $filename.pbs echo " " echo "===================================================================" echo " " echo "Un fichier $filename.pbs a ete cree pour lancer le calcul" echo "Ne pas effacer ce fichier avant la fin du calcul" echo " " echo "-------------------------------------------------------------------" echo " " echo "pour avoir des informations sur vos job taper : qstat " echo " " echo "pour detruire un job taper : qdel num.master0.alin" echo " num.master0.alin est le Job Id fourni par qstat" echo " " echo "===================================================================" echo " "