Skip to content

Commit

Permalink
added MPI CI
Browse files Browse the repository at this point in the history
using Intel MPI. The default MS-MPI github action seemed bugged
  • Loading branch information
TysonRayJones committed Feb 2, 2024
1 parent 4c53822 commit e521800
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 21 deletions.
61 changes: 56 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
push:

env:
C_FLAGS: '-Isrc -std=c99'
C_FLAGS: '-Isrc -std=c99 -lstdc++'
CPP_FLAGS: '-Isrc -std=c++14'
CUDA_FLAGS: '-Isrc -std=c++14'
MPI_FLAGS: '-Isrc -std=c++14 -DDISTRIBUTED_MODE'

jobs:


cpp_cpu:
name: C++ (CPU)
runs-on: ubuntu-latest
Expand All @@ -21,10 +23,11 @@ jobs:
run: |
g++ -c src/core.cpp $CPP_FLAGS -o core.o
g++ -c src/alts.cpp $CPP_FLAGS -o alts.o
g++ -c src/comm.cpp $CPP_FLAGS -o comm.o
- name: compile and link main
run: |
g++ main.cpp core.o alts.o $CPP_FLAGS -o main
g++ main.cpp core.o alts.o comm.o $CPP_FLAGS -o main
- name: run main
run: |
Expand All @@ -45,14 +48,38 @@ jobs:
run: |
nvcc -c src/core.cu $CUDA_FLAGS -o core.o
g++ -c src/alts.cpp $CPP_FLAGS -o alts.o
g++ -c src/comm.cpp $CPP_FLAGS -o comm.o
- name: compile main
run: |
g++ -c main.cpp $CPP_FLAGS -o main.o
- name: link
run: |
nvcc main.o core.o alts.o $CUDA_FLAGS -o main
nvcc main.o core.o alts.o comm.o $CUDA_FLAGS -o main
cpp_mpi:
name: C++ (MPI)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1

- name: compile backend
run: |
g++ -c src/core.cpp $CPP_FLAGS -o core.o
g++ -c src/alts.cpp $CPP_FLAGS -o alts.o
mpic++ -c src/comm.cpp $MPI_FLAGS -o comm.o
- name: compile and link main
run: |
mpic++ main.cpp core.o alts.o comm.o $CPP_FLAGS -o main
- name: run main
run: |
mpiexec -n 2 ./main
c_cpu:
name: C (CPU)
Expand All @@ -65,10 +92,11 @@ jobs:
run: |
g++ -c src/core.cpp $CPP_FLAGS -o core.o
g++ -c src/alts.cpp $CPP_FLAGS -o alts.o
g++ -c src/comm.cpp $CPP_FLAGS -o comm.o
- name: compile and link main
run: |
gcc main.c core.o alts.o $C_FLAGS -o main
gcc main.c core.o alts.o comm.o $C_FLAGS -o main
- name: run main
run: |
Expand All @@ -89,11 +117,34 @@ jobs:
run: |
nvcc -c src/core.cu $CUDA_FLAGS -o core.o
g++ -c src/alts.cpp $CPP_FLAGS -o alts.o
g++ -c src/comm.cpp $CPP_FLAGS -o comm.o
- name: compile main
run: |
gcc -c main.c $CPP_FLAGS -o main.o
- name: link
run: |
nvcc main.o core.o alts.o $CUDA_FLAGS -o main
nvcc main.o core.o alts.o comm.o $CUDA_FLAGS -o main
c_mpi:
name: C (MPI)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1

- name: compile backend
run: |
g++ -c src/core.cpp $CPP_FLAGS -o core.o
g++ -c src/alts.cpp $CPP_FLAGS -o alts.o
mpic++ -c src/comm.cpp $MPI_FLAGS -o comm.o
- name: compile and link main
run: |
mpicc main.c core.o alts.o comm.o $C_FLAGS -o main
- name: run main
run: |
mpiexec -np 2 ./main
57 changes: 53 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
push:

env:
C_FLAGS: '-Isrc -std=c99'
C_FLAGS: '-Isrc -std=c99 -lstdc++'
CPP_FLAGS: '-Isrc -std=c++14'
CUDA_FLAGS: '-Isrc -std=c++14'
MPI_FLAGS: '-Isrc -std=c++14 -DDISTRIBUTED_MODE'

jobs:


cpp_cpu:
name: C++ (CPU)
runs-on: macos-latest
Expand All @@ -21,15 +23,39 @@ jobs:
run: |
clang++ -c src/core.cpp $CPP_FLAGS -o core.o
clang++ -c src/alts.cpp $CPP_FLAGS -o alts.o
clang++ -c src/comm.cpp $CPP_FLAGS -o comm.o
- name: compile and link main
run: |
clang++ main.cpp core.o alts.o $CPP_FLAGS -o main
clang++ main.cpp core.o alts.o comm.o $CPP_FLAGS -o main
- name: run main
run: |
./main
cpp_mpi:
name: C++ (MPI)
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1

