Skip to content

Commit fe5cbd4

Browse files
committed
Add NSF NCAR example
1 parent e89f067 commit fe5cbd4

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Author: Daniel Howard, NSF NCAR (dhoward)
4+
5+
# Load required modules (including correct CPU and GPU target modules)
6+
ml ncarenv/24.12
7+
ml reset
8+
ml gcc/12.4.0
9+
ml cuda/12.3.2
10+
ml swap hdf5 hdf5-mpi/1.12.3
11+
module list
12+
13+
# 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)
14+
export JUHPC_CUDA_HOME=$CUDA_HOME
15+
export JUHPC_CUDA_RUNTIME_VERSION=$CRAY_CUDATOOLKIT_VERSION
16+
export JUHPC_MPI_VENDOR="cray"
17+
export JUHPC_MPI_EXEC="mpiexec"
18+
export JUHPC_HDF5_HOME=$NCAR_ROOT_HDF5
19+
20+
# Call JUHPC
21+
JUHPC_SETUP_INSTALLDIR=/glade/u/apps/opt/julia/$NCAR_HOST/juhpc_setup
22+
JULIAUP_INSTALLDIR="/glade/work/\$USER/julia/\$NCAR_HOST/juliaup"
23+
VERSION="v0.3.0"
24+
#wget https://raw.githubusercontent.com/JuliaParallel/JUHPC/$VERSION/juhpc -O ./juhpc
25+
./juhpc $JUHPC_SETUP_INSTALLDIR $JULIAUP_INSTALLDIR --verbose=2 | tee juhpc_install.log
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
# Load required modules (including correct CPU and GPU target modules)
4+
ml ncarenv/24.12
5+
ml reset
6+
ml gcc/12.4.0
7+
ml cuda/12.3.2
8+
ml swap hdf5 hdf5-mpi/1.12.3
9+
module list
10+
11+
# Call JUHPC
12+
JUHPC_SETUP_INSTALLDIR=/glade/u/apps/opt/julia/$NCAR_HOST/juhpc_setup
13+
14+
# Activate the HPC setup environment variables
15+
. $JUHPC_SETUP_INSTALLDIR/activate
16+
17+
# Call juliaup to install juliaup and latest julia on scratch
18+
juliaup
19+
20+
# Call juliaup to see its options
21+
juliaup
22+
23+
# Call julia Pkg
24+
julia -e 'using Pkg; Pkg.status()'
25+
26+
# Add CUDA.jl
27+
julia -e 'using Pkg; Pkg.add("CUDA"); using CUDA; CUDA.versioninfo()'
28+
29+
# Add MPI.jl
30+
julia -e 'using Pkg; Pkg.add("MPI"); using MPI; MPI.versioninfo()'
31+
32+
# Add HDF5.jl
33+
julia -e 'using Pkg; Pkg.add("HDF5"); using HDF5; @show HDF5.has_parallel()'

juhpc

100644100755
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ fi
143143

144144
export JULIAUP_BINDIR="$JULIAUP_INSTALLDIR/bin" # juliaup and julia binaries
145145

146-
if [ -d "/dev/shm" ]; then
146+
if [ ! -z "$NCAR_HOST"]; then
147+
export TMP="$SCRATCH/tmp"
148+
elif [ -d "/dev/shm" ]; then
147149
export TMP="/dev/shm/$USER"
148150
elif [ -d "/tmp" ]; then
149151
export TMP="/tmp/$USER"
@@ -356,4 +358,4 @@ cleanup
356358
mv "$JULIA_PREFDIR/Manifest.toml" "$JULIA_PREFDIR/Manifest.toml.bak" || { error "failed to move Manifest.toml in $JULIA_PREFDIR"; }
357359
mv "$JUHPC_SETUP_INSTALLLOG" "$JUHPC_SETUP_INSTALLDIR/" || { error "failed to move $JUHPC_SETUP_INSTALLLOG to $JUHPC_SETUP_INSTALLDIR"; }
358360

359-
info "... The installation of the HPC setup for juliaup, julia and HPC key packages is complete.\n\n"
361+
info "... The installation of the HPC setup for juliaup, julia and HPC key packages is complete.\n\n"

0 commit comments

Comments
 (0)