skip using neighbor list load balancing weight when using KOKKOS with GPU

This commit is contained in:
Axel Kohlmeyer
2021-07-28 21:30:06 -04:00
parent b8d3297659
commit bf6c982b49

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -14,6 +13,7 @@
#include "imbalance_neigh.h"
#include "accelerator_kokkos.h"
#include "atom.h"
#include "comm.h"
#include "error.h"
@ -50,14 +50,25 @@ void ImbalanceNeigh::compute(double *weight)
if (factor == 0.0) return;
// cannot use neighbor list weight with KOKKOS using GPUs
if (lmp->kokkos && lmp->kokkos->kokkos_exists) {
if (lmp->kokkos->ngpus > 0) {
if (comm->me == 0 && !did_warn)
error->warning(FLERR, "Balance weight neigh skipped with KOKKOS using GPUs");
did_warn = 1;
return;
}
}
// find suitable neighbor list
// can only use certain conventional neighbor lists
// NOTE: why not full list, if half does not exist?
for (req = 0; req < neighbor->old_nrequest; ++req) {
if (neighbor->old_requests[req]->half &&
neighbor->old_requests[req]->skip == 0 &&
neighbor->lists[req] && neighbor->lists[req]->numneigh) break;
if (neighbor->old_requests[req]->half && neighbor->old_requests[req]->skip == 0 &&
neighbor->lists[req] && neighbor->lists[req]->numneigh)
break;
}
if (req >= neighbor->old_nrequest || neighbor->ago < 0) {