-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdot_pylada
52 lines (38 loc) · 1.36 KB
/
dot_pylada
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
vasp_has_nlep = True
################## QDEL definition ################
qdel_exe = "qdel"
################### QSTAT definition ##############
def ipython_qstat(self, arg):
""" Prints jobs of current user. """
from subprocess import Popen, PIPE
from IPython.utils.text import SList
# get user jobs ids
jobs = SList(Popen(['qstat', '-f', '-u', 'vstevano'], stdout=PIPE) \
.communicate()[0].split('\n'))
names = [ u[u.find('=')+1:].lstrip().rstrip() \
for u in jobs.grep('Job_Name') ]
mpps = [u[u.find(':')+1:] for u in jobs.grep('Job Id')]
states = [ u[u.find('=')+1:].lstrip().rstrip() \
for u in jobs.grep('job_state') ]
ids = [u[u.find(':')+1:].lstrip().rstrip() for u in jobs.grep('Job Id')]
return SList([ "{0:>10} {1:>4} {2:>3} -- {3}".format(id, mpp, state, name) \
for id, mpp, state, name in zip(ids, mpps, states, names)])
##################### PBSSCRIPT #####################
pbs_string = '''
#!/bin/bash
#PBS -A {account}
#PBS -q {queue}
#PBS -m n
#PBS -l walltime={walltime}
#PBS -l nodes={nnodes}
#PBS -e {err}
#PBS -o {out}
#PBS -N {name}
#PBS -d {directory}
#PBS -l feature=!phi
cd {directory}
source /projects/NRELMatDB/pylada-light/pylada-light/peregrine-env.sh
{header}
python {scriptcommand}
{footer}
'''