Skip to content

Commit

Permalink
Use artifacts to share MPI installations between jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF committed Oct 30, 2024
1 parent 8d5a704 commit cf0fe62
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build_mpich_source.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Build MPICH from source using the latest commit on the
# 'main' branch and cache the results. The result is installed
# to (or restored to) '${{ runner.workspace }}/mpich'.
# to (or restored to) '${{ runner.workspace }}/mpich' and
# an artifact called 'mpich' is saved for later use.

# Triggers the workflow on a call from another workflow
on:
Expand Down Expand Up @@ -80,3 +81,10 @@ jobs:
--enable-threads=multiple
make -j2
make install
- name: Save MPICH installation artifact
uses: actions/upload-artifact@v4
with:
name: mpich
path: ${{ runner.workspace }}/mpich
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
10 changes: 9 additions & 1 deletion .github/workflows/build_openmpi_source.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Build OpenMPI from source using the latest commit on the
# 'main' branch and cache the results. The result is installed
# to (or restored to) '${{ runner.workspace }}/openmpi'.
# to (or restored to) '${{ runner.workspace }}/openmpi' and
# an artifact called 'openmpi' is saved for later use.

# Triggers the workflow on a call from another workflow
on:
Expand Down Expand Up @@ -73,3 +74,10 @@ jobs:
--enable-debug
make -j2
make install
- name: Save OpenMPI installation artifact
uses: actions/upload-artifact@v4
with:
name: openmpi
path: ${{ runner.workspace }}/openmpi
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
28 changes: 22 additions & 6 deletions .github/workflows/cmake-par-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,28 @@ permissions:
contents: read

jobs:
Build_openmpi_source:
name: Build OpenMPI from source
uses: ./.github/workflows/build_openmpi_source.yml
with:
build_mode: ${{ inputs.build_mode }}

Build_mpich_source:
name: Build MPICH from source
uses: ./.github/workflows/build_mpich_source.yml
with:
build_mode: ${{ inputs.build_mode }}

CMake_build_parallel_src_openmpi:
needs: Build_openmpi_source
name: "Parallel OpenMPI GCC-${{ inputs.build_mode }}"
runs-on: ubuntu-latest
steps:
- name: Build MPI (OpenMPI)
uses: ./.github/workflows/build_openmpi_source.yml
- name: Get OpenMPI installation
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
build_mode: ${{ inputs.build_mode }}
name: openmpi
path: ${{ runner.workspace }}/openmpi

- name: Set path (OpenMPI)
shell: bash
Expand Down Expand Up @@ -130,15 +144,17 @@ jobs:
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

CMake_build_parallel_src_mpich:
needs: Build_mpich_source
name: "Parallel Mpich GCC-${{ inputs.build_mode }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7

- name: Build MPI (MPICH)
uses: ./.github/workflows/build_mpich_source.yml
- name: Get MPICH installation
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
build_mode: ${{ inputs.build_mode }}
name: mpich
path: ${{ runner.workspace }}/mpich

- name: Set path (MPICH)
shell: bash
Expand Down

0 comments on commit cf0fe62

Please sign in to comment.