plumed issue with lammps

Dear lamps users

I have recently start using plumed to calculate order parameters in lammps. My final objective is to apply a restrain based on the order parameter Q6 on a system compose of water molecules modeled with the mW model (monoatomic water model).

I mannaged to compile plumed with lammps and make it run, nevertheless whenever I unfix the “fix plumed” it gives gives a segmentation fault. This also happens if I don’t unfix the command at the end of the lammps script.
Without the “fix plumed” lammps finishes with no problems.
Also in order to make it clear plumed also works, the problem is that it can’t finalize correctly

I tried this in two computers with the same result working with mpirun -np 2

Here is some information about how I compiled plumed version 2.4.4

./configure --enable-static-patch --enable-modules=+crystallization:+colvar

make
make install

as for lammps I download the last stable version from github

git clone -b stable https://github.com/lammps/lammps.git mylammps

I compiled it with the Makefile.mpi that comes with the distribution with this packages
manybody; molecule; user-plumed.

I would like to know if this has something to do with the interface between lammps and plumed and if it can be solved.

I attached the following files in order to test the problem a very simple simulation where the Q6 is eval for just one frame.

basal.data -> the coordinate files
in.plumed_test.run -> input for lammps
mW.sw -> sw potential parameters
plumed.dat -> data for plumed

and also the output of the run
p.log and pre-COLVAR -> plumed outputs
log.lammps ->log lammps output
out.screen -> lammps screen output with the segmentation fault

thanks for the help
Matias

basal.data (22.7 KB)

in.plumed_test.run (384 Bytes)

log.lammps (2.1 KB)

out.screen (4.39 KB)

mW.sw (217 Bytes)

p.log (6.09 KB)

plumed.dat (286 Bytes)

pre-COLVAR (79 Bytes)

matias,

this is indeed a bug in the USER-PLUMED package in LAMMPS.
it is addressed with the following change:

diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp
index f8b06fdbe..4bf5acedc 100644
--- a/src/USER-PLUMED/fix_plumed.cpp
+++ b/src/USER-PLUMED/fix_plumed.cpp
@@ -214,7 +214,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
   // Define compute to calculate potential energy

   id_pe = new char[7];
- id_pe = (char *) "plmd_pe";
+ strcpy(id_pe,"plmd_pe");
   char **newarg = new char*[3];
   newarg[0] = id_pe;
   newarg[1] = (char *) "all";
@@ -227,7 +227,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
   // Define compute to calculate pressure tensor

   id_press = new char[9];
- id_press = (char *) "plmd_press";
+ strcpy(id_press,"plmd_press");
   newarg = new char*[5];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";

axel.

the patch in my last e-mail was incomplete. here is an updated version:

diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp
index f8b06fdbe..635d08c57 100644
--- a/src/USER-PLUMED/fix_plumed.cpp
+++ b/src/USER-PLUMED/fix_plumed.cpp
@@ -213,8 +213,8 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :

   // Define compute to calculate potential energy

- id_pe = new char[7];
- id_pe = (char *) "plmd_pe";
+ id_pe = new char[8];
+ strcpy(id_pe,"plmd_pe");
   char **newarg = new char*[3];
   newarg[0] = id_pe;
   newarg[1] = (char *) "all";
@@ -226,8 +226,8 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :

   // Define compute to calculate pressure tensor

- id_press = new char[9];
- id_press = (char *) "plmd_press";
+ id_press = new char[11];
+ strcpy(id_press,"plmd_press");
   newarg = new char*[5];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";

sorry for the oversight,
      axel.

Thanks axel it works perfect now !