Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add julia with cuda 12.6, spack 0.23 #184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ uenvs:
zen3: "24.9/mc"
gh200: "24.9/gh200"
develop: False
"25.1":
recipes:
zen2: "24.9/mc"
zen3: "24.9/mc"
gh200: "24.9/gh200"
develop: False
lammps:
"2023":
recipes:
Expand Down
5 changes: 5 additions & 0 deletions recipes/julia/25.1/gh200/compilers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bootstrap:
spec: [email protected]
gcc:
specs:
- [email protected]
7 changes: 7 additions & 0 deletions recipes/julia/25.1/gh200/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: julia
spack:
commit: releases/v0.23
repo: https://github.com/spack/spack.git
store: /user-environment
description: HPC setup for juliaup, julia and some HPC key packages (MPI.jl, CUDA.jl, AMDGPU.jl, HDF5.jl, ADIOS2.jl, ...) + GNU Compiler toolchain with cray-mpich, HDF5, ADIOS2, Python, CMake and other development tools.

42 changes: 42 additions & 0 deletions recipes/julia/25.1/gh200/environments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
gcc-env:
compiler:
- toolchain: gcc
spec: gcc
mpi:
spec: [email protected]
gpu: cuda
unify: true
specs:
- aws-ofi-nccl@master
- cmake
- [email protected]
- fftw
- fmt
- hdf5+hl
- libtree
- meson
- nccl
- nccl-tests
- ninja
- openblas threads=openmp
- [email protected]
- python
- bzip2
- zfp
- sz
- libpng
- c-blosc2
- libpressio
- mgard
- libcatalyst
- [email protected]+hdf5+python+fortran+sst+pic+shared+bzip2+zfp+sz+png+blosc2+libpressio+mgard+libcatalyst
variants:
- +mpi
- +cuda
- cuda_arch=90
views:
default:
link: roots
uenv:
prefix_paths:
LD_LIBRARY_PATH: [lib, lib64]
11 changes: 11 additions & 0 deletions recipes/julia/25.1/gh200/extra/reframe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
default:
features:
- cuda
- mpi
- osu-micro-benchmarks
- openmp
- serial
cc: mpicc
cxx: mpic++
ftn: mpifort
activation: /user-environment/env/default/activate.sh
78 changes: 78 additions & 0 deletions recipes/julia/25.1/gh200/extra/uenv_view.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Author: Samuel Omlin, CSCS (omlins)
#
# Description: Creation of an uenv view equivalent to the activation script in JUHPC.


using Pkg; Pkg.add("JSON")
using JSON


# Check if the required environment variables are set

function check_env(vars...)
for var in vars
if !haskey(ENV, var)
error("uenv-view: $var is not set.")
elseif isempty(ENV[var])
error("uenv-view: $var is empty.")
end
end
end

check_env("JULIAUP_WRAPPER_BINDIR", "JULIAUP_BINDIR", "JULIAUP_DEPOT", "JULIA_DEPOT", "JULIA_PREFDIR", "JULIAUP_INSTALLDIR", "ENV_JSON")


# Define the environment variables part of the julia view

julia_view_env = Dict(
"values" => Dict(
"list" => Dict(
"PATH" => [
Dict(
"value" => [ENV["JULIAUP_WRAPPER_BINDIR"], ENV["JULIAUP_BINDIR"]], # The wrapper must be before the juliaup bindir
"op" => "prepend",
),
],
),
"scalar" => Dict(
"JULIAUP_DEPOT_PATH" => ENV["JULIAUP_DEPOT"],
"JULIA_DEPOT_PATH" => ENV["JULIA_DEPOT"],
"JULIA_LOAD_PATH" => ":$(ENV["JULIA_PREFDIR"])", # ":" means appending!
[key => ENV[env_key] for (key, env_key) in
[("CUDA_HOME", "JUHPC_CUDA_HOME"),
("ROCM_PATH", "JUHPC_ROCM_HOME"),
("JULIA_ADIOS2_PATH", "JUHPC_ADIOS2_HOME")]
if haskey(ENV, env_key) && !isempty(ENV[env_key])]..., # Conditional inclusion for variables if they are set and not empty
[("JULIA_CUDA_MEMORY_POOL" => "none") for env_key in ["JUHPC_CUDA_HOME"] if haskey(ENV, env_key) && !isempty(ENV[env_key])]... # Conditionally include JULIA_CUDA_MEMORY_POOL
)
),
"version" => 1
)


