Skip to content

Commit

Permalink
[mini] document GPU-aware MPI for various clusters (#992)
Browse files Browse the repository at this point in the history
* document GPU aware MPI for JUWELS and Maxwell

* Apply suggestions from code review

* add lumi and perlmutter, fix maxwell

* fix perlmutter doc

* Update docs/source/building/platforms/perlmutter_nersc.rst

* Update docs/source/building/platforms/perlmutter_nersc.rst

more unique naming
  • Loading branch information
SeverinDiederichs authored Jul 6, 2023
1 parent e58453c commit d669bfd
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
6 changes: 6 additions & 0 deletions docs/source/building/platforms/booster_jsc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ You can then create your directory in your ``$SCRATCH_<project id>``, where you
and use it to submit a simulation.

.. tip::
Parallel simulations can be largely accelerated by using GPU-aware MPI.
To utilize GPU-aware MPI, the input parameter ``hipace.comms_buffer_on_gpu = 1`` must be set.

Note that using GPU-aware MPI may require more GPU memory.

Running on CPU
--------------

Expand Down
10 changes: 10 additions & 0 deletions docs/source/building/platforms/lumi_csc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,13 @@ You can then create your directory in ``/project/project_<project id>``, where y
and use it to submit a simulation.
.. tip::
Parallel simulations can be largely accelerated by using GPU-aware MPI.
To utilize GPU-aware MPI, the input parameter ``hipace.comms_buffer_on_gpu = 1`` must be set and the following flag must be passed in the job script:
.. code-block:: bash
export FI_MR_CACHE_MAX_COUNT=0
Note that using GPU-aware MPI may require more GPU memory.
10 changes: 10 additions & 0 deletions docs/source/building/platforms/maxwell_desy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ submission script:
The ``-npernode`` must be set to ``GPUS_PER_NODE``, otherwise not all GPUs are used correctly.
There are nodes with 4 GPUs and 1 GPU (see the `Maxwell documentation on compute infrastructure <https://confluence.desy.de/display/MXW/Compute+Infrastructure>`__.
for more details and the required constraints). Please set the value accordingly.

.. tip::
Parallel simulations can be largely accelerated by using GPU-aware MPI.
To utilize GPU-aware MPI, the input parameter ``hipace.comms_buffer_on_gpu = 1`` must be set and the following flag must be passed in the job script:

.. code-block:: bash
export UCX_MEMTYPE_CACHE=n
Note that using GPU-aware MPI may require more GPU memory.
29 changes: 21 additions & 8 deletions docs/source/building/platforms/perlmutter_nersc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,35 @@ You can then create your directory in your ``$PSCRATCH``, where you can put your
#SBATCH -q regular
#SBATCH -C gpu
#SBATCH -c 32
#SBATCH --ntasks-per-gpu=1
#SBATCH --exclusive
#SBATCH --gpu-bind=none
#SBATCH --gpus-per-node=4
#SBATCH -o hipace.o%j
#SBATCH -e hipace.e%j
# GPU-aware MPI
export MPICH_GPU_SUPPORT_ENABLED=1
# expose one GPU per MPI rank
export CUDA_VISIBLE_DEVICES=$SLURM_LOCALID
# path to executable and input script
EXE=$HOME/src/hipace/build/bin/hipace
INPUTS=inputs
srun ${EXE} ${INPUTS}
# pin to closest NIC to GPU
export MPICH_OFI_NIC_POLICY=GPU
# for GPU-aware MPI use the first line
#HIPACE_GPU_AWARE_MPI="hipace.comms_buffer_on_gpu=1"
HIPACE_GPU_AWARE_MPI=""
# CUDA visible devices are ordered inverse to local task IDs
# Reference: nvidia-smi topo -m
srun --cpu-bind=cores bash -c "
export CUDA_VISIBLE_DEVICES=\$((3-SLURM_LOCALID));
${EXE} ${INPUTS} ${HIPACE_GPU_AWARE_MPI}" \
> output.txt
and use it to submit a simulation. Note, that this example simulation runs on 8 GPUs, since `-N = 2` yields 2 nodes with 4 GPUs each.

.. tip::
Parallel simulations can be largely accelerated by using GPU-aware MPI.
To utilize GPU-aware MPI, the input parameter ``hipace.comms_buffer_on_gpu = 1`` must be set (see the job script above).

Note that using GPU-aware MPI may require more GPU memory.
2 changes: 1 addition & 1 deletion docs/source/run/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ Use ``hipace/tools/read_insitu_diagnostics.py`` to read the files using this for


Additional physics
----------------
------------------

Additional physics describe the physics modules implemented in HiPACE++ that go beyond the standard electromagnetic equations.
This includes ionization (see plasma parameters), binary collisions, and radiation reactions. Since all of these require the actual plasma density,
Expand Down

0 comments on commit d669bfd

Please sign in to comment.