Introduction#
Modules#
Here are the most used commands for manipulating modules:
- module list
- module avail
- module spider soft/version
- module load soft/version
- module unload {rm} soft/version
- module show soft
- module help soft
- module whatis soft
- module purge; module –force purge
- module use ~/modulefiles; module unuse ~/modulefiles
To see if a given software or program, called foo, is available on the software stach, run the command:
module spider fooHow to load gromacs on national systems?#
First, run the command module spider gromacs to search if gromacs is already available as a module:
module spider gromacsThe above shows that many versions are available:
- gromacs/2016.6
- gromacs/2020.4
- gromacs/2020.6
- gromacs/2021.2
- gromacs/2021.4
- gromacs/2021.6
- gromacs/2022.2
- gromacs/2022.3
- gromacs/2023
- gromacs/2023.2
- gromacs/2023.3
- gromacs/2023.5
- gromacs/2024.1
- gromacs/2024.4
- gromacs/2024.6
- gromacs/2025.4
- gromacs/2026.1
Now, try to load a particular version 2025.4:
To see how to load this particular version, run the command:
module spider gromacs/2025.4and read the instructions.
Two modules are available:
- StdEnv/2023 gcc/12.3 openmpi/4.1.5
- StdEnv/2023 gcc/12.3 openmpi/4.1.5 cuda/12.6
Load one of the following modules:
- For CPU version, use:
module load StdEnv/2023 gcc/12.3 openmpi/4.1.5 gromacs/2025.4- for GPU version, use:
module load StdEnv/2023 gcc/12.3 openmpi/4.1.5 cuda/12.6 gromacs/2025.4 Load one module and experiment with the commands:
module list
module show gromacs
ls ${EBROOTGROMACS}/bin
which gmx_mpi
module rm gromacs
module show gromacs
which gmx_mpiHow to load LAMMPS on national clusters?#
First, run the command module spider lammps to search if lammps is already available as a module:
module spider lammpsThe above shows that many versions are available:
- lammps-omp/20201029
- lammps-omp/20210929
- lammps-omp/20220623
- lammps-omp/20230802
- lammps-omp/20240829
- lammps-omp/20250722
Now, try to load a particular version 20240829:
To see how to load this particular version, run the command:
module spider lammps-omp/20240829and read the instructions.
One module is available:
module load StdEnv/2023 intel/2023.2.1 openmpi/4.1.5 lammps-omp/20240829Load the module and experiment with the commands:
module list
module show lammps
ls ${EBROOTLAMMPS}/bin
which lmp
module rm lammps
module show lammps
which lmpExperiment with other programs#
Quick test using LAMMPS#
Here are the instructions to run a quick test using LAMMPS on national system:
Requireements:
- access to login or compute node via salloc.
- access to a module (lammps in this case)
- Input file: lammps-input.in
# 3d Lennard-Jones melt
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 3.0 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
thermo 50
run 10000
#write_data config.end_melt
# End of the Input file.First, connect to a cluster {MC or any national cluster you have access to}.
Search for lammps modules:
- Module “lammps-omp/20240829”.
- Use module spider to see how to load this module.
module purge
module spider lammps-omp/20240829Then load the module “lammps-omp/20240829
module load StdEnv/2023 intel/2023.2.1 openmpi/4.1.5 lammps-omp/20240829Make sure that the module is loaded and available in your environment by running
- The binary for this program is called lmp
- See if the binary is in your path by running the command:
module list
which lmpNow try to run the test interactively by invoking the command:
lmp -in lammps-input.inBefore running any script, use cat command to see the content of the script
cat <your script>Run the following commands from your terminal
sh ./mc-runlmp-1cpu-serial.sh
sh ./mc-runlmp-2cpu-openmp.sh
sh ./mc-runlmp-2cpu-mpi.sh
sh ./mc-runlmp-4cpu-openmp.sh
sh ./mc-runlmp-4cpu-mpi.sh
sh ./mc-runlmp-8cpu-2mpi-4openmp.sh
sh ./mc-runlmp-8cpu-4mpi-2openmp.shThe above will run lammps using:
- 1 CPU ==> Serial program
- 2 CPUs ==> OpenMP program
- 2 CPUs ==> MPI program
- 4 CPUs ==> OpenMP program
- 4 CPUs ==> MPI program
- 8 CPUs ==> Hybrid mode (2 MPI + 4 OpenMP)
- 8 CPUs ==> Hybrid mode (4 MPI + 2 OpenMP)
The above will generate the following output:
- output_lammps-serial.txt
- output_lammps-openmp-2cpus.txt
- output_lammps-mpi-2cpus.txt
- output_lammps-openmp-4cpus.txt
- output_lammps-mpi-4cpus.txt
- output_lammps-8cpu-2mpi-4openmp.txt
- output_lammps-8cpu-4mpi-2openmp.txt
Useful links#
- Using modules on national clusters.
- Running Lammps on national clusters.
- Running GROMACS on national clusters.