Skip to main content

LIGGGHTS

LIGGGHTS is an open-source discrete element package further developed from LAMMPS, standing for LAMMPS Improved for General Granular and Granular Heat Transfer Simulations.


1. Script Template

submit.sh
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=56
#SBATCH --partition=g1_share
#SBATCH --job-name=liggght
#SBATCH --output=liggghts.%j.out
#SBATCH --error=liggghts.%j.err

ulimit -s unlimited
ulimit -l unlimited
unset I_MPI_PMI_LIBRARY # Unset default MPI library, use Intel's built-in
export I_MPI_JOB_RESPECT_PROCESS_PLACEMENT=0 # Parameter modification required for Intel multi-node jobs
module load gcc/9.4.0 # Load Intel environment
module load hpcx/2.11
module load liggghts/3.8_gcc9.4


mpirun -x lmp_auto -in in.sph_1

2. Compilation

# 1. Download address
#liggghts https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/tags
#vtk https://gitlab.kitware.com/ vtk/vtk
# 2. Environment selection: gcc9.4+openmpi4.1.1_gcc9.4, cmake/3.23.1
export CC=`which gcc`
export CXX=`which g++`
export FC=`which gfortran`
# 3. Select VTK version
tar xf LIGGGHTS-PUBLIC-3.8.0.tar.gz
vim LIGGGHTS-PUBLIC-3.8.0/src/MAKE/Makefile.auto
/vtk
# Check the VTK version required by LIGGGHTS; version 3.8.0 depends on VTK-8.0.1. Download address: http://www.vtk.org/files/release/8.0/VTK-8.0.1.zip
# 4. Check VTK compilation commands
# Locate cmake
/cmkae
# Use N/n to navigate search items, approximately at line 800
cmake -DBUILD_TESTING:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=../install -DModule_vtkIOMPIParallel:BOOL=ON -DVTK_Group_MPI:BOOL=ON -DVTK_Group_Rendering:BOOL=OFF -DVTK_RENDERING_BACKEND:STRING=None -DVTK_USE_X:BOOL=OFF -DModule_vtkIOMPIImage:BOOL=ON -DModule_vtkParallelMPI:BOOL=ON ../
# Exit the LIGGGHTS-PUBLIC-3.8.0/src/MAKE/Makefile.auto file
:q
# 5. Install VTK
unzip VTK-8.0.1.zip
cd VTK-8.0.1
mkdir build
cd build
cmake -DBUILD_TESTING:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=../install -DModule_vtkIOMPIParallel:BOOL=ON -DVTK_Group_MPI:BOOL=ON -DVTK_Group_Rendering:BOOL=OFF -DVTK_RENDERING_BACKEND:STRING=None -DVTK_USE_X:BOOL=OFF -DModule_vtkIOMPIImage:BOOL=ON -DModule_vtkParallelMPI:BOOL=ON ../
make -j 20
make install -j 20
# 6. Install LIGGGHTS
cd LIGGGHTS-PUBLIC-3.8.0/src/
make auto
# Modify MAKE/Makefile.user
12 AUTOINSTALL_VTK = "ON"
### VTK installation directory
120 VTK_INC_USR=-I/sh2/software/app/liggghts/vtk/VTK-8.0.1/install/include/vtk-8.0
122 VTK_LIB_USR=-L/sh2/software/app/liggghts/vtk/VTK-8.0.1/install/lib
# Save and exit
make auto
# After successful compilation, lmp_auto will be generated
## 7. Load environment variables; need to load VTK lib directory and lmp_auto file directory

Error:

User requested assistance compiling LIGGGHTS, stating she modified the source code and cannot use the pre-compiled version on the cluster. Local compilation and installation work normally.
Local environment: openmpi 1.10.7, vtk 6.2, LIGGGHTS 3.8 modified source version, gcc 4.8.5
VTK compilation:
cmake -DBUILD_TESTING:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=../install -DModule_vtkIOMPIParallel:BOOL=ON -DVTK_Group_MPI:BOOL=ON -DModule_vtkIOMPIImage:BOOL=ON -DModule_v
tkParallelMPI:BOOL=ON ../
make -j
make -j install
LIGGGHTS compilation:
vim MAKE/Makefinde.mpi
MPI_INC = -I/public/software/mpi/openmpi/1.10.7/openmpi_gcc4.8.5/include
MPI_PATH = -L/public/software/mpi/openmpi/1.10.7/openmpi_gcc4.8.5/lib
FFT_INC = -I/public/software/mathlib/fftw/3.3.10/fftw_gcc4.8.5/include
FFT_PATH = -L/public/software/mathlib/fftw/3.3.10/fftw_gcc4.8.5/lib
VTK_INC = -I/public/home/limc/software/6.2/vtk-v6.2.0/install/include/vtk-6.2
VTK_PATH = -L/public/home/limc/software/6.2/vtk-v6.2.0/install/lib
JPG_INC = -I/usr/include
JPG_PATH = -L/usr/lib64

make mpi
1. VTK library not found; add the following environment variables
export LD_LIBRARY_PATH=/public/home/limc/software/6.2/vtk-v6.2.0/install/lib:/public/software/mpi/openmpi/1.10.7/openmpi_gcc4.8.5/lib:$LD_LIBRARY_PATH
export PATH=/public/home/limc/software/6.2/vtk-v6.2.0/install/bin:/public/software/mpi/openmpi/1.10.7/openmpi_gcc4.8.5/bin:$PATH
2. Missing functions

Suspected source code issue; checked the function mentioned in the prompt, which is included in LIGGGHTS-PUBLIC-3.8.0/src: neigh_request.h
Following the prompt, checked pair_hybrid.cpp and pair_hybrid_overlay.cpp; both include neigh_request.h
Since the user modified the source code, attempted to compile the original LIGGGHTS to determine if it was a dependency issue. Compilation succeeded, effectively ruling out dependency library issues.
Used diff to compare the original version with the user-modified source code; output showed over 4000 lines. Focused on filtering files mentioned in the error messages and files with 'neigh_request' in the filename. Found that LIGGGHTS-PUBLIC-3.8.0/src: neigh_request.cpp was missing.
Copied LIGGGHTS-PUBLIC-3.8.0/src: neigh_request.cpp from the original version to the corresponding location in the user-modified source package; compilation succeeded.
Confirmed with the user that LIGGGHTS-PUBLIC-3.8.0/src: neigh_request.cpp was not modified, and requested test cases. Testing confirmed normal compilation.