1 | # usage |
---|
2 | # Make several versions, plus extract individual versions |
---|
3 | # make clean; make |
---|
4 | # Make and scalar CPU version |
---|
5 | # make clean; make CPU=1 |
---|
6 | # ./bpc.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 | |
---|
20 | FC=pgf90 |
---|
21 | |
---|
22 | # Default flags are the GPU with managed memory |
---|
23 | MANAGED=1 |
---|
24 | TARGET=gpu |
---|
25 | FMACPU= |
---|
26 | ifdef MANAGED |
---|
27 | MANAGE=,managed -DMANAGED |
---|
28 | endif |
---|
29 | |
---|
30 | ifdef ALL |
---|
31 | TARGET=* |
---|
32 | endif |
---|
33 | |
---|
34 | |
---|
35 | FLAGS = -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=tesla,cc70$(MANAGE) |
---|
36 | LFLAGS= -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=tesla,cc70$(MANAGE) |
---|
37 | |
---|
38 | ifdef CPU |
---|
39 | FLAGS = -gopt -Mpreprocess -fast -mp=nonuma -Minfo=mp $(FMACPU) |
---|
40 | LFLAGS= -gopt -Mpreprocess -fast -mp=nonuma -Minfo=mp $(FMACPU) |
---|
41 | TARGET=cpu |
---|
42 | endif |
---|
43 | |
---|
44 | ifdef MULTI |
---|
45 | FLAGS= -gopt -O2 -Mpreprocess -fast -acc -Minfo=acc -ta=multicore |
---|
46 | FLAGS= -gopt -Mpreprocess -fast -acc -Minfo=acc -ta=multicore |
---|
47 | TARGET=multi |
---|
48 | endif |
---|
49 | |
---|
50 | ifdef DEBUG |
---|
51 | FLAGS = -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk -Mchkptr |
---|
52 | LFLAGS= -O0 -g -C -Mchkstk -Ktrap=fp -Mchkfpstk -Mchkptr |
---|
53 | endif |
---|
54 | |
---|
55 | # These flags will be system dependent |
---|
56 | NETCDF=-I$(NETCDF_INC) -L$(NETCDF_LIB) -lnetcdff -lnetcdf |
---|
57 | NETCDF=-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 |
---|
58 | |
---|
59 | bpc_$(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 |
---|
60 | $(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 |
---|
61 | |
---|
62 | par_kind.o: par_kind.F90 |
---|
63 | $(FC) -c $(FLAGS) $(NETCDF) par_kind.F90 |
---|
64 | |
---|
65 | phycst.o: phycst.F90 par_kind.o |
---|
66 | $(FC) -c $(FLAGS) $(NETCDF) phycst.F90 |
---|
67 | |
---|
68 | len_oce.o: len_oce.F90 |
---|
69 | $(FC) -c $(FLAGS) $(NETCDF) len_oce.F90 |
---|
70 | |
---|
71 | in_out_man_cut.o: in_out_man_cut.F90 par_kind.o |
---|
72 | $(FC) -c $(FLAGS) $(NETCDF) in_out_man_cut.F90 |
---|
73 | |
---|
74 | eos_insitu.o: eos_insitu.F90 phycst.o in_out_man_cut.o len_oce.o vectopt_loop_substitute.h90 |
---|
75 | $(FC) -c $(FLAGS) $(NETCDF) eos_insitu.F90 |
---|
76 | |
---|
77 | zpshde.o: zpshde.F90 len_oce.o phycst.o in_out_man_cut.o eos_insitu.o |
---|
78 | $(FC) -c $(FLAGS) $(NETCDF) zpshde.F90 |
---|
79 | |
---|
80 | dynhpgs.o: dynhpgs.F90 par_kind.o len_oce.o in_out_man_cut.o vectopt_loop_substitute.h90 |
---|
81 | $(FC) -c $(FLAGS) $(NETCDF) dynhpgs.F90 |
---|
82 | |
---|
83 | zdfmxl.o: zdfmxl.F90 in_out_man_cut.o phycst.o len_oce.o |
---|
84 | $(FC) -c $(FLAGS) $(NETCDF) zdfmxl.F90 |
---|
85 | |
---|
86 | ldfslp.o: ldfslp.F90 len_oce.o phycst.o in_out_man_cut.o |
---|
87 | $(FC) -c $(FLAGS) $(NETCDF) ldfslp.F90 |
---|
88 | |
---|
89 | tiletype.o: tiletype.F90 |
---|
90 | $(FC) -c $(FLAGS) $(NETCDF) tiletype.F90 |
---|
91 | |
---|
92 | traldf_iso.o: traldf_iso.F90 len_oce.o phycst.o in_out_man_cut.o |
---|
93 | $(FC) -c $(FLAGS) $(NETCDF) traldf_iso.F90 |
---|
94 | |
---|
95 | traldf_iso_tile.o: traldf_iso_tile.F90 len_oce.o phycst.o in_out_man_cut.o tiletype.o |
---|
96 | $(FC) -c $(FLAGS) $(NETCDF) traldf_iso_tile.F90 |
---|
97 | |
---|
98 | main_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 |
---|
99 | $(FC) -c $(FLAGS) $(NETCDF) main_bpc_hpg.F90 |
---|
100 | |
---|
101 | clean: |
---|
102 | rm -f *.o *.mod bpc_$(TARGET).exe |
---|
103 | |
---|
104 | bpc_all: bpc_OpenMP bpc_OpenACC_managed bpc_OpenACC |
---|
105 | |
---|
106 | bpc_OpenMP: |
---|
107 | mkdir -p ../OpenMP |
---|
108 | for i in *90; do grep -v ACC $$i > ../OpenMP/$$i ; done |
---|
109 | cp Makefile ../OpenMP |
---|
110 | bpc_OpenACC_managed: |
---|
111 | mkdir -p ../OpenACC_managed |
---|
112 | for i in *90; do grep -v OMP $$i > ../OpenACC_managed/$$i ; done |
---|
113 | cp Makefile ../OpenACC_managed |
---|
114 | bpc_OpenACC: |
---|
115 | mkdir -p ../OpenACC |
---|
116 | for i in *90; do grep -v OMP $$i > ../OpenACC/$$i ; done |
---|
117 | cp Makefile ../OpenACC |
---|
118 | |
---|