File: submitGamess

package info (click to toggle)
gabedit 2.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 17,236 kB
  • sloc: ansic: 294,923; cpp: 2,081; sh: 1,111; makefile: 507; csh: 181
file content (116 lines) | stat: -rw-r--r-- 4,375 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/sh
###################################################################
#                                                                 #
#  Script ksh pour lancer un calcul Gamess en batch               #
#  Auteur:  A-R Allouche allouche@lasim.univ-lyon1.fr             #
#  LASIM, Villeurbanne                                            #
#  Ecriture : Janvier 2006                                        #
#                                                                 #
###################################################################

queue=$1 ; [ 0 = $# ] || shift
underqueue=$1 ; [ 0 = $# ] || shift
filename=$1 ; [ 0 = $# ] || shift

if [ -z "$filename" ] || [ -z "$queue" ]
then
   clear
   echo " " 
   echo "==========================================="
   echo "                 submitGamess "
   echo " Pour toutes questions contacter : "
   echo " A.R. Allouche allouche@lasim.univ-lyon1.fr"
   echo "==========================================="
   echo "vous devez fournir le nom de la queue et le nom de la sous-queue :"
   echo "     Queue         Duree    Sous-Queue     Nproc max"
   echo "     =========     =====    ==========     ========="
   echo "     v20zlin       12h      v20zlin4          4"
   echo "                            v20zlin8          8"
   echo "                            v20zlin16        16"
   echo "                            v20zlin32        32"
   echo "                            v20zlin64        64"
   echo "     v20zlinL      24h      v20zlin16        16"
   echo "                            v20zlin32        32"
   echo "     v20zlinS      48h      v20zlin4          4"
   echo "                            v20zlin8          8"
   echo "     v40zlin       24h      v40zlin4          4"
   echo "                            v40zlin8          8"
   echo "                            v40zlin16        16"
   echo "                            v40zlin32        32"
   echo "     v40zlinL      48h      v40zlin8          8"
   echo "     v40zlinS      96h      v40zlin4          4"
   echo "     test8proc     5mn      v20ztest8         8"
   echo "     test4proc     10mn     v40ztest4         4"
   echo " - le nom du fichier(y compris l'extension .com)"
   echo "-------------------------------------------"
   echo "Exemple:"
   echo "       submitGamess v20zlin v20zlin4 h2.inp "
   echo "       fichier de donnees : h2.inp"
   echo "       Queue,Sous-Queue   : v20zlin (12h00)+v20zlin4(4 proc)"
   echo "==========================================="
   echo " " 
   exit 1
fi
fileinp=$filename
filename=${fileinp%.inp}
nproc=`echo $underqueue | awk '{split($0,a,"lin"); print a[2]}'`
d="x$nproc"
l="x"
if (  test $l == $d )
then
nproc=`echo $underqueue | awk '{split($0,a,"test"); print a[2]}'`
fi
d="x$nproc"
l="x"
if (  test $l == $d )
then
echo "Sorry, $underqueue n'est pas une sous queue de $queue "
exit
fi
base1=`echo $queue | awk '{split($0,a,"lin"); print a[1]}'`
base2=`echo $underqueue | awk '{split($0,a,"lin"); print a[1]}'`
if (  test $base1 != $base2 )
then
	base1=`echo $queue | awk '{split($0,a,"proc"); print a[1]}'`
	base2=`echo $underqueue | awk '{split($0,a,"z"); print a[2]}'`
	if (  test $base1 != $base2 )
	then
		echo "Sorry, $underqueue n'est pas une sous queue de $queue "
		exit
	fi
fi
DEFAULTDIR=`pwd`
if test ! -s "$fileinp"
then
   echo " " 
   echo "============================================"
   echo "le fichier $fileinp est introuvable(ou vide)"
   echo "============================================"
   echo " " 
   exit 2
fi

endof=EOF
cat > $filename.sh <<EOF
#!/bin/sh
cd $DEFAULTDIR
rm $HOME/scr/$filename.*
/home/allouche/gamess/rungms $filename 04 $nproc >&  $filename.log
EOF

/usr/local/sge/bin/lx24-amd64/qsub -o $DEFAULTDIR -e $DEFAULTDIR -q $queue -pe $underqueue $nproc $filename.sh
echo " " 
echo "==================================================================="
echo " " 
echo "Un fichier $filename.sh 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 JobID"
echo "   JobID est le Job-Id fourni par qstat" 
echo " " 
echo "==================================================================="
echo " "