From fe5cbd47ca42412ed3798591e21e78257fbb843b Mon Sep 17 00:00:00 2001 From: Daniel Howard Date: Tue, 25 Feb 2025 14:25:54 -0700 Subject: [PATCH 1/2] Add NSF NCAR example --- examples/ncar/derecho/ncar_derecho_config | 25 ++++++++++++++ .../ncar/derecho/test_ncar_derecho_config | 33 +++++++++++++++++++ juhpc | 6 ++-- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100755 examples/ncar/derecho/ncar_derecho_config create mode 100755 examples/ncar/derecho/test_ncar_derecho_config mode change 100644 => 100755 juhpc diff --git a/examples/ncar/derecho/ncar_derecho_config b/examples/ncar/derecho/ncar_derecho_config new file mode 100755 index 0000000..b02e607 --- /dev/null +++ b/examples/ncar/derecho/ncar_derecho_config @@ -0,0 +1,25 @@ +#!/bin/bash + +# Author: Daniel Howard, NSF NCAR (dhoward) + +# Load required modules (including correct CPU and GPU target modules) +ml ncarenv/24.12 +ml reset +ml gcc/12.4.0 +ml cuda/12.3.2 +ml swap hdf5 hdf5-mpi/1.12.3 +module list + +# 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) +export JUHPC_CUDA_HOME=$CUDA_HOME +export JUHPC_CUDA_RUNTIME_VERSION=$CRAY_CUDATOOLKIT_VERSION +export JUHPC_MPI_VENDOR="cray" +export JUHPC_MPI_EXEC="mpiexec" +export JUHPC_HDF5_HOME=$NCAR_ROOT_HDF5 + +# Call JUHPC +JUHPC_SETUP_INSTALLDIR=/glade/u/apps/opt/julia/$NCAR_HOST/juhpc_setup +JULIAUP_INSTALLDIR="/glade/work/\$USER/julia/\$NCAR_HOST/juliaup" +VERSION="v0.3.0" +#wget https://raw.githubusercontent.com/JuliaParallel/JUHPC/$VERSION/juhpc -O ./juhpc +./juhpc $JUHPC_SETUP_INSTALLDIR $JULIAUP_INSTALLDIR --verbose=2 | tee juhpc_install.log diff --git a/examples/ncar/derecho/test_ncar_derecho_config b/examples/ncar/derecho/test_ncar_derecho_config new file mode 100755 index 0000000..f08550f --- /dev/null +++ b/examples/ncar/derecho/test_ncar_derecho_config @@ -0,0 +1,33 @@ +#!/bin/bash + +# Load required modules (including correct CPU and GPU target modules) +ml ncarenv/24.12 +ml reset +ml gcc/12.4.0 +ml cuda/12.3.2 +ml swap hdf5 hdf5-mpi/1.12.3 +module list + +# Call JUHPC +JUHPC_SETUP_INSTALLDIR=/glade/u/apps/opt/julia/$NCAR_HOST/juhpc_setup + +# Activate the HPC setup environment variables +. $JUHPC_SETUP_INSTALLDIR/activate + +# Call juliaup to install juliaup and latest julia on scratch +juliaup + +# Call juliaup to see its options +juliaup + +# Call julia Pkg +julia -e 'using Pkg; Pkg.status()' + +# Add CUDA.jl +julia -e 'using Pkg; Pkg.add("CUDA"); using CUDA; CUDA.versioninfo()' + +# Add MPI.jl +julia -e 'using Pkg; Pkg.add("MPI"); using MPI; MPI.versioninfo()' + +# Add HDF5.jl +julia -e 'using Pkg; Pkg.add("HDF5"); using HDF5; @show HDF5.has_parallel()' diff --git a/juhpc b/juhpc old mode 100644 new mode 100755 index baef703..99f576e --- a/juhpc +++ b/juhpc @@ -143,7 +143,9 @@ fi export JULIAUP_BINDIR="$JULIAUP_INSTALLDIR/bin" # juliaup and julia binaries -if [ -d "/dev/shm" ]; then +if [ ! -z "$NCAR_HOST"]; then + export TMP="$SCRATCH/tmp" +elif [ -d "/dev/shm" ]; then export TMP="/dev/shm/$USER" elif [ -d "/tmp" ]; then export TMP="/tmp/$USER" @@ -356,4 +358,4 @@ cleanup mv "$JULIA_PREFDIR/Manifest.toml" "$JULIA_PREFDIR/Manifest.toml.bak" || { error "failed to move Manifest.toml in $JULIA_PREFDIR"; } mv "$JUHPC_SETUP_INSTALLLOG" "$JUHPC_SETUP_INSTALLDIR/" || { error "failed to move $JUHPC_SETUP_INSTALLLOG to $JUHPC_SETUP_INSTALLDIR"; } -info "... The installation of the HPC setup for juliaup, julia and HPC key packages is complete.\n\n" \ No newline at end of file +info "... The installation of the HPC setup for juliaup, julia and HPC key packages is complete.\n\n" From ff9247f28b2b4b199a6445331086ec1839ab1e3d Mon Sep 17 00:00:00 2001 From: Daniel Howard Date: Tue, 25 Feb 2025 15:08:44 -0700 Subject: [PATCH 2/2] Add default /glade/u/home/dhoward/.julia path for backwards copatibility. --- juhpc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/juhpc b/juhpc index 99f576e..832c4cc 100755 --- a/juhpc +++ b/juhpc @@ -303,7 +303,8 @@ info "... done: wrapper created." info "Creating activate script..." export JULIAUP_DEPOT="$JULIAUP_INSTALLDIR/depot" -export JULIA_DEPOT="$JULIAUP_INSTALLDIR/depot" +# Added default $HOME/.julia path for backwards compatibility with exisitng Julia user installs +export JULIA_DEPOT="$JULIAUP_INSTALLDIR/depot:$HOME/.julia" export ACTIVATE_SCRIPT="$JUHPC_SETUP_INSTALLDIR/activate" julia -e 'println("""