Skip to content

Commit 4a7bbdf

Browse files
omlinssimonpintarellibcumming
authored
Add Julia 25.5 mc (#222)
* update CUDA to 12.8 * fix variable expansion and add jupyter view * introduce installation by UARCH --------- Co-authored-by: Simon Pintarelli <[email protected]> Co-authored-by: bcumming <[email protected]>
1 parent 117c194 commit 4a7bbdf

File tree

8 files changed

+239
-1
lines changed

8 files changed

+239
-1
lines changed

recipes/julia/25.5/gh200/post-install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export JUHPC_ADIOS2_HOME=$(spack -C $ENV_MOUNT/config location -i adios2)
2727
# Call JUHPC
2828
JUHPC_SETUP_INSTALLDIR=$ENV_MOUNT/juhpc_setup
2929
UARCH=gh200
30-
JULIAUP_INSTALLDIR="\${SCRATCH}/$UARCH/juliaup"
30+
JULIAUP_INSTALLDIR="\${SCRATCH}/.julia/$UARCH/juliaup"
3131
JUHPC_POST_INSTALL_JL=$ENV_EXTRA/uenv_view.jl # This will convert environment variables of the form ${...} to ${@...@} as required by uenv
3232
VERSION="v0.4.0"
3333
wget https://raw.githubusercontent.com/JuliaParallel/JUHPC/$VERSION/juhpc -O /tmp/juhpc

recipes/julia/25.5/mc/compilers.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bootstrap:
2+
3+
gcc:
4+
specs:
5+

recipes/julia/25.5/mc/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: julia
2+
spack:
3+
commit: releases/v0.23
4+
repo: https://github.com/spack/spack.git
5+
store: /user-environment
6+
description: HPC setup for Juliaup, Julia and some HPC key packages (MPI.jl, HDF5.jl, ADIOS2.jl, ...) + GNU Compiler toolchain with cray-mpich, HDF5, ADIOS2, Python, CMake and other development tools.
7+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
gcc-env:
2+
compiler:
3+
- toolchain: gcc
4+
spec: gcc@13
5+
mpi:
6+
7+
gpu: Null
8+
unify: true
9+
specs:
10+
11+
- fftw
12+
- fmt
13+
- hdf5+hl
14+
- libtree
15+
- meson
16+
- ninja
17+
- openblas threads=openmp
18+
19+
- python
20+
- bzip2
21+
- zfp
22+
- sz
23+
- libpng
24+
- c-blosc2
25+
26+
- mgard
27+
- libcatalyst
28+
- [email protected]+hdf5+python+fortran
29+
- '[email protected]+hdf5+python+fortran+sst+pic+shared+bzip2+zfp+sz+png+blosc2+mgard+libcatalyst'
30+
# disable libpressio because it causes compilation errors when building adios2
31+
#- '[email protected]+hdf5+python+fortran+sst+pic+shared+bzip2+zfp+sz+png+blosc2+libpressio+mgard+libcatalyst'
32+
variants:
33+
- +mpi
34+
views:
35+
default:
36+
link: roots
37+
uenv:
38+
prefix_paths:
39+
LD_LIBRARY_PATH: [lib, lib64]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
default:
2+
features:
3+
- mpi
4+
- osu-micro-benchmarks
5+
- openmp
6+
- serial
7+
cc: mpicc
8+
cxx: mpic++
9+
ftn: mpifort
10+
activation: /user-environment/env/default/activate.sh
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Author: Samuel Omlin, CSCS (omlins)
2+
#
3+
# Description: Creation of an uenv view equivalent to the activation script in JUHPC.
4+
5+
6+
using Pkg; Pkg.add("JSON")
7+
using JSON
8+
9+
10+
# Functions
11+
12+
function check_env(vars...)
13+
for var in vars
14+
if !haskey(ENV, var)
15+
error("uenv-view: $var is not set.")
16+
elseif isempty(ENV[var])
17+
error("uenv-view: $var is empty.")
18+
end
19+
end
20+
end
21+
22+
function uenv_env(key::AbstractString)
23+
s = ENV[key]
24+
pattern = r"\$\{(.*?)\}"
25+
for m in eachmatch(pattern, s)
26+
s = replace(s, m.match => "\${@" * m.captures[1] * "@}")
27+
end
28+
return s
29+
end
30+
31+
32+
# Check if the required environment variables are set and not empty
33+
34+
check_env("JULIA_WRAPPER_BINDIR", "JULIAUP_WRAPPER_BINDIR", "JULIAUP_BINDIR", "JULIAUP_DEPOT", "JULIA_DEPOT", "JULIA_PREFDIR", "JULIAUP_INSTALLDIR", "ENV_JSON")
35+
36+
37+
# Define the environment variables part of the juliaup view
38+
39+
juliaup_view_env = Dict(
40+
"values" => Dict(
41+
"list" => Dict(
42+
"PATH" => [
43+
Dict(
44+
"value" => [uenv_env("JULIAUP_WRAPPER_BINDIR"), uenv_env("JULIAUP_BINDIR")], # The wrapper must be before the juliaup bindir
45+
"op" => "prepend",
46+
),
47+
],
48+
),
49+
"scalar" => Dict(
50+
"JULIAUP_DEPOT_PATH" => uenv_env("JULIAUP_DEPOT"),
51+
"JULIA_DEPOT_PATH" => uenv_env("JULIA_DEPOT"),
52+
"JULIA_LOAD_PATH" => ":$(uenv_env("JULIA_PREFDIR"))", # ":" means appending!
53+
[key => uenv_env(env_key) for (key, env_key) in
54+
[("CUDA_HOME", "JUHPC_CUDA_HOME"),
55+
("ROCM_PATH", "JUHPC_ROCM_HOME"),
56+
("JULIA_ADIOS2_PATH", "JUHPC_ADIOS2_HOME")]
57+
if haskey(ENV, env_key) && !isempty(uenv_env(env_key))]..., # Conditional inclusion for variables if they are set and not empty
58+
[("JULIA_CUDA_MEMORY_POOL" => "none") for env_key in ["JUHPC_CUDA_HOME"] if haskey(ENV, env_key) && !isempty(uenv_env(env_key))]... # Conditionally include JULIA_CUDA_MEMORY_POOL
59+
)
60+
),
61+
"version" => 1
62+
)
63+
64+
65+
# Define the environment variables part of the jupyter view
66+
67+
jupyter_view_env = deepcopy(juliaup_view_env)
68+
jupyter_view_env["values"]["list"]["PATH"] = [
69+
Dict(
70+
"value" => [uenv_env("IJULIA_INSTALLER_BINDIR"), uenv_env("JULIA_WRAPPER_BINDIR"), uenv_env("JULIAUP_WRAPPER_BINDIR"), uenv_env("JULIAUP_BINDIR")], # The wrappers must be before the juliaup bindir
71+
"op" => "prepend",
72+
),
73+
]
74+
75+
76+
# Define the juliaup view
77+
78+
juliaup_view = Dict(
79+
"juliaup" => Dict(
80+
"root" => "/user-environment/env/juliaup",
81+
"env" => juliaup_view_env,
82+
"activate" => "/dev/null",
83+
"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"]))",
84+
"type" => "augment"
85+
)
86+
)
87+
88+
89+
# Define the jupyter view
90+
jupyter_view = Dict(
91+
"jupyter" => Dict(
92+
"root" => "/user-environment/env/jupyter",
93+
"env" => jupyter_view_env,
94+
"activate" => "/dev/null",
95+
"description" => "description: HPC setup for Julia in Jupyter: IJulia can be installed from a Jupyter terminal by typing `install_ijulia`. The setup includes furthermore Juliaup, Julia and some HPC key packages (if not present, Juliaup and Julia are installed on first execution of `install_ijulia`/`julia`/`juliaup` in $(ENV["JULIAUP_INSTALLDIR"]))",
96+
"type" => "augment"
97+
)
98+
)
99+
100+
101+
# Merge the juliaup view with the existing views in the JSON file
102+
103+
env = JSON.parsefile(ENV["ENV_JSON"])
104+
views = env["views"]
105+
views = merge(views, juliaup_view)
106+
views = merge(views, jupyter_view)
107+
env["views"] = views
108+
open(ENV["ENV_JSON"],"w") do f
109+
JSON.print(f, env, 4)
110+
end
111+
112+
113+
# Print the new views to the console
114+
@info "New views:"
115+
@info "Juliaup view:"
116+
JSON.print(stdout, juliaup_view, 4)
117+
@info "Jupyter view:"
118+
JSON.print(stdout, jupyter_view, 4)
119+
120+
121+
# Remove the added package
122+
Pkg.rm("JSON")

