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
854011d2
Commit
854011d2
authored
8 years ago
by
Kurt A. O'Hearn
Browse files
Options
Downloads
Patches
Plain Diff
sPuReMD: change static allocation in ICHOLT to dynamic allocation. Update run script.
parent
85945de1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sPuReMD/src/QEq.c
+20
-12
20 additions, 12 deletions
sPuReMD/src/QEq.c
tools/run_sim.py
+28
-5
28 additions, 5 deletions
tools/run_sim.py
with
48 additions
and
17 deletions
sPuReMD/src/QEq.c
+
20
−
12
View file @
854011d2
...
...
@@ -159,7 +159,7 @@ static void Calculate_Droptol( const sparse_matrix * const A, real * const dropt
unsigned
int
tid
;
#endif
#pragma omp parallel default(none) private(i, j, k, val, tid), shared(droptol_local)
#pragma omp parallel default(none) private(i, j, k, val, tid), shared(droptol_local
, stderr
)
{
#ifdef _OPENMP
tid
=
omp_get_thread_num
();
...
...
@@ -172,6 +172,7 @@ static void Calculate_Droptol( const sparse_matrix * const A, real * const dropt
{
if
(
(
droptol_local
=
(
real
*
)
malloc
(
omp_get_num_threads
()
*
A
->
n
*
sizeof
(
real
)))
==
NULL
)
{
fprintf
(
stderr
,
"Not enough space for droptol. Terminating...
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
}
...
...
@@ -597,16 +598,21 @@ static real diag_pre_comp( const reax_system * const system, real * const Hdia_i
static
real
ICHOLT
(
const
sparse_matrix
*
const
A
,
const
real
*
const
droptol
,
sparse_matrix
*
const
L
,
sparse_matrix
*
const
U
)
{
//TODO: either add compilation parameter or dynamically allocate
int
tmp_j
[
1000
];
real
tmp_val
[
1000
];
int
*
tmp_j
;
real
*
tmp_val
;
int
i
,
j
,
pj
,
k1
,
k2
,
tmptop
,
Ltop
;
real
val
,
start
;
int
*
Utop
;
start
=
Get_Time
(
);
Utop
=
(
int
*
)
malloc
((
A
->
n
+
1
)
*
sizeof
(
int
));
if
(
(
Utop
=
(
int
*
)
malloc
((
A
->
n
+
1
)
*
sizeof
(
int
))
)
==
NULL
||
(
tmp_j
=
(
int
*
)
malloc
(
A
->
n
*
sizeof
(
int
))
)
==
NULL
||
(
tmp_val
=
(
real
*
)
malloc
(
A
->
n
*
sizeof
(
real
))
)
==
NULL
)
{
fprintf
(
stderr
,
"not enough memory for ICHOLT preconditioning matrices. terminating.
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
// clear variables
Ltop
=
0
;
...
...
@@ -726,7 +732,9 @@ static real ICHOLT( const sparse_matrix * const A, const real * const droptol,
// fprintf( stderr, "nnz(U): %d, max: %d\n", Utop[U->n], U->n * 50 );
free
(
Utop
);
free
(
tmp_val
);
free
(
tmp_j
);
free
(
Utop
);
return
Get_Timing_Info
(
start
);
}
...
...
@@ -750,7 +758,7 @@ static real ICHOL_PAR( const sparse_matrix * const A, const unsigned int sweeps,
if
(
Allocate_Matrix
(
&
DAD
,
A
->
n
,
A
->
m
)
==
0
)
{
fprintf
(
stderr
,
"not enough memory for preconditioning matrices. terminating.
\n
"
);
fprintf
(
stderr
,
"not enough memory for
ICHOL_PAR
preconditioning matrices. terminating.
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
...
...
@@ -758,7 +766,7 @@ static real ICHOL_PAR( const sparse_matrix * const A, const unsigned int sweeps,
(
D_inv
=
(
real
*
)
malloc
(
A
->
n
*
sizeof
(
real
))
)
==
NULL
||
(
Utop
=
(
int
*
)
malloc
((
A
->
n
+
1
)
*
sizeof
(
int
))
)
==
NULL
)
{
fprintf
(
stderr
,
"not enough memory for preconditioning matrices. terminating.
\n
"
);
fprintf
(
stderr
,
"not enough memory for
ICHOL_PAR
preconditioning matrices. terminating.
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
...
...
@@ -948,14 +956,14 @@ static real ILU_PAR( const sparse_matrix * const A, const unsigned int sweeps,
if
(
Allocate_Matrix
(
&
DAD
,
A
->
n
,
A
->
m
)
==
0
)
{
fprintf
(
stderr
,
"not enough memory for preconditioning matrices. terminating.
\n
"
);
fprintf
(
stderr
,
"not enough memory for
ILU_PAR
preconditioning matrices. terminating.
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
if
(
(
D
=
(
real
*
)
malloc
(
A
->
n
*
sizeof
(
real
))
)
==
NULL
||
(
D_inv
=
(
real
*
)
malloc
(
A
->
n
*
sizeof
(
real
))
)
==
NULL
)
{
fprintf
(
stderr
,
"not enough memory for preconditioning matrices. terminating.
\n
"
);
fprintf
(
stderr
,
"not enough memory for
ILU_PAR
preconditioning matrices. terminating.
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
...
...
@@ -1158,14 +1166,14 @@ static real ILUT_PAR( const sparse_matrix * const A, const real * droptol,
Allocate_Matrix
(
&
L_temp
,
A
->
n
,
A
->
m
)
==
0
||
Allocate_Matrix
(
&
U_temp
,
A
->
n
,
A
->
m
)
==
0
)
{
fprintf
(
stderr
,
"not enough memory for preconditioning matrices. terminating.
\n
"
);
fprintf
(
stderr
,
"not enough memory for
ILUT_PAR
preconditioning matrices. terminating.
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
if
(
(
D
=
(
real
*
)
malloc
(
A
->
n
*
sizeof
(
real
))
)
==
NULL
||
(
D_inv
=
(
real
*
)
malloc
(
A
->
n
*
sizeof
(
real
))
)
==
NULL
)
{
fprintf
(
stderr
,
"not enough memory for preconditioning matrices. terminating.
\n
"
);
fprintf
(
stderr
,
"not enough memory for
ILUT_PAR
preconditioning matrices. terminating.
\n
"
);
exit
(
INSUFFICIENT_MEMORY
);
}
...
...
This diff is collapsed.
Click to expand it.
tools/run_sim.py
+
28
−
5
View file @
854011d2
...
...
@@ -103,18 +103,28 @@ class TestCase():
env
[
'
OMP_NUM_THREADS
'
]
=
param_dict
[
'
threads
'
]
start
=
time
()
proc_handle
=
Popen
([
bin_path
,
self
.
__geo_file
,
self
.
__ffield_file
,
temp_file
],
stdout
=
PIPE
,
stderr
=
PIPE
,
env
=
env
)
stdout
=
PIPE
,
stderr
=
PIPE
,
env
=
env
,
universal_newlines
=
True
)
stdout
,
stderr
=
proc_handle
.
communicate
()
stop
=
time
()
if
proc_handle
.
returncode
<
0
:
print
(
"
WARNING: process terminated with code {0}
"
.
format
(
proc_handle
.
returncode
))
else
:
print
(
'
stdout:
'
)
print
(
stdout
)
print
(
'
stderr:
'
)
print
(
stderr
)
else
:
#TODO: fix
start
=
0.
stop
=
0.
self
.
_process_result
(
fout
,
stop
-
start
,
param_dict
)
fout
.
close
()
remove
(
temp_file
)
rmdir
(
temp_dir
)
if
path
.
exists
(
temp_file
):
remove
(
temp_file
)
if
path
.
exists
(
temp_dir
):
rmdir
(
temp_dir
)
def
_process_result
(
self
,
fout
,
time
,
param
):
qeq
=
0.
...
...
@@ -123,7 +133,12 @@ class TestCase():
pre_app
=
0.
spmv
=
0.
cnt
=
0
with
open
(
param
[
'
name
'
]
+
'
.log
'
,
'
r
'
)
as
fp
:
log_file
=
param
[
'
name
'
]
+
'
.log
'
if
not
path
.
exists
(
log_file
):
print
(
'
***WARNING: {0} does not exist!
'
.
format
(
log_file
))
return
with
open
(
log_file
,
'
r
'
)
as
fp
:
for
line
in
fp
:
line
=
line
.
split
()
try
:
...
...
@@ -219,7 +234,7 @@ if __name__ == '__main__':
geo_format
=
[
'
1
'
],
result_file
=
result_file
))
if
'
water_78480
'
in
args
.
data
:
test_cases
.
append
(
TestCase
(
path
.
join
(
data_dir
,
'
water/water_78480.
pdb
'
),
TestCase
(
path
.
join
(
data_dir
,
'
water/water_78480.
geo
'
),
path
.
join
(
data_dir
,
'
water/ffield.water
'
),
path
.
join
(
control_dir
,
'
param.gpu.water
'
),
params
=
params
,
result_header_fmt
=
header_fmt_str
,
...
...
@@ -241,6 +256,14 @@ if __name__ == '__main__':
params
=
params
,
result_header_fmt
=
header_fmt_str
,
result_header
=
header_str
,
result_body_fmt
=
body_fmt_str
,
geo_format
=
[
'
1
'
],
result_file
=
result_file
))
if
'
bilayer_340800
'
in
args
.
data
:
test_cases
.
append
(
TestCase
(
path
.
join
(
data_dir
,
'
bilayer/bilayer_340800.geo
'
),
path
.
join
(
data_dir
,
'
bilayer/ffield-bio
'
),
path
.
join
(
control_dir
,
'
param.gpu.water
'
),
params
=
params
,
result_header_fmt
=
header_fmt_str
,
result_header
=
header_str
,
result_body_fmt
=
body_fmt_str
,
geo_format
=
[
'
0
'
],
result_file
=
result_file
))
if
'
dna_19733
'
in
args
.
data
:
test_cases
.
append
(
TestCase
(
path
.
join
(
data_dir
,
'
dna/dna_19733.pdb
'
),
...
...
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