PabloPiaggi/Crystallization-of-Silicon

Some environment setting up problem

Closed this issue · 10 comments

CareF commented

On MacOS I'm not able to run the example, showing

I cannot understand line: ENVIRONMENTSIMILARITY SPECIES=1-216 SIGMA=0.04 LATTICE_CONSTANTS=0.5431 CRYSTAL_STRUCTURE=DIAMOND LABEL=es MORE_THAN=RATIONAL R_0=0.5 NN=6 MM=12 MEAN

On my Linux computer it's running fine but slow. I'm trying to run it on adroit with slurm file below (also building with intel and openmpi/intel):

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=2
#SBATCH --cpus-per-task=2
#SBATCH --time 05:00:00

#set up environment

module purge
module load intel/17.0
module load openmpi/intel-17.0
if [ -n "$SLURM_CPUS_PER_TASK" ]; then
	omp_threads=$SLURM_CPUS_PER_TASK
else
	omp_threads=1
fi
export OMP_NUM_THREADS=$omp_threads
lammpsexe=/home/minglyu/lammps/lammps-stable_3Mar2020/src/lmp_mpi
plumedexe=/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/bin/plumed
source /home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed-2.6.0/sourceme.sh

#launch job with srun, not mpirun/mpiexec
srun -i start.lmp -o out.lmp $lammpsexe
# $lammpsexe < start.lmp > out.lmp

plumed keeps showing error message:

I cannot load library EnvironmentSimilarity.cpp ./EnvironmentSimilarity.so: cannot open shared object file: No such file or directory

The full log.plumed file is:

PLUMED: PLUMED is starting
PLUMED: Version: 2.6.0 (git: Unknown) compiled on Apr 19 2020 at 01:52:54
PLUMED: Please cite these papers when using PLUMED [1][2]
PLUMED: For further information see the PLUMED web page at http://www.plumed.org
PLUMED: Root: /home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/lib/plumed
PLUMED: For installed feature, see /home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/lib/plumed/src/config/config.txt
PLUMED: Molecular dynamics engine: LAMMPS
PLUMED: Precision of reals: 8
PLUMED: Running over 2 nodes
PLUMED: Number of threads: 1
PLUMED: Cache line size: 512
PLUMED: Number of atoms: 216
PLUMED: File suffix: 
PLUMED: FILE: plumed.dat
PLUMED: Action LOAD
PLUMED:   with label @0
PLUMED: Executing: env PLUMED_ROOT="/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/lib/plumed" env PLUMED_HTMLDIR="/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/share/doc/plumed" env PLUMED_INCLUDEDIR="/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/include" env PLUMED_PROGRAM_NAME="plumed" env PLUMED_IS_INSTALLED="yes" "/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/lib/plumed"/scripts/mklib.sh EnvironmentSimilarity.cpp (only on master node)
PLUMED: ERROR
PLUMED: I cannot load library EnvironmentSimilarity.cpp ./EnvironmentSimilarity.so: cannot open shared object file: No such file or directory
PLUMED: 
PLUMED: 
PLUMED: ################################################################################
PLUMED: 
PLUMED: 
PLUMED: +++ PLUMED error
PLUMED: +++ at PlumedMain.cpp:914, function void PLMD::PlumedMain::load(const std::basic_string<char, std::char_traits<char>, std::allocator<char>> &)
PLUMED: +++ message follows +++
PLUMED: I cannot load library EnvironmentSimilarity.cpp ./EnvironmentSimilarity.so: cannot open shared object file: No such file or directory
PLUMED: 
PLUMED: ################################################################################
PLUMED: 

It looks like EnvironmentSimilarity.cpp somehow is not built. And if I manually run this

env PLUMED_ROOT="/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/lib/plumed" env PLUMED_HTMLDIR="/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/share/doc/plumed" env PLUMED_INCLUDEDIR="/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/include" env PLUMED_PROGRAM_NAME="plumed" env PLUMED_IS_INSTALLED="yes" "/home/minglyu/lammps/lammps-stable_3Mar2020/lib/plumed/plumed2/lib/plumed"/scripts/mklib.sh EnvironmentSimilarity.cpp

after lammpsexe the .so file is lost.

Any advice what I should try for either of the two problems?
Thank you!

Hi @CareF , I'm working on a solution. I'll let you know when I upload it to GitHub.

CareF commented

Update, I tried using other openmpi module including module load openmpi/gcc/2.1.0/64, openmpi/gcc/3.1.5/64, openmpi/intel-16.0 and openmpi/intel-17.0, all giving same result on adroit

