Skip to content

Commit 9dec7cc

Browse files
committed
Update environment and MPI call for GCPBackend
1 parent 3da2c05 commit 9dec7cc

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

src/backends.jl

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,36 @@ function module_load_string(::Type{DerechoBackend})
102102
end
103103

104104
function module_load_string(::Type{GCPBackend})
105-
return """export OPAL_PREFIX="/sw/openmpi-5.0.5"
106-
export PATH="/sw/openmpi-5.0.5/bin:\$PATH"
107-
export LD_LIBRARY_PATH="/sw/openmpi-5.0.5/lib:\$LD_LIBRARY_PATH"
108-
export UCX_MEMTYPE_CACHE=y # UCX Memory optimization which toggles whether UCX library intercepts cu*alloc* calls
105+
return """
106+
unset CUDA_ROOT
107+
unset NVHPC_CUDA_HOME
108+
unset CUDA_INC_DIR
109+
unset CPATH
110+
unset NVHPC_ROOT
111+
112+
# NVHPC and HPC-X paths
113+
export NVHPC=/sw/nvhpc/Linux_x86_64/24.5
114+
export HPCX_PATH=${NVHPC}/comm_libs/12.4/hpcx/hpcx-2.19
115+
116+
# CUDA environment
117+
export CUDA_HOME=${NVHPC}/cuda/12.4
118+
export CUDA_PATH=${CUDA_HOME}
119+
export CUDA_ROOT=${CUDA_HOME}
120+
121+
# MPI via MPIwrapper
122+
export MPITRAMPOLINE_LIB="/sw/mpiwrapper/lib/libmpiwrapper.so"
123+
export OPAL_PREFIX=${HPCX_PATH}/ompi
124+
125+
# Library paths - CUDA first, then HPC-X
126+
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${HPCX_PATH}/ompi/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
127+
128+
# Executable paths
129+
export PATH=/sw/mpiwrapper/bin:${CUDA_HOME}/bin:${PATH}
130+
export PATH="${NVHPC}/profilers/Nsight_Systems/target-linux-x64:${PATH}"
131+
132+
# Julia
133+
export PATH="/sw/julia/julia-1.11.5/bin:${PATH}"
134+
export JULIA_MPI_HAS_CUDA=true
109135
"""
110136
end
111137

src/slurm.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ function generate_sbatch_script(
212212
climacomms_device = gpus_per_task > 0 ? "CUDA" : "CPU"
213213
# TODO: Remove this exception for GCP
214214
mpiexec_string =
215-
get_backend() == GCPBackend ?
216-
"/sw/openmpi-5.0.5/bin/mpiexec -n $ntasks" :
215+
get_backend() == GCPBackend ? "mpiexec -n $ntasks" :
217216
"srun --output=$member_log --open-mode=append"
218217
sbatch_contents = """
219218
#!/bin/bash

0 commit comments

Comments
 (0)