Software installation guideline

Software installation guideline


1. Preparing software environment

This section offers guidelines on setting up an environment for building and running application software on LANTA.

There are mainly three approaches in preparing an environment on LANTA:

For each software/application, users should choose one over another. They should not be mixed, since library conflicts may occur if not managed carefully.

1.1 HPE Cray Programming Environment

LANTA is an HPE Cray EX cluster. On the system, HPE Cray Programming Environment (PrgEnv or CPE) is installed by the vendor and is preferred for compatibility with the HPE Slingshot network. The environment provides a uniform interface across different sets of compiler and libraries. Below are the modules for each available compiler suite.

Module name

Description

Note

Module name

Description

Note

PrgEnv-gnu

GNU compiler suite

-

PrgEnv-intel

INTEL compiler suite

Intel oneAPI with MKL

PrgEnv-cray

Cray Compiling Environment (CCE)

Loaded by default, upon login

PrgEnv-nvidia

NVIDIA HPC SDK compiler suite

No CUDA

PrgEnv-aocc

AMD AOCC compiler suite

Without AOCL

The default set of modules loaded at login comprises of the latest PrgEnv-cray, CCE, perftools-base, xpmem and craype-x86-milan.

  • To remove them all, execute module purge

  • To use other compiler suite, execute module swap PrgEnv-cray PrgEnv-xxx

  • To restore back the above default, execute module reset or module restore

Execute cc --version, CC --version, or ftn --version to check which compiler is being used underneath. With PrgEnv-intel loaded, ${MKLROOT} is set to the corresponding Intel Math Kernal Library (MKL). To use only Intel Classic, execute module swap intel intel-classic after loading PrgEnv-intel. With PrgEnv-nvidia loaded, ${NVIDIA_PATH} is set to the corresponding NVIDIA SDK location. With PrgEnv-aocc loaded, ${AOCC_PATH} is set to the corresponding AOCC location. Main modules from HPE Cray Programming Environment (CPE) [06/2025] ----------------------------------- /opt/cray/pe/lmod/modulefiles/core ----------------------------------- PrgEnv-aocc (3) cce (4) cray-libpals (3) cray-zmqnet (1) intel-oneapi (2) PrgEnv-cray (3) cpe-cuda (3) cray-libsci (3) craype (4) intel (2) PrgEnv-gnu (3) cpe (4) cray-libsci_acc (1) craypkg-gen (3) iobuf (1) PrgEnv-intel (3) cray-R (3) cray-mrnet (3) cuda (6) nvidia (3) PrgEnv-nvhpc (2) cray-ccdb (3) cray-pals (3) gcc-native (3) papi (4) PrgEnv-nvidia (3) cray-cti (6) cray-pmi (4) gcc (3) perftools-base (4) aocc (2) cray-dsmml (2) cray-python (3) gdb4hpc (4) sanitizers4hpc (3) atp (4) cray-dyninst (3) cray-stat (3) intel-classic (2) valgrind4hpc (4) -------------------------- /opt/cray/pe/lmod/modulefiles/craype-targets/default -------------------------- craype-x86-milan (1) craype-accel-nvidia80 (1) craype-network-none (1) craype-network-ofi (1) ------------------------------ /lustrefs/disk/modules/lmod/modulefiles/core ------------------------------ aocc (1) intel-oneapi (1) intel (1) ----------------------------------------- /opt/cray/modulefiles ------------------------------------------ cudatoolkit (2) libfabric (2) xpmem (1)

GPU acceleration

Additionally, load the cuda/<version> module for GPU acceleration. Currently, NVIDIA CUDA versions 10.2, 11.0, 11.7, 11.8, 12.0, and 12.6 are readily available on LANTA.

[June 2025] According to the information from nvidia-smi, NVIDIA driver version on LANTA is currently565.57.01 which supports CUDA version up to 12.7. Please be aware of the compatibility between CUDA and cray-mpich. For instance, CUDA 12 is only supported by cray-mpich/8.1.27 or newer. For cross-compilation, you may have to use nvcc -ccbin cc to compile .cu You have to manually pass the respective OpenACC/OpenMP offloading flags of each compiler.

Build target

To enable optimizations that depend on the hardware architecture of LANTA, the following modules should be loaded together with PrgEnv and cuda.

Module name

Hardware target

Note

Module name

Hardware target

Note

