Makefile 1.11 KB
Newer Older
1
2
TAU = 0

Camille Coti's avatar
Camille Coti committed
3
4
5
6
CXX = g++
MPICXX = mpic++
LD = g++
MPILD = mpic++
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

ifeq ($(TAU),1)
	TAUDIR = $(HOME)/logiciels/tau-2.29/x86_64
	TAUOPT = -DTAUPROF -I$(TAUDIR)/../include
	TAULIB = -L$(TAUDIR)/lib -lTAU

	MPICXX = tau_cxx.sh
	CXX = tau_cxx.sh
	LD = tau_cxx.sh
	MPILD = tau_cxx.sh
#	export TAU_MAKEFILE=$(TAUDIR)/lib/Makefile.tau-papi-mpi-pdt-openmp
else
	TAUOPT =
	TAULIB =
endif

CFLAGS = -Wall -g -O3  -Wno-unused-variable -std=c++11 $(TAUOPT)
LDOPT = -lginac $(TAULIB)
Camille Coti's avatar
Camille Coti committed
25
26

MPIEXEC = mpiexec
27
NP = 5
Camille Coti's avatar
Camille Coti committed
28

Camille Coti's avatar
Camille Coti committed
29
MPISRC = masterworker.cpp mw_addslave.cpp hierarchical.cpp  \
Camille Coti's avatar
Camille Coti committed
30
         perf.cpp  sequential.cpp  tensormatrix_mpi.cpp      \
31
         utils.cpp  utils_parall.cpp profiling.cpp mw_combined.cpp \
Camille Coti's avatar
Camille Coti committed
32
	 masterworker2.cpp mw_addslave2.cpp hierarchical2.cpp  \
Camille Coti's avatar
Camille Coti committed
33
	 masterworker3.cpp mw_addslave3.cpp mw_addslave4.cpp 
Camille Coti's avatar
Camille Coti committed
34

Camille Coti's avatar
Camille Coti committed
35
36
37
MPIOBJ= $(MPISRC:.cpp=.o)


Camille Coti's avatar
Camille Coti committed
38
39
all: tensormatrix_mpi

Camille Coti's avatar
Camille Coti committed
40
tensormatrix_mpi: $(MPIOBJ)
Camille Coti's avatar
Camille Coti committed
41
42
	$(MPILD)  -o $@ $^ $(LDOPT)

Camille Coti's avatar
Camille Coti committed
43
44
45
tensormatrix: tensormatrix.o
	$(LD) -o $@ $^ $(LDOPT)

Camille Coti's avatar
Camille Coti committed
46
47
48
49
%.o: %.cpp
	$(MPICXX) $(CFLAGS) -o $@ -c $<

run: tensormatrix_mpi
Camille Coti's avatar
Camille Coti committed
50
	$(MPIEXEC) --oversubscribe -n $(NP) $<
Camille Coti's avatar
Camille Coti committed
51
52
53
54
55

clean:
	@rm -f *.o tensormatrix_mpi tensormatrix

.PHONY: clean run