Skip to content

Commit 049faeb

Browse files
committed
add craype configuration
1 parent 07f60c9 commit 049faeb

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

configs/cscs/craype_config

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
# Author: Samuel Omlin, CSCS (omlins)
4+
#
5+
# Description: Definition of site specific variables and call of JUHPC.
6+
# Site: ALPS:todi, Swiss National Supercomputing Centre (CSCS)
7+
# Base: craype
8+
9+
10+
# Load required modules (including correct CPU and GPU target modules)
11+
module load cray
12+
module switch PrgEnv-cray PrgEnv-gnu
13+
module load cudatoolkit craype-accel-nvidia90
14+
module load cray-hdf5-parallel
15+
module list
16+
17+
18+
# Environment variables for HPC key packages that require system libraries that require system libraries (MPI.jl, CUDA.jl, HDF5.jl and ADIOS2.jl)
19+
export JUHPC_CUDA_HOME=$CUDA_HOME # Used for CUDA.jl runtime discovery (set as CUDA_HOME in the uenv view / activate script).
20+
export JUHPC_CUDA_RUNTIME_VERSION=$CRAY_CUDATOOLKIT_VERSION # Used for CUDA.jl runtime version definition (set in preferences).
21+
export JUHPC_ROCM_HOME= # Used for AMDGPU.jl runtime discovery (set as ROCM_PATH in the uenv view / activate script).
22+
export JUHPC_MPI_HOME= # Used for MPI.jl system binary discovery (set in preferences).
23+
export JUHPC_MPI_VENDOR="cray" # Used for MPI.jl system binary discovery (used to set preferences).
24+
export JUHPC_MPI_EXEC="srun -C gpu" # Used for MPI.jl exec command discovery (set in preferences). Arguments are space separated, e.g. "srun -C gpu".
25+
export JUHPC_HDF5_HOME=$HDF5_DIR # Used for HDF5.jl library discovery (set in preferences).
26+
export JUHPC_ADIOS2_HOME= # Used for ADIOS2.jl library discovery (set as JULIA_ADIOS2_PATH in the uenv view / activate script).
27+
28+
29+
# Call JUHPC
30+
JUHPC_SETUP_INSTALLDIR=$SCRATCH/${HOSTNAME%%-*}/juhpc_setup # HPC setup installation environment variables must be expanded during installation.
31+
JULIAUP_INSTALLDIR="\$SCRATCH/\${HOSTNAME%%-*}/juliaup" # User environment variables SCRATCH and HOSTNAME must not be expanded during uenv build, but during usage. Separate installation by HOSTNAME is required, because different hosts with different architectures can share the same file system (e.g., daint and eiger on ALPS).
32+
bash -l ./juhpc $JUHPC_SETUP_INSTALLDIR $JULIAUP_INSTALLDIR # NOTE: The juhpc script must be in the current directory.
33+
34+
35+
# Activate the HPC setup environment variables
36+
. $JUHPC_SETUP_INSTALLDIR/activate
37+
38+
# Call juliaup to install juliaup and latest julia on scratch
39+
juliaup
40+
41+
# Call juliaup to see its options
42+
juliaup
43+
44+
# Call julia Pkg
45+
julia -e 'using Pkg; Pkg.status()'
46+
47+
# Add CUDA.jl
48+
julia -e 'using Pkg; Pkg.add("CUDA"); using CUDA; CUDA.versioninfo()'
49+
50+
# Add MPI.jl
51+
julia -e 'using Pkg; Pkg.add("MPI"); using MPI; MPI.versioninfo()'
52+
53+
# Add HDF5.jl
54+
julia -e 'using Pkg; Pkg.add("HDF5"); using HDF5; @show HDF5.has_parallel()'
55+
56+
# Test CUDA-aware MPI
57+
cd ~/cudaaware
58+
MPICH_GPU_SUPPORT_ENABLED=1 srun -Acsstaff -C'gpu' -N2 -n2 julia cudaaware.jl
59+
60+
# julia -e 'import Pkg; Pkg.test("MPI"; test_args=["--backend=CUDA"])'

0 commit comments

Comments
 (0)