diff --git a/ci/templates/test_image.yml.j2 b/ci/templates/test_image.yml.j2 index 6667dd1..4df2461 100644 --- a/ci/templates/test_image.yml.j2 +++ b/ci/templates/test_image.yml.j2 @@ -45,3 +45,31 @@ 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: + - hostname + - 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") # use bc because bash cannot compare floating poing numbers + - test $RES -eq 1 # bc: true 1 false 0, bash: true 0 false 1 + variables: + SLURM_JOB_NUM_NODES: 2 + SLURM_NTASKS: 2 diff --git a/test/Dockerfile.mpi-osu_bw b/test/Dockerfile.mpi-osu_bw new file mode 100644 index 0000000..0345659 --- /dev/null +++ b/test/Dockerfile.mpi-osu_bw @@ -0,0 +1,35 @@ +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 TARGET=/usr/local/cuda/lib64/stubs/libcuda.so; \ + LINK_NAME=/usr/local/cuda/lib64/libcuda.so; \ + if test -f $TARGET && test ! -f $LINK_NAME; \ + then \ + ln -s $TARGET $LINK_NAME; \ + fi + +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