Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101343344
show
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
Sat, Feb 8, 02:08
Size
1 KB
Mime Type
text/x-python
Expires
Mon, Feb 10, 02:08 (2 d)
Engine
blob
Format
Raw Data
Handle
24139819
Attached To
rPNBODY pNbody
show
View Options
#!/usr/bin/env python
#csh
#mpiexec -n 1 src/Gadget2 params > snap/out.dat < /dev/null&
import
sys
,
os
,
shutil
from
optparse
import
OptionParser
import
nodes
def
parse_options
():
usage
=
"usage: %prog [options] file"
parser
=
OptionParser
(
usage
=
usage
)
parser
.
add_option
(
"-n"
,
"--np"
,
action
=
"store"
,
type
=
"int"
,
dest
=
"np"
,
default
=
1
,
help
=
"number of processors"
)
parser
.
add_option
(
"--snapdir"
,
action
=
"store"
,
type
=
"string"
,
dest
=
"snapdir"
,
default
=
'snap'
,
help
=
"output snap directory"
)
(
options
,
args
)
=
parser
.
parse_args
()
files
=
args
return
files
,
options
files
,
opt
=
parse_options
()
cdir
=
os
.
getcwd
()
sname
=
os
.
path
.
basename
(
cdir
)
localdir
=
os
.
getcwd
()
blocaldir
=
os
.
path
.
basename
(
localdir
)
outputfile
=
"
%s
/out.dat"
%
opt
.
snapdir
if
nodes
.
nodes
!=
None
:
node
=
nodes
.
nodes
[
0
]
outputfile
=
"/net/
%s
/scratch/revaz/
%s
/
%s
"
%
(
node
,
blocaldir
,
outputfile
)
os
.
system
(
"tail -f
%s
"
%
outputfile
)
Event Timeline
Log In to Comment