-
Notifications
You must be signed in to change notification settings - Fork 62
156 lines (140 loc) · 5.01 KB
/
test_with_MFEM_master.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
name: Test_with_MFEM_master
on:
pull_request:
types:
- labeled
#push:
# branches: [ test ]
#pull_request:
# branches: [ test ]
# types: [synchronize]
jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'in-test-with-mfem-master')
strategy:
fail-fast: false
matrix:
#python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.10"]
os: [ubuntu-20.04]
# USE_FLAGS : cuda, parallel, libceed
env:
- { USE_FLAGS: "000"}
# - { USE_FLAGS: "100"}
# - { USE_FLAGS: "010"}
# - { USE_FLAGS: "110"}
include:
- os: macos-latest
python-version: 3.11
env: {USE_FLAGS: "000"}
# - os: [ubuntu-20.04]
# python-version: 3.9
# env: {USE_FLAGS: "001"}
#
runs-on: ${{ matrix.os }}
#env: ${{ matrix.env }}
env:
USE_FLAGS: ${{ matrix.env.USE_FLAGS }}
CUDA: "11.5"
steps:
- uses: actions/checkout@v3
# with:
# ref: master_tracking_branch
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
#python -m pip install --upgrade pip setuptools wheel
python -c "import setuptools;print(setuptools.__version__)"
PYTHONLIB=${HOME}/sandbox/lib/python${{ matrix.python-version }}/site-packages
mkdir -p $PYTHONLIB
export PYTHONPATH=$PYTHONLIB:$PYTHONPATH
echo "PYTHONPATH:"$PYTHONPATH
pip install six numpy --verbose
if [ "${{matrix.python-version}}" = "3.10" ] ; then
pip install numba numba-scipy --verbose
#pip install scipy
else
pip install numba numba-scipy --verbose
fi
if [ -f requirements.txt ]; then
pip install -r requirements.txt --prefix=${HOME}/sandbox --verbose
fi
python -c "import sys;print(sys.path)"
python -c "import numpy;print(numpy.__file__)"
echo ${HOME}
which swig # this default is 4.0.1
pip install swig --prefix=${HOME}/sandbox
export PATH=/usr/local/cuda-${CUDA}/bin:${HOME}/sandbox/bin:$PATH
ls ${HOME}/sandbox/bin
which swig
swig -version
${HOME}/sandbox/bin/swig -version
if [ "${USE_FLAGS:0:1}" = "1" ] ; then
echo $cuda
source ./ci_scripts/add_cuda_11_5.sh;
fi
if [ "${USE_FLAGS:1:1}" = "1" ] ; then
sudo apt-get install mpich;
sudo apt-get install libmpich-dev;
pip install mpi4py
#pip install mpi4py --no-cache-dir --prefix=${HOME}/sandbox;
#python -m pip install git+https://github.com/mpi4py/mpi4py
#python -c "import mpi4py;print(mpi4py.get_include())";
fi
ls -l $PYTHONLIB
- name: Build
run: |
export PATH=/usr/local/cuda-${CUDA}/bin:${HOME}/sandbox/bin:$PATH
PYTHONLIB=${HOME}/sandbox/lib/python${{ matrix.python-version }}/site-packages
export PYTHONPATH=$PYTHONLIB:$PYTHONPATH
echo $PATH
echo $PYTHONPATH
echo "SWIG exe"$(which swig)
if [ "${USE_FLAGS}" = "000" ]; then
python setup.py install --user --mfem-branch='master'
fi
if [ "${USE_FLAGS}" = "010" ]; then
python setup.py install --with-parallel --prefix=${HOME}/sandbox --mfem-branch='master'
fi
if [ "${USE_FLAGS}" = "100" ]; then
ls -l /usr/local/cuda-${CUDA}/include
python setup.py install --with-cuda --prefix=${HOME}/sandbox --mfem-branch='master'
fi
if [ "${USE_FLAGS}" = "110" ]; then
python setup.py install --with-cuda --with-parallel --mfem-branch='master'
fi
if [ "${USE_FLAGS}" = "001" ]; then
python setup.py install --prefix=${HOME}/sandbox --with-libceed --mfem-branch='master'
fi
- name: RUN_EXAMPLES
run: |
export PATH=/usr/local/cuda-${CUDA}/bin:$PATH
PYTHONLIB=${HOME}/sandbox/lib/python${{ matrix.python-version }}/site-packages
export PYTHONPATH=$PYTHONLIB:$PYTHONPATH
echo $PATH
echo $PYTHONPATH
cd test
echo $PATH
echo $PYTHONPATH
if [ "${USE_FLAGS}" = "000" ]; then
#python ../examples/ex1.py
#python ../examples/ex9.py
python run_examples.py -serial -verbose
fi
if [ "${USE_FLAGS}" = "010" ]; then
which mpicc
python run_examples.py -parallel -verbose -np 2
fi
if [ "${USE_FLAGS}" = "100" ]; then
python ../examples/ex1.py --pa
fi
if [ "${USE_FLAGS}" = "110" ]; then
mpirun -np 2 python ../examples/ex1.py --pa
fi
if [ "${USE_FLAGS}" = "001" ]; then
python ../examples/ex1.py -d ceed-cpu
python ../examples/ex9.py -d ceed-cpu
fi