Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
runOPAL
Commits
bb0090c6
Commit
bb0090c6
authored
Feb 20, 2018
by
ext-neveu_n
Browse files
cleaning a few print statements. Still need to finish fixing commands
parent
34a0aeea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
runOPAL/simulation.py
runOPAL/simulation.py
+7
-6
No files found.
runOPAL/simulation.py
View file @
bb0090c6
...
...
@@ -29,11 +29,11 @@ class Simulation:
# If there's already a directory remove it...
if
os
.
path
.
isdir
(
self
.
dirname
):
if
doKeep
:
print
(
'KEEP existing directory
'
,
self
.
dirname
)
print
(
'KEEP existing directory
{}'
.
format
(
self
.
dirname
)
)
print
(
self
.
dirname
)
return
False
else
:
print
(
'REMOVE existing directory
'
,
self
.
dirname
)
print
(
'REMOVE existing directory
{}'
.
format
(
self
.
dirname
)
)
shutil
.
rmtree
(
self
.
dirname
)
# create directory
...
...
@@ -102,7 +102,7 @@ class Simulation:
else
:
opalexe
=
'opal'
print
(
'Simulation directory is
'
+
self
.
dirname
+
' using OPAL at '
,
os
.
environ
.
get
(
'OPAL_EXE_PATH'
))
print
(
'Simulation directory is
{} using OPAL at {}'
.
format
(
self
.
dirname
,
os
.
environ
.
get
(
'OPAL_EXE_PATH'
))
)
print
(
'Using templatefile at '
+
inputfilePath
)
print
(
'Using fieldmaps at '
+
fieldmapPath
)
print
(
'Parameter set in '
+
oinpFile
+
' are:'
)
...
...
@@ -189,11 +189,12 @@ class Simulation:
return
qid
if
doNobatch
:
print
(
'Done with setup of the OPAL simulation and executing the job on
'
+
str
(
CORES
)
+
' cores...
\n\n\n
'
)
print
(
'Done with setup of the OPAL simulation and executing the job on
{} cores...
\n\n\n
'
.
format
(
CORES
))
ofn
,
fileExtension
=
os
.
path
.
splitext
(
oinpFile
)
print
(
'STD output is written to {}.out'
.
format
(
ofn
))
execommand
=
'mpirun -np '
+
str
(
CORES
)
+
' '
+
opalexe
+
' '
+
oinpFile
+
' 2>&1 | tee '
+
ofn
+
'.out'
qid
=
subprocess
.
check_output
(
execommand
)
#execommand = 'mpirun -np ' + str(CORES) + ' ' + opalexe + ' ' + oinpFile + ' 2>&1 | tee ' + ofn + '.out'
outfile
=
ofn
+
'.out'
qid
=
subprocess
.
call
([
'mpirun'
,
'-np '
,
str
(
CORES
),
opalexe
,
oinpFile
,
'2>&1'
,
'|'
,
'tee'
,
outfile
])
os
.
chdir
(
'..'
)
return
-
1
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment