File: submitg98

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 (157 lines) | stat: -rw-r--r-- 4,809 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/bin/ksh
###################################################################
#                                                                 #
#  Script ksh pour lancer un calcul Gaussian 98 en batch          #
#  Auteur:  A-R Allouche allouche@lasim.univ-lyon1.fr             #
#  LASIM, Villeurbanne                                            #
#  Ecriture : Janvier 2003                                        #
#                                                                 #
###################################################################

nproc=$1 ; [ 0 = $# ] || shift
jobtime=$1 ; [ 0 = $# ] || shift
filename=$1 ; [ 0 = $# ] || shift

if [ -z "$filename" ] || [ -z "$nproc" ] || [ -z "$jobtime" ]
then
   clear
   echo " " 
   echo "==========================================="
   echo "                 submitg98 "
   echo " Pour toutes questions contacter : "
   echo " A.R. Allouche allouche@lasim.univ-lyon1.fr"
   echo "==========================================="
   echo "vous devez fournir :"
   echo "      - le nombre de microprocesseurs"
   echo "      - le temps de calcul( hh:mm:ss)"
   echo "      - le nom du fichier(y compris l'extension .com)"
   echo "-------------------------------------------"
   echo "Exemple:"
   echo "       submitg98 4 2:00:00 h2.com "
   echo "       fichier de donnees         : h2.com"
   echo "       Nombre de microprocesseurs : 4"
   echo "       Temps de calcul(maximum)   : 2 heurs"
   echo "==========================================="
   echo " " 
   exit 1
fi
filecom=$filename
filename=${filecom%.com}
if test ! -s "$filecom"
then
   echo " " 
   echo "============================================"
   echo "le fichier $filecom est introuvable(ou vide)"
   echo "============================================"
   echo " " 
   exit 2
fi

gscr=/tmpp/$NAME

notifi="# @ notification=never"
notifyuser="#"

endof=EOF
cat > $filename.cmd <<EOF
#!/bin/ksh
#--------------------------------------------------------------------
# fichier script genere par batg98
#--------------------------------------------------------------------
#
# @ step_name = step_$filename
#
# @ SET=$filename
#
# @ restart=no
#
# @ output=\$(SET).output
# @ error=\$(SET).error
#
# @ initialdir = `pwd`
$notifyuser
# @ total_tasks = $nproc
# @ wall_clock_limit = $jobtime
#
# @ job_type = parallel
# @ node = 1
$notifi
# @ environment = COPY_ALL; SET=\$(SET);LL_JOB=true;cluster=\$(cluster);OMP_NUM_THREADS=\$(total_tasks);GAUSS_SCRDIR=$gscr/$RANDOM;
# @ queue

PREFIX=g98

util=\`whoami\`
#-------------------------------------------------------------
# operations a realiser avant l'execution de GAUSSIAN
#-------------------------------------------------------------

if test ! -d $gscr
then
   mkdir $gscr
fi

# creation du scratch dir s'il n'existe pas


if test -d "\$GAUSS_SCRDIR"
then
   echo "le repertoire de travail \$GAUSS_SCRDIR existe deja"
   EXISTE=1
else
   echo "le repertoire de travail \$GAUSS_SCRDIR n'existe pas : creation"
   mkdir \$GAUSS_SCRDIR
   EXISTE=0
fi
#-------------------------------------------------------------
# demarrage de GAUSSIAN PARALLELE
#-------------------------------------------------------------
echo "demarrage de GAUSSIAN PARALLELE"

export g98root=/usr/oem

. \$g98root/g98/bsd/g98.profile
cat > \$PREFIX.\$SET.com <<$endof
%Nproc=\$OMP_NUM_THREADS
$endof
cat \$SET.com >> \$PREFIX.\$SET.com 

timex \$g98root/g98/bsd/g98l  < \$PREFIX.\$SET.com  2>&1 > \$SET.log
#
#-------------------------------------------------------------
# operations a realiser apres l'execution de GAUSSIAN
#-------------------------------------------------------------

# destruction du scratch dir s'il a ete cree durant le run

if (( EXISTE==0))
then
   echo "destruction du repertoire \$GAUSS_SCRDIR cree"
   rm -r \$GAUSS_SCRDIR
fi

EOF
llsubmit $filename.cmd
echo " " 
echo "==================================================================="
echo " " 
echo "Un fichier $filename.cmd 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 : llq -u $NAME"
echo " " 
echo "pour detruire un job taper : llcancel host.cluster.proc"
echo "                   host.cluster.proc est fourni par llq"
echo " " 
echo "pour avoir plus d'informations taper : llq -x -l -u $NAME"
echo " " 
echo "-------------------------------------------------------------------"
echo " " 
echo "Si vous avez des problemes de memoire, coder dans toto.com"
echo "%Mem=160000000    ce qui correspobd a 1G de memoire"
echo "#MaxDisk=500MB    pour qu'il utilise de preference la memoire"
echo " " 
echo "==================================================================="
echo " "