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
1ac45a4b
Commit
1ac45a4b
authored
6 years ago
by
Alperen, Abdullah
Browse files
Options
Downloads
Patches
Plain Diff
PuReMD: fix read option for python script
parent
108a472d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/run_sim_puremd.py
+66
-29
66 additions, 29 deletions
tools/run_sim_puremd.py
with
66 additions
and
29 deletions
tools/run_sim_puremd.py
+
66
−
29
View file @
1ac45a4b
...
@@ -168,12 +168,24 @@ class TestCase():
...
@@ -168,12 +168,24 @@ class TestCase():
rmdir
(
temp_dir
)
rmdir
(
temp_dir
)
def
_process_result
(
self
,
fout
,
param
,
min_step
,
max_step
):
def
_process_result
(
self
,
fout
,
param
,
min_step
,
max_step
):
time
=
0.
from
operator
import
mul
from
functools
import
reduce
total
=
0.
comm
=
0.
neighbors
=
0.
init
=
0.
bonded
=
0.
nonbonded
=
0.
cm
=
0.
cm
=
0.
iters
=
0.
cm_sort
=
0.
s_iters
=
0.
pre_comp
=
0.
pre_comp
=
0.
pre_app
=
0.
pre_app
=
0.
spmv
=
0.
s_comm
=
0.
s_allr
=
0.
s_spmv
=
0.
s_vec_ops
=
0.
cnt
=
0
cnt
=
0
line_cnt
=
0
line_cnt
=
0
log_file
=
param
[
'
name
'
]
+
'
.log
'
log_file
=
param
[
'
name
'
]
+
'
.log
'
...
@@ -189,39 +201,63 @@ class TestCase():
...
@@ -189,39 +201,63 @@ class TestCase():
(
min_step
and
not
max_step
and
cnt
>=
min_step
)
or
\
(
min_step
and
not
max_step
and
cnt
>=
min_step
)
or
\
(
not
min_step
and
max_step
and
cnt
<=
max_step
)
or
\
(
not
min_step
and
max_step
and
cnt
<=
max_step
)
or
\
(
cnt
>=
min_step
and
cnt
<=
max_step
):
(
cnt
>=
min_step
and
cnt
<=
max_step
):
cm
=
cm
+
float
(
line
[
6
])
if
(
int
(
line
[
0
])
<
int
(
param
[
'
nsteps
'
])
):
iters
=
iters
+
float
(
line
[
8
])
total
=
total
+
float
(
line
[
1
])
pre_comp
=
pre_comp
+
float
(
line
[
9
])
comm
=
comm
+
float
(
line
[
2
])
pre_app
=
pre_app
+
float
(
line
[
10
])
neighbors
=
neighbors
+
float
(
line
[
3
])
spmv
=
spmv
+
float
(
line
[
11
])
init
=
init
+
float
(
line
[
4
])
cnt
=
cnt
+
1
bonded
=
bonded
+
float
(
line
[
5
])
nonbonded
=
nonbonded
+
float
(
line
[
6
])
cm
=
cm
+
float
(
line
[
7
])
cm_sort
=
cm_sort
+
float
(
line
[
8
])
s_iters
=
s_iters
+
float
(
line
[
9
])
pre_comp
=
pre_comp
+
float
(
line
[
10
])
pre_app
=
pre_app
+
float
(
line
[
11
])
s_comm
=
s_comm
+
float
(
line
[
12
])
s_allr
=
s_allr
+
float
(
line
[
13
])
s_spmv
=
s_spmv
+
float
(
line
[
14
])
s_vec_ops
=
s_vec_ops
+
float
(
line
[
15
])
cnt
=
cnt
+
1
except
Exception
:
except
Exception
:
pass
pass
if
line
[
0
]
==
'
total:
'
:
try
:
time
=
float
(
line
[
1
])
except
Exception
:
pass
line_cnt
=
line_cnt
+
1
line_cnt
=
line_cnt
+
1
if
cnt
>
0
:
if
cnt
>
0
:
comm
=
comm
/
cnt
neighbors
=
neighbors
/
cnt
init
=
init
/
cnt
bonded
=
bonded
/
cnt
nonbonded
=
nonbonded
/
cnt
cm
=
cm
/
cnt
cm
=
cm
/
cnt
iters
=
iters
/
cnt
cm_sort
=
cm_sort
/
cnt
s_iters
=
s_iters
/
cnt
pre_comp
=
pre_comp
/
cnt
pre_comp
=
pre_comp
/
cnt
pre_app
=
pre_app
/
cnt
pre_app
=
pre_app
/
cnt
spmv
=
spmv
/
cnt
s_comm
=
s_comm
/
cnt
s_allr
=
s_allr
/
cnt
s_spmv
=
s_spmv
/
cnt
s_vec_ops
=
s_vec_ops
/
cnt
# subtract for header, footer (total time), and extra step
# subtract for header, footer (total time), and extra step
# (e.g., 100 steps means steps 0 through 100, inclusive)
# (e.g., 100 steps means steps 0 through 100, inclusive)
if
(
line_cnt
-
3
)
=
=
int
(
param
[
'
nsteps
'
]):
if
(
line_cnt
-
1
)
>
=
int
(
param
[
'
nsteps
'
]):
fout
.
write
(
self
.
__result_body_fmt
.
format
(
path
.
basename
(
self
.
__geo_file
).
split
(
'
.
'
)[
0
],
fout
.
write
(
self
.
__result_body_fmt
.
format
(
path
.
basename
(
self
.
__geo_file
).
split
(
'
.
'
)[
0
],
param
[
'
nsteps
'
],
param
[
'
charge_method
'
],
param
[
'
cm_solver_type
'
]
,
str
(
reduce
(
mul
,
map
(
int
,
param
[
'
proc_by_dim
'
].
split
(
'
:
'
)),
1
))
,
param
[
'
cm_solver_q_err
'
],
param
[
'
cm_domain_sparsity
'
],
param
[
'
nsteps
'
],
param
[
'
cm_solver_pre_comp_type
'
],
param
[
'
cm_solver_
pre_comp_type
'
],
param
[
'
cm_solver_pre_comp_droptol
'
],
param
[
'
cm_solver_
q_err
'
],
param
[
'
cm_solver_pre_comp_sweeps
'
],
param
[
'
cm_solver_pre_comp_sai_thres
'
],
param
[
'
reneighbor
'
],
param
[
'
cm_solver_pre_
app_type
'
],
param
[
'
cm_solver_pre_app_jacobi_iter
s
'
],
param
[
'
cm_solver_pre_
comp_sai_thre
s
'
],
pre_
com
p
,
pre_app
,
iters
,
spmv
,
total
,
com
m
,
neighbors
,
init
,
bonded
,
nonbonded
,
cm
,
cm_sort
,
cm
,
param
[
'
threads
'
],
time
))
s_iters
,
pre_comp
,
pre_app
,
s_comm
,
s_allr
,
s_spmv
,
s_vec_ops
))
else
:
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
'
)))
print
(
'
**WARNING: nsteps not correct in file {0} (nsteps = {1:d}, counted steps = {2:d}).
'
.
format
(
print
(
'
**WARNING: nsteps not correct in file {0} (nsteps = {1:d}, counted steps = {2:d}).
'
.
format
(
log_file
,
int
(
param
[
'
nsteps
'
]),
max
(
line_cnt
-
3
,
0
)))
log_file
,
int
(
param
[
'
nsteps
'
]),
max
(
line_cnt
-
3
,
0
)))
fout
.
flush
()
fout
.
flush
()
...
@@ -259,10 +295,11 @@ if __name__ == '__main__':
...
@@ -259,10 +295,11 @@ if __name__ == '__main__':
control_dir
=
path
.
join
(
base_dir
,
'
environ
'
)
control_dir
=
path
.
join
(
base_dir
,
'
environ
'
)
data_dir
=
path
.
join
(
base_dir
,
'
data/benchmarks
'
)
data_dir
=
path
.
join
(
base_dir
,
'
data/benchmarks
'
)
header_fmt_str
=
'
{:15}|{:5}|{:5}|{:5}|{:5}|{:5}|{:5}|{:5}|{:5}|{:5}|{:5}|{:5}|{:10}|{:10}|{:10}|{:10}|{:10}|{:3}|{:10}
\n
'
header_fmt_str
=
'
{:15} {:5} {:5} {:5} {:5} {:5} {:5} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10} {:10}
\n
'
header_str
=
[
'
Data Set
'
,
'
Steps
'
,
'
CM
'
,
'
Solvr
'
,
'
Q Tol
'
,
'
QDS
'
,
'
PreCT
'
,
'
PreCD
'
,
'
PreCS
'
,
'
PCSAI
'
,
'
PreAT
'
,
'
PreAJ
'
,
'
Pre Comp
'
,
header_str
=
[
'
Data Set
'
,
'
Proc
'
,
'
Steps
'
,
'
PreCt
'
,
'
Q Tol
'
,
'
Ren
'
,
'
PCSAI
'
,
'
Pre App
'
,
'
Iters
'
,
'
SpMV
'
,
'
CM
'
,
'
Thd
'
,
'
Time (s)
'
]
'
total
'
,
'
comm
'
,
'
neighbors
'
,
'
init
'
,
'
bonded
'
,
'
nonbonded
'
,
'
CM
'
,
'
CM Sort
'
,
body_fmt_str
=
'
{:15} {:5} {:5} {:5} {:5} {:5} {:5} {:5} {:5} {:5} {:5} {:5} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:3} {:10.3f}
\n
'
'
S Iters
'
,
'
Pre Comm
'
,
'
Pre App
'
,
'
S Comm
'
,
'
S Allr
'
,
'
S SpMV
'
,
'
S Vec Ops
'
]
body_fmt_str
=
'
{:15} {:5} {:5} {:5} {:5} {:5} {:5} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f} {:10.3f}
\n
'
params
=
{
params
=
{
'
ensemble_type
'
:
[
'
0
'
],
'
ensemble_type
'
:
[
'
0
'
],
...
...
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