Site Tools


tcr_sri003

LAMMPS version 29 Oct 20

description

LAMMPS is a classical molecular dynamics code with a focus on materials modeling. It's an acronym for Large-scale Atomic/Molecular Massively Parallel Simulator. ( https://lammps.sandia.gov/index.html ) .

software version

prepare software

To prepare LAMMPS version 29Oct20 software login to tcr.cent.uw.edu.pl.

Then open interactive session on any computing node with :

srun -n16 -N1 --pty bash -l

When interactive session is started go through LAMMPS installation process described with bellow commands. It will take about 14 minutes.

#folder for source files
mkdir -p ~/downloads/lammps_29Oct20
#folder for compiled binares
mkdir -p ~/soft/lammps_29Oct20

cd ~/downloads/lammps_29Oct20
wget https://github.com/lammps/lammps/archive/stable_29Oct2020.tar.gz
tar xvzf stable_29Oct2020.tar.gz
cd lammps-stable_29Oct2020

module load mpi/openmpi-x86_64
module load compilers/gcc-9.3.0

mkdir build
cd build
cmake3 -D CMAKE_INSTALL_PREFIX=~/soft/lammps_29Oct20 -D LAMMPS_MACHINE=mpi ../cmake
make -j${SLURM_NTASKS}
make install

remember to end interactive session with exit command.

If no errors occurred, compiled LAMMP binary is available in /home/users/${USER}/soft/lammps_29Oct20/bin .

example file

Create new folder for example file :

 mkdir ~/lammps_29Oct20_example

It is recommended that you test this script before you try to run your own LAMMPS problems.

The example is a Lennard-Jones melt in a 3D box. The Lennard-Jones force has a cutoff at r = 2.5 sigma, where sigma is the distance at which the interparticle potential is zero. The system includes 32,000 atoms, and is to be modeled for 1000 time steps.

Store below in the filename in.lj, under ~/lammps_29Oct20_example/:

# 3d Lennard-Jones melt
variable x index 1
variable y index 1
variable z index 1
variable t index 200000

variable xx equal 20*$x
variable yy equal 20*$y
variable zz equal 20*$z

units         lj
atom_style    atomic

lattice       fcc 0.8442
region        box block 0 ${xx} 0 ${yy} 0 ${zz}
create_box    1 box
create_atoms  1 box
mass     1 1.0

velocity all create 1.44 87287 loop geom

pair_style    lj/cut 2.5
pair_coeff    1 1 1.0 1.0 2.5

neighbor 0.3 bin
neigh_modify  delay 0 every 20 check no

fix      1 all nve
thermo   100
run      $t

sbatch example

Use LAMMPS 29Oct20. This description assumes that path to binaries is /home/users/${USER}/soft/lammps_29Oct20/bin and example file in.lj is under /home/users/${USER}/lammps_29Oct20_example. Use bellow lammps_29Oct20-test.sbatch file to run computation.

#!/bin/bash -l
#SBATCH --job-name="lammps-example-N2_n32"
#SBATCH --nodes=2                   # number of computing_nodes
#SBATCH --ntasks=32                 # number of CPU's ( 16*computing_nodes )
#SBATCH --mem-per-cpu=2G
#SBATCH --partition=short
#SBATCH --constraint=intel
#SBATCH --exclusive
#SBATCH --time=2:00:00

WORKDIR="/home/users/${USER}/lammps_29Oct20_example"
cd ${WORKDIR}

export BIN_DIR="/home/users/${USER}/soft/lammps_29Oct20/bin"
export PATH=${BIN_DIR}:$PATH
export TMP_DIR="/tmp"
   
module load mpi/openmpi-x86_64
module load compilers/gcc-9.3.0

T1=`date +%s`
  
mpirun -np ${SLURM_NTASKS} lmp_mpi -in in.lj
  
T2=`date +%s`
echo -e "stop ${T2}\t start ${T1}\t ${SLURM_NNODES}"

performance tests

Bellow results show time of computation in function of used resources (computation scalability) for a specific computational task lammps_29Oct20-test.sbatch.

Assigning a larger amount of computing nodes does not always lead to a (efficient) reduction in computing time (wall-time of the job). To find the most appropriate number of nodes for a specific type of job, it is essential to run one's own benchmarks. In general, parallel jobs should scale to at least 70% efficiency for the sake of other TCR users. One user using twice the resources to squeeze out 10% more performance may be keeping other users from working at all.

Bellow results should be consider as results of this specific computational task on this specific hardware (TCR cluster) and not overall benchmark for LAMMPS software.

nodes min [s] avg [s] median [s] max [s] efficiency [%]
1 349 351.67 349 357 100.00%
2 206 209.33 207 215 84.71%
3 156 156.33 156 157 74.57%
4 128 128.67 129 129 68.16%
5 121 121.33 121 122 57.69%
6 111 111 111 111 52.40%
7 92 93 93 94 54.19%
8 88 88.67 89 89 49.57%
9 83 84 84 85 46.72%

*) values (min, avg, median, max, efficiency) do not include failed runs
*) results are from 3 runs
*) efficiency as t1 / ( nodes * tn ) ( where t1 is min computation time at one node, tn is min computation time on N nodes )

other

above desciption uses default settings and do not include any extra LAMMPS packages that you may require. More about LAMMPS' package at https://lammps.sandia.gov/doc/Build_package.html .

*) https://arc.vt.edu/userguide/lammps/

tcr_sri003.txt · Last modified: 2023/08/01 01:08 by 127.0.0.1