-
Notifications
You must be signed in to change notification settings - Fork 71
163 lines (139 loc) · 5.13 KB
/
flare.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
# Adapted from: https://github.com/satu0king/Github-Documentation-With-Doxygen
# This is a basic workflow to help you get started with Actions
name: flare
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request]
# 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:
strategy:
matrix:
omp: [OFF, ON]
lapack: [OFF, ON]
python-version: ["3.7", "3.8"]
name: "(OpenMP, Lapack, Python) ="
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
BUILD_DIR: build_${{ matrix.omp }}_${{ matrix.lapack }}
CC: gcc-9
CXX: g++-9
# 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
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build
run: |
sudo apt install liblapacke liblapacke-dev libopenmpi-dev
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
if [ "${{ matrix.omp }}" = "ON" ]; then
unset NO_OMP
else
export NO_OMP=1
fi
if [ "${{ matrix.lapack }}" = "ON" ]; then
unset NO_LAPACK
else
export NO_LAPACK=1
fi
echo "OpenMP ${{ matrix.omp }}"
echo "Lapack ${{ matrix.lapack }}"
cmake ..
cmake --build . -j4
cp _C_flare* ../flare/bffs/sgp
cd ctests
./tests
- name: Install LAMMPS
run: |
git clone --depth 1 https://github.com/lammps/lammps.git lammps
cd lammps/src
cp pair_hybrid.* pair_lj_cut.* ..
rm pair_*.cpp pair_*.h
mv ../pair_hybrid.* ../pair_lj_cut.* .
cp MANYBODY/pair_tersoff.* .
rm MANYBODY/pair_*.*
rm MANYBODY/fix_*.*
mv pair_tersoff.* MANYBODY/
cp KOKKOS/pair_kokkos.* .
rm KOKKOS/pair_*.*
mv pair_kokkos.* KOKKOS/
cd ../..
cd lammps_plugins
./install.sh $(pwd)/../lammps
cd ..
sudo cp -r ${BUILD_DIR}/External/Eigen3/Eigen /usr/include
cd lammps
mkdir build
cd build
cmake ../cmake -DPKG_KOKKOS=ON -DKokkos_ENABLE_OPENMP=ON -DPKG_MANYBODY=ON
make -j4
- name: Pip install
run: |
pip install -U codecov pytest pytest-cov pytest_mock Sphinx sphinx-rtd-theme breathe nbsphinx
pip install -r requirements.txt
- name: Patch ASE
run: |
ase_file="$(dirname $(python3 -c 'import ase; print(ase.__file__)'))/calculators/lammpsrun.py"
sed -i 's/line.startswith(_custom_thermo_mark)/line.strip\(\).startswith\("Step"\)/g' $ase_file
- name: Run tests
run: |
export lmp=$(pwd)/lammps/build/lmp
cd tests
pytest
- name: Run LAMMPS tests with Kokkos
run: |
export lmp="$(pwd)/lammps/build/lmp -k on t 4 -sf kk -pk kokkos newton on neigh full"
cd tests
pytest test_lammps.py
- name: Install Sphinx and Breathe
run: |
sudo apt-get update
sudo apt-get install python3-sphinx python3-sphinx-rtd-theme python3-breathe python3-nbsphinx
- name: Run Doxygen
uses: mattnotmitt/[email protected]
with:
# Path to Doxyfile
doxyfile-path: "./Doxyfile" # default is ./Doxyfile
# Working directory
working-directory: "./docs" # default is .
- name: Run Sphinx
run: |
export PYTHONPATH=$PYTHONPATH:$PWD/lammps/python
cd docs
pwd
ls
make html
- name: Publish the docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Default Doxyfile build documentation to html directory.
# Change the directory if changes in Doxyfile
publish_dir: ./docs/build/html
if: github.event_name == 'pull_request' && matrix.lapack == 'on' && matrix.omp == 'on'
# - name: Run tutorial
# run: |
# cd tests
# # Download colab notebook
# export fileid="18_pTcWM19AUiksaRyCgg9BCpVyw744xv"
# wget -O tutorial.ipynb 'https://docs.google.com/uc?export=download&id='${fileid}
# # Convert notebook into python script
# pip install -U jupyter nbconvert
# jupyter nbconvert --to script tutorial.ipynb
# # Remove bash commands in the notebook
# sed '/!/d' tutorial.txt > tutorial.py
# cat test_tutorial.py tutorial.py > tuttest.py
# # Download datasets needed for the tutorial
# wget http://quantum-machine.org/gdml/data/npz/aspirin_dft.npz
# wget https://www.ctcms.nist.gov/potentials/Download/1999--Mishin-Y-Farkas-D-Mehl-M-J-Papaconstantopoulos-D-A--Al/2/Al99.eam.alloy
# # Run script
# pytest -s tuttest.py
# # Remove output files
# rm Al* aspirin_dft.npz tutorial.ipynb tuttest.py tutorial.py tutorial.txt