Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
96fbd03
early commit with partial EXAMPLES.md
tonykew Nov 5, 2025
8490d79
On-going work on EXAMPLES.md
tonykew Nov 7, 2025
0b4cf2d
Add images
tonykew Nov 8, 2025
32ca651
Fix remote image URLs
tonykew Nov 8, 2025
8e57e1d
Fix pagination of text before images
tonykew Nov 8, 2025
8708c95
Actually fix pagination of text before images!
tonykew Nov 8, 2025
2e9cfcb
Use correct image for Pressure plot
tonykew Nov 8, 2025
2ec40be
Fix paginataion error
tonykew Nov 8, 2025
fa37d62
Added circles to the points in the temperature plot
tonykew Nov 8, 2025
7137992
Added options to xmgrace for the images
tonykew Nov 8, 2025
46ccb8e
Fix broken pagination
tonykew Nov 8, 2025
e75fdd9
Further work on the examples
tonykew Nov 11, 2025
7ccb3fd
Fix pagination
tonykew Nov 11, 2025
10be980
Pagination fixes
tonykew Nov 11, 2025
7b16c96
Fix typo
tonykew Nov 11, 2025
942239b
Attempt to fix superscript & subscript
tonykew Nov 11, 2025
df2f306
Update y axis text to use superscript
tonykew Nov 11, 2025
7a3887d
Merge branch 'main' into GROMACS
tonykew Nov 25, 2025
c5e8391
Merge branch 'main' into GROMACS
tonykew Dec 29, 2025
3b2d8a1
Merge branch 'main' into GROMACS
tonykew Jan 24, 2026
f45af48
Work in progress slurm example
tonykew Feb 12, 2026
6bcbd8f
Updates to use nvidia's GROMACS container
tonykew Feb 17, 2026
6bb60df
Fix SLURM params
tonykew Feb 17, 2026
5c6db3d
srun fixes
tonykew Feb 17, 2026
1bcd48b
Work in progress
tonykew Feb 17, 2026
a653b8a
Fixed long examples
tonykew Feb 19, 2026
94521be
Fix Typos
tonykew Feb 20, 2026
a89a6cd
Updated EXAMPLES.md
tonykew Feb 25, 2026
39f1feb
Added .def file for grace/xmgrace
tonykew Feb 25, 2026
5bdb9db
Add (commented) functional curl URL from my github repo
tonykew Feb 25, 2026
45f89c1
Fix typo in comments
tonykew Mar 18, 2026
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
1,967 changes: 1,967 additions & 0 deletions containers/2_ApplicationSpecific/GROMACS/EXAMPLES.md

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions containers/2_ApplicationSpecific/GROMACS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Examples for using nvidia's GROMACS container

GROMACS is an open-source software suite for high-performance molecular dynamics and output analysis.

The interactive and Slurm examples use nvidia's container.
The container supports nvidia GPUs, but is limited to a single node.

