allow -kokkos on g 0 without GPU support, report GPUs only if ngpu > 0
This commit is contained in:
@ -121,11 +121,12 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||
|
||||
} else if (strcmp(arg[iarg],"g") == 0 ||
|
||||
strcmp(arg[iarg],"gpus") == 0) {
|
||||
#ifndef LMP_KOKKOS_GPU
|
||||
error->all(FLERR,"GPUs are requested but Kokkos has not been compiled using a GPU-enabled backend");
|
||||
#endif
|
||||
if (iarg+2 > narg) error->all(FLERR,"Invalid Kokkos command-line args");
|
||||
ngpus = utils::inumeric(FLERR, arg[iarg+1], false, lmp);
|
||||
#ifndef LMP_KOKKOS_GPU
|
||||
if (ngpus > 0)
|
||||
error->all(FLERR,"GPUs are requested but Kokkos has not been compiled using a GPU-enabled backend");
|
||||
#endif
|
||||
|
||||
int skip_gpu = 9999;
|
||||
if (iarg+2 < narg && isdigit(arg[iarg+2][0])) {
|
||||
@ -207,7 +208,8 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||
init_ngpus = ngpus;
|
||||
}
|
||||
|
||||
if (me == 0) utils::logmesg(lmp, " will use up to {} GPU(s) per node\n", ngpus);
|
||||
if ((me == 0) && (ngpus > 0))
|
||||
utils::logmesg(lmp, " will use up to {} GPU(s) per node\n", ngpus);
|
||||
|
||||
#ifdef LMP_KOKKOS_GPU
|
||||
if (ngpus <= 0)
|
||||
|
||||
Reference in New Issue
Block a user