craype-x86-milan

AMD EPYC Milan (x86)

-

craype-accel-nvidia80

NVIDIA A100

Load after a cuda module (11.0 or newer)

If craype-x86-milan is not loaded when using cc, CC or ftn, you may get a warning No supported cpu target is set, CRAY_CPU_TARGET=x86-64 will be used. Load a valid targeting module or set CRAY_CPU_TARGET With the target modules loaded, -march, -mtune, -hcpu, -haccel, -tp, -gpu, ... will be automatically filled in by cc, CC, ftn. To visualize this, try cc --version -craype-verbose.

Cray-optimized libraries

Most Cray-optimized libraries become accessible only after loading PrgEnv, ensuring compatibility with the selected compiler suite. Additionally, some libraries, such as NetCDF, require users to load their dependencies first. Below is the hierarchy of commonly used cray-* modules.

LANTA-cray-mod_highdef.png
Figure 1: A hierarchy of HPE Cray modules
module purge module load craype-x86-milan module load PrgEnv-intel module load cray-hdf5-parallel module load cray-netcdf-hdf5parallel module list # The default version is the latest available on the system.

CPE version

To ensure backward compatibility after a system upgrade, it is recommended to fix the Cray Programming Environment version using either cpe/<version> or cpe-cuda/<version>. Otherwise, the most recent version will be loaded by default.

To strictly pin them down at runtime, add the following line after loading all cray-* modules.
export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH} (Reference)

CPE toolchain

A CPE toolchain module is a bundle consisting of craype-x86-milan, PrgEnv-<compiler> and cpe-xxx/<version>. This module is defined as a toolchain for convenience and for use with EasyBuild, the framework used to install most ThaiSC modules.

CPE toolchain Description cpeGNU/23.03 GCC 11.2.0 + cray-mpich/8.1.25 cpeCray/23.03 CCE 15.0.1 + cray-mpich/8.1.25 cpeIntel/23.03 Deprecated and hidden. It will be removed in the future. cpeIntel/23.09 Intel Compiler 2023.1.0 + cray-mpich/8.1.27 cpeGNU/25.03 GCC 14.2 + cray-mpich/8.1.32 cpeCray/25.03 CCE 19.0.0 + cray-mpich/8.1.32 cpeIntel/25.03 Intel Compiler 2025.1 + cray-mpich/8.1.32

ThaiSC modules

All ThaiSC modules are located at the same module path, so there is no module hierarchy. Executing module avail on LANTA will display all available ThaiSC modules. For a more concise list, you can use module overview, then, use module help <name> or module spider <name> to learn more about each specific module.

Users can readily use ThaiSC modules and CPE toolchains to build their applications. Some popular application software are pre-installed as well. For more information on how to use the pre-installed software, please visit Applications usage. To set up your own local modules or install software using EasyBuild, please visit Local module & EasyBuild.

