|
22 | 22 | parflow_dir: "parflow", |
23 | 23 | model_opts: "--ICON --eCLM --ParFlow" |
24 | 24 | } |
| 25 | + - { |
| 26 | + name: "eCLM-ParFlowGPU", |
| 27 | + use_oasis: "True", |
| 28 | + parflow_dir: "parflow", |
| 29 | + model_opts: "--eCLM --ParFlowGPU" |
| 30 | + } |
25 | 31 | # TODO - Fix PDAF GNU errors |
26 | 32 | # - { |
27 | 33 | # name: "CLM3.5-PDAF", |
@@ -55,27 +61,39 @@ jobs: |
55 | 61 | MPI_HOME: /usr/lib/x86_64-linux-gnu/openmpi |
56 | 62 | VER_NETCDF_C: 4.9.2 |
57 | 63 | VER_NETCDF_F90: 4.6.1 |
58 | | - VER_HYPRE: 2.26.0 |
| 64 | + VER_HYPRE: 2.33.0 |
59 | 65 | VER_ECCODES: 2.40.0 |
60 | 66 | VER_OASIS: tsmp-patches-v0.1 |
61 | 67 |
|
62 | 68 | steps: |
63 | 69 | - uses: actions/checkout@v4 |
64 | 70 |
|
65 | | - # These apt packages have post-install step which can't be triggered by GitHub cache. |
| 71 | + # |
| 72 | + # Install required TSMP2 dependencies |
| 73 | + # |
66 | 74 | - name: Install TSMP2 dependencies on Ubuntu |
67 | 75 | run: | |
68 | 76 | sudo apt-get update |
69 | 77 | sudo apt-get install gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev libhdf5-openmpi-hl-fortran-100t64 hdf5-helpers liblapack-dev libblas-dev |
70 | 78 |
|
71 | | - # These apt packages can be safely cached. |
72 | 79 | - name: Install extra TSMP2 dependencies on Ubuntu |
73 | 80 | uses: awalsh128/cache-apt-pkgs-action@latest |
74 | 81 | with: |
75 | 82 | packages: libxml++2.6-dev pylint wget cmake libpnetcdf-dev tcl-dev tk-dev liblzma-dev |
76 | 83 | version: 1.0 |
77 | 84 | execute_install_scripts: true |
78 | 85 |
|
| 86 | + # |
| 87 | + # Install CUDA dependencies on Ubuntu |
| 88 | + # |
| 89 | + - if: contains(matrix.config.name, 'ParFlowGPU') |
| 90 | + name: Install CUDA compiler and libraries |
| 91 | + uses: awalsh128/cache-apt-pkgs-action@latest |
| 92 | + with: |
| 93 | + packages: nvidia-cuda-toolkit nvidia-cuda-dev |
| 94 | + version: 1.0 |
| 95 | + execute_install_scripts: true |
| 96 | + |
79 | 97 | - name: Initialize dependency directory and variables |
80 | 98 | run: | |
81 | 99 | TSMP2_ROOT=$(git rev-parse --show-toplevel) |
@@ -156,38 +174,82 @@ jobs: |
156 | 174 | key: ${{ matrix.config.name }}_netcdf-f90-${{ env.VER_NETCDF_F90 }} |
157 | 175 |
|
158 | 176 | # |
159 | | - # Hypre |
| 177 | + # Hypre (OpenMP backend) |
160 | 178 | # |
161 | | - - if: contains(matrix.config.name, 'ParFlow') |
162 | | - name: Restore cached hypre-${{ env.VER_HYPRE }} |
| 179 | + - if: contains(matrix.config.name, 'ParFlow') && !contains(matrix.config.name, 'GPU') |
| 180 | + name: Restore cached hypre-${{ env.VER_HYPRE }} (OpenMP backend) |
163 | 181 | uses: actions/cache/restore@v4 |
164 | | - id: cache-hypre-restore |
| 182 | + id: cache-hypre-openmp-restore |
165 | 183 | with: |
166 | | - path: ${{ env.DEPENDENCIES_ROOT }}/hypre-${{ env.VER_HYPRE }} |
167 | | - key: ${{ matrix.config.name }}_hypre-${{ env.VER_HYPRE }} |
| 184 | + path: ${{ env.DEPENDENCIES_ROOT }}/hypre-${{ env.VER_HYPRE }}-openmp |
| 185 | + key: hypre-${{ env.VER_HYPRE }}-openmp |
168 | 186 |
|
169 | | - - if: contains(matrix.config.name, 'ParFlow') && steps.cache-hypre-restore.outputs.cache-hit != 'true' |
170 | | - name: Install hypre-${{ env.VER_HYPRE }} |
| 187 | + - if: contains(matrix.config.name, 'ParFlow') && !contains(matrix.config.name, 'GPU') && steps.cache-hypre-openmp-restore.outputs.cache-hit != 'true' |
| 188 | + name: Install hypre-${{ env.VER_HYPRE }} (OpenMP backend) |
171 | 189 | working-directory: /tmp |
172 | 190 | run: | |
173 | 191 | # Download |
174 | 192 | wget https://github.com/hypre-space/hypre/archive/v${VER_HYPRE}.tar.gz |
175 | 193 | tar xf v${VER_HYPRE}.tar.gz |
176 | | - cd hypre-${VER_HYPRE}/src |
| 194 | + cd hypre-${VER_HYPRE} |
177 | 195 |
|
178 | 196 | # Install |
179 | | - ./configure --prefix=${DEPENDENCIES_ROOT}/hypre-${VER_HYPRE} |
180 | | - make -j4 install |
| 197 | + INSTALL_DIR="${DEPENDENCIES_ROOT}/hypre-${VER_HYPRE}-openmp" |
| 198 | + cmake -S src -B bld \ |
| 199 | + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
| 200 | + -DMPI_INCLUDE_DIR="${MPI_HOME}/include" \ |
| 201 | + -DHYPRE_ENABLE_OPENMP="ON" |
| 202 | + cmake --build bld --parallel 4 |
| 203 | + cmake --install bld |
| 204 | +
|
| 205 | + # Verify |
| 206 | + tree -L 2 ${INSTALL_DIR} |
| 207 | +
|
| 208 | + - if: contains(matrix.config.name, 'ParFlow') && !contains(matrix.config.name, 'GPU') && steps.cache-hypre-openmp-restore.outputs.cache-hit != 'true' |
| 209 | + name: Cache hypre-${{ env.VER_HYPRE }} (OpenMP backend) |
| 210 | + uses: actions/cache/save@v4 |
| 211 | + with: |
| 212 | + path: ${{ env.DEPENDENCIES_ROOT }}/hypre-${{ env.VER_HYPRE }}-openmp |
| 213 | + key: hypre-${{ env.VER_HYPRE }}-openmp |
| 214 | + |
| 215 | + # |
| 216 | + # Hypre (CUDA backend) |
| 217 | + # |
| 218 | + - if: contains(matrix.config.name, 'ParFlowGPU') |
| 219 | + name: Restore cached hypre-${{ env.VER_HYPRE }} (CUDA backend) |
| 220 | + uses: actions/cache/restore@v4 |
| 221 | + id: cache-hypre-cuda-restore |
| 222 | + with: |
| 223 | + path: ${{ env.DEPENDENCIES_ROOT }}/hypre-${{ env.VER_HYPRE }}-cuda |
| 224 | + key: hypre-${{ env.VER_HYPRE }}-cuda |
| 225 | + |
| 226 | + - if: contains(matrix.config.name, 'ParFlowGPU') && steps.cache-hypre-cuda-restore.outputs.cache-hit != 'true' |
| 227 | + name: Install hypre-${{ env.VER_HYPRE }} (CUDA backend) |
| 228 | + working-directory: /tmp |
| 229 | + run: | |
| 230 | + # Download |
| 231 | + wget https://github.com/hypre-space/hypre/archive/v${VER_HYPRE}.tar.gz |
| 232 | + tar xf v${VER_HYPRE}.tar.gz |
| 233 | + cd hypre-${VER_HYPRE} |
| 234 | +
|
| 235 | + # Install |
| 236 | + INSTALL_DIR="${DEPENDENCIES_ROOT}/hypre-${VER_HYPRE}-cuda" |
| 237 | + cmake -S src -B bld \ |
| 238 | + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
| 239 | + -DMPI_INCLUDE_DIR="${MPI_HOME}/include" \ |
| 240 | + -DHYPRE_ENABLE_CUDA="ON" |
| 241 | + cmake --build bld --parallel 4 |
| 242 | + cmake --install bld |
181 | 243 |
|
182 | 244 | # Verify |
183 | | - tree -L 2 ${DEPENDENCIES_ROOT}/hypre-${VER_HYPRE} |
| 245 | + tree -L 2 ${INSTALL_DIR} |
184 | 246 |
|
185 | | - - if: contains(matrix.config.name, 'ParFlow') && steps.cache-hypre-restore.outputs.cache-hit != 'true' |
186 | | - name: Cache hypre-${{ env.VER_HYPRE }} |
| 247 | + - if: contains(matrix.config.name, 'ParFlowGPU') && steps.cache-hypre-cuda-restore.outputs.cache-hit != 'true' |
| 248 | + name: Cache hypre-${{ env.VER_HYPRE }} (CUDA backend) |
187 | 249 | uses: actions/cache/save@v4 |
188 | 250 | with: |
189 | | - path: ${{ env.DEPENDENCIES_ROOT }}/hypre-${{ env.VER_HYPRE }} |
190 | | - key: ${{ matrix.config.name }}_hypre-${{ env.VER_HYPRE }} |
| 251 | + path: ${{ env.DEPENDENCIES_ROOT }}/hypre-${{ env.VER_HYPRE }}-cuda |
| 252 | + key: hypre-${{ env.VER_HYPRE }}-cuda |
191 | 253 |
|
192 | 254 | # |
193 | 255 | # ecCodes |
@@ -359,6 +421,7 @@ jobs: |
359 | 421 | run: | |
360 | 422 | tree -FUCh --du -L 2 $(pwd) |
361 | 423 | CMAKE_PREFIX_PATH=$(ls -1 | xargs realpath | paste -sd ":" -) |
| 424 | + CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${MPI_HOME}" |
362 | 425 | echo "" && echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" |
363 | 426 | echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV |
364 | 427 |
|
|
0 commit comments