Skip to content

Commit

Permalink
Single process errors in pair style kim reported using error->one
Browse files Browse the repository at this point in the history
Errors during a KIM compute operation that occur on a single processor were reported using error->all, which causes LAMMPS to hang when running in parallel with more than one processor. This has been fixed by replacing error->all with error->one for those cases.
  • Loading branch information
riseofdata committed Jan 7, 2025
1 parent cd6ab17 commit a795ae3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/KIM/pair_kim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void PairKIM::compute(int eflag, int vflag)
KIM_COMPUTE_ARGUMENT_NAME_particleContributing,
kim_particleContributing);
if (kimerror)
error->all(FLERR,"Unable to set KIM particle species codes and/or contributing");
error->one(FLERR,"Unable to set KIM particle species codes and/or contributing");
}

// kim_particleSpecies = KIM atom species for each LAMMPS atom
Expand All @@ -250,7 +250,7 @@ void PairKIM::compute(int eflag, int vflag)

// compute via KIM model
int kimerror = KIM_Model_Compute(pkim, pargs);
if (kimerror) error->all(FLERR, "KIM Compute returned error {}", kimerror);
if (kimerror) error->one(FLERR, "KIM Compute returned error {}", kimerror);

// scale results for fix adapt if needed
if (scale_extracted) {
Expand Down Expand Up @@ -814,7 +814,7 @@ void PairKIM::kim_free()
if (kim_init_ok) {
int kimerror = KIM_Model_ComputeArgumentsDestroy(pkim, &pargs);
if (kimerror)
error->all(FLERR,"Unable to destroy Compute Arguments Object");
error->one(FLERR,"Unable to destroy Compute Arguments Object");

KIM_Model_Destroy(&pkim);

Expand Down

0 comments on commit a795ae3

Please sign in to comment.