Skip to content

cmon mac

cmon mac #80

Workflow file for this run

name: MacOS
on:
push:
env:
C_FLAGS: '-Isrc -std=c99 -lstdc++'
CPP_FLAGS: '-Isrc -std=c++14'
CUDA_FLAGS: ''
MPI_FLAGS: '-DDISTRIBUTED_MODE'
OPENMP_COMP_FLAGS: '-Xclang -fopenmp'
OPENMP_LINK_FLAGS: '-lomp'
jobs:
cpp_cpu:
name: C++ (CPU)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: compile backend
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
clang++ -c src/multi.cpp $CPP_FLAGS -o multi.o
- name: compile and link main
run: |
clang++ main.cpp core.o alts.o comm.o multi.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
clang++ -c src/multi.cpp $CPP_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: |
mpiexec -n 2 ./main
c_cpu:
name: C (CPU)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: compile backend
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
clang++ -c src/multi.cpp $CPP_FLAGS -o multi.o
- name: compile and link main
run: |
clang main.c core.o alts.o comm.o multi.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
clang++ -c src/multi.cpp $CPP_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: |
mpiexec -np 2 ./main
cpp_cpu_multi:
name: C++ (CPU) (OpenMP)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: prepare libomp
run: |
brew install libomp
- name: find libomp
run: |
ls /opt/local/include/libomp
cat /opt/local/include/libomp/omp.h
- name: try to move libomp
cp /opt/local/include/libomp/omp.h /opt/local/include/omp.h
cp /usr/local/opt/libomp/include/omp.h /opt/local/include/omp.h
- name: compile backend
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
clang++ -c src/multi.cpp $CPP_FLAGS $OPENMP_COMP_FLAGS -o multi.o
- name: compile and link main
run: |
clang++ main.cpp core.o alts.o comm.o multi.o $CPP_FLAGS $OPENMP_LINK_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
./main
cpp_mpi_multi:
name: C++ (MPI) (OpenMP)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1
- name: prepare libomp
run: |
brew install libomp
- name: compile backend
run: |
clang++ -c src/core.cpp $CPP_FLAGS -o core.o
clang++ -c src/alts.cpp $CPP_FLAGS -o alts.o
clang++ -c src/multi.cpp $CPP_FLAGS $OPENMP_COMP_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 $OPENMP_LINK_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
mpiexec -n 2 ./main
c_cpu_multi:
name: C (CPU) (OpenMP)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: prepare libomp
run: |
brew install libomp
- name: compile backend
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
clang++ -c src/multi.cpp $CPP_FLAGS $OPENMP_COMP_FLAGS -o multi.o
- name: compile and link main
run: |
clang main.c core.o alts.o comm.o multi.o $C_FLAGS $OPENMP_LINK_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
./main
c_mpi_multi:
name: C (MPI) (OpenMP)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1
- name: prepare libomp
run: |
brew install libomp
- name: compile backend
run: |
clang++ -c src/core.cpp $CPP_FLAGS -o core.o
clang++ -c src/alts.cpp $CPP_FLAGS -o alts.o
clang++ -c src/multi.cpp $CPP_FLAGS $OPENMP_COMP_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 $OPENMP_LINK_FLAGS -o main
- name: run main
run: |
export OMP_NUM_THREADS=2
mpiexec -np 2 ./main