-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (173 loc) · 5.1 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: CI
on:
push:
branches:
- main
paths:
- include
- src
- test
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