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

Test MPI in the container #13

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
27 changes: 27 additions & 0 deletions ci/templates/test_image.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,30 @@ test_job_test_image_gromacs-{{os}}{{osver}}-spack{{spackver}}-{{archstr[arch]}}:
{% if arch == "rocm" -%}
- echo "TODO Lets ignore ROCm for now"
{%- endif %}

##### mpi-osu_bw

build_job_test_image_mpi-osu_bw-{{os}}{{osver}}-spack{{spackver}}-{{archstr[arch]}}:
stage: build_test_image
extends:
- {{container_builder[arch]}}
variables:
DOCKERFILE: "test/Dockerfile.mpi-osu_bw"
PERSIST_IMAGE_NAME: "{{registry_path}}/test-mpi-osu_bw:spack{{spackver}}-{{os}}{{osver}}-{{archstr[arch]}}"
DOCKER_BUILD_ARGS: '["BUILDIMG={{registry_build_image_name_tag}}", "RUNTIMEIMG={{registry_runtime_image_name_tag}}", "TARGET={{spack_target}}"]'

test_job_test_image_mpi-osu_bw-{{os}}{{osver}}-spack{{spackver}}-{{archstr[arch]}}:
stage: test_test_image
extends:
- {{container_runner[arch]}}
image: "{{registry_path}}/test-mpi-osu_bw:spack{{spackver}}-{{os}}{{osver}}-{{archstr[arch]}}"
script:
- osu_bw | tee osu_bw-out.txt
- SIZE=4194304
- BW_THRESHOLD=20000
- BW=$(awk "/^$SIZE/ {print \$2}" osu_bw-out.txt)
- RES=$(bc <<< "$BW > $BW_THRESHOLD")
rjanalik marked this conversation as resolved.
Show resolved Hide resolved
- test $RES -eq 1 # bc: true 1 false 0, bash: true 0 false 1
variables:
SLURM_JOB_NUM_NODES: 2
SLURM_NTASKS: 2
rjanalik marked this conversation as resolved.
Show resolved Hide resolved
30 changes: 30 additions & 0 deletions test/Dockerfile.mpi-osu_bw
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG BUILDIMG
FROM $BUILDIMG as builder

RUN apt-get update \
&& env DEBIAN_FRONTEND=noninteractive TZ=Europe/Zurich apt-get -yqq install --no-install-recommends build-essential

# Fix error in ./configure: cannot link with -lcuda
RUN (test -f /usr/local/cuda/lib64/stubs/libcuda.so && ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/libcuda.so) || true

ARG TARGET
RUN spack-install-helper \
"$TARGET" \
osu-micro-benchmarks \
bc


# copy only relevant parts to the final container
ARG RUNTIMEIMG
FROM $RUNTIMEIMG

# it is important to keep the paths, otherwise your installation is broken
# all these paths are created with the above `spack-install-helper` invocation
COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software
COPY --from=builder /opt/._view /opt/._view
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh

# Some boilerplate to get all paths correctly - fix_spack_install is part of the base image
# and makes sure that all important things are being correctly setup
RUN fix_spack_install