-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (46 loc) · 1.59 KB
/
Makefile
File metadata and controls
62 lines (46 loc) · 1.59 KB
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
CXX = mpiicpc
CXXFLAGS=-qopenmp -mkl
CPUFLAGS = $(CXXFLAGS) -xhost
MICFLAGS = $(CXXFLAGS) -mmic
OPTFLAGS = -qopt-report -qopt-report-file=$@.optrpt
CPUOBJECTS = main.o workdistribution.o pricing.o
MICOBJECTS = main.oMIC workdistribution.oMIC pricing.oMIC
TARGET=app
MICTARGET=app-MIC
.SUFFIXES: .o .cc .oMIC
all: $(TARGET) $(MICTARGET) instructions
app: $(CPUOBJECTS)
$(info )
$(info Linking the CPU executable:)
$(CXX) $(CPUFLAGS) -o $@ $(CPUOBJECTS)
%-MIC: $(MICOBJECTS)
$(info )
$(info Linking the MIC executable:)
$(CXX) $(MICFLAGS) -o $@ $(MICOBJECTS)
.cc.o:
$(info )
$(info Compiling a CPU object file:)
$(CXX) -c $(CPUFLAGS) $(OPTFLAGS) -o "$@" "$<"
.cc.oMIC:
$(info )
$(info Compiling a MIC object file:)
$(CXX) -c $(MICFLAGS) $(OPTFLAGS) -o "$@" "$<"
run-cpu: app
mpirun -machine machines-cpu.txt $(PWD)/app
run-mic: app-MIC
ssh mic0 mkdir -p $(PWD)
scp app-MIC mic0:$(PWD)/
I_MPI_MIC=1 LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(MIC_LD_LIBRARY_PATH) mpirun -machine machines-mic.txt $(PWD)/app-MIC
run-het: app app-MIC
ssh mic0 mkdir -p $(PWD)
scp app-MIC mic0:$(PWD)/
I_MPI_MIC=1 I_MPI_MIC_POSTFIX="-MIC" LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(MIC_LD_LIBRARY_PATH) mpirun -machine machines-heterogeneous.txt $(PWD)/app
instructions:
$(info )
$(info TO EXECUTE THE APPLICATION: )
$(info "make run-cpu" to run the application on the host CPU)
$(info "make run-mic" to run the application on the coprocessor)
$(info "make run-het" to run the application on the heterogeneous system of CPUs and MICs)
$(info )
clean:
rm -f $(CPUOBJECTS) $(MICOBJECTS) $(TARGET) $(MICTARGET) *.optrpt