make taper warnings consistent between Kokkos and CPU and avoid multiple outputs

This commit is contained in:
Axel Kohlmeyer
2024-12-26 16:28:22 -05:00
parent 3b21f69d70
commit b762610944
2 changed files with 11 additions and 12 deletions

View File

@ -385,13 +385,13 @@ void PairReaxFFKokkos<DeviceType>::init_md()
swb = api->control->nonb_cut;
enobondsflag = api->control->enobondsflag;
if (fabs(swa) > 0.01)
error->warning(FLERR,"Warning: non-zero lower Taper-radius cutoff");
if ((fabs(swa) > 0.01) && (comm->me == 0))
error->warning(FLERR, "Non-zero lower Taper-radius cutoff");
if (swb < 0)
error->one(FLERR,"Negative upper Taper-radius cutoff");
else if (swb < 5)
error->one(FLERR,"Warning: very low Taper-radius cutoff: {}\n", swb);
if (swb < 0.0) {
error->all(FLERR,"Negative upper Taper-radius cutoff");
} else if ((swb < 5.0) && (comm->me ==0))
error->warning(FLERR,"Very low Taper-radius cutoff: {}\n", swb);
d1 = swb - swa;
d7 = powint(d1,7);

View File

@ -80,15 +80,14 @@ namespace ReaxFF {
swa = control->nonb_low;
swb = control->nonb_cut;
if (fabs(swa) > 0.01 && control->me == 0)
if ((fabs(swa) > 0.01) && (control->me == 0))
error->warning(FLERR, "Non-zero lower Taper-radius cutoff");
if (swb < 0) {
if (swb < 0.0) {
error->all(FLERR,"Negative upper Taper-radius cutoff");
}
else if (swb < 5 && control->me == 0)
error->warning(FLERR,fmt::format("Warning: very low Taper-radius cutoff: "
"{}\n", swb));
} else if ((swb < 5.0) && (control->me == 0))
error->warning(FLERR,fmt::format("Very low Taper-radius cutoff: {}\n", swb));
d1 = swb - swa;
d7 = pow(d1, 7.0);
swa2 = SQR(swa);