diff --git a/.github/workflows/docker-bases.yml b/.github/workflows/docker-bases.yml index ba1582ac2a..d2bed47180 100644 --- a/.github/workflows/docker-bases.yml +++ b/.github/workflows/docker-bases.yml @@ -101,16 +101,6 @@ jobs: build-args: 'arch=icx' tags: 'devitocodes/bases:cpu-icx' - - name: ICC image - uses: docker/build-push-action@v3 - with: - context: . - file: './docker/Dockerfile.cpu' - push: true - target: 'icc' - build-args: 'arch=icc' - tags: 'devitocodes/bases:cpu-icc' - ####################################################### ################### Nvidia nvhpc ###################### ####################################################### @@ -250,7 +240,7 @@ jobs: context: . file: './docker/Dockerfile.amd' push: true - target: 'aomp' + target: 'amdclang' tags: devitocodes/bases:amd - name: AMD HIP image diff --git a/.github/workflows/docker-devito.yml b/.github/workflows/docker-devito.yml index a5f127b8d4..6f4313500a 100644 --- a/.github/workflows/docker-devito.yml +++ b/.github/workflows/docker-devito.yml @@ -43,12 +43,6 @@ jobs: test: 'tests/test_operator.py' runner: ubuntu-latest - - base: 'bases:cpu-icc' - tag: "icc" - flag: '' - test: 'tests/test_operator.py' - runner: ubuntu-latest - - base: 'bases:cpu-icx' tag: "icx" flag: '' diff --git a/.github/workflows/pytest-core-mpi.yml b/.github/workflows/pytest-core-mpi.yml index d6ca8e80e8..0811d51289 100644 --- a/.github/workflows/pytest-core-mpi.yml +++ b/.github/workflows/pytest-core-mpi.yml @@ -59,7 +59,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - arch: [gcc, icc, icx] + arch: [gcc, icx] steps: - name: Checkout devito diff --git a/.github/workflows/pytest-core-nompi.yml b/.github/workflows/pytest-core-nompi.yml index 11063b6b36..03a2b904a1 100644 --- a/.github/workflows/pytest-core-nompi.yml +++ b/.github/workflows/pytest-core-nompi.yml @@ -37,9 +37,8 @@ jobs: pytest-ubuntu-py38-gcc8-omp, pytest-ubuntu-py39-gcc9-omp, pytest-osx-py37-clang-omp, - pytest-docker-py37-gcc-omp, - pytest-docker-py37-icc-omp, - pytest-docker-py38-icx-omp + pytest-docker-py39-gcc-omp, + pytest-docker-py39-icx-omp ] set: [base, adjoint] include: @@ -92,26 +91,19 @@ jobs: language: "C" sympy: "1.9" - - name: pytest-docker-py37-gcc-omp - python-version: '3.7' + - name: pytest-docker-py39-gcc-omp + python-version: '3.9' os: ubuntu-latest arch: "gcc" language: "openmp" - sympy: "1.10" + sympy: "1.12" - - name: pytest-docker-py37-icc-omp - python-version: '3.7' - os: ubuntu-22.04 - arch: "icc" - language: "openmp" - sympy: "1.11" - - - name: pytest-docker-py38-icx-omp - python-version: '3.8' + - name: pytest-docker-py39-icx-omp + python-version: '3.9' os: ubuntu-22.04 arch: "icx" language: "openmp" - sympy: "1.11" + sympy: "1.12" - set: base test-set: 'not adjoint' diff --git a/.github/workflows/tutorials.yml b/.github/workflows/tutorials.yml index 6e1bad8761..b869aea7c8 100644 --- a/.github/workflows/tutorials.yml +++ b/.github/workflows/tutorials.yml @@ -32,7 +32,7 @@ jobs: tutos-ubuntu-gcc-py37, tutos-osx-gcc-py37, tutos-osx-clang-py37, - tutos-docker-gcc-py37 + tutos-docker-gcc-py39 ] include: @@ -51,7 +51,7 @@ jobs: compiler: clang language: "C" - - name: tutos-docker-gcc-py37 + - name: tutos-docker-gcc-py39 os: ubuntu-latest compiler: gcc language: "openmp" @@ -61,7 +61,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Python 3.7 - if: matrix.name != 'tutos-docker-gcc-py37' + if: "!contains(matrix.name, 'docker')" uses: actions/setup-python@v4 with: python-version: 3.7 @@ -72,13 +72,13 @@ jobs: xcode-version: latest-stable - name: Build docker image - if: matrix.name == 'tutos-docker-gcc-py37' + if: "contains(matrix.name, 'docker')" run: | docker build . --file docker/Dockerfile.devito --tag devito_img - name: Set run prefix run: | - if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py37' ]; then + if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py39' ]; then echo "RUN_CMD=docker run --rm --name testrun devito_img" >> $GITHUB_ENV else echo "RUN_CMD=" >> $GITHUB_ENV @@ -86,7 +86,7 @@ jobs: id: set-run - name: Install dependencies - if: matrix.name != 'tutos-docker-gcc-py37' + if: matrix.name != 'tutos-docker-gcc-py39' run: | python -m pip install --upgrade pip pip install -e .[tests,extras] diff --git a/docker/Dockerfile.amd b/docker/Dockerfile.amd index f6dab252ea..629054fd30 100644 --- a/docker/Dockerfile.amd +++ b/docker/Dockerfile.amd @@ -65,7 +65,7 @@ WORKDIR /tmp # Install UCX RUN cd /tmp/ \ - && git clone https://github.com/openucx/ucx.git -b ${UCX_BRANCH} \ + && git clone --depth 1 https://github.com/openucx/ucx.git -b ${UCX_BRANCH} \ && cd ucx \ && ./autogen.sh \ && mkdir build \ @@ -82,8 +82,26 @@ RUN cd /tmp/ \ && make -j ${nproc} \ && make install +# Install OpenMPI +RUN cd /tmp \ + && git clone --depth 1 --recursive https://github.com/open-mpi/ompi.git -b ${OMPI_BRANCH} \ + && cd ompi \ + && ./autogen.pl \ + && mkdir build \ + && cd build \ + && ../configure --prefix=$OMPI_HOME --with-ucx=$UCX_HOME \ + CC=amdclang CXX=amdclang++ FC=amdflang F90=amdflang \ + --enable-mca-no-build=btl-uct \ + --without-verbs \ + --with-pmix \ + --enable-mpi \ + --enable-mpi-fortran=yes \ + --disable-debug \ + && make -j ${nproc} \ + && make install + # Cleanup -RUN rm -rf /tmp/ucx +RUN rm -rf /tmp/ucx && rm -rf /tmp/ompi # Adding OpenMPI and UCX to Environment ENV PATH=$OMPI_HOME/bin:$UCX_HOME/bin:$PATH \ @@ -117,26 +135,7 @@ CMD ["/bin/bash"] # AOMP for GPUs (OpenMP offloading) ######################################################################## # This will only trigger if arch is aomp since the final stage depends on it -FROM sdk-base as aomp - -# Install OpenMPI -RUN cd /tmp \ - && git clone --recursive https://github.com/open-mpi/ompi.git -b ${OMPI_BRANCH} \ - && cd ompi \ - && ./autogen.pl \ - && mkdir build \ - && cd build \ - && ../configure --prefix=$OMPI_HOME --with-ucx=$UCX_HOME \ - CC=amdclang CXX=amdclang++ FC=amdflang F90=amdflang \ - --enable-mca-no-build=btl-uct \ - --without-verbs \ - --with-pmix \ - --enable-mpi \ - --enable-mpi-fortran=yes \ - --disable-debug \ - && make -j ${nproc} \ - && make install -RUN RUN rm -rf /tmp/ompi +FROM sdk-base as amdclang # MPI env ENV OMPI_CC="amdclang" @@ -153,25 +152,6 @@ ENV DEVITO_LANGUAGE="openmp" # This will only trigger if arch is hip since the final stage depends on it FROM sdk-base as hip -# Install OpenMPI -RUN cd /tmp \ - && git clone --recursive https://github.com/open-mpi/ompi.git -b ${OMPI_BRANCH} \ - && cd ompi \ - && ./autogen.pl \ - && mkdir build \ - && cd build \ - && ../configure --prefix=$OMPI_HOME --with-ucx=$UCX_HOME \ - CC=hipcc CXX=hipcc FC=hipfort F90=hipfort \ - --enable-mca-no-build=btl-uct \ - --without-verbs \ - --with-pmix \ - --enable-mpi \ - --enable-mpi-fortran=yes \ - --disable-debug \ - && make -j ${nproc} \ - && make install -RUN RUN rm -rf /tmp/ompi - # MPI env ENV OMPI_CC="hipcc" ENV OMPI_CXX="hipcc" diff --git a/docker/Dockerfile.cpu b/docker/Dockerfile.cpu index 02d7e91552..afa26ceff4 100644 --- a/docker/Dockerfile.cpu +++ b/docker/Dockerfile.cpu @@ -5,6 +5,7 @@ ARG pyversion=python:3.9 ARG arch=gcc +ARG OMPI_BRANCH="v4.1.4" # Base image FROM ${pyversion}-slim-bullseye as base @@ -34,8 +35,10 @@ CMD ["/bin/bash"] ############################################################## FROM base as gcc +ARG OMPI_BRANCH="v4.1.4" +# Install OpenMPI RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \ - git clone --recursive --branch v4.1.4 https://github.com/open-mpi/ompi.git openmpi && \ + git clone --depth 1 --recursive --branch ${OMPI_BRANCH} https://github.com/open-mpi/ompi.git openmpi && \ cd openmpi && ./autogen.pl && \ mkdir build && cd build && \ ../configure --prefix=/opt/openmpi/ \ @@ -71,6 +74,7 @@ ENV FI_PROVIDER_PATH $I_MPI_ROOT/libfabric/lib/prov:/usr/lib64/libfabric:${LD_LI ############################################################## # ICC image +# This is a legacy setup that is not built anymore but kept for reference ############################################################## FROM oneapi as icc diff --git a/docker/README.md b/docker/README.md index 4149660009..10e8996a5d 100644 --- a/docker/README.md +++ b/docker/README.md @@ -10,9 +10,9 @@ Devito provides several images that target different architectures and compilers We provide two CPU images: - `devito:gcc-*` with the standard GNU gcc compiler. -- `devito:icc-*` with the Intel C compiler for Intel architectures. +- `devito:icx-*` with the Intel C compiler for Intel architectures. -These images provide a working environment for any CPU architecture and come with [Devito], `gcc/icc` and `mpi` preinstalled, and utilities such as `jupyter` for usability and exploration of the package. +These images provide a working environment for any CPU architecture and come with [Devito], `gcc/icx` and `mpi` preinstalled, and utilities such as `jupyter` for usability and exploration of the package. To run this image locally, you will first need to install `docker`. Then, the following commands will get you started: