New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Makefile in NEMO/branches/UKMO/BPC_miniapp/Master – NEMO

source: NEMO/branches/UKMO/BPC_miniapp/Master/Makefile @ 10895

Last change on this file since 10895 was 10895, checked in by wayne_gaudin, 3 years ago

Fixed the GPU=1 compile option to not use managed memory

File size: 3.9 KB
Line 
1# usage
2# Make several versions, plus extract individual versions
3# make clean; make
4# Make and scalar GPU version
5# make clean GPU=1 ; make GPU=1
6# ./bpc_gpu.exe
7#
8# Make and run mananged memory version for GPU
9# make clean MANAGED=1 ; make MANAGED=1
10# ./bpc_gpu_managed.exe
11#
12# Make and run OpenACC CPU version
13# make clean MULTI=1 ; make MULTI=1
14# ACC_NUM_CORES=20 ./bpc_multi.exe
15#
16# Make and run CPU/OpenMP version
17# make clean CPU=1 ; make CPU=1
18# OMP_NUM_THREADS=20 ./bpc_cpu.exe
19
20FC=pgf90
21
22# Default flags are the GPU with managed memory
23MANAGED=1
24TARGET=managed
25FMACPU=
26
27ifdef MANAGED
28  MANAGE=,managed -DMANAGED
29  TARGET=managed
30endif
31
32ifdef GPU
33  TARGET=gpu
34  MANAGE=
35endif
36
37ifdef ALL
38TARGET=*
39endif
40
41FLAGS = -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=tesla,cc70$(MANAGE)
42LFLAGS= -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=tesla,cc70$(MANAGE)
43
44ifdef CPU
45  FLAGS = -gopt -Mpreprocess -fast -mp=nonuma -Minfo=mp $(FMACPU)
46  LFLAGS= -gopt -Mpreprocess -fast -mp=nonuma -Minfo=mp $(FMACPU)
47  TARGET=cpu
48  MANAGE=
49endif
50
51ifdef MULTI
52  FLAGS= -gopt -O2 -Mpreprocess -fast -acc -Minfo=acc -ta=multicore
53  FLAGS= -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=multicore
54  TARGET=multi
55  MANAGE=
56endif
57
58ifdef DEBUG
59  FLAGS = -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk -Mchkptr
60  LFLAGS= -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk -Mchkptr
61endif
62
63# These flags will be system dependent
64NETCDF=-I$(NETCDF_INC) -L$(NETCDF_LIB) -lnetcdff -lnetcdf
65NETCDF=-I$(CPATH) -L/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/pgi-19.1/netcdf-4.6.1-snrb2ywx62gybndihod5cjn2cgqv6g5b/lib -L/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/pgi-19.1/netcdf-fortran-4.4.4-3pcdzmpp5luuvp72ddzuc24dldq45pfw/lib -lnetcdff -lnetcdf
66
67bpc_$(TARGET).exe: par_kind.o phycst.o len_oce.o in_out_man_cut.o eos_insitu.o zpshde.o dynhpgs.o zdfmxl.o ldfslp.o traldf_iso.o main_bpc_hpg.o
68   $(FC) par_kind.o phycst.o len_oce.o in_out_man_cut.o eos_insitu.o zpshde.o dynhpgs.o zdfmxl.o ldfslp.o traldf_iso.o tiletype.o traldf_iso_tile.o main_bpc_hpg.o $(LFLAGS) $(NETCDF) -o bpc_$(TARGET).exe
69
70par_kind.o: par_kind.F90
71   $(FC) -c $(FLAGS) $(NETCDF) par_kind.F90
72
73phycst.o: phycst.F90 par_kind.o
74   $(FC) -c $(FLAGS) $(NETCDF) phycst.F90
75
76len_oce.o: len_oce.F90
77   $(FC) -c $(FLAGS) $(NETCDF) len_oce.F90
78
79in_out_man_cut.o: in_out_man_cut.F90 par_kind.o
80   $(FC) -c $(FLAGS) $(NETCDF) in_out_man_cut.F90
81
82eos_insitu.o: eos_insitu.F90 phycst.o in_out_man_cut.o len_oce.o vectopt_loop_substitute.h90
83   $(FC) -c $(FLAGS) $(NETCDF) eos_insitu.F90
84
85zpshde.o: zpshde.F90 len_oce.o phycst.o in_out_man_cut.o eos_insitu.o
86   $(FC) -c $(FLAGS) $(NETCDF) zpshde.F90
87
88dynhpgs.o: dynhpgs.F90 par_kind.o len_oce.o in_out_man_cut.o vectopt_loop_substitute.h90
89   $(FC) -c $(FLAGS) $(NETCDF) dynhpgs.F90
90
91zdfmxl.o: zdfmxl.F90 in_out_man_cut.o phycst.o len_oce.o
92   $(FC) -c $(FLAGS) $(NETCDF) zdfmxl.F90
93
94ldfslp.o: ldfslp.F90 len_oce.o phycst.o in_out_man_cut.o
95   $(FC) -c $(FLAGS) $(NETCDF) ldfslp.F90
96
97tiletype.o: tiletype.F90
98   $(FC) -c $(FLAGS) $(NETCDF) tiletype.F90
99
100traldf_iso.o: traldf_iso.F90  len_oce.o phycst.o in_out_man_cut.o
101   $(FC) -c $(FLAGS) $(NETCDF) traldf_iso.F90
102
103traldf_iso_tile.o: traldf_iso_tile.F90  len_oce.o phycst.o in_out_man_cut.o tiletype.o
104   $(FC) -c $(FLAGS) $(NETCDF) traldf_iso_tile.F90
105
106main_bpc_hpg.o: main_bpc_hpg.F90 par_kind.o len_oce.o phycst.o in_out_man_cut.o eos_insitu.o zpshde.o dynhpgs.o zdfmxl.o ldfslp.o traldf_iso.o traldf_iso_tile.o tiletype.o
107   $(FC) -c $(FLAGS) $(NETCDF) main_bpc_hpg.F90
108
109clean:
110   rm -f *.o *.mod bpc_$(TARGET).exe
111
112bpc_all: bpc_OpenMP bpc_OpenACC_managed bpc_OpenACC
113
114bpc_OpenMP:
115   mkdir -p ../OpenMP
116   for i in *90; do  grep -v ACC $$i > ../OpenMP/$$i ; done
117   cp Makefile ../OpenMP
118bpc_OpenACC_managed:
119   mkdir -p ../OpenACC_managed
120   for i in *90; do  grep -v OMP $$i > ../OpenACC_managed/$$i ; done
121   cp Makefile ../OpenACC_managed
122bpc_OpenACC:
123   mkdir -p ../OpenACC
124   for i in *90; do  grep -v OMP $$i > ../OpenACC/$$i ; done
125   cp Makefile ../OpenACC
126
Note: See TracBrowser for help on using the repository browser.