-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueue.svl
464 lines (415 loc) · 24.2 KB
/
queue.svl
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
function writeEquilibrationQueue_GTI;
function writeEquilibrationWorkstation;
function writeMDQueue_GTI;
function writeMDQueue;
function writeMDShell_Workstation;
function writeAmberLaunchScripts_Workstation;
function writeEquilibrationQueue;
function writeDUCKSMDQueue_GTI;
function writeDUCKSMDQueue;
function writeDUCKSMDQueue_Workstation;
// write Basic shell scripts for running the whole thing on a GPU submit_duck_gpu_Workstation
global function writeAmberLaunchScripts_Workstation options
writeEquilibrationWorkstation[];
local ns=1;
while (ns <= options.wqb_maxruns) loop
writeMDShell_Workstation[ns,options];
ns=ns+1;
endloop
writeDUCKSMDQueue_Workstation options;
endfunction
global function launchAmber_Workstation options
writeAmberLaunchScripts_Workstation options;
endfunction
//SRC ADD NEXT LINES FROM AMBER_MD.SVL
global function writeAmberLaunchScripts options
writeEquilibrationQueue[options];
local ns=1;
while (ns <= options.wqb_maxruns) loop
writeMDQueue[ns,options];
ns=ns+1;
endloop
writeDUCKSMDQueue options;
endfunction
global function launchAmber options
writeAmberLaunchScripts options;
endfunction
//SRC MINO queues
global function writeAmberLaunchScripts_GTI options
writeEquilibrationQueue_GTI options;
local ns=1;
while (ns <= options.wqb_maxruns) loop
writeMDQueue_GTI[ns,options];
ns=ns+1;
endloop
writeDUCKSMDQueue_GTI options;
endfunction
global function launchAmber_GTI options
writeAmberLaunchScripts_GTI options;
endfunction
//SRC MINO queues end
global function writeEquilibrationQueue[options]
local currentDir= cd [];
local fh=fopenw ['equil.q'];
fwrite[fh,'#!/bin/bash\n'];
fwrite[fh,'###########################################################\n'];
fwrite[fh,'# USAGE: MARC #\n'];
fwrite[fh,'# qsub queue_whatever.csh to submit a job #\n'];
fwrite[fh,'# qstat to monitorize your jobs #\n'];
fwrite[fh,'# qstat -f to see an overview of the queues #\n'];
fwrite[fh,'# qdel "jobid" to delete a job #\n'];
fwrite[fh,'###########################################################\n'];
fwrite[fh,'#$ -N duck_equil # The name of the job, can be whatever makes sense to you\n'];
fwrite[fh,'#$ -S /bin/bash # Force sh if not Sun Grid Engine default shell\n'];
fwrite[fh,'#$ -cwd # The batchsystem should use the current directory as working directory.\n'];
fwrite[fh,'#$ -q gpu # Queue name where the job should be placed into.\n'];
fwrite[fh,'#$ -o equil.q.o # Redirect output stream to this file.\n'];
fwrite[fh,'#$ -e equil.q.e # Redirect error stream to this file.\n'];
fwrite[fh,'#$ -l h_rt=10:00:00 # Time limit\n'];
fwrite[fh,'#$ -l gpu=1\n'];
fwrite[fh,'#$ -l h=\'syrah|garnatxa\'\n'];
fwrite[fh,'### TO CHECK IF WE DEAL WITH A TITAN GPU ###################\n'];
fwrite[fh,'smitool=`which nvidia-smi`\n'];
fwrite[fh,'type=`$smitool -L | grep TITAN | cut -f5 -d" " | tail -n 1`\n'];
fwrite[fh,'if [ "$type" == "TITAN" ]; then\n'];
fwrite[fh,'export AMBERHOME=/data/SOFT/amber12_TITAN\n'];
fwrite[fh,'export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64\n'];
fwrite[fh,'export PATH=/data/SOFT/amber12_TITAN/bin:${}PATH{}\n','{','}'];
fwrite[fh,'else\n'];
fwrite[fh,'module load amber12 cuda50 mpich2gnu44\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'#############################################################\n'];
fwrite[fh,'pmemd.cuda -O -i 1_min.in -o min.out -p lib/system_solv.prmtop -c lib/system_solv.prmcrd -r min.rst -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 2_eq.in -o 2_eq.out -p lib/system_solv.prmtop -c min.rst -r 2_eq.rst -x 2_eq.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_200.in -o eq3_200.out -p lib/system_solv.prmtop -c 2_eq.rst -r 3_eq_200.rst -x 3_eq_200.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_250.in -o eq3_250.out -p lib/system_solv.prmtop -c 3_eq_200.rst -r 3_eq_250.rst -x 3_eq_250.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_300.in -o eq3_300.out -p lib/system_solv.prmtop -c 3_eq_250.rst -r 3_eq_300.rst -x 3_eq_300.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 4a_eq.in -o eq4a.out -p lib/system_solv.prmtop -c 3_eq_300.rst -r 4a_eq.rst -x 4a_eq.nc -ref lib/system_solv.prmcrd -e 4a_eq.ene\n'];
fwrite[fh,'pmemd.cuda -O -i 4b_eq.in -o eq4b.out -p lib/system_solv.prmtop -c 4a_eq.rst -r 4b_eq.rst -x 4b_eq.nc -ref lib/system_solv.prmcrd -e 4b_eq.ene\n'];
fwrite[fh,'csh ../submit_duck_smd_gpu.csh 0 0 300K\n'];
fwrite[fh,'qsub md1.q\n'];
fwrite[fh,'exit\n'];
fclose fh;
cd currentDir;
endfunction
global function writeMDQueue[number,options]
local currentDir= cd [];
print options;
local fh=fopenw [tok_cat['md',totok[number],'.q']];
fwrite[fh,'#!/bin/bash\n'];
fwrite[fh,'###########################################################\n'];
fwrite[fh,'# USAGE: MARC #\n'];
fwrite[fh,'# qsub queue_whatever.csh to submit a job #\n'];
fwrite[fh,'# qstat to monitorize your jobs #\n'];
fwrite[fh,'# qstat -f to see an overview of the queues #\n'];
fwrite[fh,'# qdel "jobid" to delete a job #\n'];
fwrite[fh,'###########################################################\n'];
fwrite[fh,'#$ -N duck_md{} # The name of the job, can be whatever makes sense to you\n',number];
fwrite[fh,'#$ -S /bin/bash # Force sh if not Sun Grid Engine default shell\n'];
fwrite[fh,'#$ -cwd # The batchsystem should use the current directory as working directory.\n'];
fwrite[fh,'#$ -q gpu # Queue name where the job should be placed into.\n'];
fwrite[fh,'#$ -o md{}.q.o # Redirect output stream to this file.\n',number];
fwrite[fh,'#$ -e md{}.q.e # Redirect error stream to this file.\n',number];
fwrite[fh,'#$ -l h_rt=20:00:00 # Time limit\n'];
fwrite[fh,'#$ -l gpu=1\n'];
fwrite[fh,'#$ -l h=\'syrah|garnatxa\'\n'];
fwrite[fh,'### TO CHECK IF WE DEAL WITH A TITAN GPU ###################\n'];
fwrite[fh,'smitool=`which nvidia-smi`\n'];
fwrite[fh,'type=`$smitool -L | grep TITAN | cut -f5 -d" " | tail -n 1`\n'];
fwrite[fh,'if [ "$type" == "TITAN" ]; then\n'];
fwrite[fh,'export AMBERHOME=/data/SOFT/amber12_TITAN\n'];
fwrite[fh,'export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64\n'];
fwrite[fh,'export PATH=/data/SOFT/amber12_TITAN/bin:${}PATH{}\n','{','}'];
fwrite[fh,'else\n'];
fwrite[fh,'module load amber12 cuda50 mpich2gnu44\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'#############################################################\n'];
fwrite[fh,'######BLOCK TO CHECK IF WQB IS LOWER THAN {}########\n',options.wqb_thresh];
fwrite[fh,'if [ $(echo "`Rscript ../getWqbValues.R` < {}" | bc) -eq 1 ]; then\n',options.wqb_thresh];
fwrite[fh,' echo Wqb lower than {}, stopping DUck runs;\n',options.wqb_thresh];
fwrite[fh,' Rscript ../getWqbValues.R plot;\n'];
fwrite[fh,' exit\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'###################################################\n'];
if number==1 then
fwrite[fh,'pmemd.cuda -O -i md.in -o md1.out -p lib/system_solv.prmtop -c 4b_eq.rst -r md1.rst -x md1.nc -ref lib/system_solv.prmcrd\n'];
// fwrite[fh,'i=0 ; for f in `ls -1rt md.rst_*`; do ((i++)); mv $f md${}i{}.rst ; done\n','{','}'];// SRC deprecated
fwrite[fh,'######BLOCK TO CHECK IF WQB IS LOWER THAN {}########\n',options.wqb_thresh];
fwrite[fh,'if [ $(echo "`Rscript ../getWqbValues.R` < {}" | bc) -eq 1 ]; then\n',options.wqb_thresh];
fwrite[fh,' echo Wqb lower than {}, stopping DUck runs;\n',options.wqb_thresh];
fwrite[fh,' Rscript ../getWqbValues.R plot;\n'];
fwrite[fh,' exit\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'###################################################\n'];
fwrite[fh,'csh ../submit_duck_smd_gpu.csh 0 1 325K\n'];
fwrite[fh,'csh ../submit_duck_smd_gpu.csh 1 1 300K\n'];
else
fwrite[fh,'pmemd.cuda -O -i md.in -o md{}.out -p lib/system_solv.prmtop -c md{}.rst -r md{}.rst -x md{}.nc -ref lib/system_solv.prmcrd\n',number,number-1,number,number];
// fwrite[fh,'i={} ; for f in `ls -1rt md.rst_*`; do ((i++)); mv $f md${}i{}.rst ; done\n',number-1,'{','}']; // SRC deprecated
//fwrite[fh,'qsub md{}.q\n',number+5];
fwrite[fh,'######BLOCK TO CHECK IF WQB IS LOWER THAN {}########\n',options.wqb_thresh];
fwrite[fh,'if [ $(echo "`Rscript ../getWqbValues.R` < {}" | bc) -eq 1 ]; then\n',options.wqb_thresh];
fwrite[fh,' echo Wqb lower than {}, stopping DUck runs;\n',options.wqb_thresh];
fwrite[fh,' Rscript ../getWqbValues.R plot;\n'];
fwrite[fh,' exit\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'###################################################\n'];
fwrite[fh,'csh ../submit_duck_smd_gpu.csh {} {} 300K\n',number,number];
fwrite[fh,'csh ../submit_duck_smd_gpu.csh {} {} 325K\n',number,number];
endif
fwrite[fh,'qsub md{}.q\n',number+1];
fwrite[fh,'exit\n'];
fclose fh;
endfunction
//SRC GTI QUEUES
global function writeEquilibrationWorkstation[]
local currentDir= cd [];
local fh=fopenw ['equilibration.sh'];
fwrite[fh,'pmemd.cuda -O -i 1_min.in -o min.out -p lib/system_solv.prmtop -c lib/system_solv.prmcrd -r min.rst -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 2_eq.in -o 2_eq.out -p lib/system_solv.prmtop -c min.rst -r 2_eq.rst -x 2_eq.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_200.in -o eq3_200.out -p lib/system_solv.prmtop -c 2_eq.rst -r 3_eq_200.rst -x 3_eq_200.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_250.in -o eq3_250.out -p lib/system_solv.prmtop -c 3_eq_200.rst -r 3_eq_250.rst -x 3_eq_250.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_300.in -o eq3_300.out -p lib/system_solv.prmtop -c 3_eq_250.rst -r 3_eq_300.rst -x 3_eq_300.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 4a_eq.in -o eq4a.out -p lib/system_solv.prmtop -c 3_eq_300.rst -r 4a_eq.rst -x 4a_eq.nc -ref lib/system_solv.prmcrd -e 4a_eq.ene\n'];
fwrite[fh,'pmemd.cuda -O -i 4b_eq.in -o eq4b.out -p lib/system_solv.prmtop -c 4a_eq.rst -r 4b_eq.rst -x 4b_eq.nc -ref lib/system_solv.prmcrd -e 4b_eq.ene\n'];
fwrite[fh,'chmod +x ../launch_duck_gpu_Workstation.sh; ../launch_duck_gpu_Workstation.sh 0 0 300K\n'];
//fwrite[fh,'../launch_duck_gpu_Workstation.sh 0 0 325K\n'];
fwrite[fh,'chmod +x md1.sh; ./md1.sh\n'];
fwrite[fh,'exit\n'];
fclose fh;
cd currentDir;
endfunction
global function writeEquilibrationQueue_GTI[options]
local currentDir= cd [];
local fh=fopenw ['equil.q'];
fwrite[fh,'#!/bin/sh\n'];
fwrite[fh,'#SBATCH --job-name=duck_equil \n'];
fwrite[fh,'#SBATCH --workdir=.\n'];
fwrite[fh,'#SBATCH -N 1\n'];
fwrite[fh,'#SBATCH -t 11520\n'];
fwrite[fh,'#SBATCH -p gpu\n'];
fwrite[fh,'#SBATCH --gres=gpu:4\n'];
fwrite[fh,'#SBATCH --export=ALL\n'];
fwrite[fh,'source $HOME/miniconda2/bin/activate root \n'];
fwrite[fh,'module load shared cuda80 gcc/5.4.0 openmpi/gcc/64/1.10.1 fftw3/openmpi/open64/64/3.3.4 slurm\n'];
fwrite[fh,'export AMBERHOME=$HOME/amber16 \n'];
fwrite[fh,'source $AMBERHOME/amber.sh\n'];
fwrite[fh,'pmemd.cuda -O -i 1_min.in -o min.out -p lib/system_solv.prmtop -c lib/system_solv.prmcrd -r min.rst -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 2_eq.in -o 2_eq.out -p lib/system_solv.prmtop -c min.rst -r 2_eq.rst -x 2_eq.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_200.in -o eq3_200.out -p lib/system_solv.prmtop -c 2_eq.rst -r 3_eq_200.rst -x 3_eq_200.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_250.in -o eq3_250.out -p lib/system_solv.prmtop -c 3_eq_200.rst -r 3_eq_250.rst -x 3_eq_250.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 3_eq_300.in -o eq3_300.out -p lib/system_solv.prmtop -c 3_eq_250.rst -r 3_eq_300.rst -x 3_eq_300.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'pmemd.cuda -O -i 4_eq.in -o eq4.out -p lib/system_solv.prmtop -c 3_eq_300.rst -r 4_eq.rst -x 4_eq.nc -ref lib/system_solv.prmcrd -e 4_eq.ene\n'];
fwrite[fh,'export CUDA_VISIBLE_DEVICES=0\n'];
fwrite[fh,'bash ../submit_duck_smd_gpu_GTI.sh 0 0 300K &\n'];
fwrite[fh,'export CUDA_VISIBLE_DEVICES=1\n'];
fwrite[fh,'bash md1.q &\n'];
fwrite[fh,'wait\n'];
fwrite[fh,'exit\n'];
fclose fh;
cd currentDir;
endfunction
global function writeMDShell_Workstation[number,options]
local currentDir= cd [];
local fh=fopenw [tok_cat['md',totok[number],'.sh']];
//fwrite[fh,'#!/bin/tcsh\n']; //commented for now as there are several environment problems on osx
// fwrite[fh,'######BLOCK TO CHECK IF WQB IS LOWER THAN 6########\n'];
// fwrite[fh,'set res=`Rscript ../getWqbValues.R`;\n'];
// fwrite[fh,'if ( `echo "$res < 6" | bc` == 1 ) then;\n'];
// fwrite[fh,' echo Wqb lower than 6, stopping DUck runs;\n'];
// fwrite[fh,' Rscript ../getWqbValues.R plot;\n'];
// fwrite[fh,' exit\n'];
// fwrite[fh,'endif\n'];
// fwrite[fh,'###################################################\n'];
//had the comment the previous block as this is not bash, but csh
if number==1 then
fwrite[fh,'pmemd.cuda -O -i md.in -o md1.out -p lib/system_solv.prmtop -c 4b_eq.rst -r md1.rst -x md1.nc -ref lib/system_solv.prmcrd\n'];
else
fwrite[fh,'pmemd.cuda -O -i md.in -o md{}.out -p lib/system_solv.prmtop -c md{}.rst -r md{}.rst -x md{}.nc -ref lib/system_solv.prmcrd\n',number,number-1,number,number];
endif
// fwrite[fh,'set i = {}\n',number-1];
// fwrite[fh,'for f in `ls md.rst_*`;\n'];
// fwrite[fh,'do\n'];
// fwrite[fh,'((i+=1))\n'];
// fwrite[fh,'mv $f md${}i{}.rst\n','{','}'];
// fwrite[fh,'done\n'];
if number==1 then
fwrite[fh,'../launch_duck_gpu_Workstation.sh 0 1 325K\n'];
fwrite[fh,'../launch_duck_gpu_Workstation.sh 1 1 300K\n'];
else
fwrite[fh,'../launch_duck_gpu_Workstation.sh {} {} 300K\n',number,number];
fwrite[fh,'../launch_duck_gpu_Workstation.sh {} {} 325K\n',number,number];
endif
fwrite[fh,'wqb=`Rscript ../getWqbValues.R`\n'];
fwrite[fh,'echo "$wqb" > wqb.txt\n'];
fwrite[fh,'if [ $(echo " $wqb > {}" | bc) -eq 1 ]\n',options.wqb_thresh];
fwrite[fh,'then\n'];
fwrite[fh,'chmod +x ./md{}.sh; ./md{}.sh\n',number+1,number+1];
fwrite[fh,'fi\n'];
fclose fh;
endfunction
global function writeMDQueue_GTI[number,options]
local currentDir= cd [];
local fh=fopenw [tok_cat['md',totok[number],'.q']];
fwrite[fh,'#!/bin/sh\n'];
fwrite[fh,'######BLOCK TO CHECK IF WQB IS LOWER THAN {}########\n',options.wqb_thresh];
fwrite[fh,'res=`Rscript ../getWqbValues.R`;\n'];
fwrite[fh,'if [ `echo "$res < {}" | bc` == 1 ]; then\n',options.wqb_thresh];
fwrite[fh,' echo Wqb lower than {}, stopping DUck runs;\n',options.wqb_thresh];
fwrite[fh,' Rscript ../getWqbValues.R plot;\n'];
fwrite[fh,' exit\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'###################################################\n'];
if [ number==1 ] then
fwrite[fh,'pmemd.cuda -O -i md.in -o md1.out -p lib/system_solv.prmtop -c 4_eq.rst -r md1.rst -x md1.nc -ref lib/system_solv.prmcrd\n'];
fwrite[fh,'######BLOCK TO CHECK IF WQB IS LOWER THAN {}########\n',options.wqb_thresh];
fwrite[fh,'res=`Rscript ../getWqbValues.R`;\n'];
fwrite[fh,'if [ `echo "$res < {}" | bc` == 1 ]; then\n',options.wqb_thresh];
fwrite[fh,' echo Wqb lower than {}, stopping DUck runs;\n',options.wqb_thresh];
fwrite[fh,' Rscript ../getWqbValues.R plot;\n'];
fwrite[fh,' exit\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'###################################################\n'];
fwrite[fh,'wait\n'];
fwrite[fh,'export CUDA_VISIBLE_DEVICES=0\n'];
fwrite[fh,'bash ../submit_duck_smd_gpu_GTI.sh 1 1 300K &\n'];
fwrite[fh,'export CUDA_VISIBLE_DEVICES=1\n'];
fwrite[fh,'bash ../submit_duck_smd_gpu_GTI.sh 0 1 325K &\n'];
fwrite[fh,'wait\n'];
else
fwrite[fh,'pmemd.cuda -O -i md.in -o md{}.out -p lib/system_solv.prmtop -c md{}.rst -r md{}.rst -x md{}.nc -ref lib/system_solv.prmcrd\n',number,number-1,number,number];
fwrite[fh,'######BLOCK TO CHECK IF WQB IS LOWER THAN {}########\n',options.wqb_thresh];
fwrite[fh,'res=`Rscript ../getWqbValues.R`;\n'];
fwrite[fh,'if [ `echo "$res < {}" | bc` == 1 ];then\n',options.wqb_thresh];
fwrite[fh,' echo Wqb lower than {}, stopping DUck runs;\n',options.wqb_thresh];
fwrite[fh,' Rscript ../getWqbValues.R plot;\n'];
fwrite[fh,' exit\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'###################################################\n'];
fwrite[fh,'wait\n'];
fwrite[fh,'export CUDA_VISIBLE_DEVICES=0\n'];
fwrite[fh,'bash ../submit_duck_smd_gpu_GTI.sh {} {} 300K &\n',number,number];
fwrite[fh,'export CUDA_VISIBLE_DEVICES=1\n'];
fwrite[fh,'bash ../submit_duck_smd_gpu_GTI.sh {} {} 325K &\n',number,number];
fwrite[fh,'wait\n'];
endif
fwrite[fh,'bash md{}.q\n',number+1];
fwrite[fh,'exit\n'];
fclose fh;
endfunction
global function writeDUCKSMDQueue_GTI[options]
local currentDir= cd [];
local fh=fopenw ['duck_template_gpu.q'];
fwrite[fh,'#!/bin/sh\n'];
fwrite[fh,'#SBATCH --job-name=duck_smdZZ\n'];
fwrite[fh,'#SBATCH --workdir=.\n'];
fwrite[fh,'#SBATCH -N 1\n'];
fwrite[fh,'#SBATCH -t 11520\n'];
fwrite[fh,'#SBATCH -p gpu\n'];
fwrite[fh,'#SBATCH --gres=gpu:4\n'];
fwrite[fh,'#SBATCH --export=ALL\n'];
fwrite[fh,'source $HOME/miniconda2/bin/activate root \n'];
fwrite[fh,'module load shared cuda80 gcc/5.4.0 openmpi/gcc/64/1.10.1 fftw3/openmpi/open64/64/3.3.4 slurm\n'];
fwrite[fh,'export AMBERHOME=$HOME/amber16 \n'];
fwrite[fh,'source $AMBERHOME/amber.sh\n'];
fwrite[fh,'pmemd.cuda -O -i ../duck.in -o duck_ZZ.o -p ../lib/system_solv.prmtop -c ../mdZZ.rst -r duck_ZZ.rst -x duck_ZZ.nc -e duck_ZZ.e -ref ../lib/system_solv.prmcrd\n'];
fwrite[fh,'exit\n'];
fclose fh;
local fh2=fopenw ['duck_template_gpu_325K.q'];
fwrite[fh2,'#!/bin/sh\n'];
fwrite[fh2,'#SBATCH --job-name=duck_smdZZ_325K\n'];
fwrite[fh2,'#SBATCH --workdir=.\n'];
fwrite[fh2,'#SBATCH -N 1\n'];
fwrite[fh2,'#SBATCH -t 11520\n'];
fwrite[fh2,'#SBATCH -p gpu\n'];
fwrite[fh2,'#SBATCH --gres=gpu:4\n'];
fwrite[fh2,'#SBATCH --export=ALL\n'];
fwrite[fh2,'source $HOME/miniconda2/bin/activate root \n'];
fwrite[fh2,'module load shared cuda80 gcc/5.4.0 openmpi/gcc/64/1.10.1 fftw3/openmpi/open64/64/3.3.4 slurm\n'];
fwrite[fh2,'export AMBERHOME=$HOME/amber16 \n'];
fwrite[fh2,'source $AMBERHOME/amber.sh\n'];
fwrite[fh2,'pmemd.cuda -O -i ../duck_325K.in -o duck_ZZ.o -p ../lib/system_solv.prmtop -c ../mdZZ.rst -r duck_ZZ.rst -x duck_ZZ.nc -e duck_ZZ.e -ref ../lib/system_solv.prmcrd\n'];
fclose fh2;
cd currentDir;
endfunction
global function writeDUCKSMDQueue[options]
local currentDir= cd [];
local fh=fopenw ['duck_template_gpu.q'];
fwrite[fh,'#!/bin/bash\n'];
fwrite[fh,'###########################################################\n'];
fwrite[fh,'# USAGE: MARC #\n'];
fwrite[fh,'# qsub queue_whatever.csh to submit a job #\n'];
fwrite[fh,'# qstat to monitorize your jobs #\n'];
fwrite[fh,'# qstat -f to see an overview of the queues #\n'];
fwrite[fh,'# qdel "jobid" to delete a job #\n'];
fwrite[fh,'###########################################################\n'];
fwrite[fh,'#$ -N duck_smdZZ # The name of the job, can be whatever makes sense to you\n'];
fwrite[fh,'#$ -S /bin/bash # Force sh if not Sun Grid Engine default shell\n'];
fwrite[fh,'#$ -cwd # The batchsystem should use the current directory as working directory.\n'];
fwrite[fh,'#$ -q gpu # Queue name where the job should be placed into.\n'];
fwrite[fh,'#$ -o duck_ZZ.q.o # Redirect output stream to this file.\n'];
fwrite[fh,'#$ -e duck_ZZ.q.e # Redirect error stream to this file.\n'];
fwrite[fh,'#$ -l h_rt=10:00:00 # Time limit\n'];
fwrite[fh,'#$ -l gpu=1\n'];
// fwrite[fh,'#$ -l h=\'syrah|garnatxa\'\n'];
fwrite[fh,'### TO CHECK IF WE DEAL WITH A TITAN GPU ###################\n'];
fwrite[fh,'smitool=`which nvidia-smi`\n'];
fwrite[fh,'type=`$smitool -L | grep TITAN | cut -f5 -d" " | tail -n 1`\n'];
fwrite[fh,'if [ "$type" == "TITAN" ]; then\n'];
fwrite[fh,'export AMBERHOME=/data/SOFT/amber12_TITAN\n'];
fwrite[fh,'export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64\n'];
fwrite[fh,'export PATH=/data/SOFT/amber12_TITAN/bin:${}PATH{}\n','{','}'];
fwrite[fh,'else\n'];
fwrite[fh,'module load amber12 cuda50 mpich2gnu44\n'];
fwrite[fh,'fi\n'];
fwrite[fh,'#############################################################\n'];
fwrite[fh,'pmemd.cuda -O -i ../duck.in -o duck_ZZ.o -p ../lib/system_solv.prmtop -c ../mdZZ.rst -r duck_ZZ.rst -x duck_ZZ.nc -e duck_ZZ.e -ref ../lib/system_solv.prmcrd\n'];
fwrite[fh,'exit\n'];
fclose fh;
local fh2=fopenw ['duck_template_gpu_325K.q'];
fwrite[fh2,'#!/bin/bash\n'];
fwrite[fh2,'###########################################################\n'];
fwrite[fh2,'# USAGE: MARC #\n'];
fwrite[fh2,'# qsub queue_whatever.csh to submit a job #\n'];
fwrite[fh2,'# qstat to monitorize your jobs #\n'];
fwrite[fh2,'# qstat -f to see an overview of the queues #\n'];
fwrite[fh2,'# qdel "jobid" to delete a job #\n'];
fwrite[fh2,'###########################################################\n'];
fwrite[fh2,'#$ -N duck_smdZZ_325K # The name of the job, can be whatever makes sense to you\n'];
fwrite[fh2,'#$ -S /bin/bash # Force sh if not Sun Grid Engine default shell\n'];
fwrite[fh2,'#$ -cwd # The batchsystem should use the current directory as working directory.\n'];
fwrite[fh2,'#$ -q gpu # Queue name where the job should be placed into.\n'];
fwrite[fh2,'#$ -o duck_ZZ.q.o # Redirect output stream to this file.\n'];
fwrite[fh2,'#$ -e duck_ZZ.q.e # Redirect error stream to this file.\n'];
fwrite[fh2,'#$ -l h_rt=10:00:00 # Time limit\n'];
fwrite[fh2,'#$ -l gpu=1\n'];
// fwrite[fh2,'#$ -l h=\'syrah|garnatxa\'\n'];
fwrite[fh2,'### TO CHECK IF WE DEAL WITH A TITAN GPU ###################\n'];
fwrite[fh2,'smitool=`which nvidia-smi`\n'];
fwrite[fh2,'type=`$smitool -L | grep TITAN | cut -f5 -d" " | tail -n 1`\n'];
fwrite[fh2,'if [ "$type" == "TITAN" ]; then\n'];
fwrite[fh2,'export AMBERHOME=/data/SOFT/amber12_TITAN\n'];
fwrite[fh2,'export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64\n'];
fwrite[fh2,'export PATH=/data/SOFT/amber12_TITAN/bin:${}PATH{}\n','{','}'];
fwrite[fh2,'else\n'];
fwrite[fh2,'module load amber12 cuda50 mpich2gnu44\n'];
fwrite[fh2,'fi\n'];
fwrite[fh2,'#############################################################\n'];
fwrite[fh2,'pmemd.cuda -O -i ../duck_325K.in -o duck_ZZ.o -p ../lib/system_solv.prmtop -c ../mdZZ.rst -r duck_ZZ.rst -x duck_ZZ.nc -e duck_ZZ.e -ref ../lib/system_solv.prmcrd\n'];
fwrite[fh2,'exit\n'];
fclose fh2;
cd currentDir;
endfunction
global function writeDUCKSMDQueue_Workstation[options]
local currentDir= cd [];
local fh=fopenw ['duck_template_gpu.sh'];
fwrite[fh,'pmemd.cuda -O -i ../duck.in -o duck_ZZ.o -p ../lib/system_solv.prmtop -c ../mdZZ.rst -r duck_ZZ.rst -x duck_ZZ.nc -e duck_ZZ.e -ref ../lib/system_solv.prmcrd\n'];
fwrite[fh,'exit\n'];
fclose fh;
local fh2=fopenw ['duck_template_gpu_325K.sh'];
fwrite[fh2,'pmemd.cuda -O -i ../duck_325K.in -o duck_ZZ.o -p ../lib/system_solv.prmtop -c ../mdZZ.rst -r duck_ZZ.rst -x duck_ZZ.nc -e duck_ZZ.e -ref ../lib/system_solv.prmcrd\n'];
fwrite[fh2,'exit\n'];
fclose fh2;
cd currentDir;
endfunction
//SRC GTI QUEUES END