Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
8 changes: 8 additions & 0 deletions .cscs-ci/container/build.Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG DEPS_IMAGE
FROM $DEPS_IMAGE

COPY . /oomph
WORKDIR /oomph

RUN spack -e ci build-env oomph -- cmake -B build -DOOMPH_WITH_TESTING=ON -DMPIEXEC_EXECUTABLE="" -DMPIEXEC_NUMPROC_FLAG="" -DMPIEXEC_PREFLAGS="" -DMPIEXEC_POSTFLAGS="" && \
spack -e ci build-env oomph -- cmake --build build -j$(nproc)
24 changes: 24 additions & 0 deletions .cscs-ci/container/deps.Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ghcr.io/eth-cscs/alps-images:py26.01-alps3-base

ARG SPACK_SHA=v1.1.1
ARG SPACK_PACKAGES_SHA=bc93746ce936d6653271b6e98f6df6ee28f64e84 # develop on 2026-03-25
ARG SPACK_ENV_FILE

ENV DEBIAN_FRONTEND=noninteractive

RUN mkdir -p /opt/spack && \
curl -Ls "https://api.github.com/repos/spack/spack/tarball/$SPACK_SHA" | tar --strip-components=1 -xz -C /opt/spack

ENV PATH="/opt/spack/bin:$PATH"

RUN mkdir -p /opt/spack-packages && \
curl -Ls "https://api.github.com/repos/spack/spack-packages/tarball/$SPACK_PACKAGES_SHA" | tar --strip-components=1 -xz -C /opt/spack-packages

RUN spack repo remove --scope defaults:base builtin && \
spack repo add --scope site /opt/spack-packages/repos/spack_repo/builtin

COPY $SPACK_ENV_FILE /spack_environment/spack.yaml

RUN spack env create ci /spack_environment/spack.yaml && \
spack -e ci concretize -f && \
spack -e ci install --jobs $(nproc) --fail-fast --only=dependencies
191 changes: 191 additions & 0 deletions .cscs-ci/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
include:
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'

stages:
- build_deps
- build
- test

variables:
# The base image is the py26.01 alps3 image from docs.cscs.ch
BASE_IMAGE: ghcr.io/eth-cscs/alps-images:py26.01-alps3-base
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To do: is there a slimmer version with just the networking libraries? Or is this one anyway ok?

SPACK_SHA: develop
SPACK_PACKAGES_SHA: main
FF_TIMESTAMPS: true

.build_deps_template:
stage: build_deps
timeout: 1 hours
before_script:
- echo $DOCKERHUB_TOKEN | podman login docker.io -u $DOCKERHUB_USERNAME --password-stdin || true
- export DOCKERFILE_SHA=`sha256sum .cscs-ci/container/deps.Containerfile | head -c 16`
- export ENV_FILE_SHA=`sha256sum ${SPACK_ENV_FILE} | head -c 16`
- export CONFIG_TAG=`echo $DOCKERFILE_SHA-$BASE_IMAGE-$SPACK_SHA-$SPACK_PACKAGES_SHA-$ENV_FILE_SHA | sha256sum - | head -c 16`
- export PERSIST_IMAGE_NAME=$CSCS_REGISTRY_PATH/oomph-spack-deps-$BACKEND:$CONFIG_TAG
- echo -e "CONFIG_TAG=$CONFIG_TAG" >> base-${BACKEND}.env
- echo -e "DEPS_IMAGE=$PERSIST_IMAGE_NAME" >> base-${BACKEND}.env
variables:
DOCKERFILE: .cscs-ci/container/deps.Containerfile
DOCKER_BUILD_ARGS: '["SPACK_SHA", "SPACK_PACKAGES_SHA", "SPACK_ENV_FILE"]'
artifacts:
reports:
dotenv: base-${BACKEND}.env

build_deps_nccl:
extends:
- .container-builder-cscs-gh200
- .build_deps_template
variables:
BACKEND: nccl
SPACK_ENV_FILE: .cscs-ci/spack/nccl.yaml

build_deps_mpi:
extends:
- .container-builder-cscs-gh200
- .build_deps_template
variables:
BACKEND: mpi
SPACK_ENV_FILE: .cscs-ci/spack/mpi.yaml

build_deps_ucx:
extends:
- .container-builder-cscs-gh200
- .build_deps_template
variables:
BACKEND: ucx
SPACK_ENV_FILE: .cscs-ci/spack/ucx.yaml

build_deps_libfabric:
extends:
- .container-builder-cscs-gh200
- .build_deps_template
variables:
BACKEND: libfabric
SPACK_ENV_FILE: .cscs-ci/spack/libfabric.yaml

