Skip to content

NAMD: Nanoscale Molecular Dynamics

Overview of package

Package: NAMD
Description: Nanoscale Molecular Dynamics
For more information: https://www.ks.uiuc.edu/Research/namd
Categories: MolecularDynamics
Chemistry
License: Free2Use (NAMD)

General Usage

Nanoscale Molecular Dynamics (NAMD) is software for molecular dynamics simulation, written using the Charm++ parallel programming model. It is noted for its parallel efficiency and is often used to simulate large systems (millions of atoms).

This module will add the namd and charmrun commands to your PATH.

Available versions by cluster

This section lists the available versions of the package NAMDon the UMD HPC clusters.

Versions available on the Zaratan cluster

Version Module tags CPU(s) optimized for GPU ready?
2.14 2.14
namd/nocuda/gcc/11.3.0/openmpi/4.1.5/zen2/2.14
zen2 Yes
2.14 2.14
namd/nocuda/gcc/8.4.0/openmpi/3.1.5/zen/2.14
zen Yes
2.14 2.14
namd/cuda/11.6.2/gcc/9.4.0/nompi/zen2/2.14
zen2 Yes

Usage guidelines and hints

The following guidelines and hints only cover the mechanics of starting the namd2 program, especially on the High Performance Computing clusters. Unfortunately, the Division of Information Technology does not have the expertise to assist in the assembling the inputs, etc. to the NAMD program.

Using on CPUs

The Division of IT builds of charm++ (and thus NAMD) are MPI aware. Thus for these versions, you should not be using the
charmrun command to start NAMD but instead use the standard
mpirun command, as in the example below.

#!/bin/bash                                                   
#SBATCH -n 12                                                 
#SBATCH -t 1:00                                               

# Ensure module command is available
source ~/.profile                                                  

# Load namd
module load namd

# This directory needs to have been previously created
WORKDIR=~scratch/namd/tests/alanin                   
cd $WORKDIR                                                   

mpirun namd2 alanin                                           

This is a short example, so time limit is only 1 minute. You will likely need to increase this, and change the account to charge against.

Note that we run using mpirun to distribute the job among the requested
cores. OpenMPI is Slurm-aware, so it will automatically distribute the namd2 code over the requested processor cores.

Using on GPUs

To use namd on a GPU, you need to use a build of namd which supports GPUs. If you module load gpu before doing the module load namd, the module system will by default attempt to use the GPU enabled build of namd. The following example shows a typical use:

#!/bin/bash                                                   
#SBATCH -n 1                                                  
#SBATCH -t 1:00                                               
#SBATCH --gpus:a100_1g.5gb:1

# Ensure module command is available
. ~/.profile                                                  

# Load GPU-enabled namd namd
module load cuda
module load namd

# This directory should have been previously created
WORKDIR=~scratch/test/namd/alanin                      

cd $WORKDIR                                                   

namd2 alanin                                                  

Note here that we ask for a single task (#SBATCH -n 1), a single fractional A100 GPU (#SBATCH --gpus=a100_1g.5gb:1) and that we module load cuda before namd to ensure we get a GPU-enabled build of namd.

There are way more cores on even a single GPU than are
needed for this simple case, so we only request a fractional A100 gpu. The GPU-enabled NAMD is also MPI aware, so we should be able to run on multiple nodes if needed. (If someone succeeds in doing such, please send us your submit script to add it to this page.)