summaryrefslogtreecommitdiff
path: root/BFS/baselines/cpu/Makefile
blob: 1efe4573a975e186be02083eee418e1bf5cd48a3 (plain)
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
benchmark ?= 1
debug ?= 0
native ?= 1
nop_sync ?= 0
numa ?= 0

LDFLAGS =
CFLAGS =

ifeq (${debug}, 1)
	CFLAGS += -g
endif

ifeq (${native}, 1)
	CFLAGS += -march=native
endif

ifeq (${numa}, 1)
	LDFLAGS += -lnuma
endif

bfs: app.c
	gcc -Wall -Wextra -pedantic -O3 ${CFLAGS} -DNUMA=${numa} -DNUMA_MEMCPY=${numa_memcpy} -DNOP_SYNC=${nop_sync} -DWITH_BENCHMARK=${benchmark} -o bfs -fopenmp app.c ${LDFLAGS}

bfs_O0: app.c
	gcc -o bfs_O0 -fopenmp app.c

bfs_O2: app.c
	gcc -O2 -o bfs_O2 -fopenmp app.c

# each bfs invocation performs 100 iterations

.PHONY: run
run: bfs
	./bfs -f ../../data/loc-gowalla_edges.txt

.PHONY: run_O0
run_O0: bfs_O0
	OMP_NUM_THREADS=4 ./bfs_O0 -f ../../data/loc-gowalla_edges.txt

.PHONY: run_O2
run_O2: bfs_O2
	OMP_NUM_THREADS=4 ./bfs_O2 -f ../../data/loc-gowalla_edges.txt

.PHONY: clean
clean:
	rm -f bfs bfs_O0 bfs_O2

.PHONY: all