|
| 1 | +name: "GPU AT2 gcc 13.3 hip 6.2" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + precision: |
| 7 | + required: false |
| 8 | + type: string |
| 9 | + build_type: |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + |
| 13 | +jobs: |
| 14 | + # this is more work than I'd expect, but this is how you pass info after |
| 15 | + # operating on it in a job/step |
| 16 | + # TODO: factor this out into an action? |
| 17 | + # parse the inputs from the workflow call that'll be used by strategy.matrix |
| 18 | + define_matrix: |
| 19 | + runs-on: ubuntu-22.04 |
| 20 | + # define the outputs that will come from the steps below |
| 21 | + outputs: |
| 22 | + build_type: ${{ steps.build_type.outputs.build_type }} |
| 23 | + precision: ${{ steps.precision.outputs.precision }} |
| 24 | + steps: |
| 25 | + - name: Define build_type |
| 26 | + id: build_type |
| 27 | + env: |
| 28 | + # if empty (i.e., triggered by PR) make ALL default |
| 29 | + btype: ${{ inputs.build_type || 'ALL' }} |
| 30 | + # this is a little over-cautious, since the 'else' should never happen |
| 31 | + run: | |
| 32 | + case ${{ env.btype }} in |
| 33 | + "Debug") |
| 34 | + echo 'build_type=["Debug"]' >> "$GITHUB_OUTPUT" ;; |
| 35 | + "Release") |
| 36 | + echo 'build_type=["Release"]' >> "$GITHUB_OUTPUT" ;; |
| 37 | + "ALL") |
| 38 | + echo 'build_type=["Debug", "Release"]' >> "$GITHUB_OUTPUT" ;; |
| 39 | + *) |
| 40 | + echo 'build_type=["Debug", "Release"]' >> "$GITHUB_OUTPUT" ;; |
| 41 | + esac |
| 42 | + - name: Define precision |
| 43 | + id: precision |
| 44 | + env: |
| 45 | + prec: ${{ inputs.precision || 'ALL' }} |
| 46 | + run: | |
| 47 | + case ${{ env.prec }} in |
| 48 | + "Debug") |
| 49 | + echo 'precision=["single"]' >> "$GITHUB_OUTPUT" ;; |
| 50 | + "Release") |
| 51 | + echo 'precision=["double"]' >> "$GITHUB_OUTPUT" ;; |
| 52 | + "ALL") |
| 53 | + echo 'precision=["single", "double"]' >> "$GITHUB_OUTPUT" ;; |
| 54 | + *) |
| 55 | + echo 'precision=["single", "double"]' >> "$GITHUB_OUTPUT" ;; |
| 56 | + esac |
| 57 | + gcc-cuda: |
| 58 | + runs-on: [self-hosted, m4xci-snl-hip, hip, gcc] |
| 59 | + # will run other tests in the matrix even if one fails |
| 60 | + # NOTE: prioritizes extra info over speed, so consider whether this makes sense |
| 61 | + continue-on-error: false |
| 62 | + needs: define_matrix |
| 63 | + # A build matrix storing all desired configurations. |
| 64 | + strategy: |
| 65 | + fail-fast: true |
| 66 | + matrix: |
| 67 | + # to get the array instead of a string, need the fromJSON() |
| 68 | + build-type: ${{ fromJSON(needs.define_matrix.outputs.build_type) }} |
| 69 | + fp-precision: ${{ fromJSON(needs.define_matrix.outputs.precision) }} |
| 70 | + name: gcc-hip / ${{ matrix.build-type }} - ${{ matrix.fp-precision }} |
| 71 | + steps: |
| 72 | + - name: Check out the repository |
| 73 | + uses: actions/checkout@v4 |
| 74 | + with: |
| 75 | + persist-credentials: false |
| 76 | + show-progress: false |
| 77 | + submodules: recursive |
| 78 | + - name: Cloning Haero |
| 79 | + uses: actions/checkout@v4 |
| 80 | + with: |
| 81 | + repository: eagles-project/haero |
| 82 | + submodules: recursive |
| 83 | + path: haero_src |
| 84 | + - name: Show action trigger |
| 85 | + uses: ./.github/actions/show-workflow-trigger |
| 86 | + - name: Building Haero (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision) |
| 87 | + run: | |
| 88 | + cmake -S haero_src -B haero_build \ |
| 89 | + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ |
| 90 | + -DCMAKE_INSTALL_PREFIX="haero_install" \ |
| 91 | + -DCMAKE_C_COMPILER=gcc \ |
| 92 | + -DCMAKE_CXX_COMPILER=hipcc \ |
| 93 | + -DHAERO_SKIP_FIND_YAML_CPP=ON \ |
| 94 | + -DHAERO_ENABLE_MPI=OFF \ |
| 95 | + -DHAERO_ENABLE_GPU=ON \ |
| 96 | + -DHAERO_PRECISION=${{ matrix.fp-precision }} \ |
| 97 | + -DKokkos_ARCH_AMD_GFX90A=ON \ |
| 98 | + -DHAERO_DEVICE_ARCH=AMD_GFX90A |
| 99 | + cd haero_build |
| 100 | + make -j |
| 101 | + make install |
| 102 | + - name: Configuring MAM4xx (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision) |
| 103 | + run: | |
| 104 | + cmake -S . -B build \ |
| 105 | + -DCMAKE_CXX_COMPILER=hipcc \ |
| 106 | + -DCMAKE_C_COMPILER=gcc \ |
| 107 | + -DCMAKE_INSTALL_PREFIX=$(pwd)/install \ |
| 108 | + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ |
| 109 | + -DMAM4XX_HAERO_DIR=$(pwd)/haero_install \ |
| 110 | + -DNUM_VERTICAL_LEVELS=72 \ |
| 111 | + -DENABLE_COVERAGE=OFF \ |
| 112 | + -DENABLE_SKYWALKER=ON \ |
| 113 | + -DCMAKE_CUDA_ARCHITECTURES=AMD_GFX90A \ |
| 114 | + -G "Unix Makefiles" |
| 115 | + - name: Building MAM4xx (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision) |
| 116 | + run: | |
| 117 | + cd build |
| 118 | + make -j |
| 119 | + - name: Running tests (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision) |
| 120 | + run: | |
| 121 | + cd build |
| 122 | + ctest -V --output-on-failure |
0 commit comments