-
Notifications
You must be signed in to change notification settings - Fork 323
218 lines (206 loc) · 8.87 KB
/
linuxWF.yml
File metadata and controls
218 lines (206 loc) · 8.87 KB
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
name: linuxCI
on:
workflow_call:
env:
# on CI, better dump stack trace in case there is an error
PLUMED_STACK_TRACE: yes
# use two threads for openMP tests
PLUMED_NUM_THREADS: 2
# these are used to build required packages
CC: gcc
CXX: g++
jobs:
linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
variant:
- -doc-mpi-
- -mpi-
- -coverage-mpi-
- -debug-
- -debug-mpi-
# temporarily commented out
# see https://github.com/plumed/plumed2/issues/976
- -intel-
- -pycv-mpi-
#this does not install mpi but uses the internal one
- -nvhpc-mpi-
steps:
- uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-reset1-linux${{ matrix.variant }}hash-${{ github.sha }}
restore-keys: ccache-reset1-linux${{ matrix.variant }}hash-
- name: setup the CI environment
uses: ./.github/actions/linux-setup
with:
ccache: true
pytest-make: true
boost-debug: ${{ contains( matrix.variant, '-debug-' ) }}
mpi: ${{ contains( matrix.variant, '-mpi-' ) }}
- name: Set up Python
uses: actions/setup-python@v6
with:
# testing the oldest supported python version, see the "python" workflow for newer version
python-version: "3.10"
- name: Install python packages needed for tests
run: |
python -m pip install --upgrade pip
pip install --user -r ./python/requirements_build.txt
pip install --user -r ./python/requirements_run.txt
pip install --user -r ./.ci/pytorch/requirements.txt
- name: Configure libmetatomic & libtorch
if: ${{ ! contains( matrix.variant, '-debug-' ) }} # the libraries on PyPI are not compiled with GLIBCXX_DEBUG
run: |
PIP_CPPFLAGS=$(python src/metatomic/flags-from-python.py --cppflags)
PIP_LDFLAGS=$(python src/metatomic/flags-from-python.py --ldflags)
echo "LDFLAGS=$PIP_LDFLAGS $LDFLAGS" >> $GITHUB_ENV
echo "CPPFLAGS=$PIP_CPPFLAGS $CPPFLAGS" >> $GITHUB_ENV
# the flags above enable the use of both libmetatomic and libtorch
echo "PLUMED_CONFIG=$PLUMED_CONFIG --enable-libmetatomic --enable-libtorch" >> $GITHUB_ENV
- name: Install tools for setting up the manuals
if: contains( matrix.variant, '-doc-' )
run: |
python -m pip install --upgrade pip
pip install --user -r ./new-manual/requirements.txt
sudo apt-get install -y graphviz
sudo apt-get install -y doxygen-latex
.ci/install.doxygen Release_1_13_2
echo "PLUMED_CONFIG=$PLUMED_CONFIG --enable-pdfdoc" >> $GITHUB_ENV
# make sure all tests are run
echo "PLUMED_ALL_TESTS=yes" >> $GITHUB_ENV
- name: Install lcov
if: contains( matrix.variant, '-coverage-' )
run: |
.ci/install.lcov v1.16
echo "PLUMED_CONFIG=$PLUMED_CONFIG --disable-external-lapack --disable-external-blas --enable-gcov CXXFLAGS=-O" >> $GITHUB_ENV
# make sure all tests are run
echo "PLUMED_ALL_TESTS=yes" >> $GITHUB_ENV
- name: Setup debug flags
if: contains( matrix.variant, '-debug-' )
run: |
echo "PLUMED_CONFIG=$PLUMED_CONFIG --enable-debug --enable-debug-glibcxx" >> $GITHUB_ENV
- name: Install INTEL compiler
# install INTEL at last since it modifies CC and CXX
if: contains( matrix.variant, '-intel-' )
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
#wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
#sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
#rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
#sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl intel-oneapi-mkl-devel intel-oneapi-compiler-fortran
sudo apt-get install intel-basekit intel-hpckit
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
echo "CXX=icpx" >> $GITHUB_ENV
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifx" >> $GITHUB_ENV
- name: Install MPI
# install MPI at last since it modifies CC and CXX
if: contains( matrix.variant, '-mpi-' )
run: |
pip install --user mpi4py
python -c "import mpi4py"
- name: Configure PLUMED
id: config
run: |
ccache -s -M 100M
#removed LDFLAGS=-Wl,-rpath,$LD_LIBRARY_PATH
./configure CXX="ccache $CXX" --enable-boost_serialization --disable-dependency-tracking --enable-modules=all $PLUMED_CONFIG --prefix="$HOME/opt"
ccache -s -M 100M
- name: Config Log
if: failure() && steps.config.outcome == 'failure'
run: cat config.log
- name: Build PLUMED
run: |
ccache -s -M 100M
make -j 4
make install
# check for global symbols, see https://github.com/plumed/plumed2/issues/549
make nmcheck
ccache -s -M 100M
- name: Install NVHPC compiler
if: contains( matrix.variant, '-nvhpc-' )
# use this if it does not work
# wget https://developer.download.nvidia.com/hpc-sdk/24.3/nvhpc_2024_243_Linux_x86_64_cuda_12.3.tar.gz
# tar xpzf nvhpc_2024_243_Linux_x86_64_cuda_12.3.tar.gz
# nvhpc_2024_243_Linux_x86_64_cuda_12.3/install
run: |
curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list
sudo apt-get update -y
sudo apt-get install -y nvhpc-24-3
NVHOME=/opt/nvidia/hpc_sdk
NVARCH=`uname -s`_`uname -m`
# echo "NVHPC=$NVHOME" >> $GITHUB_ENV
# echo "NVHPC_ROOT=$NVHOME/$NVARCH/24.3" >> $GITHUB_ENV
nvcudadir=$NVHOME/$NVARCH/24.3/cuda
nvcompdir=$NVHOME/$NVARCH/24.3/compilers
nvmathdir=$NVHOME/$NVARCH/24.3/math_libs
nvcommdir=$NVHOME/$NVARCH/24.3/comm_libs
echo "PATH=$nvcudadir/bin:$nvcompdir/bin:$nvcommdir/mpi/bin:$nvcompdir/extras/qd/bin:$PATH" >> $GITHUB_ENV
# echo "LD_LIBRARY_PATH=$nvcudadir/lib64:$nvcudadir/12.3/targets/x86_64-linux/lib/stubs/:$nvcudadir/extras/CUPTI/lib64:$nvcompdir/extras/qd/lib:$nvcompdir/lib:$nvmathdir/lib64:$nvcommdir/nccl/lib:$nvcommdir/nvshmem/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
# echo "CPATH=$nvmathdir/include:$nvcommdir/nccl/include:$nvcommdir/nvshmem/include:$nvcompdir/extras/qd/include/qd:$CPATH" >> $GITHUB_ENV
# echo "NVHPC_CUDA_HOME=$nvcudadir/12.3" >> $GITHUB_ENV
$nvcompdir/bin/nvc++ -help -gpu
echo "NVCXX=$nvcommdir/mpi/bin/mpic++" >> $GITHUB_ENV
echo "NVCC=$nvcommdir/mpi/bin/mpicc" >> $GITHUB_ENV
echo "NVFC=$nvcompdir/bin/nvfortran" >> $GITHUB_ENV
- name: check if the openacc module can be compiled
if: contains( matrix.variant, '-nvhpc-' )
run: |
source sourceme.sh
cd plugins/openaccPTM/
./configure
NVCXX=$NVCXX make
- name: Run tests
if: ${{ ! contains( matrix.variant, '-doc-mpi-' ) && ! contains( matrix.variant, '-pycv-mpi-' ) && ! contains( matrix.variant, '-nvhpc-' ) }}
run: |
(while true; do # see https://github.com/actions/virtual-environments/issues/1860
df -h
sleep 15
done) &
make --no-print-directory -C regtest testclean
# these can fail for numerical reasons
make -C regtest checkfail
- name: Run python tests
run: |
cd python
pip install --user pytest
pytest -v
- name: Build doc
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN_PLUMEDBOT }}
if: contains( matrix.variant, '-doc-' )
run: |
export PLUMED_MAXBACKUP=0
make doc >/dev/null
- name: Coverage
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN_PLUMEDBOT }}
if: contains( matrix.variant, '-coverage-' )
run: |
make -C developer-doc coverage
.ci/push coverage
# this is hanging for some reason now (2024-04-03) - GB
#bash <(curl -s https://codecov.io/bash) > /dev/null
- name: Push doc
if: contains( matrix.variant, '-doc-' )
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN_PLUMEDBOT }}
run: |
.ci/push doc
- name: Compile and test pycv
if: contains( matrix.variant, '-pycv-' )
working-directory: ./plugins/pycv/
run: |
source ../../sourceme.sh
ln -s $(realpath ../../regtest/scripts) ./regtest/scripts
make check