You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -60,25 +60,28 @@ Details are given in the following two subsections.
60
60
-`JUHPC_ADIOS2_HOME`: Activates HPC setup for ADIOS2 and is used to set ADIOS2.jl preferences.
61
61
62
62
> [!NOTE]
63
-
> The automatically defined preferences suitable for typical HPC needs can be modified with a post install Julia script (see `JUHPC_POST_INSTALL_JL` in next section). Also preferences for other packages could be added this way if needed. Of course, any of these preferences can later be overwritten by local preferences.
63
+
> The automatically defined preferences suitable for typical HPC needs can be modified with a post install Julia script (see keyword argument `--postinstall` in next section). Also preferences for other packages could be added this way if needed. Of course, any of these preferences can later be overwritten by local preferences.
I.e., it takes the following positional arguments:
72
72
-`JUHPC_SETUP_INSTALLDIR`: the folder into which the HPC setup is installed, e.g., `"$SCRATCH/../julia/${HOSTNAME%%-*}/juhpc_setup"`.
73
73
-`JULIAUP_INSTALLDIR`: the folder into which Juliaup and Julia will automatically be installed the first time the end user calls `juliaup`. *User environment variables should be escaped* in order not to have them expanded during HPC setup installation, but during its usage by the end user, e.g., `"\$SCRATCH/../julia/\$USER/\${HOSTNAME%%-*}/juliaup"`.
74
-
-`JUHPC_POST_INSTALL_JL` (optional): site-specific post installation Julia script, using the project where preferences were set (e.g, to modify preferences or to create an uenv view equivalent to the activation script).
75
74
76
75
> [!NOTE]
77
76
> The above examples assume that `$SCRATCH/../julia` is a wipe out protected folder on scratch.
78
77
79
78
> [!IMPORTANT]
80
79
> Separate installation by `HOSTNAME` is required if different hosts with different architectures share the file system used for installation (e.g., daint and eiger on ALPS).
81
80
81
+
Furthermore, it supports the following keyword argument:
82
+
-`--postinstall=<julia-script>`: site-specific post installation Julia script, using the project where preferences were set (e.g, to modify preferences or to create an uenv view equivalent to the activation script).
83
+
-`--verbose=<value>`: verbosity of the output during the HPC setup installation: if set to `1`, the generated HPC package preferences and environment variables are printed; if set to `2`, all the output of all commands is printed in addition for debugging purposes (default verbosity is `0`). No matter which verbosity level is set, all output is written in to a log file (`"$JUHPC_SETUP_INSTALLDIR/hpc_setup_install.log"`).
84
+
82
85
83
86
## Examples: HPC setup installations on the ALPS supercomputer (CSCS)
# Description: Definition of site specific variables and call of JUHPC.
6
+
# Site: Piz Daint:gpu, Swiss National Supercomputing Centre (CSCS)
7
+
# Base: craype (not using CUDA-aware MPI because system CUDA is outdated as daint is to be decommissioned soon)
8
+
9
+
10
+
# Load required modules, including correct CPU and GPU target modules (NOTE: the same modules should be loaded when running julia - JUHPC can be used in a module build recipe...)
11
+
module load daint-gpu
12
+
module switch PrgEnv-cray PrgEnv-gnu
13
+
module load cray-hdf5-parallel
14
+
module list
15
+
16
+
17
+
# Environment variables for HPC key packages that require system libraries that require system libraries (MPI.jl, CUDA.jl, AMDGPU.jl, HDF5.jl and ADIOS2.jl)
# Load required modules, including correct CPU and GPU target modules (NOTE: the same modules should be loaded when running julia - JUHPC can be used in a module build recipe...)
7
+
module load daint-gpu
8
+
module switch PrgEnv-cray PrgEnv-gnu
9
+
module load cudatoolkit/11.2.0_3.39-2.1__gf93aa1c craype-accel-nvidia60 # Load latest available cudatoolkit
10
+
module load cray-hdf5-parallel
11
+
module list
12
+
13
+
# Activate the HPC setup environment variables
14
+
.$JUHPC_SETUP_INSTALLDIR/activate
15
+
16
+
# Call juliaup to install juliaup and latest julia on scratch
17
+
juliaup
18
+
19
+
# Call juliaup to see its options
20
+
juliaup
21
+
22
+
# Call julia Pkg
23
+
julia -e 'using Pkg; Pkg.status()'
24
+
25
+
# Add CUDA.jl
26
+
julia -e 'using Pkg; Pkg.add("CUDA"); using CUDA; CUDA.versioninfo()'
27
+
28
+
# Add MPI.jl
29
+
julia -e 'using Pkg; Pkg.add("MPI"); using MPI; MPI.versioninfo()'
30
+
31
+
# Add HDF5.jl
32
+
julia -e 'using Pkg; Pkg.add("HDF5"); using HDF5; @show HDF5.has_parallel()'
# - optionally executing a site-specific post installation julia script, using the project where preferences were set (e.g, to modify preferences or to create an uenv view equivalent to the activation script).
9
9
10
10
11
-
# Define info, error, cleanup and check functions
11
+
# Define log, info, error, cleanup, check functions and julia call for setting preferences
12
+
13
+
export JUHPC_SETUP_INSTALLLOG="./hpc_setup_install.log"# must be defined at the very beginning
if [[ -n"${JUHPC_CUDA_HOME}"||-n"${JUHPC_ROCM_HOME}" ]];then
122
-
julia --project="$JULIA_PREFDIR" -e 'using Pkg; Pkg.add("Preferences")'
198
+
julia_pref 'using Pkg; Pkg.add("Preferences")' 30
123
199
echo"[extras]">>"$JULIA_PREF_PROJECT"
124
200
fi
125
201
126
202
if [ -n"${JUHPC_CUDA_HOME}" ];then# Set preference for using the local CUDA runtime before any installation of CUDA.jl to avoid downloading of artifacts
if [ -n"${JUHPC_ROCM_HOME}" ];then# Set preference for using the local ROCm runtime before any installation of AMDGPU.jl to avoid downloading of artifacts
if [ -n"${JUHPC_CUDA_HOME}" ];thenexport CUDA_HOME="$JUHPC_CUDA_HOME";fi
142
218
if [ -n"${JUHPC_ROCM_HOME}" ];thenexport ROCM_PATH="$JUHPC_ROCM_HOME";fi
143
219
144
-
julia --project="$JULIA_PREFDIR" -e 'using Pkg; Pkg.add([p for (p,l) in [("MPIPreferences", "JUHPC_MPI_VENDOR"), ("MPIPreferences", "JUHPC_MPI_HOME"), ("CUDA", "JUHPC_CUDA_HOME"), ("AMDGPU", "JUHPC_ROCM_HOME"), ("HDF5", "JUHPC_HDF5_HOME")] if haskey(ENV,l) && ENV[l]!=""])'
220
+
julia_pref 'using Pkg; Pkg.add([p for (p,l) in [("MPIPreferences", "JUHPC_MPI_VENDOR"), ("MPIPreferences", "JUHPC_MPI_HOME"), ("CUDA", "JUHPC_CUDA_HOME"), ("AMDGPU", "JUHPC_ROCM_HOME"), ("HDF5", "JUHPC_HDF5_HOME")] if haskey(ENV,l) && ENV[l]!=""])' 70
145
221
146
222
if [ -n"${JUHPC_CUDA_HOME}" ];then# Set preference for using the local CUDA runtime in a more stable way (in case the previous would not be valid anymore)
147
-
julia --project="$JULIA_PREFDIR" -e 'using CUDA; CUDA.set_runtime_version!((VersionNumber(join(split(ENV[key],".")[1:2],".")) for key in ["JUHPC_CUDA_RUNTIME_VERSION"] if haskey(ENV,key) && ENV[key]!=="")...; local_toolkit=true)'
223
+
julia_pref 'using CUDA; CUDA.set_runtime_version!((VersionNumber(join(split(ENV[key],".")[1:2],".")) for key in ["JUHPC_CUDA_RUNTIME_VERSION"] if haskey(ENV,key) && ENV[key]!=="")...; local_toolkit=true)' 80
148
224
fi
149
225
150
226
if [ -n"${JUHPC_ROCM_HOME}" ];then# Set preference for using the local ROCm runtime in a more stable way (in case the previous would not be valid anymore)
151
-
julia --project="$JULIA_PREFDIR" -e 'using AMDGPU; AMDGPU.ROCmDiscovery.use_artifacts!(false)'
0 commit comments