diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0bf894fa07c736188dd0ae4ce8276c1fc37e499d..bfaea679161a999b42ef24091de83f19b130ade2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - test_projects - build_mpich_gcc8 - build_openmpi_gcc8 + - build_openmpi_gcc10_vtk9 - build_mpich_gcc9 - build_openmpi_gcc9 - build_mpich_gcc10 @@ -18,7 +19,7 @@ before_script: build-mpich-nofortran-gcc8: stage: build_mpich_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc8-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc8-full tags: - public-docker when: always @@ -28,7 +29,7 @@ build-mpich-nofortran-gcc8: build-mpich-nofortran-gcc9: stage: build_mpich_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc9-full tags: - public-docker when: always @@ -38,7 +39,7 @@ build-mpich-nofortran-gcc9: build-mpich-nofortran-gcc10: stage: build_mpich_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc10-full tags: - public-docker when: always @@ -48,7 +49,7 @@ build-mpich-nofortran-gcc10: build-mpich-fortran-gcc8: stage: build_mpich_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc8-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc8-full tags: - public-docker when: always @@ -58,7 +59,7 @@ build-mpich-fortran-gcc8: build-mpich-fortran-gcc9: stage: build_mpich_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc9-full tags: - public-docker when: always @@ -68,7 +69,7 @@ build-mpich-fortran-gcc9: build-mpich-fortran-gcc10: stage: build_mpich_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc10-full tags: - public-docker when: always @@ -78,7 +79,7 @@ build-mpich-fortran-gcc10: #build-mpich-fortran-f08-gcc8: # stage: build_mpich_gcc8 -# image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc8-full +# image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc8-full # tags: # - public-docker # when: always @@ -88,7 +89,7 @@ build-mpich-fortran-gcc10: build-mpich-fortran-f08-gcc9: stage: build_mpich_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc9-full tags: - public-docker when: always @@ -98,7 +99,7 @@ build-mpich-fortran-f08-gcc9: build-mpich-fortran-f08-gcc10: stage: build_mpich_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc10-full tags: - public-docker when: always @@ -108,7 +109,7 @@ build-mpich-fortran-f08-gcc10: build-mpich-voronoi-gcc8: stage: build_mpich_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc8-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc8-full tags: - public-docker when: always @@ -118,7 +119,7 @@ build-mpich-voronoi-gcc8: build-mpich-voronoi-gcc9: stage: build_mpich_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc9-full tags: - public-docker when: always @@ -128,7 +129,7 @@ build-mpich-voronoi-gcc9: build-mpich-voronoi-gcc10: stage: build_mpich_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc10-full tags: - public-docker when: always @@ -138,7 +139,7 @@ build-mpich-voronoi-gcc10: build-openmpi-nofortran-gcc8: stage: build_openmpi_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc8-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc8-full tags: - public-docker when: always @@ -148,7 +149,7 @@ build-openmpi-nofortran-gcc8: build-openmpi-nofortran-gcc9: stage: build_openmpi_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc9-full tags: - public-docker when: always @@ -158,7 +159,7 @@ build-openmpi-nofortran-gcc9: build-openmpi-nofortran-gcc10: stage: build_openmpi_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full tags: - public-docker when: always @@ -168,7 +169,7 @@ build-openmpi-nofortran-gcc10: build-openmpi-fortran-gcc8: stage: build_openmpi_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc8-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc8-full tags: - public-docker when: always @@ -178,7 +179,7 @@ build-openmpi-fortran-gcc8: build-openmpi-fortran-gcc9: stage: build_openmpi_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc9-full tags: - public-docker when: always @@ -188,7 +189,7 @@ build-openmpi-fortran-gcc9: build-openmpi-fortran-gcc10: stage: build_openmpi_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full tags: - public-docker when: always @@ -198,7 +199,7 @@ build-openmpi-fortran-gcc10: build-openmpi-fortran-f08-gcc8: stage: build_openmpi_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc8-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc8-full tags: - public-docker when: always @@ -208,7 +209,7 @@ build-openmpi-fortran-f08-gcc8: build-openmpi-fortran-f08-gcc9: stage: build_openmpi_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc9-full tags: - public-docker when: always @@ -218,7 +219,7 @@ build-openmpi-fortran-f08-gcc9: build-openmpi-fortran-f08-gcc10: stage: build_openmpi_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full tags: - public-docker when: always @@ -228,7 +229,7 @@ build-openmpi-fortran-f08-gcc10: build-openmpi-voronoi-gcc8: stage: build_openmpi_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc8-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc8-full tags: - public-docker when: always @@ -238,7 +239,7 @@ build-openmpi-voronoi-gcc8: build-openmpi-voronoi-gcc9: stage: build_openmpi_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc9-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc9-full tags: - public-docker when: always @@ -248,7 +249,7 @@ build-openmpi-voronoi-gcc9: build-openmpi-voronoi-gcc10: stage: build_openmpi_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full tags: - public-docker when: always @@ -258,7 +259,7 @@ build-openmpi-voronoi-gcc10: build-mpich-complete-gcc8: stage: build_mpich_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc8-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc8-full:latest tags: - public-docker when: always @@ -268,7 +269,7 @@ build-mpich-complete-gcc8: build-mpich-complete-gcc9: stage: build_mpich_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc9-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc9-full:latest tags: - public-docker when: always @@ -278,7 +279,7 @@ build-mpich-complete-gcc9: build-mpich-complete-gcc10: stage: build_mpich_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/mpich-gcc10-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/mpich-gcc10-full:latest tags: - public-docker when: always @@ -288,7 +289,7 @@ build-mpich-complete-gcc10: build-openmpi-complete-gcc8: stage: build_openmpi_gcc8 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc8-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc8-full:latest tags: - public-docker when: always @@ -298,7 +299,7 @@ build-openmpi-complete-gcc8: build-openmpi-complete-gcc9: stage: build_openmpi_gcc9 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc9-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc9-full:latest tags: - public-docker when: always @@ -308,7 +309,7 @@ build-openmpi-complete-gcc9: build-openmpi-complete-gcc10: stage: build_openmpi_gcc10 - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full:latest tags: - public-docker when: always @@ -316,9 +317,20 @@ build-openmpi-complete-gcc10: - ./ci/build_mpi_complete.sh allow_failure: false +build-openmpi-complete-gcc10-vtk9: + stage: build_openmpi_gcc10_vtk9 + image: + name: registry.jsc.fz-juelich.de/slms/loadbalancing/vtk9-v1:latest + tags: + - public-docker + when: always + script: + - ./ci/build_mpi_complete_vtk9.sh + allow_failure: false + test-project-cmake: stage: test_projects - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full:latest tags: - public-docker when: always @@ -328,7 +340,7 @@ test-project-cmake: test-project-cmake-subdir: stage: test_projects - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full:latest tags: - public-docker when: always @@ -338,7 +350,7 @@ test-project-cmake-subdir: test-project-makefile: stage: test_projects - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc10-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc10-full:latest tags: - public-docker when: always @@ -350,7 +362,7 @@ release: stage: release only: - /^releases/.*$/ - image: gitlab.version.fz-juelich.de:5555/slms/loadbalancing/openmpi-gcc8-full:latest + image: registry.jsc.fz-juelich.de/slms/loadbalancing/openmpi-gcc8-full:latest tags: - public-docker script: diff --git a/ci/build_mpi_complete.sh b/ci/build_mpi_complete.sh index aedfd0d2a667ce8edff48b4b3d407bf34312a13d..f73d932d52b1e563423506db73927fa08845ea9d 100755 --- a/ci/build_mpi_complete.sh +++ b/ci/build_mpi_complete.sh @@ -1,6 +1,9 @@ #!/bin/bash +set -exo pipefail source $(cd "$(dirname "$0")"; pwd -P)/ci_funcs.sh +dot -v + # load MPI environment load_MPI diff --git a/ci/build_mpi_complete_vtk9.sh b/ci/build_mpi_complete_vtk9.sh new file mode 100755 index 0000000000000000000000000000000000000000..ae4f14f7a47f029f3740101e5d2181a1d4e694d5 --- /dev/null +++ b/ci/build_mpi_complete_vtk9.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -exo pipefail +source $(cd "$(dirname "$0")"; pwd -P)/ci_funcs.sh + +#dot -v +which ls +ls /usr/local/lib/cmake/ + +# load MPI environment +load_MPI + +# build +mkdir -p build && cd build + +if [[ $? == 0 ]]; then + + #CC=/usr/lib64/mpi/gcc/openmpi3/bin/mpicc CXX=/usr/lib64/mpi/gcc/openmpi3/bin/mpicxx FC=/usr/lib64/mpi/gcc/openmpi3/bin/mpif90 ${CMAKE} .. + ${CMAKE} .. -DCM_ALL_FORTRAN=ON -DCM_ALL_USE_F08=ON -DCM_ALL_VORONOI=ON -DCM_ALL_VTK_OUTPUT=ON -DCM_ALL_TESTS=ON -DCM_ALL_AUTO_DOC=OFF -DVTK_DIR=/usr/local/lib/cmake/vtk-9.0 + make + make test +fi diff --git a/ci/ci_funcs.sh b/ci/ci_funcs.sh index 399c8fc96c574af689de2727b60e1f8f06fe2471..8bd0697feea747d3670dfc1bc6bb02a988c43b84 100644 --- a/ci/ci_funcs.sh +++ b/ci/ci_funcs.sh @@ -1,3 +1,5 @@ +# make sure profile is really loaded +# source /etc/profile # create a badge in current directory function create_badge { diff --git a/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/Dockerfile b/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..304edd34515802c309b253fea970d8d280bea8b2 --- /dev/null +++ b/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/Dockerfile @@ -0,0 +1,84 @@ +# Build stage with Spack pre-installed and ready to be used +FROM registry.jsc.fz-juelich.de/slms/loadbalancing/spack-alpine as builder + + +# What we want to install and how we want to install it +# is specified in a manifest file (spack.yaml) +RUN mkdir /opt/spack-environment \ +&& (echo "spack:" \ +&& echo " specs:" \ +&& echo " - cmake" \ +&& echo " - openmpi" \ +&& echo " - graphviz +expat +libgd" \ +&& echo " - boost" \ +&& echo " - doxygen +graphviz" \ +&& echo " - py-sphinx" \ +&& echo " - py-sphinx-rtd-theme" \ +&& echo " - py-breathe" \ +&& echo " - py-recommonmark" \ +&& echo " - py-commonmark" \ +&& echo " - hugo" \ +&& echo " packages:" \ +&& echo " all:" \ +&& echo " target:" \ +&& echo " - x86_64" \ +&& echo " compiler:" \ +&& echo " - gcc@10" \ +&& echo " concretization: together" \ +&& echo " config:" \ +&& echo " install_tree: /opt/software" \ +&& echo " view: /opt/view") > /opt/spack-environment/spack.yaml + +# Install the software, remove unnecessary deps +RUN cd /opt/spack-environment && spack env activate . && export SPACKMON_USER=$(cat /run/secrets/su) && export SPACKMON_TOKEN=$(cat /run/secrets/st) && spack install --fail-fast && spack gc -y + +# Strip all the binaries +RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \ + xargs file -i | \ + grep 'charset=binary' | \ + grep 'x-executable\|x-archive\|x-sharedlib' | \ + awk -F: '{print $1}' | xargs strip -s + +# Modifications to the environment that are necessary to run +RUN cd /opt/spack-environment && \ + spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh + + +# Bare OS image to run the installed executables +FROM registry.jsc.fz-juelich.de/slms/loadbalancing/spack-alpine + +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 + + +RUN source /etc/profile && \ +wget https://www.vtk.org/files/release/9.0/VTK-9.0.3.tar.gz -O- | tar xz && \ +mv VTK-9.0.3 vtk && \ +CC=gcc CXX=g++ cmake -S vtk -B vtk_build \ +-DCMAKE_BUILD_TYPE=Release \ +-DINSTALL_CMAKE_PACKAGE_MODULE=ON \ +-DVTK_PYTHON_VERSION=3 \ +-DVTK_USE_MPI=ON \ +-DVTK_GROUP_ENABLE_MPI=YES \ +-DVTK_GROUP_ENABLE_Imaging=DONT_WANT \ +-DVTK_GROUP_ENABLE_Qt=DONT_WANT \ +-DVTK_GROUP_ENABLE_Rendering=DONT_WANT \ +-DVTK_GROUP_ENABLE_StandAlone=WANT \ +-DVTK_GROUP_ENABLE_Views=DONT_WANT \ +-DVTK_GROUP_ENABLE_Web=DONT_WANT \ +-DVTK_ENABLE_LOGGING=OFF && \ +cmake --build vtk_build -j16 && \ +find -L vtk_build -type f -exec readlink -f '{}' \; | \ +xargs file -i | \ +grep 'charset=binary' | \ +grep 'x-executable\|x-archive\|x-sharedlib' | \ +awk -F: '{print $1}' | xargs strip -s && \ +cmake --install vtk_build && \ +rm -rf vtk vtk_build +RUN sed -i '1s:.*:#!/usr/bin/python3:' /opt/view/bin/sphinx-build /opt/view/bin/sphinx-apidoc /opt/view/bin/sphinx-autogen /opt/view/bin/sphinx-quickstart +RUN source /etc/profile && mkdir /usr/share/fonts && wget https://download.gimp.org/pub/gimp/fonts/urw-fonts.tar.gz -O- | tar xz -C /usr/share/fonts && fc-cache + + +ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c"] diff --git a/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/Dockerfile.patch b/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/Dockerfile.patch new file mode 100644 index 0000000000000000000000000000000000000000..1961bbc349e58f7bcff88df7ae9cd0b7df15764d --- /dev/null +++ b/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/Dockerfile.patch @@ -0,0 +1,8 @@ +--- old/Dockerfile 2021-07-21 11:52:27.076745285 +0200 ++++ new/Dockerfile 2021-07-21 11:52:45.204842728 +0200 +@@ -57,4 +57,4 @@ + RUN source /etc/profile && wget https://www.vtk.org/files/release/9.0/VTK-9.0.3.tar.gz -O- | tar xz && mv VTK-9.0.3 vtk && CC=gcc CXX=g++ cmake -S vtk -B vtk_build -DCMAKE_BUILD_TYPE=Release -DINSTALL_CMAKE_PACKAGE_MODULE=ON -DVTK_PYTHON_VERSION=3 -DVTK_USE_MPI=ON -DVTK_GROUP_ENABLE_MPI=YES -DVTK_GROUP_ENABLE_Imaging=DONT_WANT -DVTK_GROUP_ENABLE_Qt=DONT_WANT -DVTK_GROUP_ENABLE_Rendering=DONT_WANT -DVTK_GROUP_ENABLE_StandAlone=WANT -DVTK_GROUP_ENABLE_Views=DONT_WANT -DVTK_GROUP_ENABLE_Web=DONT_WANT -DVTK_ENABLE_LOGGING=OFF && cmake --build vtk_build -j16 && find -L vtk_build -type f -exec readlink -f '{}' \; | xargs file -i | grep 'charset=binary' | grep 'x-executable\|x-archive\|x-sharedlib' | awk -F: '{print $1}' | xargs strip -s && cmake --install vtk_build && rm -rf vtk vtk_build + + +-ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"] ++ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c"] diff --git a/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/spack.yaml b/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/spack.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d9342d163a44e4beb3c75c0e73cb5dac30f6b151 --- /dev/null +++ b/ci/docker/openmpi-gcc10-full-vtk9-spack-alpine/spack.yaml @@ -0,0 +1,52 @@ +spack: + specs: + - cmake + - openmpi + - graphviz +expat +libgd + - boost + - doxygen +graphviz + - py-sphinx + - py-sphinx-rtd-theme + - py-breathe + - py-recommonmark + - py-commonmark + - hugo + packages: + all: + target: ["x86_64"] + compiler: [gcc@10] + container: + format: docker + images: + build: registry.jsc.fz-juelich.de/slms/loadbalancing/spack-alpine + final: registry.jsc.fz-juelich.de/slms/loadbalancing/spack-alpine + strip: true + extra_instructions: + final: | + RUN source /etc/profile && \ + wget https://www.vtk.org/files/release/9.0/VTK-9.0.3.tar.gz -O- | tar xz && \ + mv VTK-9.0.3 vtk && \ + CC=gcc CXX=g++ cmake -S vtk -B vtk_build \ + -DCMAKE_BUILD_TYPE=Release \ + -DINSTALL_CMAKE_PACKAGE_MODULE=ON \ + -DVTK_PYTHON_VERSION=3 \ + -DVTK_USE_MPI=ON \ + -DVTK_GROUP_ENABLE_MPI=YES \ + -DVTK_GROUP_ENABLE_Imaging=DONT_WANT \ + -DVTK_GROUP_ENABLE_Qt=DONT_WANT \ + -DVTK_GROUP_ENABLE_Rendering=DONT_WANT \ + -DVTK_GROUP_ENABLE_StandAlone=WANT \ + -DVTK_GROUP_ENABLE_Views=DONT_WANT \ + -DVTK_GROUP_ENABLE_Web=DONT_WANT \ + -DVTK_ENABLE_LOGGING=OFF && \ + cmake --build vtk_build -j16 && \ + find -L vtk_build -type f -exec readlink -f '{}' \; | \ + xargs file -i | \ + grep 'charset=binary' | \ + grep 'x-executable\|x-archive\|x-sharedlib' | \ + awk -F: '{print $1}' | xargs strip -s && \ + cmake --install vtk_build && \ + rm -rf vtk vtk_build + RUN sed -i '1s:.*:#!/usr/bin/python3:' /opt/view/bin/sphinx-build /opt/view/bin/sphinx-apidoc /opt/view/bin/sphinx-autogen /opt/view/bin/sphinx-quickstart + RUN source /etc/profile && mkdir /usr/share/fonts && wget https://download.gimp.org/pub/gimp/fonts/urw-fonts.tar.gz -O- | tar xz -C /usr/share/fonts && fc-cache + diff --git a/ci/docker/openmpi-gcc10-full-vtk9/Dockerfile b/ci/docker/openmpi-gcc10-full-vtk9/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..218bab08d2adfeec3fa9eb453badfd9c0447c2ac --- /dev/null +++ b/ci/docker/openmpi-gcc10-full-vtk9/Dockerfile @@ -0,0 +1,82 @@ +FROM registry.jsc.fz-juelich.de/slms/loadbalancing/spack_v2:latest +LABEL maintainer="Rene Halver <r.halver@fz-juelich.de>" + +RUN update-alternatives --force --install /usr/bin/gcc gcc /usr/bin/gcc-10 40 && \ + update-alternatives --force --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 40 && \ + update-alternatives --force --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-10 40 && \ + update-alternatives --force --install /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 40 && \ + update-alternatives --force --install /usr/bin/g++ g++ /usr/bin/g++-10 40 && \ + update-alternatives --force --install /usr/bin/gfortran gfortran /usr/bin/gfortran-10 40 && \ + update-alternatives --force --install /usr/bin/gcov gcov /usr/bin/gcov-10 40 && \ + update-alternatives --force --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-10 40 && \ + update-alternatives --force --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-10 40 + +ADD packages.yaml /root/.spack/packages.yaml + +RUN spack install cmake && \ + /root/spack-rm-confdir3.sh && \ + spack clean -a && \ + spack view --dependencies true symlink --ignore-conflicts /usr/local cmake + +RUN spack install openmpi && \ + /root/spack-rm-confdir3.sh && \ + spack clean -a && \ + spack view --dependencies true symlink /usr/local openmpi + +RUN wget https://www.vtk.org/files/release/9.0/VTK-9.0.3.tar.gz -O- | tar xz && \ + mv VTK-9.0.3 vtk && \ + CC=gcc CXX=g++ cmake -S vtk -B vtk_build \ + -DCMAKE_BUILD_TYPE=Release \ + -DINSTALL_CMAKE_PACKAGE_MODULE=ON \ + -DVTK_PYTHON_VERSION=3 \ + -DVTK_USE_MPI=ON \ + -DVTK_GROUP_ENABLE_MPI=YES \ + -DVTK_GROUP_ENABLE_Imaging=DONT_WANT \ + -DVTK_GROUP_ENABLE_Qt=DONT_WANT \ + -DVTK_GROUP_ENABLE_Rendering=DONT_WANT \ + -DVTK_GROUP_ENABLE_StandAlone=WANT \ + -DVTK_GROUP_ENABLE_Views=DONT_WANT \ + -DVTK_GROUP_ENABLE_Web=DONT_WANT \ + -DVTK_ENABLE_LOGGING=OFF && \ + cmake --build vtk_build -j16 && \ + find -L vtk_build -type f -exec readlink -f '{}' \; | \ + xargs file -i | \ + grep 'charset=binary' | \ + grep 'x-executable\|x-archive\|x-sharedlib' | \ + awk -F: '{print $1}' | xargs strip -s && \ + cmake --install vtk_build && \ + rm -rf vtk vtk_build + +#RUN spack install vtk -osmesa -opengl2 -qt ^openmpi && \ +# /root/spack-rm-confdir3.sh && \ +# spack clean -a && \ +# spack view --dependencies false symlink --ignore-conflicts /usr/local vtk + +#RUN spack dependencies graphviz~ghostscript && \ +# spack graph mesa~llvm && \ +# spack graph graphviz~ghostscript ^osmesa~llvm && \ +# spack install graphviz~ghostscript ^osmesa~llvm && \ +# spack view --dependencies no symlink --ignore-conflicts /usr/local graphviz + +RUN apt-get update && \ + apt-get -y install graphviz && \ + apt-get -y install libboost-all-dev + +RUN spack install doxygen && \ + spack install py-sphinx && \ + spack install py-breathe && \ + spack install py-recommonmark && \ + spack install py-commonmark && \ + spack install py-pip && \ + spack install hugo && \ + /root/spack-rm-confdir3.sh && \ + spack clean -a && \ + spack view --dependencies no symlink --ignore-conflicts /usr/local doxygen && \ + spack view --dependencies true symlink --ignore-conflicts /usr/local py-sphinx && \ + spack view --dependencies true symlink --ignore-conflicts /usr/local py-pip && \ + spack view --dependencies no symlink --ignore-conflicts /usr/local py-breathe && \ + spack view --dependencies no symlink --ignore-conflicts /usr/local py-recommonmark && \ + spack view --dependencies no symlink --ignore-conflicts /usr/local py-commonmark && \ + spack view --dependencies no symlink --ignore-conflicts /usr/local hugo && \ + pip install sphinx_rtd_theme + diff --git a/ci/docker/openmpi-gcc10-full-vtk9/packages.yaml b/ci/docker/openmpi-gcc10-full-vtk9/packages.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0a3f28b6d0f3f17cb1492558a98a3bd09010024d --- /dev/null +++ b/ci/docker/openmpi-gcc10-full-vtk9/packages.yaml @@ -0,0 +1,4 @@ +packages: + all: + target: ["x86_64"] + compiler: [gcc@10] diff --git a/ci/docker/spack-alpine/Dockerfile b/ci/docker/spack-alpine/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6c5606a43cdd282d79210afd29b57411ea7e84c1 --- /dev/null +++ b/ci/docker/spack-alpine/Dockerfile @@ -0,0 +1,53 @@ +FROM alpine:3.14 +MAINTAINER Spack Maintainers <maintainers@spack.io> + +ENV DOCKERFILE_BASE=centos \ + DOCKERFILE_DISTRO=centos \ + DOCKERFILE_DISTRO_VERSION=7 \ + SPACK_ROOT=/opt/spack \ + DEBIAN_FRONTEND=noninteractive \ + CURRENTLY_BUILDING_DOCKER_IMAGE=1 \ + container=docker + +COPY bin $SPACK_ROOT/bin +COPY etc $SPACK_ROOT/etc +COPY lib $SPACK_ROOT/lib +COPY share $SPACK_ROOT/share +COPY var $SPACK_ROOT/var +RUN mkdir -p $SPACK_ROOT/opt/spack + +RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \ + /usr/local/bin/docker-shell \ + && ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \ + /usr/local/bin/interactive-shell \ + && ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \ + /usr/local/bin/spack-env + +# Install basic system dependencies +RUN apk update && \ + apk add --no-cache git gcc g++ gfortran make bzip2 && \ + apk add --no-cache patch file curl python3 gnupg xz && \ + apk add --no-cache curl bash openssh libtool linux-headers +# pip install boto3 # amazon stuff + + +RUN mkdir -p /root/.spack \ + && cp $SPACK_ROOT/share/spack/docker/modules.yaml \ + /root/.spack/modules.yaml \ + && rm -rf /root/*.* /run/nologin $SPACK_ROOT/.git + +# [WORKAROUND] +# https://superuser.com/questions/1241548/ +# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889 +RUN [ -f ~/.profile ] \ + && sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \ + || true + +WORKDIR /root +SHELL ["docker-shell"] + +# TODO: add a command to Spack that (re)creates the package cache +RUN spack spec hdf5+mpi + +ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"] +CMD ["interactive-shell"] diff --git a/include/ALL.hpp b/include/ALL.hpp index f0c685ecc23c53da38e19791f3df8bd30bb07d67..78e765124f55b66adf09e579f444d1e1aa67e4b2 100644 --- a/include/ALL.hpp +++ b/include/ALL.hpp @@ -66,6 +66,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <vtkVoxel.h> #include <vtkXMLPUnstructuredGridWriter.h> #include <vtkXMLUnstructuredGridWriter.h> +#ifdef VTK_CELL_ARRAY_V2 +#include <vtkNew.h> +#endif #endif namespace ALL { @@ -542,14 +545,19 @@ public: // define rank array (length = 4, x,y,z, rank) int rank = 0; MPI_Comm_rank(communicator, &rank); + auto coords = vtkSmartPointer<vtkFloatArray>::New(); + coords->SetNumberOfComponents(3); + coords->SetNumberOfTuples(1); + coords->SetName("coords"); + coords->SetValue(0, procGridLoc.at(0)); + coords->SetValue(1, procGridLoc.at(1)); + coords->SetValue(2, procGridLoc.at(2)); + auto rnk = vtkSmartPointer<vtkFloatArray>::New(); - rnk->SetNumberOfComponents(4); + rnk->SetNumberOfComponents(1); rnk->SetNumberOfTuples(1); - rnk->SetName("rank"); - rnk->SetValue(0, procGridLoc.at(0)); - rnk->SetValue(1, procGridLoc.at(1)); - rnk->SetValue(2, procGridLoc.at(2)); - rnk->SetValue(3, rank); + rnk->SetName("MPI rank"); + rnk->SetValue(0, rank); // define tag array (length = 1) auto tag = vtkSmartPointer<vtkIntArray>::New(); @@ -605,6 +613,7 @@ public: unstructuredGrid->GetCellData()->AddArray(work); unstructuredGrid->GetCellData()->AddArray(expanse); unstructuredGrid->GetCellData()->AddArray(rnk); + unstructuredGrid->GetCellData()->AddArray(coords); unstructuredGrid->GetCellData()->AddArray(tag); createDirectory("vtk_outline"); @@ -662,11 +671,14 @@ public: local_vertices[nVertices * balancer->getDimension()] = (T)balancer->getWork().at(0); + /* T *global_vertices; if (local_rank == 0) { global_vertices = new T[n_ranks * (nVertices * balancer->getDimension() + 1)]; } + */ + T global_vertices[n_ranks * (nVertices * balancer->getDimension() + 1)]; // collect all works and vertices on a single process MPI_Gather(local_vertices, nVertices * balancer->getDimension() + 1, @@ -676,7 +688,12 @@ public: if (local_rank == 0) { auto vtkpoints = vtkSmartPointer<vtkPoints>::New(); +#ifdef VTK_CELL_ARRAY_V2 + vtkNew<vtkUnstructuredGrid> unstructuredGrid; + unstructuredGrid->Allocate(n_ranks + 10); +#else auto unstructuredGrid = vtkSmartPointer<vtkUnstructuredGrid>::New(); +#endif // enter vertices into unstructured grid for (int i = 0; i < n_ranks; ++i) { @@ -702,7 +719,29 @@ public: cell->SetNumberOfTuples(n_ranks); cell->SetName("cell id"); + for (int n = 0; n < n_ranks; ++n) { + +#ifdef VTK_CELL_ARRAY_V2 + // define grid points, i.e. vertices of local domain + vtkIdType pointIds[8] = {8 * n + 0, 8 * n + 1, 8 * n + 2, 8 * n + 3, + 8 * n + 4, 8 * n + 5, 8 * n + 6, 8 * n + 7}; + + vtkIdType faces[48] = { 3, 8 * n + 0, 8 * n + 2, 8 * n + 1, + 3, 8 * n + 1, 8 * n + 2, 8 * n + 3, + 3, 8 * n + 0, 8 * n + 4, 8 * n + 2, + 3, 8 * n + 2, 8 * n + 4, 8 * n + 6, + 3, 8 * n + 2, 8 * n + 6, 8 * n + 3, + 3, 8 * n + 3, 8 * n + 6, 8 * n + 7, + 3, 8 * n + 1, 8 * n + 5, 8 * n + 3, + 3, 8 * n + 3, 8 * n + 5, 8 * n + 7, + 3, 8 * n + 0, 8 * n + 4, 8 * n + 1, + 3, 8 * n + 1, 8 * n + 4, 8 * n + 5, + 3, 8 * n + 4, 8 * n + 6, 8 * n + 5, + 3, 8 * n + 5, 8 * n + 6, 8 * n + 7}; + + unstructuredGrid->InsertNextCell(VTK_POLYHEDRON, 8, pointIds, 12, faces); +#else // define grid points, i.e. vertices of local domain vtkIdType pointIds[8] = {8 * n + 0, 8 * n + 1, 8 * n + 2, 8 * n + 3, 8 * n + 4, 8 * n + 5, 8 * n + 6, 8 * n + 7}; @@ -742,6 +781,7 @@ public: unstructuredGrid->InsertNextCell(VTK_POLYHEDRON, 8, pointIds, 12, faces->GetPointer()); +#endif work->SetValue( n, global_vertices[n * (nVertices * balancer->getDimension() + 1) + @@ -762,7 +802,7 @@ public: // writer->SetDataModeToBinary(); writer->Write(); - delete[] global_vertices; + //delete[] global_vertices; } } #endif