Unable to patch PLUMED with INTEL package

Hello,

I am trying to patch LAMMPS 29Sep2021 with PLUMED. As it stands, I have managed to get PLUMED working with LAMMPS but I am trying to squeeze some extra performance by using Intel acceleration.

To get plumed running on the HPC cluster, I had to make the following changes after untarring stable_29Sep2021.tar.gz:

  1. Go to “xxx/lammps-stable_3Mar2020/lib/plumed/Install.py”, and comment out everything between “if buildflag:” and “# build plumed” to prevent lammps download plumed again.

  2. Go to “xxx/lammps-stable_3Mar2020/lib/plumed/plumed-2.7.1/Makefile.conf.in”, and change “LD_RO=@LD_RO@” to " LD_RO=/opt/rh/gcc-toolset-10/root/usr/bin/ld -r -o".

And then, I did:

make lib-plumed args="-b"
make yes-plumed

Now that I made the above changes, to get stuff going with plumed, i needed the following packages:
CLASS2 EXTRA-DUMP EXTRA-FIX EXTRA-MOLECULE KSPACE MANYBODY MOLECULE PLUMED

with all of this packages configured and installed with make yes-xxx inside the src folder followed by make mpi. However, once I do

make yes-intel
make mpi

I get a large message about an error in improper_harmonic_intel.cpp. I have attached the entire message to this post.

How do I solve this error? Any advice you have would be appreciated!

output (8.7 KB)

You have to add the -restrict flag to CCFLAGS in your machine makefile.

You seem to be compiling with GCC and there is little to gain with the INTEL package over the OPENMP or OPT packages. You must also use the Intel compilers to take full advantage of the INTEL package (i.e. advanced vectorization). GCC doesn’t recognize the vectorization pragmas.

The recommended procedure would be:

  • Compile/install plumed beforehand. Update PKG_CONFIG_PATH so that LAMMPS can find it
  • Use CMake to compile LAMMPS. via pkg-config it should find your installed plumed directly
  • You may also want to use a more recent version of LAMMPS for improved code and bugs fixed.

Thank you for your response @akohlmey ! I agree with your assessment that with gcc, intel vectorization cannot be leveraged. But what makes you say that I am compiling with gcc? I am making sure to use intel-mpi modules to perform my compilation…

Because of how the error messages look. They look gcc-ish. What do you get when you type mpicc -v?

Intel-MPI can be used with any compiler.

Hello @akohlmey, mpicc -v gives:

mpicc for MPICH version 3.3.2
icc version 19.1.1.217 (gcc version 8.5.0 compatibility)

However, I bit the bullet and went through the CMAKE way of getting PLUMED patched with LAMMPS and it seem to be working!

Thank you for the advice.