From 420e32dc0d04c77bdd79dc7eceb13373630139a3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Mar 2024 15:33:23 -0500 Subject: [PATCH 1/2] Incorporate aocc workflow into structure --- .github/workflows/aocc-ompi-auto.yml | 98 ++++++++++++++++++++++ .github/workflows/aocc-ompi-cmake.yml | 92 ++++++++++++++++++++ .github/workflows/autotools.yml | 6 ++ .github/workflows/cmake.yml | 6 ++ .github/workflows/linux-auto-aocc-ompi.yml | 73 ---------------- .github/workflows/main-cmake-par.yml | 20 +---- .github/workflows/nvhpc-auto.yml | 3 +- 7 files changed, 207 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/aocc-ompi-auto.yml create mode 100644 .github/workflows/aocc-ompi-cmake.yml delete mode 100644 .github/workflows/linux-auto-aocc-ompi.yml diff --git a/.github/workflows/aocc-ompi-auto.yml b/.github/workflows/aocc-ompi-auto.yml new file mode 100644 index 00000000000..7d5aa4bfc5a --- /dev/null +++ b/.github/workflows/aocc-ompi-auto.yml @@ -0,0 +1,98 @@ +name: hdf5 dev PAR autotools aocc ompi + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + aocc_build_and_test: + name: "aocc ${{ inputs.build_mode }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + + - name: Install Linux dependencies + shell: bash + run: | + sudo apt update + sudo apt install -y autoconf automake libtool libtool-bin libaec-dev + sudo apt install -y doxygen libncurses-dev libquadmath0 libstdc++6 libxml2 + sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 + sudo apt install -y m4 flex bison cmake libzip-dev openssl build-essential + + - name: Install AOCC 4.1.0 + run: | + wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0.tar + tar -xvf aocc-compiler-4.1.0.tar + cd aocc-compiler-4.1.0 + bash install.sh + source /home/runner/work/hdf5/hdf5/setenv_AOCC.sh + which clang + which flang + clang -v + + - name: Cache OpenMPI 4.1.5 installation + id: cache-openmpi-4_1_5 + uses: actions/cache@v4 + with: + path: /home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + key: ${{ runner.os }}-${{ runner.arch }}-openmpi-4_1_5-cache + + - name: Install OpenMPI 4.1.5 + if: ${{ steps.cache-openmpi-4_1_5.outputs.cache-hit != 'true' }} + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib + wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz + tar zxvf openmpi-4.1.5.tar.gz + cd openmpi-4.1.5 + ./configure CC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/clang FC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/flang --prefix=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + make + make install + + - name: Autotools Configure + env: + NPROCS: 2 + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export LD_RUN_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + sh ./autogen.sh + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CC=mpicc $GITHUB_WORKSPACE/configure \ + --prefix=/tmp \ + --enable-build-mode=${{ inputs.build_mode }} \ + --enable-shared \ + --enable-parallel \ + LDFLAGS="-L/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib \ + -L/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib" + + # BUILD + - name: Autotools Build + shell: bash + run: | + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + make -j3 + working-directory: ${{ runner.workspace }}/build + + # RUN TESTS + # NORMAL + - name: Autotools Run Tests + run: | + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + make check -j + working-directory: ${{ runner.workspace }}/build + + # INSTALL (note that this runs even when we don't run the tests) + - name: Autotools Install + run: | + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + make install + working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/aocc-ompi-cmake.yml b/.github/workflows/aocc-ompi-cmake.yml new file mode 100644 index 00000000000..171cf452fe8 --- /dev/null +++ b/.github/workflows/aocc-ompi-cmake.yml @@ -0,0 +1,92 @@ +name: hdf5 dev PAR CMake aocc ompi + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + aocc_build_and_test: + name: "aocc ${{ inputs.build_mode }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + + - name: Install Linux dependencies + shell: bash + run: | + sudo apt update + sudo apt install -y libaec-dev ninja-build + sudo apt install -y doxygen libncurses-dev libquadmath0 libstdc++6 libxml2 + sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 + sudo apt install -y m4 flex bison cmake libzip-dev openssl build-essential + + - name: Install AOCC 4.1.0 + run: | + wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0.tar + tar -xvf aocc-compiler-4.1.0.tar + cd aocc-compiler-4.1.0 + bash install.sh + source /home/runner/work/hdf5/hdf5/setenv_AOCC.sh + which clang + which flang + clang -v + + - name: Cache OpenMPI 4.1.5 installation + id: cache-openmpi-4_1_5 + uses: actions/cache@v4 + with: + path: /home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + key: ${{ runner.os }}-${{ runner.arch }}-openmpi-4_1_5-cache + + - name: Install OpenMPI 4.1.5 + if: ${{ steps.cache-openmpi-4_1_5.outputs.cache-hit != 'true' }} + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib + wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz + tar zxvf openmpi-4.1.5.tar.gz + cd openmpi-4.1.5 + ./configure CC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/clang FC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/flang --prefix=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + make + make install + + - name: CMake Configure with aocc + shell: bash + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export LD_RUN_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CC=mpicc cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \ + -DHDF5_ENABLE_PARALLEL:BOOL=ON \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_BUILD_FORTRAN:BOOL=ON \ + -DHDF5_BUILD_JAVA:BOOL=OFF \ + -DMPIEXEC_MAX_NUMPROCS:STRING="2" \ + $GITHUB_WORKSPACE + #cat src/libhdf5.settings + + # BUILD + - name: CMake Build + shell: bash + run: | + cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + working-directory: ${{ runner.workspace }}/build + + # RUN TESTS + - name: CMake Run Tests + shell: bash + run: | + ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -E "ph5_f90_hyperslab_by_chunk|ph5_f90_hyperslab_by_pattern" + working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/autotools.yml b/.github/workflows/autotools.yml index 4075b259d79..b31dbf98caf 100644 --- a/.github/workflows/autotools.yml +++ b/.github/workflows/autotools.yml @@ -70,3 +70,9 @@ jobs: uses: ./.github/workflows/nvhpc-auto.yml with: build_mode: "production" + + call-release-auto-aocc: + name: "Autotools aocc Workflows" + uses: ./.github/workflows/aocc-ompi-auto.yml + with: + build_mode: "production" diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7911be7354e..b7f8a2bb9d8 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -73,3 +73,9 @@ jobs: uses: ./.github/workflows/nvhpc-cmake.yml with: build_mode: "Release" + + call-release-cmake-aocc: + name: "CMake nvhpc Workflows" + uses: ./.github/workflows/aocc-ompi-cmake.yml + with: + build_mode: "Release" diff --git a/.github/workflows/linux-auto-aocc-ompi.yml b/.github/workflows/linux-auto-aocc-ompi.yml deleted file mode 100644 index a8c51eac1cd..00000000000 --- a/.github/workflows/linux-auto-aocc-ompi.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: hdf5 dev autotools aocc ompi - -on: - push: - pull_request: - branches: - - develop - paths-ignore: - - '.github/CODEOWNERS' - - '.github/FUNDING.yml' - - 'doc/**' - - 'release_docs/**' - - 'ACKNOWLEDGEMENTS' - - 'COPYING**' - - '**.md' - -# Using concurrency to cancel any in-progress job or run -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.1 - - - name: Install System dependencies - run: | - sudo apt update - sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen openssl libtool libtool-bin build-essential libncurses-dev libquadmath0 libstdc++6 libxml2 - - name: Install AOCC 4.1.0 - run: | - wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0.tar - tar -xvf aocc-compiler-4.1.0.tar - cd aocc-compiler-4.1.0 - bash install.sh - source /home/runner/work/hdf5/hdf5/setenv_AOCC.sh - which clang - which flang - clang -v - - name: Cache OpenMPI 4.1.5 installation - id: cache-openmpi-4_1_5 - uses: actions/cache@v4 - with: - path: /home/runner/work/hdf5/hdf5/openmpi-4.1.5-install - key: ${{ runner.os }}-${{ runner.arch }}-openmpi-4_1_5-cache - - if: ${{ steps.cache-openmpi-4_1_5.outputs.cache-hit != 'true' }} - name: Install OpenMPI 4.1.5 - run: | - export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib - wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz - tar zxvf openmpi-4.1.5.tar.gz - cd openmpi-4.1.5 - ./configure CC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/clang FC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/flang --prefix=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install - make - make install - - name: Install HDF5 - env: - NPROCS: 2 - run: | - export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib - export LD_RUN_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib - export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH - ./autogen.sh - ./configure --prefix=/tmp --enable-parallel --enable-shared CC=mpicc LDFLAGS="-L/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib -L/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib" - make -j - make check -j - make install - make uninstall diff --git a/.github/workflows/main-cmake-par.yml b/.github/workflows/main-cmake-par.yml index faecefcd952..f023cdf8d1c 100644 --- a/.github/workflows/main-cmake-par.yml +++ b/.github/workflows/main-cmake-par.yml @@ -1,6 +1,5 @@ name: hdf5 dev PAR CMake CI -# Controls when the action will run. Triggers the workflow on a call on: workflow_call: inputs: @@ -12,9 +11,6 @@ on: permissions: contents: read -# A workflow run is made up of one or more jobs that can run sequentially or -# in parallel. We just have one job, but the matrix items defined below will -# run in parallel. jobs: # # The GitHub runners are inadequate for running parallel HDF5 tests, @@ -25,15 +21,10 @@ jobs: # CMake_build_parallel: name: "Parallel GCC-${{ inputs.build_mode }}" - # Don't run the action if the commit message says to skip CI - if: ${{ inputs.thread_safety != 'TS' }} - - # The type of runner that the job will run on runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # SETUP + - uses: actions/checkout@v4.1.1 + - name: Install Linux Dependencies run: | sudo apt update @@ -45,12 +36,8 @@ jobs: echo "CC=mpicc" >> $GITHUB_ENV echo "FC=mpif90" >> $GITHUB_ENV - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Get Sources - uses: actions/checkout@v4.1.1 - - # CMAKE CONFIGURE - name: CMake Configure + shell: bash run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" @@ -69,7 +56,6 @@ jobs: -DHDF5_ENABLE_ROS3_VFD:BOOL=OFF \ -DHDF5_PACK_EXAMPLES:BOOL=ON \ $GITHUB_WORKSPACE - shell: bash # BUILD - name: CMake Build diff --git a/.github/workflows/nvhpc-auto.yml b/.github/workflows/nvhpc-auto.yml index 158a8614cb2..bc6c9350ac1 100644 --- a/.github/workflows/nvhpc-auto.yml +++ b/.github/workflows/nvhpc-auto.yml @@ -23,7 +23,8 @@ jobs: sudo apt-get update sudo apt-get install autoconf automake libtool libtool-bin libaec-dev sudo apt-get install doxygen graphviz - sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openssl build-essential + sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 + sudo apt install -y m4 flex bison cmake libzip-dev openssl build-essential - name: Install NVHPC shell: bash From dea2193f1e72df71136345105ced33e6552dc043 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Mar 2024 15:51:08 -0500 Subject: [PATCH 2/2] adjust parameters --- .github/workflows/aocc-ompi-auto.yml | 6 ++++++ .github/workflows/aocc-ompi-cmake.yml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aocc-ompi-auto.yml b/.github/workflows/aocc-ompi-auto.yml index 7d5aa4bfc5a..be67672407b 100644 --- a/.github/workflows/aocc-ompi-auto.yml +++ b/.github/workflows/aocc-ompi-auto.yml @@ -77,6 +77,8 @@ jobs: # BUILD - name: Autotools Build shell: bash + env: + NPROCS: 2 run: | export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH make -j3 @@ -85,6 +87,8 @@ jobs: # RUN TESTS # NORMAL - name: Autotools Run Tests + env: + NPROCS: 2 run: | export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH make check -j @@ -92,6 +96,8 @@ jobs: # INSTALL (note that this runs even when we don't run the tests) - name: Autotools Install + env: + NPROCS: 2 run: | export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH make install diff --git a/.github/workflows/aocc-ompi-cmake.yml b/.github/workflows/aocc-ompi-cmake.yml index 171cf452fe8..f2a834d063f 100644 --- a/.github/workflows/aocc-ompi-cmake.yml +++ b/.github/workflows/aocc-ompi-cmake.yml @@ -71,7 +71,7 @@ jobs: -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ -DLIBAEC_USE_LOCALCONTENT=OFF \ -DZLIB_USE_LOCALCONTENT=OFF \ - -DHDF5_BUILD_FORTRAN:BOOL=ON \ + -DHDF5_BUILD_FORTRAN:BOOL=OFF \ -DHDF5_BUILD_JAVA:BOOL=OFF \ -DMPIEXEC_MAX_NUMPROCS:STRING="2" \ $GITHUB_WORKSPACE @@ -88,5 +88,5 @@ jobs: - name: CMake Run Tests shell: bash run: | - ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -E "ph5_f90_hyperslab_by_chunk|ph5_f90_hyperslab_by_pattern" + ctest . --parallel 2 -C ${{ inputs.build_mode }} -V working-directory: ${{ runner.workspace }}/build