Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
multiscale
lammps
Commits
db1ed32a
Commit
db1ed32a
authored
7 years ago
by
Stan Moore
Browse files
Options
Downloads
Patches
Plain Diff
Fix minor issues in pair_snap_kokkos
parent
d7d087ae
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/KOKKOS/pair_snap_kokkos.h
+1
-2
1 addition, 2 deletions
src/KOKKOS/pair_snap_kokkos.h
src/KOKKOS/pair_snap_kokkos_impl.h
+8
-28
8 additions, 28 deletions
src/KOKKOS/pair_snap_kokkos_impl.h
with
9 additions
and
30 deletions
src/KOKKOS/pair_snap_kokkos.h
+
1
−
2
View file @
db1ed32a
...
...
@@ -48,7 +48,6 @@ public:
void
coeff
(
int
,
char
**
);
void
init_style
();
void
compute
(
int
,
int
);
double
memory_usage
();
template
<
int
NEIGHFLAG
,
int
EVFLAG
>
KOKKOS_INLINE_FUNCTION
...
...
@@ -83,7 +82,7 @@ protected:
// How much parallelism to use within an interaction
int
vector_length
;
int
eflag
,
vflag
,
nlocal
;
int
eflag
,
vflag
;
void
allocate
();
//void read_files(char *, char *);
...
...
This diff is collapsed.
Click to expand it.
src/KOKKOS/pair_snap_kokkos_impl.h
+
8
−
28
View file @
db1ed32a
...
...
@@ -133,7 +133,7 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
eflag
=
eflag_in
;
vflag
=
vflag_in
;
if
(
neighflag
==
FULL
)
no_virial_fdotr_compute
=
1
;
// FIX ME??
if
(
neighflag
==
FULL
)
no_virial_fdotr_compute
=
1
;
if
(
eflag
||
vflag
)
ev_setup
(
eflag
,
vflag
,
0
);
else
evflag
=
vflag_fdotr
=
0
;
...
...
@@ -160,13 +160,12 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
x
=
atomKK
->
k_x
.
view
<
DeviceType
>
();
f
=
atomKK
->
k_f
.
view
<
DeviceType
>
();
type
=
atomKK
->
k_type
.
view
<
DeviceType
>
();
nlocal
=
atom
->
nlocal
;
NeighListKokkos
<
DeviceType
>*
k_list
=
static_cast
<
NeighListKokkos
<
DeviceType
>*>
(
list
);
d_numneigh
=
k_list
->
d_numneigh
;
d_neighbors
=
k_list
->
d_neighbors
;
d_ilist
=
k_list
->
d_ilist
;
//
int inum = list->inum;
int
inum
=
list
->
inum
;
/*
for (int i = 0; i < nlocal; i++) {
...
...
@@ -175,7 +174,7 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
if (max_neighs<num_neighs) max_neighs = num_neighs;
}*/
int
max_neighs
=
0
;
Kokkos
::
parallel_reduce
(
"PairSNAPKokkos::find_max_neighs"
,
nlocal
,
FindMaxNumNeighs
<
DeviceType
>
(
k_list
),
Kokkos
::
Experimental
::
Max
<
int
>
(
max_neighs
));
Kokkos
::
parallel_reduce
(
"PairSNAPKokkos::find_max_neighs"
,
inum
,
FindMaxNumNeighs
<
DeviceType
>
(
k_list
),
Kokkos
::
Experimental
::
Max
<
int
>
(
max_neighs
));
snaKK
.
nmax
=
max_neighs
;
...
...
@@ -197,13 +196,13 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
if
(
eflag
)
{
if
(
neighflag
==
HALF
)
{
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALF
,
1
>
>
policy
(
nlocal
,
team_size
,
vector_length
);
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALF
,
1
>
>
policy
(
inum
,
team_size
,
vector_length
);
Kokkos
::
parallel_reduce
(
policy
.
set_scratch_size
(
1
,
Kokkos
::
PerThread
(
thread_scratch_size
))
.
set_scratch_size
(
1
,
Kokkos
::
PerTeam
(
team_scratch_size
))
,
*
this
,
ev
);
}
else
if
(
neighflag
==
HALFTHREAD
)
{
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALFTHREAD
,
1
>
>
policy
(
nlocal
,
team_size
,
vector_length
);
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALFTHREAD
,
1
>
>
policy
(
inum
,
team_size
,
vector_length
);
Kokkos
::
parallel_reduce
(
policy
.
set_scratch_size
(
1
,
Kokkos
::
PerThread
(
thread_scratch_size
))
.
set_scratch_size
(
1
,
Kokkos
::
PerTeam
(
team_scratch_size
))
...
...
@@ -211,13 +210,13 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
}
}
else
{
if
(
neighflag
==
HALF
)
{
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALF
,
0
>
>
policy
(
nlocal
,
team_size
,
vector_length
);
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALF
,
0
>
>
policy
(
inum
,
team_size
,
vector_length
);
Kokkos
::
parallel_for
(
policy
.
set_scratch_size
(
1
,
Kokkos
::
PerThread
(
thread_scratch_size
))
.
set_scratch_size
(
1
,
Kokkos
::
PerTeam
(
team_scratch_size
))
,
*
this
);
}
else
if
(
neighflag
==
HALFTHREAD
)
{
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALFTHREAD
,
0
>
>
policy
(
nlocal
,
team_size
,
vector_length
);
typename
Kokkos
::
TeamPolicy
<
DeviceType
,
TagPairSNAP
<
HALFTHREAD
,
0
>
>
policy
(
inum
,
team_size
,
vector_length
);
Kokkos
::
parallel_for
(
policy
.
set_scratch_size
(
1
,
Kokkos
::
PerThread
(
thread_scratch_size
))
.
set_scratch_size
(
1
,
Kokkos
::
PerTeam
(
team_scratch_size
))
...
...
@@ -615,23 +614,4 @@ void PairSNAPKokkos<DeviceType>::v_tally_xyz(EV_FLOAT &ev, const int &i, const i
v_vatom
(
j
,
4
)
+=
0.5
*
v4
;
v_vatom
(
j
,
5
)
+=
0.5
*
v5
;
}
}
/* ----------------------------------------------------------------------
memory usage
------------------------------------------------------------------------- */
template
<
class
DeviceType
>
double
PairSNAPKokkos
<
DeviceType
>::
memory_usage
()
{
double
bytes
=
Pair
::
memory_usage
();
int
n
=
atom
->
ntypes
+
1
;
bytes
+=
n
*
n
*
sizeof
(
int
);
bytes
+=
n
*
n
*
sizeof
(
double
);
bytes
+=
3
*
nmax
*
sizeof
(
double
);
bytes
+=
nmax
*
sizeof
(
int
);
bytes
+=
(
2
*
ncoeffall
)
*
sizeof
(
double
);
bytes
+=
(
ncoeff
*
3
)
*
sizeof
(
double
);
//bytes += snaKK.memory_usage(); // FIXME
return
bytes
;
}
}
\ No newline at end of file
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