Do you have access to tiger? The compilation instructions here work on tiger and you don't need to load the EnvironmentSimilarity.cpp file on Plumed's input. As a matter of fact you should remove the LOAD line from the plumed.dat file. I suppose something similar should work on adroit. I am writing an alternative set of instructions to avoid compiling EnvironmentSimilarity.cpp on the fly and I am also working on compilation instructions specific for adroit. I'll keep you posted.

CareF commented

Do you have access to tiger? The compilation instructions here work on tiger and you don't need to load the EnvironmentSimilarity.cpp file on Plumed's input. As a matter of fact you should remove the LOAD line from the plumed.dat file. I suppose something similar should work on adroit. I am writing an alternative set of instructions to avoid compiling EnvironmentSimilarity.cpp on the fly and I am also working on compilation instructions specific for adroit. I'll keep you posted.

I don't have tiger access. tiger is not open to general princeton students. I tried on adroit and it's still running but most likely good.

I updated the compilation instructions. There is a new alternative that doesn't require on-the-fly compilation.

I also prepared a script for adroit if you need it. Here it is:

module purge
module load intel intel-mpi

installfolder=$(pwd)

mkdir Programs; cd Programs

# Build plumed

git clone https://github.com/plumed/plumed2 plumed2
cd plumed2
./configure --prefix=${installfolder}/Programs/plumed-install --enable-modules=all CXX=mpiicpc CXXFLAGS="-Ofast" cross_compiling=yes
make -j 10
make install

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${installfolder}/Programs/plumed-install/lib/pkgconfig"
cd ..

# Build lammps

git clone https://github.com/lammps/lammps lammps
cd lammps
mkdir build; cd build

# copy and paste the next 4 lines into the terminal
cmake3 -D CMAKE_INSTALL_PREFIX=$HOME/.local -D LAMMPS_MACHINE=adroitCpu -D ENABLE_TESTING=yes \
-D BUILD_MPI=yes -D BUILD_OMP=yes -D CMAKE_CXX_COMPILER=icpc -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS_RELEASE="-Ofast -DNDEBUG" -D PKG_USER-OMP=yes \
-D PKG_KSPACE=yes -D PKG_RIGID=yes -D PKG_MANYBODY=yes -D PKG_USER-PLUMED=yes \
-D DOWNLOAD_PLUMED=no -D PLUMED_MODE=static \
-D PKG_MOLECULE=yes -D PKG_USER-INTEL=yes -D INTEL_ARCH=cpu -D INTEL_LRT_MODE=threads ../cmake

make -j 10

Let me know if that solves your problem.

Do you have access to tiger? The compilation instructions here work on tiger and you don't need to load the EnvironmentSimilarity.cpp file on Plumed's input. As a matter of fact you should remove the LOAD line from the plumed.dat file. I suppose something similar should work on adroit. I am writing an alternative set of instructions to avoid compiling EnvironmentSimilarity.cpp on the fly and I am also working on compilation instructions specific for adroit. I'll keep you posted.

I don't have tiger access. tiger is not open to general princeton students. I tried on adroit and it's still running but most likely good.

So it is working?

CareF commented

Do you have access to tiger? The compilation instructions here work on tiger and you don't need to load the EnvironmentSimilarity.cpp file on Plumed's input. As a matter of fact you should remove the LOAD line from the plumed.dat file. I suppose something similar should work on adroit. I am writing an alternative set of instructions to avoid compiling EnvironmentSimilarity.cpp on the fly and I am also working on compilation instructions specific for adroit. I'll keep you posted.

I don't have tiger access. tiger is not open to general princeton students. I tried on adroit and it's still running but most likely good.

So it is working?

I didn't try your new updates here but used https://github.com/PabloPiaggi/CSI-hacks-and-tricks/tree/master/Compilation/Plumed this link, and turns out working on adroit, with slurm file below:

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=2
#SBATCH --time=05:10:00

#set up environment
module purge
module load intel intel-mpi
if [ -n "$SLURM_CPUS_PER_TASK" ]; then
	omp_threads=$SLURM_CPUS_PER_TASK
else
	omp_threads=1
fi
export OMP_NUM_THREADS=$omp_threads

lammpsexe=/home/minglyu/lammps/build/lmp_tigerCpu
plumedexe=/home/minglyu/plumed/bin/plumed

#launch job with srun, not mpirun/mpiexec
srun -i start.lmp -o out.lmp $lammpsexe

And it seems equivalent with what you posted.

CareF commented

And BTW, adroit also uses skylake CPU so I think we can preserve " -mtune=skylake-avx512" option

Thanks! Ok, if everything is working I will close the issue.

CareF commented

And I tested on MacOS, if I compile the entire plumed, the issue I mentioned in the beginning also is solved.