-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
123 lines (92 loc) · 3.35 KB
/
Makefile
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
SHELL := bash
# Second tag after tip is usually the latest release
RELEASE=$(shell hg tags -T "{node|short}\n" | sed -n 2p)
MPI_NUM_PROCS ?= 2
.PHONY: black black_check clean clean_pyc clean_so cleantransonic coverage_short develop dist lint _report_coverage shortlog tests _tests_coverage tests_mpi
develop: sync
sync:
pdm sync --clean
install_fluidfft_plugins:
pdm run pip install fluidfft-fftw fluidfft-fftwmpi fluidfft-mpi_with_fftw
install_editable_perf:
pdm sync --clean --no-self
pip install -e . -v --no-build-isolation --no-deps -C setup-args=-Dnative=true
lock:
pdm lock
clean_so:
find fluidsim -name "*.so" -delete
clean_pyc:
find fluidsim -name "*.pyc" -delete
find fluidsim -name "__pycache__" -type d | xargs rm -rf
cleantransonic:
find fluidsim -type d -name __pythran__ | xargs rm -rf
find fluidsim -type d -name __python__ | xargs rm -rf
find fluidsim -type d -name __numba__ | xargs rm -rf
find fluidsim -type d -name __cython__ | xargs rm -rf
clean:
rm -rf build lib/build lib/dist
cleanall: clean clean_so cleantransonic
shortlog:
@hg log -M -r$(RELEASE): --template '- {desc|firstline} (:rev:`{node|short}`)\n'
black:
pdm black
black_check:
pdm black_check
lint:
pdm lint
validate_code:
pdm validate_code
tests:
pytest -v lib
fluidsim-test -v
tests_mpi:
mpirun -np 2 fluidsim-test -v --exitfirst
define _init_coverage
rm -rf .coverage
mkdir -p .coverage
endef
define _end_coverage
coverage html
@echo "Code coverage analysis complete. View detailed report:"
@echo "file://${PWD}/.coverage/index.html"
endef
define _end_coverage_combine
coverage combine
$(call _end_coverage)
endef
coverage_short:
$(call _init_coverage)
coverage run -p -m pytest -v -s lib
TRANSONIC_NO_REPLACE=1 coverage run -p -m fluidsim.util.testing -v -x
make _report_coverage
pytest_cov_html:
$(call _init_coverage)
TRANSONIC_NO_REPLACE=1 pytest -v --cov --cov-config=pyproject.toml $(PYTEST_ARGS) --durations=10 -x
$(call _end_coverage)
pytest_cov_html_mpi:
$(call _init_coverage)
TRANSONIC_NO_REPLACE=1 mpirun -np $(MPI_NUM_PROCS) coverage run -p -m pytest -v --exitfirst $(PYTEST_ARGS)
$(call _end_coverage_combine)
pytest_cov_html_full:
$(call _init_coverage)
TRANSONIC_NO_REPLACE=1 mpirun -np $(MPI_NUM_PROCS) coverage run -p -m pytest -v --exitfirst $(PYTEST_ARGS)
TRANSONIC_NO_REPLACE=1 coverage run -p -m pytest -v $(PYTEST_ARGS) --durations=10
$(call _end_coverage_combine)
define _pytest_mpi_operators3d
$(call _init_coverage)
FLUIDSIM_TYPE_FFT=$(1) TRANSONIC_NO_REPLACE=1 mpirun -np $(MPI_NUM_PROCS) coverage run -p -m pytest -v --exitfirst fluidsim/operators/test/test_operators3d.py -p no:warnings
$(call _end_coverage_combine)
endef
pytest_mpi_with_fftwmpi3d:
$(call _pytest_mpi_operators3d,fft3d.mpi_with_fftwmpi3d)
pytest_mpi_with_fftw1d:
$(call _pytest_mpi_operators3d,fft3d.mpi_with_fftw1d)
pytest_mpi_with_pfft:
$(call _pytest_mpi_operators3d,fft3d.mpi_with_pfft)
pytest_mpi_with_p3dfft:
$(call _init_coverage)
FLUIDSIM_TYPE_FFT=fft3d.mpi_with_p3dfft TRANSONIC_NO_REPLACE=1 mpirun -np $(MPI_NUM_PROCS) \
coverage run -p -m pytest -v --exitfirst fluidsim/operators/test/test_operators3d.py::TestCoarse
FLUIDSIM_TYPE_FFT=fft3d.mpi_with_p3dfft TRANSONIC_NO_REPLACE=1 mpirun -np $(MPI_NUM_PROCS) \
coverage run -p -m pytest -v --exitfirst fluidsim/operators/test/test_operators3d.py -k "not TestCoarse"
$(call _end_coverage_combine)