Skip to content

Commit

Permalink
test linux openmp
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonRayJones committed Feb 2, 2024
1 parent 162afd2 commit 1dca25a
Showing 1 changed file with 150 additions and 1 deletion.
151 changes: 150 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:

CUDA_FLAGS: ''
MPI_FLAGS: '-DDISTRIBUTED_MODE'
OPENMP_FLAGS: '-fopenmp'

jobs:

Expand Down Expand Up @@ -154,4 +155,152 @@ jobs:
- name: run main
run: |
mpiexec -np 2 ./main
mpiexec -np 2 ./main
cpp_cpu_multi:
name: C++ (CPU) (OpenMP)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: compile backend
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
g++ -c src/multi.cpp $CPP_FLAGS $OPENMP_FLAGS -o multi.o
- name: compile and link main
run: |
g++ main.cpp core.o alts.o comm.o multi.o $CPP_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
./main
cpp_gpu_multi:
name: C++ (GPU) (OpenMP)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: Jimver/cuda-toolkit@v0.2.14
with:
sub-packages: '["nvcc"]'
method: 'network'

- name: compile backend
run: |
nvcc -c src/core.cu $CPP_FLAGS $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
g++ -c src/multi.cpp $CPP_FLAGS $OPENMP_FLAGS -o multi.o
- name: compile main
run: |
g++ -c main.cpp $CPP_FLAGS -o main.o
- name: link
run: |
nvcc main.o core.o alts.o comm.o multi.o $CPP_FLAGS $CUDA_FLAGS -o main
cpp_mpi:
name: C++ (MPI) (OpenMP)
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
g++ -c src/multi.cpp $CPP_FLAGS $OPENMP_FLAGS -o multi.o
mpic++ -c src/comm.cpp $CPP_FLAGS $MPI_FLAGS -o comm.o
- name: compile and link main
run: |
mpic++ main.cpp core.o alts.o comm.o multi.o $CPP_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
mpiexec -n 2 ./main
c_cpu:
name: C (CPU) (OpenMP)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: compile backend
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
g++ -c src/multi.cpp $CPP_FLAGS $OPENMP_FLAGS -o multi.o
- name: compile and link main
run: |
gcc main.c core.o alts.o comm.o multi.o $C_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
./main
c_gpu:
name: C (GPU) (OpenMP)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: Jimver/cuda-toolkit@v0.2.14
with:
sub-packages: '["nvcc"]'
method: 'network'

- name: compile backend
run: |
nvcc -c src/core.cu $CPP_FLAGS $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
g++ -c src/multi.cpp $CPP_FLAGS $OPENMP_FLAGS -o multi.o
- name: compile main
run: |
gcc -c main.c $CPP_FLAGS -o main.o
- name: link
run: |
nvcc main.o core.o alts.o comm.o multi.o $CPP_FLAGS $CUDA_FLAGS -o main
c_mpi:
name: C (MPI) (OpenMP)
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
g++ -c src/multi.cpp $CPP_FLAGS $OPENMP_FLAGS -o multi.o
mpic++ -c src/comm.cpp $CPP_FLAGS $MPI_FLAGS -o comm.o
- name: compile and link main
run: |
mpicc main.c core.o alts.o comm.o multi.o $C_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
mpiexec -np 2 ./main

0 comments on commit 1dca25a

Please sign in to comment.