Skip to content

Commit 7649eaf

Browse files
Create mpi.yml
1 parent 01739b9 commit 7649eaf

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/mpi.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: MPI Galaxy Demo
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
11+
concurrency:
12+
group: mpi-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
mpi-galaxy:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Install dependencies (MPI + HDF5 + Python)
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y mpich libhdf5-dev libomp-dev cmake build-essential python3
27+
28+
- name: Configure project (CMake)
29+
run: |
30+
mkdir -p build
31+
cd build
32+
cmake .. -DCMAKE_BUILD_TYPE=Release -DNEXT_FP64=ON -DNEXT_MPI=ON
33+
34+
- name: Build project
35+
run: |
36+
cd build
37+
cmake --build . -- -j$(nproc)
38+
39+
- name: Run Galaxy demo (timed)
40+
run: |
41+
# Go back to project root
42+
cd $GITHUB_WORKSPACE/examples/GalaxyDemo
43+
python3 galaxy.py
44+
# Run with 2 MPI ranks and 2 OpenMP threads, stop after 20s
45+
OMP_NUM_THREADS=2 timeout 20s mpiexec -n 2 ../../build/next galaxy.txt 2 0.01 0.1 hdf5
46+
47+
- name: Upload simulation outputs
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: galaxy-dumps
51+
path: |
52+
examples/GalaxyDemo/dump_*.hdf5
53+
examples/GalaxyDemo/dump_*.xdmf

0 commit comments

Comments
 (0)