-
Notifications
You must be signed in to change notification settings - Fork 56
251 lines (247 loc) · 12.9 KB
/
main.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- 'main'
- 'devel'
pull_request:
types:
- opened
branches:
- 'main'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-AsFem:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: show repository information
run: echo ${{github.event.repository.name}}
- name: show CPU information
run: cat /proc/cpuinfo
- name: show file structure
run: |
echo "*********************************************************************"
echo "*** Current path is:"
pwd
echo "*********************************************************************"
echo "*** Current folders are:"
ls -l
- name: check gcc/gfortran/cmake version
run: |
echo "*********************************************************************"
echo "*** Check the version of gnu-c,c++,fortran compiler"
echo "*********************************************************************"
gcc --version
g++ --version
gfortran --version
cmake --version
echo "*********************************************************************"
echo "*** Version check is done !"
echo "*********************************************************************"
- name: create temp folder and lib folder
run: |
echo "*********************************************************************"
echo "*** Current folder structure is:"
ls -l
echo "*********************************************************************"
echo "*** Now we start to create folder"
echo "*********************************************************************"
mkdir temp && mkdir AsFemLibs
ls -l
cd AsFemLibs && mkdir openmpi && mkdir petsc
pwd
echo "*********************************************************************"
echo "*** Now we have the following folders:"
ls -l
- name: download openmpi
run: |
cd temp
ls -l
curl -L -O https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.1.tar.gz
echo "******************************************************"
echo "*** Openmpi 5.0.1 has been downloaded !"
echo "******************************************************"
ls -l
- name: compile and install openmpi
run: |
echo "******************************************************"
echo "*** Start to compile openmpi-5.0.1"
echo "******************************************************"
cd temp
tar -xf openmpi-5.0.1.tar.gz
cd openmpi-5.0.1
./configure --prefix=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
make -j8
echo "******************************************************"
echo "*** Make -j8 is done for openmpi-5.0.1"
echo "******************************************************"
make install
echo "******************************************************"
echo "*** Make install is done for openmpi-5.0.1"
echo "******************************************************"
- name: check openmpi version
run: |
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi/bin
echo "******************************************************"
echo "*** Now we check the version of mpicc and mpicxx"
./mpicc --version
./mpicxx --version
./mpirun --version
echo "******************************************************"
- name: downlaod PETSc
run: |
echo "******************************************************"
echo "*** download petsc"
echo "******************************************************"
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp
curl -L -O https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-lite-3.20.2.tar.gz
tar -xf petsc-lite-3.20.2.tar.gz
- name: compile and install PETSc
run: |
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.20.2
echo "******************************************************"
echo "*** Configure petsc ..."
echo "******************************************************"
./configure \
--prefix=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/petsc \
--with-debugging=0 \
--with-ssl=0 \
--with-pic=1 \
--with-openmp=0 \
--with-mpi-dir=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi \
--with-shared-libraries=1 \
--with-fortran-bindings=0 \
--with-sowing=0 \
--download-fblaslapack=1 \
--download-scalapack=1 \
--download-mumps=1 \
COPTFLAGS='-fPIC -O3 ' \
CXXOPTFLAGS='-fPIC -O3 ' \
FOPTFLAGS='-fPIC -O3 ' \
PETSC_DIR=`pwd`
echo "******************************************************"
echo "*** Make petsc ..."
echo "******************************************************"
make PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.20.2 PETSC_ARCH=arch-linux-c-opt all
echo "******************************************************"
echo "*** Install petsc ..."
echo "******************************************************"
make PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/temp/petsc-3.20.2 PETSC_ARCH=arch-linux-c-opt install
- name: compile AsFem
run: |
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}
echo "*********************************************************************"
echo "*** Setup mpi and petsc bash profile"
echo "*********************************************************************"
export MPI_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
export PATH=$PATH:$MPI_DIR/bin
export CC=$MPI_DIR/bin/mpicc
export CXX=$MPI_DIR/bin/mpicxx
export F90=$MPI_DIR/bin/mpif90
export F77=$MPI_DIR/bin/mpif77
export OMP_NUM_THREADS=1
export PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/petsc
export C_INCLUDE_PATH=$mpi/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$mpi/include:$CPLUS_INCLUDE_PATH
export FPATH=$mpi/include:$FPATH
export MANPATH=$mpi/share/man:$MANPATH
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
cmake CMakeLists.txt -DCMAKE_BUILD_TYPE=Release
echo "*********************************************************************"
echo "*** Make AsFem"
echo "*********************************************************************"
make -j8
echo "*********************************************************************"
echo "*** AsFem has been successuflly installed !"
echo "*********************************************************************"
ls
- name: run AsFem test script
run: |
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}
echo "*********************************************************************"
echo "*** Start to run AsFem autotest"
echo "*********************************************************************"
ls
export MPI_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
export PATH=$PATH:$MPI_DIR/bin
export CC=$MPI_DIR/bin/mpicc
export CXX=$MPI_DIR/bin/mpicxx
export F90=$MPI_DIR/bin/mpif90
export F77=$MPI_DIR/bin/mpif77
export OMP_NUM_THREADS=1
export PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/petsc
export C_INCLUDE_PATH=$mpi/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$mpi/include:$CPLUS_INCLUDE_PATH
export FPATH=$mpi/include:$FPATH
export MANPATH=$mpi/share/man:$MANPATH
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
python3 scripts/AutoTest.py -n 2
- name: run step2-2d in parallel
run: |
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/examples/tutorial
ls
export MPI_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
export PATH=$PATH:$MPI_DIR/bin
export CC=$MPI_DIR/bin/mpicc
export CXX=$MPI_DIR/bin/mpicxx
export F90=$MPI_DIR/bin/mpif90
export F77=$MPI_DIR/bin/mpif77
export OMP_NUM_THREADS=1
export PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/petsc
export C_INCLUDE_PATH=$mpi/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$mpi/include:$CPLUS_INCLUDE_PATH
export FPATH=$mpi/include:$FPATH
export MANPATH=$mpi/share/man:$MANPATH
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
mpirun -np 2 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step2-2d.json
- name: run step2-3d in parallel
run: |
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/examples/tutorial
ls
export MPI_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
export PATH=$PATH:$MPI_DIR/bin
export CC=$MPI_DIR/bin/mpicc
export CXX=$MPI_DIR/bin/mpicxx
export F90=$MPI_DIR/bin/mpif90
export F77=$MPI_DIR/bin/mpif77
export OMP_NUM_THREADS=1
export PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/petsc
export C_INCLUDE_PATH=$mpi/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$mpi/include:$CPLUS_INCLUDE_PATH
export FPATH=$mpi/include:$FPATH
export MANPATH=$mpi/share/man:$MANPATH
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
mpirun -np 2 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step2-3d.json
- name: run step3-2d in parallel
run: |
cd /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/examples/tutorial
export MPI_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/openmpi
export PATH=$PATH:$MPI_DIR/bin
export OMP_NUM_THREADS=1
export PETSC_DIR=/home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/AsFemLibs/petsc
export C_INCLUDE_PATH=$mpi/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$mpi/include:$CPLUS_INCLUDE_PATH
export FPATH=$mpi/include:$FPATH
export MANPATH=$mpi/share/man:$MANPATH
export LD_LIBRARY_PATH=$mpi/lib:$LD_LIBRARY_PATH
mpirun -np 2 /home/runner/work/${{github.event.repository.name}}/${{github.event.repository.name}}/bin/asfem -i step3-2d.json
- name: clean all folders and files
run: |
rm -rf temp
rm -rf AsFemLibs
python3 scripts/Clean.py
ls -l
echo "*********************************************************************"
echo "*** All the files are clean !"
echo "*********************************************************************"