Notes for Specific Machines =========================== The software stack on every machine has its own idiosyncrasies, especially on GPU clusters. Below are settings that are known to work (as of the latest update to this page) on a number of open-science clusters. In each of the following instructions, the top-level AthenaK directory is denoted ``$athenak``, and the relative build directory is denoted ``$build``. List of Machines: ----------------- - :ref:`OLCF: Frontier (MI250X GPU nodes) ` - :ref:`ALCF: Aurora (PVC GPU nodes) ` - :ref:`ALCF: Polaris (A100 GPU nodes) ` - :ref:`NERSC: Perlmutter (A100 GPU nodes) ` - :ref:`NCSA: DeltaAI (GH200 GPU nodes) ` - :ref:`Flatiron Institute: Rusty (A100 GPU nodes) ` - :ref:`Princeton: Della (A100 GPU nodes) ` - :ref:`Princeton: Stellar (Cascade Lake nodes) ` - :ref:`IAS: Apollo (A100 GPU nodes) ` - :ref:`PSU: Roar Collab (A100 GPU nodes) ` .. _Frontier: OLCF: Frontier (MI250X GPU nodes) --------------------------------- For reference, consult the `Frontier User Guide `_. Building and compiling ^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash module restore module load PrgEnv-cray \ craype-accel-amd-gfx90a \ cmake \ cray-python \ amd-mixed/5.3.0 \ cray-mpich/8.1.23 \ cce/15.0.1 export MPICH_GPU_SUPPORT_ENABLED=1 cd ${athenak} cmake -Bbuild -DAthena_ENABLE_MPI=ON -DKokkos_ARCH_ZEN3=ON -DKokkos_ARCH_VEGA90A=ON \ -DKokkos_ENABLE_HIP=ON -DCMAKE_CXX_COMPILER=CC \ -DCMAKE_EXE_LINKER_FLAGS="-L${ROCM_PATH}/lib -lamdhip64" \ -DCMAKE_CXX_FLAGS=-I${ROCM_PATH}/include cd ${build} make -j Running ^^^^^^^ Frontier uses the Slurm batch scheduler. Jobs should be run in the ``$PROJWORK`` directory. A simple example Slurm script is given below. .. code-block:: bash #!/bin/bash #SBATCH -A AST179 #SBATCH -J mad_64_8 #SBATCH -o %x-%j.out #SBATCH -e %x-%j.err #SBATCH -t 2:00:00 #SBATCH -p batch #SBATCH -N 64 module restore module load PrgEnv-cray craype-accel-amd-gfx90a cmake cray-python \ amd-mixed/5.3.0 cray-mpich/8.1.23 cce/15.0.1 export MPICH_GPU_SUPPORT_ENABLED=1 # Can get an increase in write performance when disabling collective buffering for MPI IO export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" cd /lustre/orion/ast179/proj-shared/mad_64_8 srun -N 64 -n 512 -c 1 --gpus-per-node=8 --gpu-bind=closest athena -i mad_64_8.athinput Full example with bundled jobs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The below script can be used to run any number of jobs, with each using the same executable and same number of nodes but with different input files and command-line arguments. Each job will combine stdout and stderr and write them to its own file. This script will automatically check for existing restarts and continue any such jobs, starting from the beginning only in cases where no restart files can be found. .. code-block:: bash #! /bin/bash #SBATCH --job-name #SBATCH --account #SBATCH --partition batch #SBATCH --nodes #SBATCH --time :: #SBATCH --output #SBATCH --mail-user #SBATCH --mail-type END,FAIL # Parameters nodes_per_job= ranks_per_job= gpus_per_node=8 run_dir= executable= input_dir= output_dir= names=( <...>) arguments=("" "" "<...>") # Set environment cd $run_dir module restore module load PrgEnv-cray craype-accel-amd-gfx90a cmake cray-python amd-mixed/5.3.0 cray-mpich/8.1.23 cce/15.0.1 export MPICH_GPU_SUPPORT_ENABLED=1 export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" # Check parallel values num_jobs=${#names[@]} num_nodes=$((num_jobs * nodes_per_job)) if [ $num_nodes -gt $SLURM_JOB_NUM_NODES ]; then echo "Insufficient nodes requested." exit fi gpus_per_job=$((nodes_per_job * gpus_per_node)) if [ $ranks_per_job -gt $gpus_per_job ]; then echo "Insufficient GPUs requested." exit fi # Check for restart files restart_lines=() for ((n = 0; n < $num_jobs; n++)); do name=${names[$n]} test_file=$(find $name/rst -maxdepth 1 -name "$name.*.rst" -print -quit) if [ -n "$test_file" ]; then restart_files=$(ls -t $name/rst/$name.*.rst) restart_file=(${restart_files[0]}) restart_line="-r $restart_file" printf "\nrestarting $name from $restart_file\n\n" else restart_line="-i $input_dir/$name.athinput" printf "\nstarting $name from beginning\n\n" fi restart_lines+=("$restart_line") done # Run code for ((n = 0; n < $num_jobs; n++)); do name=${names[$n]} mpi_options="--nodes $nodes_per_job --ntasks $ranks_per_job --cpus-per-task 1 --gpus-per-node $gpus_per_node --gpu-bind=closest" athenak_options="-d $name ${restart_lines[$n]} ${arguments[$n]}" output_file=$output_dir/$name.out time srun -u $mpi_options $executable $athenak_options &> $output_file && echo $name & sleep 10 done wait Notes ^^^^^ There are many separate filesystems on this machine, and often rearrangements of the path are equivalent. Some of the most useful are: - ``$HOME`` (``/ccs/home/``): 50 GB, backed up, files retained; good for source code and scripts - ``$MEMBERWORK/`` (``/lustre/orion//scratch/``): 50 TB, not backed up, 90-day purge; good for miscellaneous simulation outputs - ``$PROJWORK/`` (``/lustre/orion//proj-shared``): 50 TB, not backed up, 90-day purge; good for simulation outputs shared with other project members - ``/hpss/prod//users/``: 100 TB, not backed up, files retained; needs ``hsi``, ``htar``, or Globus to access; good for personal storage - ``/hpss/prod//proj-shared``: 100 TB, not backed up, files retained; needs ``hsi``, ``htar``, or Globus to access; good for storage shared with other project members Andes can be used for visualization (try ``module load python texlive`` to get everything needed for the plotting scripts to work). Its ``/gpfs/alpine/`` directory structure mirrors ``/lustre/orion/``. Files can only be transferred between them with something like Globus (the ``OLCF DTN`` endpoint works for both). Small files can be easily transferred through the shared home directory. .. _Aurora: ALCF: Aurora (PVC GPU nodes) ---------------------------- Intel Data Center GPU Max 1550, formerly Ponte Vecchio (PVC). Refer to `Aurora - Early User Notes and Known Issues `_ page of the ALCF User Guides frequently for updates. The most important items to note right now are: - Job stability beyond 2048 nodes is a serious issue for most applications. Stay below this node count, for now. Major instability causes/symptoms include: - Ping failures (network) - Node hangs (node-local hardware: memory controller, voltage regulation, etc.) - Kernel panics - Run job I/O on the `Flare `_ Lustre filesystem, project directory ``/lus/flare/projects/RadBlackHoleAcc/`` Building and compiling ^^^^^^^^^^^^^^^^^^^^^^^ It is recommended to bump Kokkos to at least version 4.5.01 (2024-12-23), since SYCL support was promoted from Experimental in that previous minor version release. Assuming that the AthenaK repository clone has its submodules properly initialized, execute this once: .. code-block:: bash cd ${athenak} cd kokkos git fetch git checkout 4.5.01 To build using ahead-of-time compilation (AOT compilation): .. code-block:: bash module use cmake cd ${athenak} cmake -DAthena_ENABLE_MPI=ON -DCMAKE_CXX_COMPILER=icpx -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_SYCL=ON \ -DKokkos_ARCH_INTEL_PVC=ON -DKokkos_ENABLE_OPENMP=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${build} \ [-DPROBLEM=gr_torus] \ -Bbuild cd ${build} make -j104 all # installs the kokkos include/, lib64/, and bin/ cmake --install . --prefix `pwd` To build with just-in-time (JIT) compilation (**not recommended**), replace ``-DKokkos_ARCH_INTEL_PVC=ON`` with ``-DKokkos_ARCH_INTEL_GEN=ON``. Running ^^^^^^^ Aurora uses the PBS job scheduler, and the officially-supported MPI distribution is Aurora MPICH. Launch an interactive job via: .. code-block:: bash qsub -l select=2 -l walltime=00:30:00 -A RadBlackHoleAcc -l filesystems=home:flare -I -q debug See the next section on ALCF Polaris, which uses a similar MPICH (Cray) + PBS job scheduler + Cray PALS launcher setup, for a non-interactive batch jobscript example. The resource (CPU core and multi-tile GPU) affinity options on Aurora are quite complicated. Consult the relevant `Aurora user-guides page `_ for a detailed walkthrough. Binding 12 MPI ranks to the 12 GPU tiles on a node is best accomplished via a shared wrapper script located at ``/soft/tools/mpi_wrapper_utils/gpu_tile_compact.sh``. **not yet updated:** .. code-block:: bash export MPICH_GPU_SUPPORT_ENABLED=1 cd ${PBS_O_WORKDIR} # MPI and OpenMP settings NNODES=`wc -l < $PBS_NODEFILE` NRANKS_PER_NODE=$(nvidia-smi -L | wc -l) NDEPTH=16 NTHREADS=1 mpiexec -np ${NTOTRANKS} --ppn ${NRANKS_PER_NODE} -d ${NDEPTH} --cpu-bind numa --env OMP_NUM_THREADS=${NTHREADS} -env OMP_PLACES=threads /soft/tools/mpi_wrapper_utils/gpu_tile_compact.sh ./athena -i ../../inputs/grmhd/gr_fm_torus_sane_8_4.athinput .. _Polaris: ALCF: Polaris (A100 GPU nodes) ------------------------------ For reference, consult the Polaris link in the `ALCF User Guide `_. Building and compiling ^^^^^^^^^^^^^^^^^^^^^^^ The simplest way to build and compile on Polaris is: .. code-block:: bash module use /soft/modulefiles module load PrgEnv-gnu module load spack-pe-base cmake module load cudatoolkit-standalone/12.4.0 module load craype-x86-milan export CRAY_ACCEL_TARGET=nvidia80 export MPICH_GPU_SUPPORT_ENABLED=1 cd ${athenak} cmake -DAthena_ENABLE_MPI=ON -DKokkos_ENABLE_CUDA=On -DKokkos_ARCH_AMPERE80=On \ -DMPI_CXX_COMPILER=CC -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_ZEN3=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${build} \ -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_COMPILER=CC \ [-DPROBLEM=gr_torus] \ -Bbuild cd ${build} gmake -j8 all # installs the kokkos include/, lib64/, and bin/ cmake --install . --prefix `pwd` Running ^^^^^^^ Polaris uses the PBS batch scheduler. An example PBS job script for Polaris can be found `here `_. Important: all multi-GPU jobs assume that you have a local copy of the script https://github.com/argonne-lcf/GettingStarted/blob/master/Examples/Polaris/affinity_gpu/set_affinity_gpu_polaris.sh in your home directory. This is required to enforce that only 1 distinct GPU device per node is visible to each MPI rank, since the PBS scheduler does not offer such a built-in option. The following example selects 16 nodes; all jobs with >10 nodes must be routed to ``prod`` queue. It is strongly suggested to specify only the filesystems that are truly required for a particular job's input/output to avoid the job being stuck in the queue if Grand and/or Eagle are down for maintenance. .. code-block:: bash #!/bin/bash -l #PBS -l select=16:ncpus=64:ngpus=4:system=polaris #PBS -l place=scatter #PBS -l walltime=0:30:00 #PBS -l filesystems=home:grand:eagle #PBS -q prod #PBS -A RadBlackHoleAcc cd ${PBS_O_WORKDIR} # MPI and OpenMP settings NNODES=`wc -l < $PBS_NODEFILE` NRANKS_PER_NODE=$(nvidia-smi -L | wc -l) NDEPTH=16 NTHREADS=1 NTOTRANKS=$(( NNODES * NRANKS_PER_NODE )) echo "NUM_OF_NODES= ${NNODES} TOTAL_NUM_RANKS= ${NTOTRANKS} RANKS_PER_NODE= ${NRANKS_PER_NODE} THREADS_PER_RANK= ${NTHREADS}" module use /soft/modulefiles module load PrgEnv-gnu module load cudatoolkit-standalone/12.4.0 module load craype-x86-milan export CRAY_ACCEL_TARGET=nvidia80 export MPICH_GPU_SUPPORT_ENABLED=1 mpiexec -np ${NTOTRANKS} --ppn ${NRANKS_PER_NODE} -d ${NDEPTH} --cpu-bind numa --env OMP_NUM_THREADS=${NTHREADS} -env OMP_PLACES=threads ~/set_affinity_gpu_polaris.sh ./athena -i ../../inputs/grmhd/gr_fm_torus_sane_8_4.athinput Some more options that may be useful: .. code-block:: bash #PBS -joe #PBS -o example.out #PBS -M #PBS -m be By default, the stderr of the job gets put into ``