forked from UK-MAC/CloverLeaf_OpenMP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
238 lines (211 loc) · 8.95 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#Crown Copyright 2012 AWE.
#
# This file is part of CloverLeaf.
#
# CloverLeaf is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# CloverLeaf is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# CloverLeaf. If not, see http://www.gnu.org/licenses/.
# @brief Makefile for CloverLeaf
# @author Wayne Gaudin, Andy Herdman
# @details Agnostic, platform independent makefile for the Clover Leaf benchmark code.
# It is not meant to be clever in anyway, just a simple build out of the box script.
# Just make sure mpif90 is in your path. It uses mpif90 even for all builds because this abstracts the base
# name of the compiler. If you are on a system that doesn't use mpif90, just replace mpif90 with the compiler name
# of choice. The only mpi dependencies in this non-MPI version are mpi_wtime in timer.f90.
# There is no single way of turning OpenMP compilation on with all compilers.
# The known compilers have been added as a variable. By default the make
# will use no options, which will work on Cray for example, but not on other
# compilers.
# To select a OpenMP compiler option, do this in the shell before typing make:-
#
# export COMPILER=INTEL # to select the Intel flags
# export COMPILER=SUN # to select the Sun flags
# export COMPILER=GNU # to select the Gnu flags
# export COMPILER=CRAY # to select the Cray flags
# export COMPILER=PGI # to select the PGI flags
# export COMPILER=PATHSCALE # to select the Pathscale flags
# export COMPILER=XL # to select the IBM Xlf flags
# or this works as well:-
#
# make COMPILER=INTEL
# make COMPILER=SUN
# make COMPILER=GNU
# make COMPILER=CRAY
# make COMPILER=PGI
# make COMPILER=PATHSCALE
# make COMPILER=XL
#
# Don't forget to set the number of threads you want to use, like so
# export OMP_NUM_THREADS=4
# usage: make # Will make the binary
# make clean # Will clean up the directory
# make DEBUG=1 # Will select debug options. If a compiler is selected, it will use compiler specific debug options
# make IEEE=1 # Will select debug options as long as a compiler is selected as well
# e.g. make COMPILER=INTEL MPI_COMPILER=mpiifort C_MPI_COMPILER=mpiicc DEBUG=1 IEEE=1 # will compile with the intel compiler with intel debug and ieee flags included
ifndef COMPILER
MESSAGE=select a compiler to compile in OpenMP, e.g. make COMPILER=INTEL
endif
OMP_INTEL = -openmp
OMP_SUN = -xopenmp=parallel -vpara
OMP_GNU = -fopenmp
OMP_CRAY =
OMP_PGI = -mp=nonuma
OMP_PATHSCALE = -mp
OMP_XL = -qsmp=omp -qthreaded
OMP=$(OMP_$(COMPILER))
FLAGS_INTEL = -O3 -no-prec-div
FLAGS_SUN = -fast -xipo=2 -Xlistv4
FLAGS_GNU = -O3 -march=native -funroll-loops
FLAGS_CRAY = -em -ra -h acc_model=fast_addr:no_deep_copy:auto_async_all
FLAGS_PGI = -fastsse -Mipa=fast -Mlist
FLAGS_PATHSCALE = -O3
FLAGS_XL = -O5 -qipa=partition=large -g -qfullpath -Q -qsigtrap -qextname=flush:ideal_gas_kernel_c:viscosity_kernel_c:pdv_kernel_c:revert_kernel_c:accelerate_kernel_c:flux_calc_kernel_c:advec_cell_kernel_c:advec_mom_kernel_c:reset_field_kernel_c:timer_c:unpack_top_bottom_buffers_c:pack_top_bottom_buffers_c:unpack_left_right_buffers_c:pack_left_right_buffers_c:field_summary_kernel_c:update_halo_kernel_c:generate_chunk_kernel_c:initialise_chunk_kernel_c:calc_dt_kernel_c:clover_unpack_message_bottom_c:clover_pack_message_bottom_c:clover_unpack_message_top_c:clover_pack_message_top_c:clover_unpack_message_right_c:clover_pack_message_right_c:clover_unpack_message_left_c:clover_pack_message_left_c -qlistopt -qattr=full -qlist -qreport -qxref=full -qsource -qsuppress=1506-224:1500-036FLAGS_ = -O3
CFLAGS_INTEL = -O3 -no-prec-div -restrict -fno-alias
CFLAGS_SUN = -fast -xipo=2
CFLAGS_GNU = -O3 -march=native -funroll-loops
CFLAGS_CRAY = -em -h list=a
CFLAGS_PGI = -fastsse -Mipa=fast -Mlist
CFLAGS_PATHSCALE = -O3
CFLAGS_XL = -O5 -qipa=partition=large -g -qfullpath -Q -qlistopt -qattr=full -qlist -qreport -qxref=full -qsource -qsuppress=1506-224:1500-036 -qsrcmsg
CFLAGS_ = -O3
ifdef DEBUG
FLAGS_INTEL = -O0 -g -debug all -check all -traceback -check noarg_temp_created
FLAGS_SUN = -g -xopenmp=noopt -stackvar -u -fpover=yes -C -ftrap=common
FLAGS_GNU = -O0 -g -O -Wall -Wextra -fbounds-check
FLAGS_CRAY = -O0 -g -em -eD
FLAGS_PGI = -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk -Mchkptr
FLAGS_PATHSCALE = -O0 -g
FLAGS_XL = -O0 -g -qfullpath -qcheck -qflttrap=ov:zero:invalid:en -qsource -qinitauto=FF -qmaxmem=-1 -qinit=f90ptr -qsigtrap -qextname=flush:ideal_gas_kernel_c:viscosity_kernel_c:pdv_kernel_c:revert_kernel_c:accelerate_kernel_c:flux_calc_kernel_c:advec_cell_kernel_c:advec_mom_kernel_c:reset_field_kernel_c:timer_c:unpack_top_bottom_buffers_c:pack_top_bottom_buffers_c:unpack_left_right_buffers_c:pack_left_right_buffers_c:field_summary_kernel_c:update_halo_kernel_c:generate_chunk_kernel_c:initialise_chunk_kernel_c:calc_dt_kernel_c
FLAGS_ = -O0 -g
CFLAGS_INTEL = -O0 -g -debug all -traceback
CFLAGS_SUN = -g -O0 -xopenmp=noopt -stackvar -u -fpover=yes -C -ftrap=common
CFLAGS_GNU = -O0 -g -O -Wall -Wextra -fbounds-check
CFLAGS_CRAY = -O0 -g -em -eD
CFLAGS_PGI = -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk
CFLAGS_PATHSCALE= -O0 -g
CFLAGS_XL = -O0 -g -qfullpath -qcheck -qflttrap=ov:zero:invalid:en -qsource -qinitauto=FF -qmaxmem=-1 -qsrcmsg
endif
ifdef IEEE
I3E_INTEL = -fp-model strict -fp-model source -prec-div -prec-sqrt
I3E_SUN = -fsimple=0 -fns=no
I3E_GNU = -ffloat-store
I3E_CRAY = -hflex_mp=intolerant
I3E_PGI = -Kieee
I3E_PATHSCALE = -mieee-fp
I3E_XL = -qfloat=nomaf
I3E=$(I3E_$(COMPILER))
endif
MPI_COMPILER_INTEL = ifort
C_MPI_COMPILER_INTEL = icc
MPI_COMPILER_SUN = f95
C_MPI_COMPILER_SUN = CC
MPI_COMPILER_GNU = gfortran
C_MPI_COMPILER_GNU = gcc
MPI_COMPILER_CRAY = ftn
C_MPI_COMPILER_CRAY = cc
MPI_COMPILER_PGI = pgfortran
C_MPI_COMPILER_PGI = pgcc
MPI_COMPILER_PATHSCALE = pathf95
C_MPI_COMPILER_PATHSCALE = pathcc
MPI_COMPILER_XL = xlf
C_MPI_COMPILER_XL = xlc
MPI_COMPILER_ = FC
C_MPI_COMPILER_ = CC
FLAGS=$(FLAGS_$(COMPILER)) $(OMP) $(I3E) $(OPTIONS)
CFLAGS=$(CFLAGS_$(COMPILER)) $(OMP) $(I3E) $(C_OPTIONS) -c
MPI_COMPILER=$(MPI_COMPILER_$(COMPILER))
C_MPI_COMPILER=$(C_MPI_COMPILER_$(COMPILER))
clover_leaf: c_lover *.f90 Makefile
$(MPI_COMPILER) $(FLAGS) \
data.f90 \
definitions.f90 \
pack_kernel.f90 \
clover.f90 \
report.f90 \
timer.f90 \
parse.f90 \
read_input.f90 \
initialise_chunk_kernel.f90 \
initialise_chunk.f90 \
build_field.f90 \
update_tile_halo_kernel.f90 \
update_tile_halo.f90 \
update_halo_kernel.f90 \
update_halo.f90 \
ideal_gas_kernel.f90 \
ideal_gas.f90 \
start.f90 \
generate_chunk_kernel.f90 \
generate_chunk.f90 \
initialise.f90 \
field_summary_kernel.f90 \
field_summary.f90 \
viscosity_kernel.f90 \
viscosity.f90 \
calc_dt_kernel.f90 \
calc_dt.f90 \
timestep.f90 \
accelerate_kernel.f90 \
accelerate.f90 \
revert_kernel.f90 \
revert.f90 \
PdV_kernel.f90 \
PdV.f90 \
flux_calc_kernel.f90 \
flux_calc.f90 \
advec_cell_kernel.f90 \
advec_cell_driver.f90 \
advec_mom_kernel.f90 \
advec_mom_driver.f90 \
advection.f90 \
reset_field_kernel.f90 \
reset_field.f90 \
hydro.f90 \
visit.f90 \
clover_leaf.f90 \
accelerate_kernel_c.o \
PdV_kernel_c.o \
flux_calc_kernel_c.o \
revert_kernel_c.o \
reset_field_kernel_c.o \
ideal_gas_kernel_c.o \
viscosity_kernel_c.o \
advec_mom_kernel_c.o \
advec_cell_kernel_c.o \
calc_dt_kernel_c.o \
field_summary_kernel_c.o \
update_halo_kernel_c.o \
timer_c.o \
pack_kernel_c.o \
generate_chunk_kernel_c.o \
initialise_chunk_kernel_c.o \
-o clover_leaf; echo $(MESSAGE)
c_lover: *.c Makefile
$(C_MPI_COMPILER) $(CFLAGS) \
accelerate_kernel_c.c \
PdV_kernel_c.c \
flux_calc_kernel_c.c \
revert_kernel_c.c \
reset_field_kernel_c.c \
ideal_gas_kernel_c.c \
viscosity_kernel_c.c \
advec_mom_kernel_c.c \
advec_cell_kernel_c.c \
calc_dt_kernel_c.c \
field_summary_kernel_c.c \
update_halo_kernel_c.c \
pack_kernel_c.c \
generate_chunk_kernel_c.c \
initialise_chunk_kernel_c.c \
timer_c.c
clean:
rm -f *.o *.mod *genmod* *cuda* *hmd* *.cu *.oo *.hmf *.lst *.cub *.ptx *.cl clover_leaf