username@lanta-xname:~> module overview ------------------------ /lustrefs/disk/modules/easybuild/modules/all ------------------------- ADIOS2 (2) GenericIO (2) ParaView (1) fontconfig (2) ATK (2) Gmsh (1) ParallelIO (1) freetype (2) Amber (1) Go (1) Perl (2) gettext (1) Apptainer (1) HDF-EOS (2) PostgreSQL (3) giflib (1) Armadillo (2) HDF (2) QuantumESPRESSO (4) git-lfs (1) AutoDock-vina (1) HTSlib (1) RAxML-NG (1) googletest (1) Autoconf (1) HYPRE (2) SAMtools (1) gperf (1) Automake (1) HarfBuzz (2) SCOTCH (2) gperftools (2) Autotools (1) ICU (3) SDL2 (2) groff (2) BCFtools (1) Imath (2) SLEPc (2) hwloc (1) BEDTools (1) JasPer (3) SPAdes (1) intltool (1) BLAST+ (1) Java (2) SQLite (3) jbigkit (2) BLASTDB (2) KaHIP (2) SWIG (3) libGLU (2) BWA (1) LAME (1) SYCL (1) libaec (2) BamTools (1) LLVM (2) SZ (2) libdeflate (2) Beast (1) LMDB (1) SpectrA (1) libdrm (2) Bison (1) LibTIFF (2) SuiteSparse (2) libepoxy (2) Blosc (2) M4 (1) SuperLU_DIST (2) libffi (1) Boost (4) MAFFT (1) Tcl (2) libgeotiff (2) Bowtie (1) METIS (2) Tk (2) libglvnd (2) Bowtie2 (1) MPC (2) Trimmomatic (1) libiconv (2) Brotli (2) MPFR (2) UDUNITS2 (1) libjpeg-turbo (3) C-Blosc2 (2) MUMPS (4) VASP (3) libpciaccess (2) CFITSIO (2) Mako (2) VCFtools (1) libpng (3) CGAL (2) Mamba (1) WPS (2) libreadline (2) CLHEP (1) Mesa (2) WRF (1) libtirpc (2) CMake (2) Meson (2) WRFchem (2) libtool (1) CrayNVHPC (1) Miniforge3 (1) Wayland (2) libunwind (2) DB (2) MrBayes (1) X11 (2) libxml2 (3) DBus (1) NASM (1) XZ (3) lz4 (3) ESMF (2) NLopt (2) Xerces-C++ (1) minimap2 (1) EasyBuild (2) Nextflow (3) Yasm (1) nccl (1) Eigen (1) Ninja (1) arpack-ng (2) ncurses (2) FDS (1) OSPRay (2) assimp (2) nlohmann_json (1) FFmpeg (2) OpenCASCADE (2) at-spi2-atk (2) numactl (1) FastQC (1) OpenEXR (2) at-spi2-core (2) pixman (1) FortranGIS (2) OpenFOAM (2) aws-ofi-nccl (1) pkgconf (1) FreeXL (2) OpenJPEG (2) beagle-lib (1) tbb (1) FriBidi (2) OpenMPI (1) binutils (1) termcap (1) GATK (1) OpenSSL (1) bzip2 (3) use-local-tmp (1) GDAL (2) OpenTURNS (2) cURL (1) x264 (1) GEOS (2) PCRE (1) cairo (2) x265 (1) GLM (2) PCRE2 (1) canu (1) xorg-macros (2) GLib (2) PDAL (1) cpeCray (2) xprop (2) GMP (3) PETSc (2) cpeGNU (2) xxHash (1) GObject-Introspection (2) PROJ (2) cpeIntel (2) zfp (2) GROMACS (3) Pango (2) ecCodes (2) zlib (2) GSL (3) ParFlow (1) expat (2) zstd (3) Gaussian (1) ParMETIS (2) flex (1)
module purge module load Boost/1.81.0-cpeGNU-23.03 echo ${CPATH} echo ${LIBRARY_PATH} echo ${LD_LIBRARY_PATH} echo ${EBROOTBOOST}

2. Building an application software

After an appropriate environment is loaded, this section provides guidelines on how to use it to build an application software on LANTA.

2.1 Compiler wrapper

<wrapper> cmd

Description

Manual

In substitution for

cc

C compiler wrapper

man cc or cc --help

mpicc / mpiicx

CC

C++ compiler wrapper

man CC or CC --help

mpic++ / mpiicpx

ftn

Fortran compiler wrapper

man ftn or ftn --help

mpif90 / mpiifx

The Cray compiler wrappers--namely, cc, CC and ftn--become available after loading any PrgEnv-<compiler> module (or our CPE toolchain). When invoked, the wrapper passes relevant information about the cray-* libraries, loaded in the current environment, to the underlying <compiler> to compile the source code. It is strongly recommended to use these wrappers for building MPI applications with the native Cray MPICH library cray-mpich.

Adding -craype-verbose to the wrapper when compiling a source file will display the final command executed.

To see what will be added before compiling, use <wrapper> --cray-print-opts=all.