The interactive examples follow the [Lysozyme in Water GROMACS tutorial](http://www.mdtutorials.com/gmx/lysozyme/01_pdb2gmx.html)
and the long Slurm example script does the same computations.

The interacrive examples use "xmgrace" - instructions for buildind a grace
container are below.
This is NOT required to use nvidia's GROMACS container. The sample Slurm
scrtips do NOT need this.


## Building a container with grace/xmgrace

1. Start an interactive job in the debug queue
see the [CCR documantation on Slurm jobs](https://docs.ccr.buffalo.edu/en/latest/hpc/jobs) for more information

e.g.

```bash
salloc --cluster=ub-hpc --partition=debug --qos=debug --mem=0 --exclusive --time=01:00:00
```

2. Change to your build directory
e.g.

```bash
cd /projects/academic/[YourGroupName]/GROMACS
```

Set the target directory for all your container images
e.g.

```bash
CONTAINER_DIR="/projects/academic/[CCRgroupname]/Containers"
```

Make sure APPTAINER_TMPDIR and APPTAINER_CACHEDIR environment
variables are set to sensible values

```bash
export APPTAINER_TMPDIR="${APPTAINER_TMPDIR:-${SLURMTMPDIR}/apptainer/tmp}"
mkdir -p "${APPTAINER_TMPDIR}"
export APPTAINER_CACHEDIR="${APPTAINER_CACHEDIR:-${SLURMTMPDIR}/apptainer}"
mkdir -p "${APPTAINER_CACHEDIR}"
```

Download the .def file

```bash
#curl -L -o "grace.def" "https://raw.githubusercontent.com/tonykew/ccr-examples/refs/heads/GROMACS/containers/2_ApplicationSpecific/GROMACS/grace.def"
curl -L -o "grace.def" "https://raw.githubusercontent.com/ubccr/ccr-examples/refs/heads/main/containers/2_ApplicationSpecific/GROMACS/grace.def"
```

Build the grace container image

```bash
apptainer build "${CONTAINER_DIR}/grace-$(arch).sif" "grace.def"
```

Verify that the build was successful

```bash
apptainer run \
-B /projects:/projects,/scratch:/scratch,/util:/util,/vscratch:/vscratch \
--nv \
"${CONTAINER_DIR}/grace-$(arch).sif" \
grace -version
```

Sample output:

>
> Grace-5.1.25
>
> GUI toolkit: @(#)Motif Version 2.3.8
> Xbae version: 46004
> T1lib: 1.3.1p3-grace
> FFT: FFTW
> NetCDF support: on
> libpng: 1.6.43
> libjpeg: 80
> Built: Mon Apr 8 10:40:41 2024 on Linux #191-Ubuntu SMP Fri Feb 2 13:55:07 UTC 2024 5.4.0-173-generic x86_64
> Compiler flags: gcc -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/grace-mFwzxU/grace-5.1.25=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/grace-mFwzxU/grace-5.1.25=/usr/src/grace-1:5.1.25-14 -I.. -I. -I../T1lib/t1lib -Wdate-time -D_FORTIFY_SOURCE=3 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -lXmHTML -lXbae -lXm -lXpm -lXmu -lXt -lXext -lX11 -lSM -lICE ../cephes/libcephes.a -lnetcdf -lfftw3 ../T1lib/libt1.a -ljpeg -lpng -lz -ltirpc -lm
>
> Registered devices:
> Dummy PostScript EPS MIF SVG PNM JPEG PNG Metafile
>
> (C) Copyright 1991-1995 Paul J Turner
> (C) Copyright 1996-2015 Grace Development Team
> All Rights Reserved


## Example Scripts

Provided in this repository are a couple of example GROMACS Slurm jobs.

### Short Slurm example

x86_64
[slurm_nvidia_GROMACS_short_example.bash](./slurm_nvidia_GROMACS_short_example.bash)

ARM64
[slurm_ARM64_nvidia_GROMACS_short_example.bash](./slurm_ARM64_nvidia_GROMACS_short_example.bash)


### Long Slurm example

This example does all the computations from the [Lysozyme in Water GROMACS tutorial](http://www.mdtutorials.com/gmx/lysozyme/01_pdb2gmx.html)

x86_64
[slurm_nvidia_GROMACS_long_example.bash](./slurm_nvidia_GROMACS_long_example.bash)

ARM64
[slurm_ARM64_nvidia_GROMACS_long_example.bash](./slurm_ARM64_nvidia_GROMACS_long_example.bash)

Binary file not shown.
61 changes: 61 additions & 0 deletions containers/2_ApplicationSpecific/GROMACS/grace.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Bootstrap: docker
From: ubuntu:24.04

%post -c /bin/bash
# Set the timezone, if unset
test -h /etc/localtime || ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime

cp /etc/apt/sources.list /etc/apt/sources.list~
sed -E -i 's/^# deb-src /deb-src /' /etc/apt/sources.list
apt-get -y update

# Install man & man pages - this section can be removed if not needed
# NOTE: Do this before installing anything else so their man pages are installed
sed -e '\|/usr/share/man|s|^#*|#|g' -i /etc/dpkg/dpkg.cfg.d/excludes
DEBIAN_FRONTEND=noninteractive apt-get -y install apt-utils groff dialog man-db manpages manpages-posix manpages-dev
rm -f /usr/bin/man
dpkg-divert --quiet --remove --rename /usr/bin/man

# O/S package updates:
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade

DEBIAN_FRONTEND=noninteractive apt-get -y install \
tzdata \
locales \
unzip \
wget \
git \
gawk \
pax-utils \
python3 \
python3-sphinx \
python3-sphinx-rtd-theme \
python-is-python3 \
grace \
curl \
less \
jq \
nano \
vim \
apt-file

# NOTE: apt-file is generally not needed to run, but can be useful during development
apt-file update

# These steps are necessary to configure Perl and can cause issues with Python if omitted
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales
update-locale LANG=en_US.UTF-8

%environment
export LANG=en_US.UTF-8
# Change the nvidia cache dir from ~/.nv/ComputeCache
export CUDA_CACHE_PATH="${SLURMTMPDIR:-/var/tmp}/nv_$(id -nu)"
mkdir -p "${CUDA_CACHE_PATH}"

%runscript
#!/bin/bash
export PS1="xmgrace$ "
# Exec passed command (required for Modal ENTRYPOINT compatibility)
exec "$@"

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading