This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
58 lines (47 loc) · 1.83 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
SHELL = /bin/bash
PROJECT = pdist_aggregation
VENV_PATH=`conda info --base`/envs/${PROJECT}
PYTHON_EXECUTABLE=${VENV_PATH}/bin/python
PYTEST_EXECUTABLE=${VENV_PATH}/bin/pytest
JUPYTER_EXECUTABLE=${VENV_PATH}/bin/jupyter
COMMIT=`git rev-parse --short HEAD`
.DEFAULT_GOAL := all
## help: Display list of commands
.PHONY: help
help: Makefile
@sed -n 's|^##||p' $< | column -t -s ':' | sed -e 's|^| |'
## all: Run the main targets
.PHONY: all
all: install benchmark-parallel benchmark-sequential report-parallel report-sequential
## install: Install conda env.
.PHONY: install
install:
conda env create --force -f environment.yml
## benchmark-sequential: Run benchmarks for sequential execution, 'NAME' variable can be provided
# Uses taskset to cap to a cpu solely
.PHONY: benchmark-sequential
benchmark-sequential:
@[ "${NAME}" ] || export NAME=${COMMIT}
taskset -c 0 ${PYTHON_EXECUTABLE} benchmarks/benchmark.py ${NAME}seq
## benchmark-parallel: Run benchmarks for parallel execution, 'NAME' variable can be provided
.PHONY: benchmark-parallel
benchmark-parallel:
@[ "${NAME}" ] || export NAME=${COMMIT}
${PYTHON_EXECUTABLE} benchmarks/benchmark.py ${NAME}par
## report-sequential: Report benchmarks for sequential execution, 'NAME' variable can be provided
.PHONY: report-sequential
report-sequential:
@[ "${NAME}" ] || export NAME=${COMMIT}
${PYTHON_EXECUTABLE} benchmarks/report.py ${NAME}seq
## report-parallel: Report benchmarks for parallel execution, 'NAME' variable can be provided
.PHONY: report-parallel
report-parallel:
@[ "${NAME}" ] || export NAME=${COMMIT}
${PYTHON_EXECUTABLE} benchmarks/report.py ${NAME}par
.PHONY: notebook
notebook:
${JUPYTER_EXECUTABLE} nbconvert --to html --execute --output benchmarks/results/index.html visualization.ipynb
## test: Launch all the test.
.PHONY: test
test:
${PYTEST_EXECUTABLE} tests