It's really just a placeholder in the logic. At some point
there may be different tests put there for Kokkos vs regular
neighbor lists.
fair enough, but the result is now a different logic than what was
there before the kokkos related changes were added on march 12th. here
is one example of the total change:
@@ -565,19 +573,23 @@ void Finish::end(int flag)
// find a non-skip neighbor list containing full pairwise interactions
// count neighbors in that list for stats purposes
- for (m = 0; m < neighbor->old_nrequest; m++)
+ for (m = 0; m < neighbor->old_nrequest; m++) {
if (neighbor->old_requests[m]->full &&
- neighbor->old_requests[m]->skip == 0) break;
+ neighbor->old_requests[m]->skip == 0) {
+ if (lmp->kokkos && lmp->kokkos->neigh_list_kokkos(m)) break;
+ else break;
+ }
+ }
nneighfull = 0;
if (m < neighbor->old_nrequest) {
- if (neighbor->lists[m]->numneigh > 0) {
+ if (neighbor->lists[m]) {
int inum = neighbor->lists[m]->inum;
int *ilist = neighbor->lists[m]->ilist;
int *numneigh = neighbor->lists[m]->numneigh;
for (i = 0; i < inum; i++)
nneighfull += numneigh[ilist[i]];
- }
+ } else if (lmp->kokkos) nneighfull = lmp->kokkos->neigh_count(m);
tmp = nneighfull;
stats(1,&tmp,&ave,&max,&min,10,histo);
you are losing the test for "neighbor->lists[m]->numneigh > 0" (where
the >0 is not needed, since numneigh is a pointer). now, if i read the
code correctly, with kokkos you can have a neighbor->lists[m] that is
a null pointer and instead you need to query kokkos for neighbor list
stats with the same index, so with that in mind, you'd need to add on
top of what is there currently the following change:
diff --git a/src/finish.cpp b/src/finish.cpp
index e9c6d3d..67c2085 100644
--- a/src/finish.cpp
+++ b/src/finish.cpp
@@ -583,13 +583,14 @@ void Finish::end(int flag)
nneighfull = 0;
if (m < neighbor->old_nrequest) {
- if (neighbor->lists[m]) {
+ if (neighbor->lists[m] && neighbor->lists[m]->numneigh)) {
int inum = neighbor->lists[m]->inum;
int *ilist = neighbor->lists[m]->ilist;
int *numneigh = neighbor->lists[m]->numneigh;
for (i = 0; i < inum; i++)
nneighfull += numneigh[ilist[i]];
- } else if (lmp->kokkos) nneighfull = lmp->kokkos->neigh_count(m);
+ } else if (!neighbor->lists[m] && lmp->kokkos)
+ nneighfull = lmp->kokkos->neigh_count(m);
tmp = nneighfull;
stats(1,&tmp,&ave,&max,&min,10,histo);
and similarly at another location a little bit higher up add this
change to recover the original logic and protect against empty list
pointers:
diff --git a/src/finish.cpp b/src/finish.cpp
index e9c6d3d..713f02a 100644
--- a/src/finish.cpp
+++ b/src/finish.cpp
@@ -536,8 +536,10 @@ void Finish::end(int flag)
neighbor->old_requests[m]->gran ||
neighbor->old_requests[m]->respaouter ||
neighbor->old_requests[m]->half_from_full) &&
- neighbor->old_requests[m]->skip == 0) {
- if (lmp->kokkos && lmp->kokkos->neigh_list_kokkos(m)) break;
+ neighbor->old_requests[m]->skip == 0 &&
+ neighbor->lists[m] && neighbor->lists[m]->numneigh) {
+ if (!neighbor->lists[m] && lmp->kokkos &&
+ lmp->kokkos->neigh_list_kokkos(m)) break;
else break;
}
}