module purge module load GDAL/3.6.4-cpeIntel-23.09 cc --cray-print-opts=all The output of the final command indicates that include search paths (-I), library search paths (-L), and linking flags (-l<lib> such as -lnetcdf) of cray-* library are taken care of automatically by the wrapper; there is no need to manually pass them. For ThaiSC libraries, their include and library search paths are stored in ${CPATH}, ${LIBRARY_PATH} and ${LD_LIBRARY_PATH}, and users have to manually add appropriate linking flags (-l<lib>). However, these steps should be covered automatically if using a build tool.
# Create the source code cat << Eof > HelloWorld.c #include <stdio.h> #include <mpi.h> #include <omp.h> int main(){ int rank, thread ; omp_lock_t io_lock ; omp_init_lock(&io_lock); MPI_Init(NULL, NULL); MPI_Comm_rank(MPI_COMM_WORLD, &rank); #pragma omp parallel private(thread) { thread = omp_get_thread_num(); omp_set_lock(&io_lock); printf("HelloWorld from rank %d thread %d \n", rank, thread); omp_unset_lock(&io_lock); } omp_destroy_lock(&io_lock); MPI_Finalize(); return 0; } Eof module reset # Back to the default PrgEnv-cray cc --version # Check underlying compiler # Compile the source file 'HelloWorld.c' cc -craype-verbose -o hello.exe HelloWorld.c -fopenmp # Run the program srun -p compute-devel -N1 -n4 -c2 hello.exe
# Create the source code cat << Eof > HelloWorld.cpp #include <iostream> #include <mpi.h> #include <omp.h> int main(){ int rank, thread ; omp_lock_t io_lock ; omp_init_lock(&io_lock); MPI_Init(nullptr,nullptr); MPI_Comm_rank(MPI_COMM_WORLD, &rank); #pragma omp parallel private(thread) { thread = omp_get_thread_num(); omp_set_lock(&io_lock); std::cout << "HelloWorld from rank " << rank << " thread " << thread << std::endl; omp_unset_lock(&io_lock); } omp_destroy_lock(&io_lock); MPI_Finalize(); return 0; } Eof module reset # Back to the default PrgEnv-cray CC --version # Check underlying compiler # Compile the source file 'HelloWorld.cpp' CC -craype-verbose -o hello.exe HelloWorld.cpp -fopenmp # Run the program srun -p compute-devel -N1 -n4 -c2 hello.exe
# Create the source code cat << Eof > HelloWorld.f90 program helloworld_mpi_omp use mpi use omp_lib implicit none integer :: rank, thread, provided, ierr integer(kind=omp_lock_kind) :: io_lock call omp_init_lock(io_lock) call MPI_Init(ierr) call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr) !\$omp parallel private(thread) thread = omp_get_thread_num() call omp_set_lock(io_lock) print *, 'HelloWorld from rank ', rank, ' thread ', thread call omp_unset_lock(io_lock) !\$omp end parallel call omp_destroy_lock(io_lock) call MPI_Finalize(ierr) end program helloworld_mpi_omp Eof # Note: change !\$omp to !$omp if you type the above code by hand. module reset # Back to the default PrgEnv-cray ftn --version # Check underlying compiler # Compile the source file 'HelloWorld.cpp' ftn -craype-verbose -o hello.exe HelloWorld.f90 -h omp # Run the program srun -p compute-devel -N1 -n4 -c2 hello.exe

When building a serial program, you could use module swap craype-network-ofi craype-network-none so that no libfabric (shared) library is required at runtime.

2.2 Build tools

Several tools exist to help us build large and complex software chains. Among them, GNU Make and CMake are commonly used. The developer team for each software chooses which build tool they will support. Therefore, it is important to thoroughly read the software documentation. For some software, users might need to additionally load the latest CMake or Autotools modules on the system (e.g., module load CMake/3.26.4).

Generally, there are three stages in building a program using a build tool: configure, make and make install. For more details, see Basic Installation.

Build tools typically can detect compilers through environment variables such as CC, CXX, and FC, during the configure stage. Therefore, setting these variables first should ensure the use of the Cray compiler wrappers in all subsequent steps.

Then, we recommend users to issue ./configure --help or cmake -LA to see all available config options of the software/library before proceed.

export CC=cc CXX=CC FC=ftn F77=ftn F90=ftn ./configure --help # or cmake -LA <source-dir>

At the configure step, users need to specify the installation path using --prefix= or -DCMAKE_INSTALL_PREFIX=, since the default path is normally /usr/ or /usr/local/ which are reserved for system administrators.

This installation path can be within your project home, such as /project/ltXXXXXX-YYYY/<software-name>, allowing you to manage permissions and share the software with your project members. By default on LANTA, your team will be able to read and execute the software you install there, but they will not be able to modify it or create anything within that path.

./configure --prefix=<your-install-location> [other-config-options...] # or cmake -DCMAKE_INSTALL_PREFIX=<your-install-location> [other-config-options...] <source-dir>

Note: if the CMake cache is not clean, you might need to explicitly use:

cmake -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DCMAKE_Fortran_COMPILER=ftn \ -DCMAKE_INSTALL_PREFIX=<your-install-location> [other-config-options...] <source-dir>

to make it use the Cray compiler wrapper.

Please scan the output from the configure step to verify that everything is set up correctly.

After the above steps, you should be able to execute make (or make -j <num>) and make install to build your software as you would on any other system.

module purge module load cpeCray/23.03 module load NASM/2.16.01 module load CMake/3.26.4 wget https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.2/libjpeg-turbo-3.0.2.tar.gz tar xzf libjpeg-turbo-3.0.2.tar.gz cd libjpeg-turbo-3.0.2 PARENT_DIR=$(pwd) mkdir build ; cd build export CC=cc CXX=CC FC=ftn F77=ftn F90=ftn # or, for verbosity, #export CC="cc -craype-verbose" CXX="CC -craype-verbose" FC="ftn -craype-verbose" F77="ftn -craype-verbose" F90="ftn -craype-verbose" cmake -DCMAKE_INSTALL_PREFIX=${PARENT_DIR}/cpeCray-23.03 -G"Unix Makefiles" -DWITH_JPEG8=1 .. make make install cd ${PARENT_DIR}/cpeCray-23.03 ln -s ./lib64 ./lib # Optional, but recommended

2.3 Other related/advanced topics


3. Running the software

Every main application software must run on compute/gpu/memory nodes. The recommended approach is to write a job script and submit it to Slurm scheduler through sbatch command.

Always use sbatch <job-script>.

If you run bash <job-script> or simply ./<job-script>, then the script will not get sent to Slurm, it will run on the login node instead!

3.1 Writing a job script

Overall, the job script template below consists of five sections:

#!/bin/bash #SBATCH -p gpu # Partition #SBATCH -N 1 # Number of nodes #SBATCH --gpus-per-node=4 # Number of GPU cards per nodes #SBATCH --ntasks-per-node=4 # Number of MPI processes per node #SBATCH --cpus-per-gpu=16 # Number of CPU cores per GPU cards #SBATCH -t 5-00:00:00 # Job runtime limit #SBATCH -J <JobName> # Job name #SBATCH -A ltXXXXXX # Billing account *** {USER EDIT} *** # --- Load necessary modules --- #module purge #module reset module load <...> module load <...> # --- Add software to Linux search paths --- export PATH=<software-bin-path>:${PATH} export LD_LIBRARY_PATH=<software-lib/lib64-path>:${LD_LIBRARY_PATH} # export PYTHONPATH=<software-python-site-packages>:${PYTHONPATH} # source <your-software-specific-script> # --- (Optional) Set related environment variables --- # export OMP_NUM_THREADS=<NUM> # --- Run the software --- # srun <srun-options> ./<software> # or # ./<software>

1. Slurm sbatch header


Slurm sbatch options are used to define and request computing resources according to each user’s requirements. The options can be specified either when submitting the script sbatch [sbatch-option] <your-job-script> or included as header directives in the job script #SBATCH <sbatch-option>.

The #SBATCH directives can be used to specify options that mostly unchanged, such as partition, time limit, billing account, and so on. For more details regarding all available sbatch options, please visit Slurm sbatch. Frequently used options are shown in the above script, each with a short explanation.

It should be noted that Slurm sbatch options only state computing resources that can be used inside a job script. Although, the sbatch options are passed and become the default options for subsequent srun steps, the actual resources used at any srun step inside the job can be altered by explicitly setting otherwise. This is explained briefly in Stage 5.

If more than one nodes are requested, the job script will only get executed on the first requested node (${SLURMD_NODENAME}). Only srun can launch software processes / run commands across nodes.

2. Loading modules
It is advised to load every module used when installing the software in the job script, although build dependencies such as CMake, Autotools, and binutils can be omitted. Additionally, those modules should be of the same version and toolchain as when they were used to compile the program.

As mention above, LANTA has a default set of modules loaded at login. If this is undesired, add module purge before loading other modules. On the other hands, if the default set is desired, we recommend adding module reset or module restore at the beginning of the job script.

3. Adding software paths
The Linux OS will not be able to find your program if it is not in its search paths. The commonly used ones are namely PATH (for executable/binary), LD_LIBRARY_PATH (for shared library at runtime), and PYTHONPATH (for python packages). Users MUST append or prepend them using syntax such as export PATH=<software-bin-path>:${PATH}.
If <your-install-location> is where your software is installed, then putting the below commands in your job script should be sufficient in most cases.