recipes/julia/25.5/mc/modules.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
modules:
2+
# Paths to check when creating modules for all module sets
3+
prefix_inspections:
4+
bin:
5+
- PATH
6+
lib:
7+
- LD_LIBRARY_PATH
8+
lib64:
9+
- LD_LIBRARY_PATH
10+
11+
default:
12+
arch_folder: false
13+
# Where to install modules
14+
roots:
15+
tcl: /user-environment/modules
16+
tcl:
17+
all:
18+
autoload: run
19+
hash_length: 0
20+
exclude_implicits: true
21+
hide_implicits: true
22+
exclude: ['%[email protected]', 'gcc %[email protected]']
23+
projections:
24+
all: '{name}/{version}'

recipes/julia/25.5/mc/post-install

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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:eiger, Swiss National Supercomputing Centre (CSCS)
7+
# Base: uenv
8+
9+
10+
# UENV specific environment variables
11+
export ENV_MOUNT={{ env.mount }} # export ENV_MOUNT=/user-environment
12+
export ENV_META=$ENV_MOUNT/meta
13+
export ENV_EXTRA=$ENV_META/extra
14+
export ENV_JSON=$ENV_META/env.json
15+
16+
17+
# Environment variables for HPC key packages that require system libraries (MPI.jl, CUDA.jl, AMDGPU.jl, HDF5.jl and ADIOS2.jl)
18+
export JUHPC_MPI_HOME=$(spack -C $ENV_MOUNT/config location -i cray-mpich)
19+
export JUHPC_MPI_EXEC="srun"
20+
export JUHPC_HDF5_HOME=$(spack -C $ENV_MOUNT/config location -i hdf5)
21+
export JUHPC_ADIOS2_HOME=$(spack -C $ENV_MOUNT/config location -i adios2)
22+
23+
24+
# Call JUHPC
25+
JUHPC_SETUP_INSTALLDIR=$ENV_MOUNT/juhpc_setup
26+
UARCH=mc
27+
JULIAUP_INSTALLDIR="\${SCRATCH}/.julia/$UARCH/juliaup"
28+
JUHPC_POST_INSTALL_JL=$ENV_EXTRA/uenv_view.jl # This will convert environment variables of the form ${...} to ${@...@} as required by uenv
29+
VERSION="v0.4.0"
30+
wget https://raw.githubusercontent.com/JuliaParallel/JUHPC/$VERSION/juhpc -O /tmp/juhpc
31+
bash -l /tmp/juhpc $JUHPC_SETUP_INSTALLDIR $JULIAUP_INSTALLDIR --postinstall=$JUHPC_POST_INSTALL_JL --verbose=1

0 commit comments

Comments
 (0)