.build_template:
stage: build
extends: .container-builder-cscs-gh200
timeout: 1 hours
before_script:
- echo $DOCKERHUB_TOKEN | podman login docker.io -u $DOCKERHUB_USERNAME --password-stdin || true
- export PERSIST_IMAGE_NAME=$CSCS_REGISTRY_PATH/oomph-build-$BACKEND:$CI_COMMIT_SHA
- echo -e "BUILD_IMAGE=$PERSIST_IMAGE_NAME" >> build-${BACKEND}.env
variables:
DOCKERFILE: .cscs-ci/container/build.Containerfile
DOCKER_BUILD_ARGS: '["DEPS_IMAGE"]'
artifacts:
reports:
dotenv: build-${BACKEND}.env

build_nccl:
extends: .build_template
needs:
- job: build_deps_nccl
artifacts: true
variables:
BACKEND: nccl

build_mpi:
extends: .build_template
needs:
- job: build_deps_mpi
artifacts: true
variables:
BACKEND: mpi

build_ucx:
extends: .build_template
needs:
- job: build_deps_ucx
artifacts: true
variables:
BACKEND: ucx

build_libfabric:
extends: .build_template
needs:
- job: build_deps_libfabric
artifacts: true
variables:
BACKEND: libfabric

.test_serial_template:
stage: test
extends: .container-runner-clariden-gh200
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 1
SLURM_TIMELIMIT: '00:15:00'
SLURM_PARTITION: normal
script:
- ctest --test-dir build -L "serial" --output-on-failure

.test_parallel_template:
stage: test
extends: .container-runner-clariden-gh200
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 4
SLURM_TIMELIMIT: '00:15:00'
SLURM_PARTITION: normal
SLURM_MPI: pmix
MPICH_GPU_SUPPORT_ENABLED: 1
script:
- srun -n 4 ctest --test-dir build -L "parallel-ranks-4" --output-on-failure

test_serial_nccl:
extends: .test_serial_template
needs:
- job: build_nccl
artifacts: true
image: $BUILD_IMAGE

test_parallel_nccl:
extends: .test_parallel_template
needs:
- job: build_nccl
artifacts: true
image: $BUILD_IMAGE

test_serial_mpi:
extends: .test_serial_template
needs:
- job: build_mpi
artifacts: true
image: $BUILD_IMAGE

test_parallel_mpi:
extends: .test_parallel_template
needs:
- job: build_mpi
artifacts: true
image: $BUILD_IMAGE

test_serial_ucx:
extends: .test_serial_template
needs:
- job: build_ucx
artifacts: true
image: $BUILD_IMAGE

test_parallel_ucx:
extends: .test_parallel_template
needs:
- job: build_ucx
artifacts: true
image: $BUILD_IMAGE

test_serial_libfabric:
extends: .test_serial_template
needs:
- job: build_libfabric
artifacts: true
image: $BUILD_IMAGE

test_parallel_libfabric:
extends: .test_parallel_template
needs:
- job: build_libfabric
artifacts: true
image: $BUILD_IMAGE
6 changes: 6 additions & 0 deletions .cscs-ci/spack/libfabric.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spack:
specs:
- oomph backend=libfabric +cuda +python
view: false
concretizer:
unify: true
6 changes: 6 additions & 0 deletions .cscs-ci/spack/mpi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spack:
specs:
- oomph backend=mpi +cuda +python
view: false
concretizer:
unify: true
6 changes: 6 additions & 0 deletions .cscs-ci/spack/nccl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spack:
specs:
- oomph backend=nccl +cuda +python
view: false
concretizer:
unify: true
6 changes: 6 additions & 0 deletions .cscs-ci/spack/ucx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spack:
specs:
- oomph backend=ucx +cuda +python
view: false
concretizer:
unify: true
3 changes: 2 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function(reg_serial_test t)
add_test(
NAME ${t}
COMMAND $<TARGET_FILE:${t}>)
set_tests_properties(${t} PROPERTIES LABELS "serial")
endfunction()

foreach(t ${serial_tests})
Expand All @@ -65,7 +66,7 @@ function(reg_parallel_test t_ lib n)
NAME ${t}
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${n} ${MPIEXEC_PREFLAGS}
$<TARGET_FILE:${t}> ${MPIEXEC_POSTFLAGS})
set_tests_properties(${t} PROPERTIES RUN_SERIAL TRUE)
set_tests_properties(${t} PROPERTIES RUN_SERIAL TRUE LABELS "parallel-ranks-${n}")
endfunction()

if (OOMPH_WITH_MPI)
Expand Down
3 changes: 2 additions & 1 deletion test/bindings/fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function(reg_parallel_test_f t_ lib n nthr)
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${n} ${MPIEXEC_PREFLAGS}
$<TARGET_FILE:${t}> ${MPIEXEC_POSTFLAGS})
set_tests_properties(${t} PROPERTIES
ENVIRONMENT OMP_NUM_THREADS=${nthr})
ENVIRONMENT OMP_NUM_THREADS=${nthr}
LABELS "parallel-ranks-${n}")
endfunction()

if (OOMPH_WITH_MPI)
Expand Down
Loading