export PATH=<your-install-location>/bin:${PATH} export LD_LIBRARY_PATH=<your-install-location>/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH=<your-install-location>/lib64:${LD_LIBRARY_PATH}

Noting that loading modules in Stage 2 is equivalent to setting software paths in this Step 3. Therefore, if the search paths are not appended or prepend correctly, the libraries loaded using module load in Stage 2 could be ineffective and resulting in a share-library-not-found error or others.

  • If some software dependencies are installed locally, their search paths should also be added to the job script, in an orderly fashion.

  • We do NOT recommend specifying these search paths in ~/.bashrc directly, as it could lead to internal conflicts when managing multiple software chains.

  • Some software provides an initialization script to be sourced before using it. In such cases, sourcing the initialization script in your job script should be equivalent to adding its search paths manually.

If the software also generates Python packages, then you may have to check where those packages are installed. Usually, they are in <your-install-location>/lib/python<Version>/site-packages, <your-install-location>/lib64/python<Version>/site-packages or other similar paths. Then, adding a line such as below would inform Python where the packages are. export PYTHONPATH=<your-python-package-location>:${PYTHONPATH}
When executing your program, if you encounter If 'xxx' is not a typo you can use command-not-found to lookup ... --> then, the PATH variable may be set incorrectly. xxx: error while loading shared libraries: libXXX.so: cannot open shared object file --> then, If libXXX.so seem to be from a dependency module you used when building the software, then loading that module in the job script should fix the problem. If the dependency is installed locally, then you have to append the location of libXXX.so to LD_LIBRARY_PATH. If libXXX.so seem to be related to your software directly, then you may set LD_LIBRARY_PATH variable in Step 3 incorrectly. ModuleNotFoundError: No module named 'xxx' --> then, the PYTHONPATH may be set incorrectly. Preliminary check could be performed on frontend/login node by doing something like bash # You should check them in another bash shell module purge # As specified in the job script module load <...> module load <...> export PATH=<software-bin-path>:${PATH} export LD_LIBRARY_PATH=<software-lib/lib64-path>:${LD_LIBRARY_PATH} export PYTHONPATH=<software-python-site-packages>:${PYTHONPATH} <executable> --help <executable> --version which <executable> ldd $(which <executable>) exit

4. Setting environment variables
Some additional adjustments can be done at runtime through setting environment variables. For example, setting a temporary directory for the software to use, or adjusting OpenMP and MPICH configurations. Some examples are shown below.

# 1.1 TMPDIR (NVME) [Experimental] == Removed automatically when the job is completed #module load use-local-tmp # A module that set ${TMPDIR} inside a job at runtime #export XXX_TMPDIR=${TMPDIR} # Set software TMPDIR (only if needed) # 1.2 TMPDIR (Scratch) == Old approach export XXX_TMPDIR=/scratch/ltXXXXXX-YYYY/${SLURM_JOBID} # 2. OpenMP export OMP_STACKSIZE="32M" export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} # only if --cpus-per-task= is used export OMP_AFFINITY_FORMAT="Thread: %.4n of %.4N (affinity: %.10A) [%.6P : %.12H]" export OMP_DISPLAY_AFFINITY=true # 3. MPICH export MPICH_GPU_SUPPORT_ENABLED=1 # Only if needed export MPICH_ENV_DISPLAY=1 export MPICH_RANK_REORDER_DISPLAY=1 export MPICH_OFI_NIC_VERBOSE=1 export MPICH_OFI_VERBOSE=1 # 4. Others ulimit -s unlimited #export CRAY_OMP_CHECK_AFFINITY=TRUE # Only for software built using Cray compiler
  • Setting ulimit -s unlimited may be helpful when you encounter segmentation-fault or stack-overflow errors--that is, if your software primary use stack memory instead of heap memory.

  • Output environment variables set by sbatch (Slurm sbatch - output environment variables), such as ${SLURM_CPUS_PER_TASK} and ${SLURM_JOBID}, can be used to set subsequent environment variables.

5. Running your software


Each software has its own command to be issued. Please read the software documentation and forum. Special attention should be paid to how the software is parallelized and how it utilizes multiple computing resources concurrently.

