Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PuReMD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SParTA
PuReMD
Commits
a759534a
Commit
a759534a
authored
6 years ago
by
Kurt A. O'Hearn
Browse files
Options
Downloads
Patches
Plain Diff
PuReMD-old: update tools/run_sim.py to get correct value for total simulation time.
parent
4f7f1f2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/run_sim.py
+18
-24
18 additions, 24 deletions
tools/run_sim.py
with
18 additions
and
24 deletions
tools/run_sim.py
+
18
−
24
View file @
a759534a
...
...
@@ -355,7 +355,7 @@ restart_freq 0 ! 0: do not output any restart f
def
_process_result
(
self
,
fout
,
param
,
min_step
,
max_step
,
freq_step
,
run_type
):
if
run_type
==
'
serial
'
or
run_type
==
'
openmp
'
:
step_0_cnt
=
0
time
=
0.
total_
time
=
0.
cm
=
0.
iters
=
0.
pre_comp
=
0.
...
...
@@ -391,7 +391,7 @@ restart_freq 0 ! 0: do not output any restart f
pass
if
line
[
0
]
==
'
total:
'
:
try
:
time
=
float
(
line
[
1
])
total_
time
=
float
(
line
[
1
])
except
Exception
:
pass
line_cnt
=
line_cnt
+
1
...
...
@@ -412,7 +412,7 @@ restart_freq 0 ! 0: do not output any restart f
param
[
'
cm_solver_pre_comp_sweeps
'
],
param
[
'
cm_solver_pre_comp_sai_thres
'
],
param
[
'
cm_solver_pre_app_type
'
],
param
[
'
cm_solver_pre_app_jacobi_iters
'
],
pre_comp
,
pre_app
,
iters
,
spmv
,
cm
,
param
[
'
threads
'
],
time
))
cm
,
param
[
'
threads
'
],
total_
time
))
else
:
print
(
'
[WARNING] nsteps not correct in file {0} (nsteps = {1:d}, step freq = {2:d}, counted steps = {3:d}).
'
.
format
(
log_file
,
int
(
param
[
'
nsteps
'
]),
freq_step
,
max
(
line_cnt
-
3
,
0
)))
...
...
@@ -422,7 +422,7 @@ restart_freq 0 ! 0: do not output any restart f
from
functools
import
reduce
step_0_cnt
=
0
total
=
0.0
total
_time
=
0.0
comm
=
0.0
neighbors
=
0.0
init
=
0.0
...
...
@@ -431,7 +431,6 @@ restart_freq 0 ! 0: do not output any restart f
init_bond
=
0.0
bonded
=
0.0
nonbonded
=
0.0
time
=
0.0
cm
=
0.0
cm_sort
=
0.0
s_iters
=
0.0
...
...
@@ -445,6 +444,7 @@ restart_freq 0 ! 0: do not output any restart f
cnt_valid
=
0
line_cnt
=
0
log_file
=
param
[
'
name
'
]
+
'
.log
'
out_file
=
param
[
'
name
'
]
+
'
.out
'
if
not
path
.
exists
(
log_file
):
print
(
'
[WARNING] {0} does not exist!
'
.
format
(
log_file
))
...
...
@@ -457,7 +457,6 @@ restart_freq 0 ! 0: do not output any restart f
(
min_step
and
not
max_step
and
cnt_valid
>=
min_step
)
or
\
(
not
min_step
and
max_step
and
cnt_valid
<=
max_step
)
or
\
(
cnt_valid
>=
min_step
and
cnt_valid
<=
max_step
):
total
=
total
+
float
(
line
[
1
])
comm
=
comm
+
float
(
line
[
2
])
neighbors
=
neighbors
+
float
(
line
[
3
])
init
=
init
+
float
(
line
[
4
])
...
...
@@ -482,11 +481,6 @@ restart_freq 0 ! 0: do not output any restart f
cnt_valid
=
cnt_valid
+
1
except
Exception
:
pass
if
line
[
0
]
==
'
total:
'
:
try
:
time
=
float
(
line
[
1
])
except
Exception
:
pass
line_cnt
=
line_cnt
+
1
if
cnt
>
0
:
comm
=
comm
/
cnt
...
...
@@ -507,6 +501,18 @@ restart_freq 0 ! 0: do not output any restart f
s_spmv
=
s_spmv
/
cnt
s_vec_ops
=
s_vec_ops
/
cnt
if
not
path
.
exists
(
out_file
):
print
(
'
[WARNING] {0} does not exist!
'
.
format
(
out_file
))
return
with
open
(
out_file
,
'
r
'
)
as
fp
:
for
line
in
fp
:
line
=
line
.
split
()
if
line
[
0
]
==
'
total:
'
:
try
:
total_time
=
float
(
line
[
1
])
except
Exception
:
pass
# subtract for header, footer (total time), and extra step
# (e.g., 100 steps means steps 0 through 100, inclusive)
if
(
line_cnt
-
2
-
step_0_cnt
)
==
(
int
(
param
[
'
nsteps
'
])
/
freq_step
):
...
...
@@ -516,22 +522,10 @@ restart_freq 0 ! 0: do not output any restart f
param
[
'
cm_solver_q_err
'
],
param
[
'
reneighbor
'
],
param
[
'
cm_solver_pre_comp_sai_thres
'
],
total
,
comm
,
neighbors
,
init
,
init_dist
,
init_cm
,
init_bond
,
total
_time
,
comm
,
neighbors
,
init
,
init_dist
,
init_cm
,
init_bond
,
bonded
,
nonbonded
,
cm
,
cm_sort
,
s_iters
,
pre_comp
,
pre_app
,
s_comm
,
s_allr
,
s_spmv
,
s_vec_ops
))
else
:
fout
.
write
(
self
.
__result_body_fmt
.
format
(
path
.
basename
(
self
.
__geo_file
).
split
(
'
.
'
)[
0
],
str
(
reduce
(
mul
,
map
(
int
,
param
[
'
proc_by_dim
'
].
split
(
'
:
'
)),
1
)),
param
[
'
nsteps
'
],
param
[
'
cm_solver_pre_comp_type
'
],
param
[
'
cm_solver_q_err
'
],
param
[
'
reneighbor
'
],
param
[
'
cm_solver_pre_comp_sai_thres
'
],
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
),
float
(
'
nan
'
)))
print
(
'
[WARNING] nsteps not correct in file {0} (nsteps = {1:d}, step freq = {2:d}, counted steps = {3:d}).
'
.
format
(
log_file
,
int
(
param
[
'
nsteps
'
]),
freq_step
,
max
(
line_cnt
-
3
,
0
)))
fout
.
flush
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment