Skip to content
Snippets Groups Projects
Makefile 1.1 KiB
Newer Older
  • Learn to ignore specific revisions
  • Camille Coti's avatar
    Camille Coti committed
    CXX = g++
    MPICXX = mpic++
    LD = g++
    MPILD = mpic++
    
    
    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
    
    MPIEXEC = mpiexec
    
    MPISRC = masterworker.cpp mw_addslave.cpp hierarchical.cpp  \
    
    Camille Coti's avatar
    Camille Coti committed
             perf.cpp  sequential.cpp  tensormatrix_mpi.cpp      \
    
             utils.cpp  utils_parall.cpp profiling.cpp mw_combined.cpp \
    
    Camille Coti's avatar
    Camille Coti committed
    	 masterworker2.cpp mw_addslave2.cpp hierarchical2.cpp  \
    
    Camille Coti's avatar
    Camille Coti committed
    	 masterworker3.cpp mw_addslave3.cpp 
    
    Camille Coti's avatar
    Camille Coti committed
    MPIOBJ= $(MPISRC:.cpp=.o)
    
    
    
    Camille Coti's avatar
    Camille Coti committed
    all: tensormatrix_mpi
    
    
    Camille Coti's avatar
    Camille Coti committed
    tensormatrix_mpi: $(MPIOBJ)
    
    Camille Coti's avatar
    Camille Coti committed
    	$(MPILD)  -o $@ $^ $(LDOPT)
    
    
    tensormatrix: tensormatrix.o
    	$(LD) -o $@ $^ $(LDOPT)
    
    
    Camille Coti's avatar
    Camille Coti committed
    %.o: %.cpp
    	$(MPICXX) $(CFLAGS) -o $@ -c $<
    
    run: tensormatrix_mpi
    
    Camille Coti's avatar
    Camille Coti committed
    	$(MPIEXEC) --oversubscribe -n $(NP) $<
    
    Camille Coti's avatar
    Camille Coti committed
    
    clean:
    	@rm -f *.o tensormatrix_mpi tensormatrix
    
    .PHONY: clean run