-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile_PizDaint
118 lines (102 loc) · 3.46 KB
/
Makefile_PizDaint
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Makefile for PizDaint
# module load pgi cudatoolkit fftw cray-hdf5-parallel/1.8.16 intel
# module swap PrgEnv-cray PrgEnv-pgi
#
all: afid_gpu afid_cpu afid_hyb
# Flags for CPU version
afid_cpu: FFLAGS = -O3 -Kieee
#-DDEBUG
#afid_cpu: FFLAGS = -O3 -DDEBUG -mp
# Flags for CUDA version
afid_gpu: FFLAGS = -O3 -DUSE_CUDA -DPASS_ARRAYS -Mcuda=cc60,cuda8.0,ptxinfo,madconst -Kieee -Mlarge_arrays -Mallocatable=95 -DUSE_GPU
#-DDEBUG
#FFLAGS= -DUSE_CUDA -Mcuda=cc35,ptxinfo,cuda6.5,nollvm,keepgpu -Minfo -DDEBUG
CUDA_HOME = $(CRAY_CUDATOOLKIT_DIR)
INCLUDE= -I $(MPICH_DIR)/include \
-I $(HDF5_INCLUDE_OPTS)
FCLIBS = -L$(MPICH_DIR)/lib -lmpich
FFTW3_BIN =
FFTW3_LIBS = -L$(FFTW_DIR) -lfftw3_threads -lfftw3
HDF5_LIBS = -L$(HDF5_DIR)/lib -lhdf5_fortran -lhdf5 -lrt -lz -ldl -lm
BLAS_LIBS= -L$(MKLROOT)/lib/intel64/ -lmkl_rt
LDFLAGS = -Mcudalib=cufft -L$(CUDA_HOME)/lib64 -lnvToolsExt $(HDF5_LIBS) $(FFTW3_LIBS) $(BLAS_LIBS)
OBJ= param.o \
mpiDeviceUtil.o \
decomp_2d.o \
tridiag.o \
decomp_2d_fft.o \
dph_routines.o \
hybrid_comm_routines.o \
AuxiliaryRoutines.o \
CalcDissipationNu.o \
CalcMaxCFL.o \
CalcPlateNu.o \
CheckDivergence.o \
CreateGrid.o \
CreateInitialConditions.o \
DeallocateVariables.o \
DebugRoutines.o \
GlobalQuantities.o \
HdfRoutines.o \
HdfReadContinua.o \
interp.o \
InitVariables.o \
InitTimeMarchScheme.o \
LocateLargeDivergence.o \
MpiAuxRoutines.o \
QuitRoutine.o \
ReadFlowField.o \
ReadInputFile.o \
ResetLogs.o \
SetTempBCs.o \
SlabDumpRoutines.o \
SolverInterfaces.o \
SolvePressureCorrection.o \
TimeMarcher.o \
WriteFlowField.o \
WriteGridInfo.o \
InitPressureSolver.o \
StatReadReduceWrite.o \
StatRoutines.o \
main.o
# Objects which require two compilation passes for hybrid version
OBJ2= CalcLocalDivergence.o \
CorrectPressure.o \
CorrectVelocity.o \
ExplicitTermsVX.o \
ExplicitTermsVY.o \
ExplicitTermsVZ.o \
ExplicitTermsTemp.o \
ImplicitAndUpdateVX.o \
ImplicitAndUpdateVY.o \
ImplicitAndUpdateVZ.o \
ImplicitAndUpdateTemp.o \
SolveImpEqnUpdate_X.o \
SolveImpEqnUpdate_YZ.o\
SolveImpEqnUpdate_Temp.o
# Create the subdirectory for objects
OBJDIRCPU := $(shell mkdir -p Obj_cpu)
OBJDIRGPU := $(shell mkdir -p Obj_gpu)
OBJDIRHYB := $(shell mkdir -p Obj_hyb Obj_hyb/cpu Obj_hyb/gpu)
OBJ_CPU = $(foreach O, ${OBJ}, Obj_cpu/$(O))
OBJ_CPU += $(foreach O, ${OBJ2}, Obj_cpu/$(O))
OBJ_GPU = $(foreach O, ${OBJ}, Obj_gpu/$(O))
OBJ_GPU += $(foreach O, ${OBJ2}, Obj_gpu/$(O))
OBJ_HYB = $(foreach O, ${OBJ}, Obj_hyb/$(O))
OBJ_HYB += $(foreach O, ${OBJ2}, Obj_hyb/cpu/$(O))
OBJ_HYB += $(foreach O, ${OBJ2}, Obj_hyb/gpu/$(O))
Obj_gpu/%.o: %.F90
pgf90 -c $(FFLAGS) $(INCLUDE) $< -o $@ -module=Obj_gpu
Obj_gpu/%.o: %.CUF
pgf90 -c $(FFLAGS) $(INCLUDE) $< -o $@ -module=Obj_gpu
Obj_cpu/%.o: %.CUF
pgf90 -c $(FFLAGS) $(INCLUDE) $< -o $@ -module=Obj_cpu
Obj_cpu/%.o: %.F90
pgf90 -c $(FFLAGS) $(INCLUDE) $< -o $@ -module=Obj_cpu
afid_gpu: ${OBJ_GPU}
pgf90 $(FFLAGS) $(OBJ_GPU) $(FCLIBS) $(LDFLAGS) -o afid_gpu
afid_cpu: $(OBJ_CPU)
pgf90 $(FFLAGS) $(OBJ_CPU) $(FCLIBS) $(LDFLAGS) -o afid_cpu
clean:
rm afid_cpu afid_gpu Obj_cpu/*.o Obj_gpu/*.o Obj_cpu/*.mod Obj_gpu/*.mod