plumed / plumed2

Development version of plumed 2
https://www.plumed.org
GNU Lesser General Public License v3.0
357 stars 284 forks source link

Issue with installing INDUS patched into PLUMED #987

Open sbkashif opened 10 months ago

sbkashif commented 10 months ago

I am trying to install PLUMED with the INDUS plugin, followed by patching it with GROMACS. I have already raised an issue at the INDUS repo, but I am also posting here in case it is more of a PLUMED issue.

Test case run and error

I ran a test script available at plumed_patch/test/bias_ntilde_v/sphere/unbiased

Input command:

./run_driver.sh ~/software/plumed-2.8.3/bin/plumed

Following is the error message:

terminate called after throwing an instance of 'PLMD::Plumed::ExceptionError'
  what():  
+++ PLUMED error
+++ at ActionWithValue.cpp:153, function void PLMD::ActionWithValue::addComponentWithDerivatives(const string&)
+++ message follows +++
a description of component q has not been added to the manual. Components should be registered like keywords in registerKeywords as described in the developer doc.

Installation details

I have downloaded plumed-2.8.3 from this very repo. I have used the installation script that is available at the INDUS repo as a reference:

#!/bin/bash -eE

# Run this script **after** running the INDUS patching script

# Number of Makefile jobs to run simultaneously
num_processors=16

####################
### Set up paths ###
####################

# Where to install PLUMED
# - Once PLUMED is installed, if your system has environment modules support, you
#   can put the necessary variables in your paths by running the following command:
#      module load $plumed_install_dir/lib/plumed_mpi/modulefile
plumed_install_dir="${HOME}/software/plumed-2.8.3/"

# Root directory of PLUMED repo
plumed_dir="${HOME}/software/plumed-2.8.3/"

# xdrfile installation
#have_xdrfile=1
#XDRFILE_DIR="${HOME}/programs/xdrfile/1.1.4"

module purge
module load gcc/9.2.0
module load cmake/3.21.3
module load cuda/11.2
module load ompi/4.1.1/gnu-9.2.0-cuda-11.2

#################
### Compilers ###
#################

# Use MPI compiler wrappers
export CC=mpicc
export CXX=mpic++
have_mpi=1

# General flags and libraries
FLAGS="-fPIC -g"                              # basic flags
FLAGS="$FLAGS -O3 -ffast-math -march=native"  # optimizations
if [[ $have_mpi -eq 1 ]]; then
    FLAGS="$FLAGS -DMPI_ENABLED"  # MPI flag for Indus
fi
export CFLAGS="${FLAGS}"
export CXXFLAGS="${FLAGS} -std=c++11"
export LIBS="-lstdc++"

# OpenMP
have_openmp=1
export OPENMP_FLAG=""
if [[ $have_openmp -eq 1 ]]; then
    export OPENMP_FLAG="-fopenmp"  # for Intel compilers, this is usually '-qopenmp' instead
    export CFLAGS="$OPENMP_FLAG ${CFLAGS}"
    export CXXFLAGS="$OPENMP_FLAG ${CXXFLAGS}"
    export LDFLAGS="$OPENMP_FLAG $LDFLAGS"
fi

# xdrfile
if [[ $have_xdrfile -eq 1 ]]; then
    XDRFILE_FLAGS="-I${XDRFILE_DIR}/include/xdrfile"
    export CFLAGS="${CFLAGS} ${XDRFILE_FLAGS}"
    export CXXFLAGS="${CXXFLAGS} ${XDRFILE_FLAGS}"
    export LDFLAGS="${LDFLAGS} -L${XDRFILE_DIR}/lib"
    export LIBS="-lxdrfile $LIBS"
fi

#################
### Configure ###
#################

echo "DATE: $( date )"

# Checks
if [[ ! -d $plumed_dir ]]; then
    echo "Unable to find PLUMED repo at location: $plumed_dir"
    echo "Exiting."
    exit 1
fi
patch_files_dir="$plumed_dir/src/orderparameters"
if [[ ! -d $patch_files_dir ]]; then
    echo "Unable to find INDUS patch files. Make sure you patch PLUMED before using this script."
    echo "Exiting."
    exit 1
fi

cd $plumed_dir

# Configure from main PLUMED directory
echo "PHASE: CONFIGURING"
module list
./configure --prefix=${plumed_install_dir} \
            --enable-modules=crystallization

# Modify PLUMED Makefiles as needed
if [[ $have_openmp -eq 1 ]]; then
    # Need to append the OpenMP flag to Makefile recipes for some of the
    # executables that PLUMED makes, or you get a link error
    # - This is necessary for the version of PLUMED that I use: it may not apply to other versions
    targets=( '$(PLUMED_MAIN_SHARED):'  '$(PLUMED_MAIN_RUNTIME):' )
    makefile_to_edit="src/lib/Makefile"
    for target in "${targets[@]}"; do
        echo "${target}"
        sed -i "/${target}/{n;s/$/ $OPENMP_FLAG/}" $makefile_to_edit
    done
fi

###########################
### Compile and install ###
###########################

echo "PHASE: COMPILING"
make -j $num_processors

echo "PHASE: INSTALLING"
make install

echo "DONE"
echo "DATE: $( date )"
sbkashif commented 10 months ago

I wanted to follow up and ask if anyone can assist with this issue.

GiovanniBussi commented 10 months ago

Hi, I guess you should ask to the developers of INDUS. I kind of expect this error if you take a CV implemented for a old PLUMED versions and "transplant it" on a newer PLUMED version.

sbkashif commented 10 months ago

@GiovanniBussi Thanks for your response. I will try an older PLUMED version and see if it works.

brweg commented 1 month ago

Hi!

I had the same PLUMED error as you. Similarly, I also installed INDUS in PLUMED-2.8.3. I was wondering if you have tried using an older version of PLUMED? I'd appreciate it if you could tell me which version works.

Thanks for a lot.

sbkashif commented 1 month ago

Hi @brweg

I haven't been able to resolve this yet and haven't been actively working on this. I will update it here when I do.

HAlireza94 commented 2 weeks ago

Hi, you gotta install plumed 2.4.0 I have had this problem with higher versions. Seems like 2.4.0 is the best to be patched with INDUS.