Differing from running on a small local machine, users may need to insert additional input arguments or options to case files in order to specify the number of threads, MPI tasks and/or GPUs at runtime. The total resources concurrently utilized in this stage should be less than or equal to the resources previously requested in Stage 1. Oversubscribing resources can reduce overall performance and could cause permanent damage to the machine.

On LANTA, the srun command MUST be used to launch MPI processes instead of mpirun, mpiexec, and aprun. The table below compares some important options across these commands.

Command

Total MPI processes

CPU per MPI process

MPI processes per node

Command

Total MPI processes

CPU per MPI process

MPI processes per node

srun

-n, --ntasks

-c, --cpus-per-task

--ntasks-per-node

mpirun/mpiexec

-n, -np

--map-by socket:PE=N

--map-by ppr:N:node

aprun

-n, --pes

-d, --cpus-per-pe

-N, --pes-per-node

If the same options are specified during the job allocation in Stage 1, then you can simply use srun <your-software> since Slurm will automatically derive those settings. Additionally, for applications that only use CPU/GPU multi-threading (not MPI), you may run the executable without srun, providing that the software can correctly detect the available resources. These applications are typically limited to a single node; therefore, #SBATCH -N 1 or #SBATCH --nodes=1 should be used.

Several options used in this srun step also indicate how computing resources will be bound to the processes being launched. For more details, see the example job scripts on LANTA at

  • /project/common/General/check_cpu_binding/

  • /project/common/General/check_gpu_binding/

--gpus-per-node or --gpus will only request GPUs. The GPU will not be specifically bound to a task or process. All tasks on the same node will see the same set of GPU IDs available on the node, starting from 0. Try salloc -p gpu-devel -N2 --gpus-per-node=4 -t 00:05:00 -J "GPU-ID" # Note: using default --ntasks-per-node=1 srun nvidia-smi -L srun --ntasks-per-node=4 nvidia-smi -L srun --ntasks-per-node=2 --gpus-per-node=3 nvidia-smi -L exit # Release salloc myqueue # Check that no "GPU-ID" job still running Usually, software can detect available GPUs and assign them to processes at runtime. If this is not the case, you should add --gpus-per-task, --ntasks-per-gpu (read below) or use SLURM_LOCALID or others to set CUDA_VISIBLE_DEVICES of each task. For example, you could use a wrapper script mentioned in HPE intro_mpi (Section 1) or you could devise an algorithm and use torch.cuda.set_device in PyTorch as demonstrated here. --gpus-per-task or --ntasks-per-gpu will additionally bind GPUs to tasks. The GPU IDs seen by each task will always start from 0 (CUDA_VISIBLE_DEVICES) but will be actually bound to a different GPU/UUID. Try salloc -p gpu-devel -N1 --gpus=4 -t 00:05:00 -J "GPU-ID" # Note: using default --ntasks-per-node=1 srun --ntasks=4 --gpus-per-task=1 nvidia-smi -L srun --ntasks-per-gpu=4 nvidia-smi -L exit # Release salloc myqueue # Check that no "GPU-ID" job still running However, it is stated in HPE intro_mpi (Section 1) that using these options with CrayMPICH could introduce an intra-node MPI performance drawback.

For hybrid (MPI+Multi-threading) applications, it was essential to specify -c or --cpus-per-tasks options to srun to prevent a potential decrease in performance (>10%) due to improper CPU binding.

Nevertheless, on 3 May 2025, Slurm on LANTA is upgraded from 22.05 to 24.05. Now, the --cpus-per-task option specified at #SBATCH is also passed and inherited by srun automatically by default.

3.2 Submitting a job

To submit your job script to Slurm, execute sbatch [options] job-script.sh [arguments].

username@lanta-xname:~> sbatch job-script.sh # Simplest Submitted batch job XXXXXX1 username@lanta-xname:~> sbatch -J <jobname> job-script.sh # Same as having '#SBATCH -j jobname1' in job-script.sh Submitted batch job XXXXXX2 username@lanta-xname:~> sbatch -D <your-case-directory> job-script.sh Submitted batch job XXXXXX3

If your software asks for a case directory where all inputs must be in, you may need to submit your job inside that directory, or use -D, --chdir option.

You can test your initial script on compute-devel or gpu-devel partitions--up to 2 hours and at most two nodes. The nodes are almost always available for testing.


Example

Installation guide

Reference