# Define the julia view

julia_view = Dict(
"julia" => Dict(
"root" => "/user-environment/env/julia",
"env" => julia_view_env,
"activate" => "/dev/null",
"description" => "description: HPC setup for juliaup, julia and some HPC key packages (juliaup and julia are installed on first execution of juliaup in $(ENV["JULIAUP_INSTALLDIR"]))",
"type" => "augment"
)
)


# Merge the julia view with the existing views in the JSON file

env = JSON.parsefile(ENV["ENV_JSON"])
views = env["views"]
views = merge(views, julia_view)
env["views"] = views
open(ENV["ENV_JSON"],"w") do f
JSON.print(f, env, 4)
end


# Remove the added package
Pkg.rm("JSON")
23 changes: 23 additions & 0 deletions recipes/julia/25.1/gh200/modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
modules:
# Paths to check when creating modules for all module sets
prefix_inspections:
bin:
- PATH
lib:
- LD_LIBRARY_PATH
lib64:
- LD_LIBRARY_PATH

default:
arch_folder: false
# Where to install modules
roots:
tcl: /user-environment/modules
tcl:
all:
autoload: none
hash_length: 0
exclude_implicits: true
exclude: ['%[email protected]', 'gcc %[email protected]']
projections:
all: '{name}/{version}'
33 changes: 33 additions & 0 deletions recipes/julia/25.1/gh200/post-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Author: Samuel Omlin, CSCS (omlins)
#
# Description: Definition of site specific variables and call of JUHPC.
# Site: ALPS:todi, Swiss National Supercomputing Centre (CSCS)
# Base: uenv


# UENV specific environment variables
export ENV_MOUNT={{ env.mount }} # export ENV_MOUNT=/user-environment
export ENV_META=$ENV_MOUNT/meta
export ENV_EXTRA=$ENV_META/extra
export ENV_JSON=$ENV_META/env.json


# Environment variables for HPC key packages that require system libraries (MPI.jl, CUDA.jl, AMDGPU.jl, HDF5.jl and ADIOS2.jl)
export JUHPC_CUDA_HOME=$(spack -C $ENV_MOUNT/config location -i cuda)
export JUHPC_CUDA_RUNTIME_VERSION=$(spack --color=never -C $ENV_MOUNT/config find cuda | \
perl -ne 'print $1 if /cuda@([\d.]+)/')
export JUHPC_MPI_HOME=$(spack -C $ENV_MOUNT/config location -i cray-mpich)
export JUHPC_MPI_EXEC="srun -C gpu"
export JUHPC_HDF5_HOME=$(spack -C $ENV_MOUNT/config location -i hdf5)
export JUHPC_ADIOS2_HOME=$(spack -C $ENV_MOUNT/config location -i adios2)


# Call JUHPC
JUHPC_SETUP_INSTALLDIR=$ENV_MOUNT/juhpc_setup
JULIAUP_INSTALLDIR="\$SCRATCH/\${HOSTNAME%%-*}/juliaup"
JUHPC_POST_INSTALL_JL=$ENV_EXTRA/uenv_view.jl
VERSION="v0.2.0"
wget https://raw.githubusercontent.com/JuliaParallel/JUHPC/$VERSION/juhpc -O /tmp/juhpc
bash -l /tmp/juhpc $JUHPC_SETUP_INSTALLDIR $JULIAUP_INSTALLDIR $JUHPC_POST_INSTALL_JL