diff --git a/.github/workflows/run-and-deploy-docker.yaml b/.github/workflows/run-and-deploy-docker.yaml index 9ac890e..2927b33 100644 --- a/.github/workflows/run-and-deploy-docker.yaml +++ b/.github/workflows/run-and-deploy-docker.yaml @@ -34,7 +34,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . - file: Dockerfile_jupyterlab + file: Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index a08d19b..40d0baf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,109 +1,164 @@ -FROM ghcr.io/seisscoped/container-base +# ========================================== +# STAGE 0: Build Environment (Ubuntu 26.04 LTS) +# ========================================== +FROM ubuntu:26.04 AS builder -RUN apt-get update \ - && apt-get install -y \ +ENV DEBIAN_FRONTEND=noninteractive + +# Installs compilation tools (heavyweight workspace) +RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ + ca-certificates \ cmake \ g++ \ gcc \ gfortran \ - libgomp1 \ + git \ + make \ libnuma-dev \ - libnuma1 \ - libocct-data-exchange-7.5 \ - libocct-data-exchange-dev \ - libocct-foundation-7.5 \ - libocct-foundation-dev \ - libocct-modeling-algorithms-7.5 \ - libocct-modeling-algorithms-dev \ - libocct-modeling-data-7.5 \ - libocct-modeling-data-dev \ - libopenblas-base \ libopenblas-dev \ + libopenmpi-dev \ libreadline-dev \ - libtbb2 \ + libtbb-dev \ libyaml-cpp-dev \ + openmpi-bin \ pkg-config \ - zlib1g \ + python3 \ + python3-pip \ + python3-setuptools \ + wget \ zlib1g-dev \ - && docker-clean + && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /home/tools +RUN mkdir -p /home/tools/bin /home/tools/lib /home/tools/include WORKDIR /tmp -ENV PATH="/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/bin:/home/tools/bin:${PATH}" \ - LD_LIBRARY_PATH="/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/libfabric/lib:/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/lib/release:/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/lib" - -RUN wget --progress=bar:force:noscroll https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.2/src/hdf5-1.12.2.tar.bz2 \ - && tar -xvf hdf5-1.12.2.tar.bz2 \ - && cd hdf5-1.12.2 \ - && CFLAGS="-fPIC" CC=mpicc FC="mpif90 --std=f95" ./configure --enable-parallel --with-zlib --disable-shared --prefix /home/tools \ +ENV PATH="/home/tools/bin:${PATH:-}" +ENV LD_LIBRARY_PATH="/home/tools/lib:${LD_LIBRARY_PATH:-}" +ENV PKG_CONFIG_PATH="/home/tools/lib/pkgconfig:${PKG_CONFIG_PATH:-}" +ENV CMAKE_PREFIX_PATH="/home/tools:${CMAKE_PREFIX_PATH:-}" +ENV CPATH="/home/tools/include:${CPATH:-}" + +# 1. Compile HDF5 +RUN wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.3/src/hdf5-1.12.3.tar.bz2 \ + && tar -xvf hdf5-1.12.3.tar.bz2 \ + && cd hdf5-1.12.3 \ + && CFLAGS="-fPIC -Wno-error=format-security" CPPFLAGS="-fPIC" CC=mpicc CXX=mpicxx ./configure \ + --enable-parallel \ + --prefix=/home/tools \ + --with-zlib \ + --disable-shared \ + --disable-dependency-tracking \ && make -j$(nproc) && make install +# 2. Build libxsmm (Compiled ONLY on amd64 hosts, cleanly skipped on ARM) +ARG TARGETARCH +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + git clone --depth=1 --single-branch --branch 1.17 https://github.com/libxsmm/libxsmm \ + && cd libxsmm \ + && make -j$(nproc) generator \ + && cp bin/libxsmm_gemm_generator /home/tools/bin/; \ + else \ + echo "Skipping libxsmm compilation: target architecture is ARM64 (Apple Silicon). Matrix acceleration will fall back cleanly to PSPaMM."; \ + fi + +# 3. Build NetCDF RUN wget --progress=bar:force:noscroll https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netcdf-c-4.9.2.tar.gz \ && tar -xvf netcdf-c-4.9.2.tar.gz \ && cd netcdf-c-4.9.2 \ - && CFLAGS="-fPIC" CC=h5pcc ./configure --enable-shared=no --prefix=/home/tools --disable-dap --disable-byterange \ + && CFLAGS="-fPIC" CC=h5pcc ./configure \ + --enable-shared=no \ + --prefix=/home/tools \ + --disable-dap \ + --disable-byterange \ + --disable-libxml2 \ && make -j$(nproc) && make install +# 4. Build ParMETIS RUN wget --progress=bar:force:noscroll https://deb.debian.org/debian/pool/non-free/p/parmetis/parmetis_4.0.3.orig.tar.gz \ && tar -xvf parmetis_4.0.3.orig.tar.gz \ && cd parmetis-4.0.3 \ && sed -i 's/IDXTYPEWIDTH 32/IDXTYPEWIDTH 64/g' ./metis/include/metis.h \ - && CC=mpicc CXX=mpicxx make config prefix=/home/tools \ + # Modernize the obsolete CMake version requirement across all internal trees + && sed -i 's/cmake_minimum_required(VERSION 2.8)/cmake_minimum_required(VERSION 3.5)/g' CMakeLists.txt \ + && sed -i 's/cmake_minimum_required(VERSION 2.8)/cmake_minimum_required(VERSION 3.5)/g' metis/CMakeLists.txt \ + # Force the policy bypass engine into the configuration line + && CC=mpicc CXX=mpicxx make config prefix=/home/tools flags="-DCMAKE_POLICY_VERSION_MINIMUM=3.5" \ && make -j$(nproc) && make install \ - && cp build/Linux-x86_64/libmetis/libmetis.a /home/tools/lib \ + # Use architecture-independent wildcards to handle both x86_64 and aarch64 output trees cleanly + && cp build/Linux-*/libmetis/libmetis.a /home/tools/lib \ && cp metis/include/metis.h /home/tools/include +# 5. Build Lua RUN wget --progress=bar:force:noscroll https://www.lua.org/ftp/lua-5.3.6.tar.gz \ && tar -xzvf lua-5.3.6.tar.gz \ && cd lua-5.3.6 && make linux CC=mpicc && make local \ && cp -r install/* /home/tools && cd .. +# 6. Build Eigen RUN wget --progress=bar:force:noscroll https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz \ && tar -xf eigen-3.4.0.tar.gz \ && cd eigen-3.4.0 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools \ && make -j$(nproc) install +# 7. Build PROJ RUN git clone --depth 1 --single-branch --branch 4.9.3 https://github.com/OSGeo/PROJ.git \ && cd PROJ \ + # 1. Modernize the root CMake requirements + && sed -i 's/cmake_minimum_required(VERSION 2.8.11)/cmake_minimum_required(VERSION 3.5)/g' CMakeLists.txt \ + # 2. Patch the obsolete link policy to use current standards instead of OLD + && sed -i 's/cmake_policy(SET CMP0022 OLD)/cmake_policy(SET CMP0022 NEW)/g' cmake/policies.cmake \ && mkdir build && cd build \ - && CC=mpicc CXX=mpicxx cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools \ + && CC=mpicc CXX=mpicxx cmake .. \ + -DCMAKE_INSTALL_PREFIX=/home/tools \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ && make -j$(nproc) && make install -RUN git clone --depth 1 --single-branch --branch 1.16.1 https://github.com/hfp/libxsmm.git \ - && cd libxsmm \ - && make -j$(nproc) generator \ - && cp bin/libxsmm_gemm_generator /home/tools/bin - -### Put all dependencies, which point to a specific version, before this comment -### Put all dependencies, which use the latest version, after this comment to reduce build time - +# 8. Build ASAGI RUN git clone --recursive https://github.com/TUM-I5/ASAGI.git \ && cd ASAGI \ && mkdir build && cd build \ - && CC=mpicc CXX=mpicxx cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DSHARED_LIB=off -DSTATIC_LIB=on -DNONUMA=on \ + && CC=mpicc CXX=mpicxx cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DCMAKE_PREFIX_PATH=/home/tools -DSHARED_LIB=off -DSTATIC_LIB=on -DNONUMA=on \ && make -j$(nproc) && make install +# 9. Build easi RUN git clone https://github.com/SeisSol/easi \ && cd easi \ && mkdir build && cd build \ - && CC=mpicc CXX=mpicxx cmake .. -DEASICUBE=OFF -DLUA=ON -DCMAKE_PREFIX_PATH=/home/tools -DCMAKE_INSTALL_PREFIX=/home/tools -DASAGI=ON -DIMPALAJIT=OFF .. \ + && CC=mpicc CXX=mpicxx cmake .. -DEASICUBE=OFF -DLUA=ON -DCMAKE_PREFIX_PATH=/home/tools -DCMAKE_INSTALL_PREFIX=/home/tools -DASAGI=ON -DIMPALAJIT=OFF \ && make -j$(nproc) && make install -RUN pip install numpy && docker-clean +# Install PSpaMM via pip3 securely using system bypass flags +RUN pip3 install --no-cache-dir --break-system-packages numpy \ + && pip3 install --no-cache-dir --break-system-packages git+https://github.com/SeisSol/PSpaMM.git -RUN git clone --recursive --depth 1 --single-branch --branch v1.3.0 https://github.com/SeisSol/SeisSol.git \ +# 10. Build SeisSol (Adaptive Multi-Architecture Evaluator) +ARG TARGETARCH +RUN git clone --recursive --depth 1 https://github.com/SeisSol/SeisSol.git \ && cd SeisSol \ - && mkdir build_hsw && cd build_hsw \ - && export PATH=$PATH:/home/tools/bin \ - && CC=mpicc CXX=mpicxx cmake .. -DCMAKE_PREFIX_PATH=/home/tools -DGEMM_TOOLS_LIST=LIBXSMM -DHOST_ARCH=hsw -DNEW_BINARY_NAMING=ON -DASAGI=on -DNETCDF=on -DORDER=4 -DDR_QUAD_RULE_OPTIONS=dunavant \ + && mkdir build_workspace && cd build_workspace \ + && if [ "$TARGETARCH" = "arm64" ]; then \ + GEMM_TOOLS="PSpaMM"; \ + HOST_ARCH="neon"; \ + else \ + GEMM_TOOLS=auto; \ + HOST_ARCH="hsw"; \ + fi \ + && PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 CC=mpicc CXX=mpicxx cmake .. \ + -DCMAKE_PREFIX_PATH=/home/tools \ + -DCMAKE_LIBRARY_PATH=/home/tools/lib \ + -DCMAKE_INCLUDE_PATH=/home/tools/include \ + -DGEMM_TOOLS_LIST="$GEMM_TOOLS" \ + -DHOST_ARCH="$HOST_ARCH" \ + -DNEW_BINARY_NAMING=ON \ + -DASAGI=on -DNETCDF=on -DORDER=4 -DDR_QUAD_RULE_OPTIONS=dunavant \ && make -j$(nproc) \ && cmake .. -DEQUATIONS=viscoelastic2 -DNUMBER_OF_MECHANISMS=3 \ && make -j$(nproc) \ && cp seissol-* /home/tools/bin +# 11. Build rconv RUN cd SeisSol/preprocessing/science/rconv \ && mkdir build && cd build \ && echo "find_package(HDF5 REQUIRED COMPONENTS C HL)" >> ../CMakeLists.txt \ @@ -111,37 +166,43 @@ RUN cd SeisSol/preprocessing/science/rconv \ && CC=mpicc CXX=mpicxx cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DCMAKE_PREFIX_PATH=/home/tools \ && make -j$(nproc) && cp rconv /home/tools/bin/ +# 12. Build PUMGen RUN git clone --recursive --branch v1.1.0 https://github.com/SeisSol/PUMGen.git \ && cd PUMGen \ && mkdir build && cd build \ - && cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release \ + && cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DCMAKE_PREFIX_PATH=/home/tools -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release \ && make -j$(nproc) && make install -FROM ghcr.io/seisscoped/container-base + +# ========================================== +# STAGE 1: Final Lightweight Runtime Image +# ========================================== +FROM ubuntu:26.04 + +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get install -y --no-install-recommends \ + ca-certificates \ gmsh \ + python3-gmsh \ + python-is-python3 \ libgomp1 \ libnuma1 \ - libocct-data-exchange-7.5 \ - libocct-foundation-7.5 \ - libocct-modeling-algorithms-7.5 \ - libocct-modeling-data-7.5 \ - libopenblas-base \ - libopenmpi3 \ - libtbb2 \ + libopenblas-dev \ + libopenmpi-dev \ + libtbb12 \ libxrender1 \ libyaml-cpp-dev \ + openmpi-bin \ + python3 \ + python3-pip \ tini \ xvfb \ zlib1g \ - && docker-clean + && rm -rf /var/lib/apt/lists/* -WORKDIR /home -COPY --from=0 /home/tools tools -### need to specify --user for gmsh installation, otherwise the tpv13 notebook can't execute !gmsh -RUN conda install \ +RUN pip3 install --no-cache-dir --break-system-packages \ panel \ ipyvtklink \ vtk \ @@ -150,16 +211,21 @@ RUN conda install \ scipy \ pyproj \ matplotlib \ - gmsh \ - python-gmsh \ sympy \ - pandas \ - && docker-clean -ENV PATH=/home/tools/bin:$PATH + pandas + +WORKDIR /home +COPY --from="builder" /home/tools tools + +ENV PATH="/home/tools/bin:${PATH:-}" +ENV LD_LIBRARY_PATH="/home/tools/lib:${LD_LIBRARY_PATH:-}" +ENV PYTHONPATH="/home/tools/lib:${PYTHONPATH:-}" + ENV OMP_PLACES="cores" ENV OMP_PROC_BIND="spread" -ENV PYTHONPATH="${PYTHONPATH}:/home/tools/lib" + COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh WORKDIR /home/training COPY tpv13/ tpv13/ diff --git a/Dockerfile_jupyterlab b/Dockerfile_jupyterlab deleted file mode 100644 index 40d0baf..0000000 --- a/Dockerfile_jupyterlab +++ /dev/null @@ -1,239 +0,0 @@ -# ========================================== -# STAGE 0: Build Environment (Ubuntu 26.04 LTS) -# ========================================== -FROM ubuntu:26.04 AS builder - -ENV DEBIAN_FRONTEND=noninteractive - -# Installs compilation tools (heavyweight workspace) -RUN apt-get update && apt-get install -y --no-install-recommends \ - bzip2 \ - ca-certificates \ - cmake \ - g++ \ - gcc \ - gfortran \ - git \ - make \ - libnuma-dev \ - libopenblas-dev \ - libopenmpi-dev \ - libreadline-dev \ - libtbb-dev \ - libyaml-cpp-dev \ - openmpi-bin \ - pkg-config \ - python3 \ - python3-pip \ - python3-setuptools \ - wget \ - zlib1g-dev \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /home/tools/bin /home/tools/lib /home/tools/include - -WORKDIR /tmp - -ENV PATH="/home/tools/bin:${PATH:-}" -ENV LD_LIBRARY_PATH="/home/tools/lib:${LD_LIBRARY_PATH:-}" -ENV PKG_CONFIG_PATH="/home/tools/lib/pkgconfig:${PKG_CONFIG_PATH:-}" -ENV CMAKE_PREFIX_PATH="/home/tools:${CMAKE_PREFIX_PATH:-}" -ENV CPATH="/home/tools/include:${CPATH:-}" - -# 1. Compile HDF5 -RUN wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.3/src/hdf5-1.12.3.tar.bz2 \ - && tar -xvf hdf5-1.12.3.tar.bz2 \ - && cd hdf5-1.12.3 \ - && CFLAGS="-fPIC -Wno-error=format-security" CPPFLAGS="-fPIC" CC=mpicc CXX=mpicxx ./configure \ - --enable-parallel \ - --prefix=/home/tools \ - --with-zlib \ - --disable-shared \ - --disable-dependency-tracking \ - && make -j$(nproc) && make install - -# 2. Build libxsmm (Compiled ONLY on amd64 hosts, cleanly skipped on ARM) -ARG TARGETARCH -RUN if [ "$TARGETARCH" = "amd64" ]; then \ - git clone --depth=1 --single-branch --branch 1.17 https://github.com/libxsmm/libxsmm \ - && cd libxsmm \ - && make -j$(nproc) generator \ - && cp bin/libxsmm_gemm_generator /home/tools/bin/; \ - else \ - echo "Skipping libxsmm compilation: target architecture is ARM64 (Apple Silicon). Matrix acceleration will fall back cleanly to PSPaMM."; \ - fi - -# 3. Build NetCDF -RUN wget --progress=bar:force:noscroll https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netcdf-c-4.9.2.tar.gz \ - && tar -xvf netcdf-c-4.9.2.tar.gz \ - && cd netcdf-c-4.9.2 \ - && CFLAGS="-fPIC" CC=h5pcc ./configure \ - --enable-shared=no \ - --prefix=/home/tools \ - --disable-dap \ - --disable-byterange \ - --disable-libxml2 \ - && make -j$(nproc) && make install - -# 4. Build ParMETIS -RUN wget --progress=bar:force:noscroll https://deb.debian.org/debian/pool/non-free/p/parmetis/parmetis_4.0.3.orig.tar.gz \ - && tar -xvf parmetis_4.0.3.orig.tar.gz \ - && cd parmetis-4.0.3 \ - && sed -i 's/IDXTYPEWIDTH 32/IDXTYPEWIDTH 64/g' ./metis/include/metis.h \ - # Modernize the obsolete CMake version requirement across all internal trees - && sed -i 's/cmake_minimum_required(VERSION 2.8)/cmake_minimum_required(VERSION 3.5)/g' CMakeLists.txt \ - && sed -i 's/cmake_minimum_required(VERSION 2.8)/cmake_minimum_required(VERSION 3.5)/g' metis/CMakeLists.txt \ - # Force the policy bypass engine into the configuration line - && CC=mpicc CXX=mpicxx make config prefix=/home/tools flags="-DCMAKE_POLICY_VERSION_MINIMUM=3.5" \ - && make -j$(nproc) && make install \ - # Use architecture-independent wildcards to handle both x86_64 and aarch64 output trees cleanly - && cp build/Linux-*/libmetis/libmetis.a /home/tools/lib \ - && cp metis/include/metis.h /home/tools/include - -# 5. Build Lua -RUN wget --progress=bar:force:noscroll https://www.lua.org/ftp/lua-5.3.6.tar.gz \ - && tar -xzvf lua-5.3.6.tar.gz \ - && cd lua-5.3.6 && make linux CC=mpicc && make local \ - && cp -r install/* /home/tools && cd .. - -# 6. Build Eigen -RUN wget --progress=bar:force:noscroll https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz \ - && tar -xf eigen-3.4.0.tar.gz \ - && cd eigen-3.4.0 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools \ - && make -j$(nproc) install - -# 7. Build PROJ -RUN git clone --depth 1 --single-branch --branch 4.9.3 https://github.com/OSGeo/PROJ.git \ - && cd PROJ \ - # 1. Modernize the root CMake requirements - && sed -i 's/cmake_minimum_required(VERSION 2.8.11)/cmake_minimum_required(VERSION 3.5)/g' CMakeLists.txt \ - # 2. Patch the obsolete link policy to use current standards instead of OLD - && sed -i 's/cmake_policy(SET CMP0022 OLD)/cmake_policy(SET CMP0022 NEW)/g' cmake/policies.cmake \ - && mkdir build && cd build \ - && CC=mpicc CXX=mpicxx cmake .. \ - -DCMAKE_INSTALL_PREFIX=/home/tools \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - && make -j$(nproc) && make install - -# 8. Build ASAGI -RUN git clone --recursive https://github.com/TUM-I5/ASAGI.git \ - && cd ASAGI \ - && mkdir build && cd build \ - && CC=mpicc CXX=mpicxx cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DCMAKE_PREFIX_PATH=/home/tools -DSHARED_LIB=off -DSTATIC_LIB=on -DNONUMA=on \ - && make -j$(nproc) && make install - -# 9. Build easi -RUN git clone https://github.com/SeisSol/easi \ - && cd easi \ - && mkdir build && cd build \ - && CC=mpicc CXX=mpicxx cmake .. -DEASICUBE=OFF -DLUA=ON -DCMAKE_PREFIX_PATH=/home/tools -DCMAKE_INSTALL_PREFIX=/home/tools -DASAGI=ON -DIMPALAJIT=OFF \ - && make -j$(nproc) && make install - -# Install PSpaMM via pip3 securely using system bypass flags -RUN pip3 install --no-cache-dir --break-system-packages numpy \ - && pip3 install --no-cache-dir --break-system-packages git+https://github.com/SeisSol/PSpaMM.git - -# 10. Build SeisSol (Adaptive Multi-Architecture Evaluator) -ARG TARGETARCH -RUN git clone --recursive --depth 1 https://github.com/SeisSol/SeisSol.git \ - && cd SeisSol \ - && mkdir build_workspace && cd build_workspace \ - && if [ "$TARGETARCH" = "arm64" ]; then \ - GEMM_TOOLS="PSpaMM"; \ - HOST_ARCH="neon"; \ - else \ - GEMM_TOOLS=auto; \ - HOST_ARCH="hsw"; \ - fi \ - && PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 CC=mpicc CXX=mpicxx cmake .. \ - -DCMAKE_PREFIX_PATH=/home/tools \ - -DCMAKE_LIBRARY_PATH=/home/tools/lib \ - -DCMAKE_INCLUDE_PATH=/home/tools/include \ - -DGEMM_TOOLS_LIST="$GEMM_TOOLS" \ - -DHOST_ARCH="$HOST_ARCH" \ - -DNEW_BINARY_NAMING=ON \ - -DASAGI=on -DNETCDF=on -DORDER=4 -DDR_QUAD_RULE_OPTIONS=dunavant \ - && make -j$(nproc) \ - && cmake .. -DEQUATIONS=viscoelastic2 -DNUMBER_OF_MECHANISMS=3 \ - && make -j$(nproc) \ - && cp seissol-* /home/tools/bin - -# 11. Build rconv -RUN cd SeisSol/preprocessing/science/rconv \ - && mkdir build && cd build \ - && echo "find_package(HDF5 REQUIRED COMPONENTS C HL)" >> ../CMakeLists.txt \ - && echo "target_link_libraries(SeisSol-rconv PUBLIC \${HDF5_C_HL_LIBRARIES} \${HDF5_C_LIBRARIES})" >> ../CMakeLists.txt \ - && CC=mpicc CXX=mpicxx cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DCMAKE_PREFIX_PATH=/home/tools \ - && make -j$(nproc) && cp rconv /home/tools/bin/ - -# 12. Build PUMGen -RUN git clone --recursive --branch v1.1.0 https://github.com/SeisSol/PUMGen.git \ - && cd PUMGen \ - && mkdir build && cd build \ - && cmake .. -DCMAKE_INSTALL_PREFIX=/home/tools -DCMAKE_PREFIX_PATH=/home/tools -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release \ - && make -j$(nproc) && make install - - -# ========================================== -# STAGE 1: Final Lightweight Runtime Image -# ========================================== -FROM ubuntu:26.04 - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - gmsh \ - python3-gmsh \ - python-is-python3 \ - libgomp1 \ - libnuma1 \ - libopenblas-dev \ - libopenmpi-dev \ - libtbb12 \ - libxrender1 \ - libyaml-cpp-dev \ - openmpi-bin \ - python3 \ - python3-pip \ - tini \ - xvfb \ - zlib1g \ - && rm -rf /var/lib/apt/lists/* - -RUN pip3 install --no-cache-dir --break-system-packages \ - panel \ - ipyvtklink \ - vtk \ - pyvista \ - ipywidgets \ - scipy \ - pyproj \ - matplotlib \ - sympy \ - pandas - -WORKDIR /home -COPY --from="builder" /home/tools tools - -ENV PATH="/home/tools/bin:${PATH:-}" -ENV LD_LIBRARY_PATH="/home/tools/lib:${LD_LIBRARY_PATH:-}" -ENV PYTHONPATH="/home/tools/lib:${PYTHONPATH:-}" - -ENV OMP_PLACES="cores" -ENV OMP_PROC_BIND="spread" - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -WORKDIR /home/training -COPY tpv13/ tpv13/ -COPY sulawesi/ sulawesi/ -COPY northridge/ northridge/ -COPY kaikoura/ kaikoura/ -RUN chmod -R 777 /home/training - -VOLUME ["/shared"] -WORKDIR /shared -ENTRYPOINT ["tini", "-s", "-g", "/entrypoint.sh", "--"] diff --git a/README.md b/README.md index fc59bea..32e0fcb 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The following tools are currently included: - rconv (tool to describe point and finite source models in SeisSol's NetCDF Rupture Format, https://seissol.readthedocs.io/en/latest/standard-rupture-format.html#how-to-use-rconv) - SeisSol O4 (pre-compiled SeisSol with 4th order space-time accuracy for elastic and viscoelastic materials, https://seissol.readthedocs.io). We use the SeisSol `v1.0.1`. See the first lines of the SeisSol output to get the exact commit hash. -The SeisSol binaries in the container use new binary naming (e.g., `seissol-cpu-elastic-p4-f64` and `seissol-cpu-viscoelastic-3-p4-f64`). +The SeisSol binaries in the container use new binary naming (e.g., `seissol-elastic-o4-f64` and `seissol-viscoelastic-3-o4-f64`). I.e. diff --git a/frontera.md b/frontera.md index f17dc52..6658219 100644 --- a/frontera.md +++ b/frontera.md @@ -49,7 +49,7 @@ mpirun apptainer run ~/my-training.sif pumgen -s msh2 mesh_northridge.msh apptainer run ~/my-training.sif rconv -i northridge_resampled.srf -o northridge_resampled.nrf -x visualization.xdmf -m "+proj=tmerc +datum=WGS84 +k=0.9996 +lon_0=-118.5150 +lat_0=34.3440 +axis=enu" OMP_NUM_THREADS=26 mpirun -n 2 apptainer run ~/my-training.sif seissol parameters.par ``` -You can change `seissol` to `seissol-cpu-viscoelastic-3-p4-f64` if you want to account for attenuation (https://seissol.readthedocs.io/en/latest/attenuation.html) instead of assuming a fully elastic rheology. +You can change `seissol` to `seissol-viscoelastic-3-o4-f64` if you want to account for attenuation (https://seissol.readthedocs.io/en/latest/attenuation.html) instead of assuming a fully elastic rheology. In Section `Interacting with Frontera from local machine`, we will also show how you may interact with Frontera from your local machine with a Jupyter Lab. diff --git a/northridge/Northridge.ipynb b/northridge/Northridge.ipynb index 1a280a0..f652ea8 100644 --- a/northridge/Northridge.ipynb +++ b/northridge/Northridge.ipynb @@ -447,7 +447,7 @@ "metadata": {}, "outputs": [], "source": [ - "!seissol-cpu-viscoelastic-3-p4-f64 parameters.par" + "!seissol-viscoelastic-3-o4-f64 parameters.par" ] } ], diff --git a/sulawesi/parametersLSW.par b/sulawesi/parametersLSW.par index 5bbfdd9..3f9ee2e 100644 --- a/sulawesi/parametersLSW.par +++ b/sulawesi/parametersLSW.par @@ -70,7 +70,7 @@ ClusteredLTS = 2 ! 1 for Global time stepping, 2,3 &Output OutputFile = 'outputs/SulawesiLSW' -wavefieldoutput = 1 +wavefieldoutput = 0 ! |stress |vel iOutputMask = 0 0 0 0 0 0 1 1 1 ! |strain |eta diff --git a/sulawesi/parametersRS.par b/sulawesi/parametersRS.par index 8677d4b..8b4f01b 100644 --- a/sulawesi/parametersRS.par +++ b/sulawesi/parametersRS.par @@ -76,7 +76,7 @@ ClusteredLTS = 2 ! 1 for Global time stepping, 2,3 &Output OutputFile = 'outputs/Sulawesi' -wavefieldoutput = 1 +wavefieldoutput = 0 ! |stress |vel iOutputMask = 0 0 0 0 0 0 1 1 1 TimeInterval = 5. ! Index of printed info at time diff --git a/tpv13/tpv13.ipynb b/tpv13/tpv13.ipynb index ac1eb05..c31de0a 100644 --- a/tpv13/tpv13.ipynb +++ b/tpv13/tpv13.ipynb @@ -310,7 +310,7 @@ "def load_mesh(prefix):\n", " # Read free-surface output data\n", " reader = vtk.vtkHDFReader()\n", - " reader.SetFileName(f'outputs/{prefix}-free-surface-4.vtkhdf')\n", + " reader.SetFileName(f'outputs/{prefix}-surface-4.vtkhdf')\n", " reader.Update()\n", " return pv.wrap(reader.GetOutput())\n", "\n",