[mod] misc #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-run: | |
name: Build and execute main | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
repository: "NaokiHori/SimpleDecomp" | |
ref: ${{ github.ref_name }} | |
- name: Compile | |
run: | | |
make all | |
- name: Run case | |
run: | | |
mpirun -n 2 --oversubscribe ./a.out | |
cat sdecomp.log | |
test-transpose2d: | |
name: Test 2D transpose | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
repository: "NaokiHori/SimpleDecomp" | |
ref: ${{ github.ref_name }} | |
- name: Compile | |
run: | | |
cd test/transpose | |
make all | |
- name: Run cases | |
run: | | |
cd test/transpose | |
# 9 x 11 | |
nprocs=(1 2 3 4 5 6 7 8) | |
for np in ${nprocs[@]}; do | |
mpirun -n ${np} --oversubscribe ./a.out 9 11; | |
done | |
# 255 x 127 | |
nprocs=(1 2 3 4 5 6 8 16) | |
for np in ${nprocs[@]}; do | |
mpirun -n ${np} --oversubscribe ./a.out 127 255; | |
done | |
# 1024 x 2048 | |
nprocs=(1 2 4 8 16 32 64 128) | |
for np in ${nprocs[@]}; do | |
mpirun -n ${np} --oversubscribe ./a.out 1024 2048; | |
done | |
test-transpose3d: | |
name: Test 3D transpose | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
repository: "NaokiHori/SimpleDecomp" | |
ref: ${{ github.ref_name }} | |
- name: Compile | |
run: | | |
cd test/transpose | |
make all | |
- name: Run cases | |
run: | | |
cd test/transpose | |
# 9 x 11 x 14 | |
nprocs=(1 2 3 4 5 6 7 8) | |
for np in ${nprocs[@]}; do | |
mpirun -n ${np} --oversubscribe ./a.out 9 11 14; | |
done | |
# 31 x 95 x 63 | |
nprocs=(1 2 3 4 5 6 8 16) | |
for np in ${nprocs[@]}; do | |
mpirun -n ${np} --oversubscribe ./a.out 31 95 63; | |
done | |
test-transpose3d-large: | |
name: Test 3D transpose for a large array | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
nprocs: [8, 16, 32, 64, 128] | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
repository: "NaokiHori/SimpleDecomp" | |
ref: ${{ github.ref_name }} | |
- name: Compile | |
run: | | |
cd test/transpose | |
make all | |
- name: Run cases | |
run: | | |
cd test/transpose | |
mpirun -n ${{ matrix.nprocs }} --oversubscribe ./a.out 128 128 128 | |
check-install: | |
name: Check install script works | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
repository: "NaokiHori/SimpleDecomp" | |
ref: "main" | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev | |
- name: Install | |
run: | | |
bash install.sh install | |
- name: Prepare a sample script | |
run: | | |
echo "#include <stdbool.h>" >> main.c | |
echo "#include <mpi.h>" >> main.c | |
echo "#include <sdecomp.h>" >> main.c | |
echo "" >> main.c | |
echo "int main(void){" >> main.c | |
echo " MPI_Init(NULL, NULL);" >> main.c | |
echo " sdecomp_info_t *info = NULL;" >> main.c | |
echo " if(0 != sdecomp.construct(" >> main.c | |
echo " MPI_COMM_WORLD," >> main.c | |
echo " 2," >> main.c | |
echo " (size_t [2]){ 0, 0}," >> main.c | |
echo " (bool [2]){false, false}," >> main.c | |
echo " &info" >> main.c | |
echo " )) return 1;" >> main.c | |
echo " if(0 != sdecomp.destruct(info)) return 1;" >> main.c | |
echo " MPI_Finalize();" >> main.c | |
echo " return 0;" >> main.c | |
echo "}" >> main.c | |
- name: Build sample script | |
run: | | |
mpicc \ | |
-std=c99 \ | |
-Wall -Wextra -Werror \ | |
-I${HOME}/.local/include \ | |
-L${HOME}/.local/lib \ | |
main.c \ | |
-o a.out \ | |
-lsdecomp | |
- name: Execute sample script | |
run: | | |
export LD_LIBRARY_PATH=${HOME}/.local/lib | |
mpirun -n 2 --oversubscribe ./a.out | |
echo $? | |
- name: Uninstall | |
run: | | |
bash install.sh uninstall | |