Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions benchmarks/lammps-nvidia/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lammps.sif
log.lammps
out.*
logs/
3 changes: 3 additions & 0 deletions benchmarks/lammps-nvidia/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'run.sh' and 'install.sh' assume that conda is on the path. You may need to modify to load conda.

`submit.sh` is a simple test script to submit on Bridges-2.
32 changes: 32 additions & 0 deletions benchmarks/lammps-nvidia/get_performance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import os
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to print a score, is 1/wall time sufficient?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it writes a yaml file with different performance metrics. 1/wall time is sufficient, but there is also a timesteps/s that is a more standard metric that is to be maximized

import json
import yaml

out = {}
nextline = False
logfile = 'log.lammps'
path = ''
if not os.path.isfile(logfile):
path = 'benchmarks/lammps-allegro'
f = open(os.path.join(path,logfile))
for line in f.readlines():
if 'Performance' in line:
print(line)
out['raw1'] = line
_, p1, u1, p2, u2 = line.split(' ')
out['simulation length'] = float(p1)
out['simulation length units'] = u1[:-1]
out['timesteps/s'] = float(p2)
nextline = True
elif nextline:
print(line)
out['raw2'] = line
out['utilization'] = line.split(' ')[0]
nextline = False

f.close()

with open(
os.path.join(path,'out.yaml'),'w'
) as fl:
yaml.dump(out,fl)
30 changes: 30 additions & 0 deletions benchmarks/lammps-nvidia/in.lj.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 3d Lennard-Jones melt

variable x index 1
variable y index 1
variable z index 1

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

run 100
7 changes: 7 additions & 0 deletions benchmarks/lammps-nvidia/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
chmod +x run.sh

mkdir logs

conda create -n env python=3.9
conda activate env
conda install pyyaml
19 changes: 19 additions & 0 deletions benchmarks/lammps-nvidia/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/bash

set -e; set -o pipefail

# Build SIF, if it doesn't exist
if [[ ! -f lammps.sif ]]; then
singularity build lammps.sif docker://nvcr.io/hpc/lammps:29Oct2020
fi

readonly gpus_per_node=$(( SLURM_NTASKS / SLURM_JOB_NUM_NODES ))

echo "Running Lennard Jones 8x8x8 example on ${SLURM_NTASKS} GPUS..."
# echo "Running 2NN MEAM example on ${SLURM_NTASKS} GPUS..."
srun --mpi=pmi2 \
singularity run --nv -B ${PWD}:/host_pwd lammps.sif \
lmp -k on g ${gpus_per_node} -sf kk -pk kokkos cuda/aware on neigh full comm device binsize 2.8 -var x 8 -var y 8 -var z 8 -in /host_pwd/in.lj.txt

conda activate env
python get_performance.py
16 changes: 16 additions & 0 deletions benchmarks/lammps-nvidia/submit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/bash

#SBATCH -t 00-01:00
#SBATCH -J lammps_benchmark
#SBATCH -o logs/output.%j
#SBATCH -e logs/error.%j
#SBATCH -p GPU-shared
#SBATCH -N 1
#SBATCH --ntasks=1
#SBATCH --gpus=v100-32:1
#SBATCH --mem-per-gpu=50000
#SBATCH --mail-user=eannevel@andrew.cmu.edu

module load anaconda3

./run.sh