- name: compile backend
run: |
clang++ -c src/core.cpp $CPP_FLAGS -o core.o
clang++ -c src/alts.cpp $CPP_FLAGS -o alts.o
mpic++ -c src/comm.cpp $MPI_FLAGS -o comm.o
- name: compile and link main
run: |
mpic++ main.cpp core.o alts.o comm.o $CPP_FLAGS -o main
- name: run main
run: |
mpiexec -n 2 ./main
c_cpu:
name: C (CPU)
runs-on: macos-latest
Expand All @@ -41,11 +67,34 @@ jobs:
run: |
clang++ -c src/core.cpp $CPP_FLAGS -o core.o
clang++ -c src/alts.cpp $CPP_FLAGS -o alts.o
clang++ -c src/comm.cpp $CPP_FLAGS -o comm.o
- name: compile and link main
run: |
clang main.c core.o alts.o comm.o $C_FLAGS -o main
- name: run main
run: |
./main
c_mpi:
name: C (MPI)
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1

- name: compile backend
run: |
clang++ -c src/core.cpp $CPP_FLAGS -o core.o
clang++ -c src/alts.cpp $CPP_FLAGS -o alts.o
mpic++ -c src/comm.cpp $MPI_FLAGS -o comm.o
- name: compile and link main
run: |
clang main.c core.o alts.o $C_FLAGS -o main
mpicc main.c core.o alts.o comm.o $C_FLAGS -o main
- name: run main
run: |
./main
mpiexec -np 2 ./main
77 changes: 65 additions & 12 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ env:
# NVCC requires = syntax (yes, really!)
CUDA_FLAGS: -Isrc -std=c++14 -arch=sm_61 -lcudart

MPI_FLAGS: '-Isrc -std=c++14 -DDISTRIBUTED_MODE'

jobs:

cpp_cpu:
name: C++ (CPU)
runs-on: windows-2019
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -27,18 +29,19 @@ jobs:
run: |
cl -c src/core.cpp ${{ env.CPP_FLAGS }}
cl -c src/alts.cpp ${{ env.CPP_FLAGS }}
cl -c src/comm.cpp ${{ env.CPP_FLAGS }}
- name: compile and link main
run: |
cl main.cpp core.obj alts.obj ${{ env.CPP_FLAGS }}
cl main.cpp core.obj alts.obj comm.obj ${{ env.CPP_FLAGS }}
- name: run main
run: |
./main.exe
cpp_gpu:
name: C++ (GPU)
runs-on: windows-2019
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -52,18 +55,45 @@ jobs:
run: |
nvcc -c src/core.cu ${{ env.CUDA_FLAGS }}
cl -c src/alts.cpp ${{ env.CPP_FLAGS }}
cl -c src/comm.cpp ${{ env.CPP_FLAGS }}
- name: compile main
run: |
cl -c main.cpp ${{ env.CPP_FLAGS }}
- name: link
run: |
nvcc -o main.exe main.obj core.obj alts.obj ${{ env.CUDA_FLAGS }}
nvcc -o main.exe main.obj core.obj alts.obj comm.obj ${{ env.CUDA_FLAGS }}
cpp_mpi:
name: C++ (MPI)
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: mpi4py/setup-mpi@v1
with:
mpi: 'intelmpi'

- name: compile backend
run: |
cl -c src/core.cpp ${{ env.CPP_FLAGS }}
cl -c src/alts.cpp ${{ env.CPP_FLAGS }}
mpicxx -c src/comm.cpp ${{ env.MPI_FLAGS }}
- name: compile and link main
run: |
mpicxx main.cpp core.obj alts.obj comm.obj ${{ env.CPP_FLAGS }}
- name: run main
run: |
mpiexec -np 2 ./main.exe
c_cpu:
name: C (CPU)
runs-on: windows-2019
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -73,22 +103,19 @@ jobs:
run: |
cl -c src/core.cpp ${{ env.CPP_FLAGS }}
cl -c src/alts.cpp ${{ env.CPP_FLAGS }}
cl -c src/comm.cpp ${{ env.CPP_FLAGS }}
- name: compile and link main
run: |
cl main.c core.obj alts.obj ${{ env.C_FLAGS }}
- name: arg test
run : |
echo '${{ env.CPP_FLAGS }}'
cl main.c core.obj alts.obj comm.obj ${{ env.C_FLAGS }}
- name: run main
run: |
./main.exe
c_gpu:
name: C (GPU)
runs-on: windows-2019
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -102,11 +129,37 @@ jobs:
run: |
nvcc -c src/core.cu ${{ env.CUDA_FLAGS }}
cl -c src/alts.cpp ${{ env.CPP_FLAGS }}
cl -c src/comm.cpp ${{ env.CPP_FLAGS }}
- name: compile main
run: |
cl -c main.c ${{ env.CPP_FLAGS }}
- name: link
run: |
nvcc -o main.exe main.obj core.obj alts.obj ${{ env.CUDA_FLAGS }}
nvcc -o main.exe main.obj core.obj alts.obj comm.obj ${{ env.CUDA_FLAGS }}
c_mpi:
name: C (MPI)
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: mpi4py/setup-mpi@v1
with:
mpi: 'intelmpi'

- name: compile backend
run: |
cl -c src/core.cpp ${{ env.CPP_FLAGS }}
cl -c src/alts.cpp ${{ env.CPP_FLAGS }}
mpicxx -c src/comm.cpp ${{ env.MPI_FLAGS }}
- name: compile and link main
run: |
mpicc main.c core.obj alts.obj comm.obj ${{ env.C_FLAGS }}
- name: run main
run: |
mpiexec -np 2 ./main.exe

0 comments on commit e521800

Please sign in to comment.