Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F67084353
sgeCoat.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jun 19, 20:00
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Jun 21, 20:00 (2 d)
Engine
blob
Format
Raw Data
Handle
18325156
Attached To
R3127 blackdynamite
sgeCoat.py
View Options
#!/usr/bin/env python
import
run
import
os
,
stat
import
subprocess
import
re
import
socket
def
launch
(
run
,
base
,
truerun
):
_exec
=
run
.
getExecFile
()
head
=
\
"""#!/bin/bash
#$ -S /bin/sh
#$ -cwd
#$ -j y
#$ -m eas -M guillaume.anciaux@epfl.ch
#$ -l walltime=200:00:00
"""
run
[
"state"
]
=
"SGE submit"
base
.
update
(
run
)
sge_head_name
=
"#$ -N "
+
str
(
run
.
id
)
+
"-"
+
run
[
"run_name"
]
+
"
\n
"
sge_head_name
=
sge_head_name
.
replace
(
":"
,
"_"
)
head
+=
sge_head_name
nproc
=
run
[
"nproc"
]
if
(
nproc
%
12
==
0
):
head
+=
"#$ -pe orte12 "
+
str
(
nproc
)
+
"
\n
"
if
(
nproc
%
8
==
0
):
head
+=
"#$ -pe orte8 "
+
str
(
nproc
)
+
"
\n
"
if
(
socket
.
gethostname
()
==
"lsmscluster1"
):
head
+=
"module load libqview"
_exec
[
"file"
]
=
head
+
_exec
[
"file"
]
f
=
open
(
_exec
[
"filename"
],
'w'
)
f
.
write
(
_exec
[
"file"
])
f
.
close
()
# os.chmod(_exec["filename"], stat.S_IRWXU)
print
(
"execute qsub ./"
+
_exec
[
"filename"
])
print
(
"in dir "
)
subprocess
.
call
(
"pwd"
)
if
(
truerun
==
True
):
ret
=
subprocess
.
call
(
"qsub "
+
_exec
[
"filename"
],
shell
=
True
)
Event Timeline
Log In to Comment