[lammps-users] Illegal compute pressure error in fix_grem with new lammps version

Hello!

I’ve recently been running simulations on dry CG lipid bilayers using generalized Replica Exchange with lammps (fix grem + fix temper/grem). I’ve been running on the March 3 2020 version of lammps with no problems, but recently built the July 30, 2021 version of lammps on XSEDE’s Expanse and have been running into issues using identical input scripts to what I had been using previously.

Specifically, I am getting the error:

ERROR: Illegal compute pressure command (src/compute_pressure.cpp:42)
Last command: fix grem all grem 150 -0.1 -19600 npt

This error occurs during the fix grem command, and only happens in the new version of LAMMPS (the March 3 2020 version & the October 29 2020 versions run as expected).

I have attached an input script (start.gREM), settings files (system.in.init and system.in.settings), as well as the data file (final_restart_file0) for a single replica that causes this error. I’m wondering if something was updated recently in either compute_pressure.cpp or in fix_grem.cpp that caused this to break? The scripts that I have attached run successfully for the two 2020 versions that I mentioned, but fail with the error for the July 2021 version.

Thanks in advance for your help!
Zeke

Zeke Piskulich, Ph.D.
Postdoctoral Associate
Cui Group • Boston University
Phone: 248-762-5783
Email: [email protected]

final_restart_file0 (975 KB)

start.gREM (1.25 KB)

system.in.init (211 Bytes)

system.in.settings (1.04 KB)

Thanks for the report and for providing a simple enough input deck to reproduce the issue.

This is indeed a bug (actually multiple bug) that was caused by some mistakes during refactoring of fix grem in the last patch.
The following changes should correct the fix for those issues.

diff --git a/src/REPLICA/fix_grem.cpp b/src/REPLICA/fix_grem.cpp
index 07b8051225…743d31fe96 100644
— a/src/REPLICA/fix_grem.cpp
+++ b/src/REPLICA/fix_grem.cpp
@@ -76,20 +76,19 @@ FixGrem::FixGrem(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor

id_press = utils::strdup(std::string(id) + “_press”);

  • modify->add_compute(fmt::format("{} all PRESSURE/GREM {}",
  • id_press, id_temp));
  • modify->add_compute(fmt::format("{} all PRESSURE/GREM {} {}", id_press, id_temp, id));

// create a new compute ke style
// id = fix-ID + ke

id_ke = utils::strdup(std::string(id) + “_ke”);

  • modify->add_compute(fmt::format("{} all ke",id_temp));
  • modify->add_compute(fmt::format("{} all ke",id_ke));

// create a new compute pe style
// id = fix-ID + pe

id_pe = utils::strdup(std::string(id) + “_pe”);

  • modify->add_compute(fmt::format("{} all pe",id_temp));
  • modify->add_compute(fmt::format("{} all pe",id_pe));

int ifix = modify->find_fix(id_nh);
if (ifix < 0)

Hi Axel,

I was able to build lammps with those changes and got it to run (and confirmed that the thermo data matched between the current version and the older version).

Thank you so much for your quick response!
Zeke

Zeke Piskulich, Ph.D.
Postdoctoral Associate
Cui Group • Boston University
Phone: 248-762-5783
Email: [email protected]