forked from HLRA-JHPCN/HACApK-MAGMA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·145 lines (114 loc) · 3.45 KB
/
Makefile
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#SYSTEM = FX10
#SYSTEM = INTEL
#SYSTEM = XC30
SYSTEM = Tsubame
#FX10
ifeq ($(SYSTEM),FX10)
OPTFLAGS = -fs
CC=mpifccpx
F90=mpifrtpx -Kfast,openmp
#F90=mpifrtpx -Kopenmp
CCFLAGS = $(OPTFLAGS)
F90FLAGS = $(OPTFLAGS) -Cfpp
LDFLAGS = -SSL2
endif
#intel
ifeq ($(SYSTEM),INTEL)
#OPTFLAGS = -O3 -traceback -ip -heap-arrays -qopenmp
OPTFLAGS = -qopenmp -O3 -ip
CC=mpiicc
F90=mpiifort
CCFLAGS = $(OPTFLAGS)
#F90FLAGS = $(OPTFLAGS) -fpp -assume nounderscore -names uppercase
F90FLAGS = $(OPTFLAGS) -fpp
#F90FLAGS = $(OPTFLAGS) -fpp -check all
#F90FLAGS = -fpe0 -traceback -g -CB -assume nounderscore -names lowercase -fpp -check all
#LDFLAGS = -mkl -trace
LDFLAGS = -mkl
endif
#XC30
ifeq ($(SYSTEM),XC30)
OPTFLAGS = -O2 -homp
CC=cc
F90=ftn
CCFLAGS = $(OPTFLAGS)
F90FLAGS = $(OPTFLAGS)
endif
#Tsubame
SYSTEM = TSUBAME
ifeq ($(SYSTEM),TSUBAME)
#OPTFLAGS = -O3 -traceback -ip -heap-arrays -qopenmp
#OPTFLAGS = -openmp -O3
OPTFLAGS = -qopenmp
#CC=mpicc
#F90=mpif90
CC=mpiicc
F90=mpiifort
CCFLAGS = $(OPTFLAGS)
F90FLAGS = $(OPTFLAGS) -fpp
#F90FLAGS = $(OPTFLAGS) -fpp1 -check all
LDFLAGS = -mkl
#INCS+= -I/usr/apps.sp3/isv/intel/ParallelStudioXE/ClusterEdition/2016-Update3/compilers_and_libraries_2016.3.210/linux/compiler/include
endif
LINK=$(F90)
OBJS = HACApK_MAGMA.o HACApK_MGPU.o HACApK_BATCH.o HACApK_BATCH_SORT.o HACApK_SOLVER.o \
HACApK_lib.o m_ppohBEM_user_func.o m_ppohBEM_matrix_element_ij.o m_HACApK_calc_entry_ij.o \
m_HACApK_base.o m_HACApK_solve.o m_HACApK_use.o m_ppohBEM_bembb2hacapk.o bem-bb-fw-HACApK-0.4.2.o \
# PaRSEC
#CPP = mpiicpc
# forcing the link with OpenMPI
#LINK = ifort
#MPI_DIR = /opt/ompi/2.0.1
#INCS = -I$(MPI_DIR)/include
#LIBS = -cxxlib
#LIBS+= $(MPI_DIR)/lib/libmpi_mpifh.so
#PARSEC_DIR = /home/yamazaki/parsec-bitbucket/dplasma
#SOLVER_DIR = /home/yamazaki/pulsar/ierus/main/parsec
#IERUS_DIR = /home/yamazaki/pulsar/ierus/ierus_source/parsec
#OBJS+= HACApK_PaRSEC.o
#LIBS+= $(IERUS_DIR)/ACA.o $(IERUS_DIR)/DataFile.o $(IERUS_DIR)/rsvd.o $(IERUS_DIR)/symbolic.o \
# $(SOLVER_DIR)/lib/*.o $(SOLVER_DIR)/lib/ierus/*.o \
# $(PARSEC_DIR)/libdague.a $(PARSEC_DIR)/data_dist/matrix/libdague_distribution_matrix.a \
# -lpthread -lm -lhwloc
#INCS+= -I$(IERUS_DIR) -I$(SOLVER_DIR)/include \
# -I$(PARSEC_DIR) -I$(PARSEC_DIR)/include
#CCFLAGS += -DHAVE_PaRSEC
#F90FLAGS+= -DHAVE_PaRSEC
# MAGMA
CUDA_DIR = /lustre/app/acc/cuda/8.0.44
MAGMA_DIR = /lustre/jh160041/g27001/magma-2.2.0
MPI_DIR = /lustre/app/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64
INCS+= -I$(CUDA_DIR)/include -I$(MAGMA_DIR)/include -I$(MPI_DIR)/include
LIBS+= -L$(CUDA_DIR)/lib64 -lcublas -lcusparse -lcudart $(MAGMA_DIR)/lib/libmagma.a
#CCFLAGS += -DISO_C_BINDING
#F90FLAGS+= -DISO_C_BINDING
CCFLAGS += -DHAVE_MAGMA -DADD_ -DMAGMA_WITH_MKL
F90FLAGS+= -DHAVE_MAGMA -DADD_ -DMAGMA_WITH_MKL
CCFLAGS += -DHAVE_MAGMA_BATCH
F90FLAGS+= -DHAVE_MAGMA_BATCH
CCFLAGS += -DPROF_MAGMA_BATCH
F90FLAGS+= -DPROF_MAGMA_BATCH
CCFLAGS += -DBICG_MAGMA_BATCH
F90FLAGS+= -DBICG_MAGMA_BATCH
CCFLAGS += -mkl=sequential
F90FLAGS+= -mkl=sequential
# runs only MGPU version
CCFLAGS += -DBICG_MAGMA_MGPU
F90FLAGS+= -DBICG_MAGMA_MGPU
OPTFLAGS += -O3
#CCFLAGS += -g
#F90FLAGS+= -g
#LDFLAGS += -g
#CCFLAGS += -Wall -Wremarks -Wcheck
TARGET=bem-bb-SCM.out
.SUFFIXES: .o .c .f90
$(TARGET): $(OBJS)
$(LINK) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
.c.o: *.c
$(CC) -c $(CCFLAGS) $(INCS) $<
.f90.o: *.f90
$(F90) -c $< $(F90FLAGS) $(INCS)
clean:
rm -f *.o *.mod $(TARGET)
rmod:
rm -f m_*.o *.mod