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
b3747ce9
Commit
b3747ce9
authored
6 years ago
by
Stan Moore
Browse files
Options
Downloads
Patches
Plain Diff
Fix some issues in new version of pair_snap_kokkos_impl.h
parent
60693a5f
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
+0
-2
0 additions, 2 deletions
src/KOKKOS/pair_snap_kokkos.h
src/KOKKOS/pair_snap_kokkos_impl.h
+9
-20
9 additions, 20 deletions
src/KOKKOS/pair_snap_kokkos_impl.h
with
9 additions
and
22 deletions
src/KOKKOS/pair_snap_kokkos.h
+
0
−
2
View file @
b3747ce9
...
...
@@ -132,10 +132,8 @@ inline double dist2(double* x,double* y);
int
need_dup
;
Kokkos
::
Experimental
::
ScatterView
<
F_FLOAT
*
[
3
],
typename
DAT
::
t_f_array
::
array_layout
,
DeviceType
,
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterDuplicated
>
dup_f
;
Kokkos
::
Experimental
::
ScatterView
<
F_FLOAT
*
[
6
],
typename
DAT
::
t_virial_array
::
array_layout
,
DeviceType
,
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterDuplicated
>
dup_vatom
;
Kokkos
::
Experimental
::
ScatterView
<
E_FLOAT
*
,
typename
DAT
::
t_efloat_1d
::
array_layout
,
DeviceType
,
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterDuplicated
>
dup_eatom
;
Kokkos
::
Experimental
::
ScatterView
<
F_FLOAT
*
[
3
],
typename
DAT
::
t_f_array
::
array_layout
,
DeviceType
,
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterNonDuplicated
>
ndup_f
;
Kokkos
::
Experimental
::
ScatterView
<
F_FLOAT
*
[
6
],
typename
DAT
::
t_virial_array
::
array_layout
,
DeviceType
,
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterNonDuplicated
>
ndup_vatom
;
Kokkos
::
Experimental
::
ScatterView
<
E_FLOAT
*
,
typename
DAT
::
t_efloat_1d
::
array_layout
,
DeviceType
,
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterNonDuplicated
>
ndup_eatom
;
friend
void
pair_virial_fdotr_compute
<
PairSNAPKokkos
>
(
PairSNAPKokkos
*
);
...
...
This diff is collapsed.
Click to expand it.
src/KOKKOS/pair_snap_kokkos_impl.h
+
9
−
20
View file @
b3747ce9
...
...
@@ -174,11 +174,9 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
if
(
need_dup
)
{
dup_f
=
Kokkos
::
Experimental
::
create_scatter_view
<
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterDuplicated
>
(
f
);
dup_vatom
=
Kokkos
::
Experimental
::
create_scatter_view
<
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterDuplicated
>
(
d_vatom
);
dup_eatom
=
Kokkos
::
Experimental
::
create_scatter_view
<
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterDuplicated
>
(
d_eatom
);
}
else
{
ndup_f
=
Kokkos
::
Experimental
::
create_scatter_view
<
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterNonDuplicated
>
(
f
);
ndup_vatom
=
Kokkos
::
Experimental
::
create_scatter_view
<
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterNonDuplicated
>
(
d_vatom
);
ndup_eatom
=
Kokkos
::
Experimental
::
create_scatter_view
<
Kokkos
::
Experimental
::
ScatterSum
,
Kokkos
::
Experimental
::
ScatterNonDuplicated
>
(
d_eatom
);
}
/*
...
...
@@ -258,10 +256,7 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
if
(
vflag_fdotr
)
pair_virial_fdotr_compute
(
this
);
if
(
eflag_atom
)
{
if
(
need_dup
)
Kokkos
::
Experimental
::
contribute
(
d_eatom
,
dup_eatom
);
k_eatom
.
template
modify
<
DeviceType
>();
k_eatom
.
template
sync
<
LMPHostType
>();
}
...
...
@@ -281,7 +276,6 @@ void PairSNAPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
if
(
need_dup
)
{
dup_f
=
decltype
(
dup_f
)();
dup_vatom
=
decltype
(
dup_vatom
)();
dup_eatom
=
decltype
(
dup_eatom
)();
}
}
...
...
@@ -578,11 +572,13 @@ void PairSNAPKokkos<DeviceType>::operator() (TagPairSNAP<NEIGHFLAG,EVFLAG>,const
Kokkos
::
single
(
Kokkos
::
PerTeam
(
team
),
[
&
]
()
{
// evdwl = energy of atom I, sum over coeffs_k * Bi_k
// evdwl = energy of atom I, sum over coeffs_k * Bi_k
double
evdwl
=
d_coeffi
[
0
];
double
evdwl
=
d_coeffi
[
0
];
// linear contributions
// could use thread vector range on this loop
// linear contributions
for
(
int
k
=
1
;
k
<=
ncoeff
;
k
++
)
evdwl
+=
d_coeffi
[
k
]
*
my_sna
.
bvec
[
k
-
1
];
...
...
@@ -598,17 +594,10 @@ void PairSNAPKokkos<DeviceType>::operator() (TagPairSNAP<NEIGHFLAG,EVFLAG>,const
}
}
}
// ev_tally_full(i,2.0*evdwl,0.0,0.0,0.0,0.0,0.0);
if
(
eflag_either
)
{
if
(
eflag_global
)
ev
.
evdwl
+=
evdwl
;
if
(
eflag_atom
)
{
// The eatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial
auto
v_eatom
=
ScatterViewHelper
<
NeedDup
<
NEIGHFLAG
,
DeviceType
>::
value
,
decltype
(
dup_eatom
),
decltype
(
ndup_eatom
)
>::
get
(
dup_eatom
,
ndup_eatom
);
auto
a_eatom
=
v_eatom
.
template
access
<
AtomicDup
<
NEIGHFLAG
,
DeviceType
>
::
value
>
();
a_eatom
[
i
]
+=
evdwl
;
}
}
//ev_tally_full(i,2.0*evdwl,0.0,0.0,0.0,0.0,0.0);
if
(
eflag_global
)
ev
.
evdwl
+=
evdwl
;
if
(
eflag_atom
)
d_eatom
[
i
]
+=
evdwl
;
});
}
}
...
...
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