Lammps + plumed

Hi,

My lammps version is lammps-23Jun2022, and I want to run MD simulations with ML hdnnp, and then use plumed to do the enhanced samplings.

I encountered a issue when I run the MD simulations:

terminate called after throwing an instance of ‘PLMD::Plumed::ExceptionError’

what():
+++ PLUMED error
+++ at Communicator.cpp:89, function void PLMD::Communicator::Set_comm(const PLMD::TypesafePtr&)
+++ message follows +++
you are trying to use an MPI function, but PLUMED has been compiled without MPI support
terminate called after throwing an instance of ‘PLMD::Plumed::ExceptionError’

I just use the make command to complie all things and have no errors generated for this complie process. I briefly describe the installation below:

  1. download lammps-23Jun2022 and go to ./src
  2. Based on this online instruction:

    I first run: make lib-plumed;
    then run: make lib-plumed args=“-b”
  3. then run make yes-ml-plumed
  4. then make mpi

I finally obtained executive lmp_mpi successfully and I perform MD simulation using the next command:

mpirun -np 20 lmp_mpi < xxxx.in

Unfortunately I encountered the error. It seems that this error tells me my plumed software cannot run multiparallel simulation, but I do not know what should I do to solve this error. Could you give me some advices? Thanks a lot.

My module loaded packages on the HPC cluster:

Cheers,
zzz

You have to look very carefully at the output that you get during compilation.

The plumed configure script should find your MPI library automatically. It does for me:

Building plumed ...
configure: Optional modules are disabled by default
configure: Enabling all optional modules
checking for mpic++... mpic++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether mpic++ accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
configure: Initial CXX:         mpic++
configure: Initial CXXFLAGS:    -O3
configure: Initial CPPFLAGS:    
configure: Initial CFLAGS:      -g -O2
configure: Initial LDFLAGS:     
configure: Initial LIBS:        
configure: Initial STATIC_LIBS: 
configure: Initial LD:          
configure: Initial LDSHARED:    mpic++
configure: Initial SOEXT:       
checking whether mpic++ accepts -fPIC... yes
checking whether gcc accepts -fPIC... yes
checking whether mpic++ accepts -Wall... yes
checking whether mpic++ accepts -pedantic... yes
checking whether mpic++ accepts -std=c++11... yes
checking whether mpic++ declares c++11 support... yes
checking whether C++ library supports C++11 exceptions... yes
checking whether mpic++ can generate dependency file with -MM -MF... yes

So you have to make certain that your environment module for MPI is always loaded and that you load the same module when you do “make lib-plumed args=-b” and when you do “make mpi”.

The alternative would be to try compiling with CMake. That should give you more feedback but be functionally effectively the same. It just compiles everything in one step.

Thanks so much for your help. I just solved this issue based on your comments!

1 Like