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 | |
---|
58 | 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 |
---|
59 | $(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 |
---|
60 | |
---|
61 | par_kind.o: par_kind.F90 |
---|
62 | $(FC) -c $(FLAGS) $(NETCDF) par_kind.F90 |
---|
63 | |
---|
64 | phycst.o: phycst.F90 par_kind.o |
---|
65 | $(FC) -c $(FLAGS) $(NETCDF) phycst.F90 |
---|
66 | |
---|
67 | len_oce.o: len_oce.F90 |
---|
68 | $(FC) -c $(FLAGS) $(NETCDF) len_oce.F90 |
---|
69 | |
---|
70 | in_out_man_cut.o: in_out_man_cut.F90 par_kind.o |
---|
71 | $(FC) -c $(FLAGS) $(NETCDF) in_out_man_cut.F90 |
---|
72 | |
---|
73 | eos_insitu.o: eos_insitu.F90 phycst.o in_out_man_cut.o len_oce.o vectopt_loop_substitute.h90 |
---|
74 | $(FC) -c $(FLAGS) $(NETCDF) eos_insitu.F90 |
---|
75 | |
---|
76 | zpshde.o: zpshde.F90 len_oce.o phycst.o in_out_man_cut.o eos_insitu.o |
---|
77 | $(FC) -c $(FLAGS) $(NETCDF) zpshde.F90 |
---|
78 | |
---|
79 | dynhpgs.o: dynhpgs.F90 par_kind.o len_oce.o in_out_man_cut.o vectopt_loop_substitute.h90 |
---|
80 | $(FC) -c $(FLAGS) $(NETCDF) dynhpgs.F90 |
---|
81 | |
---|
82 | zdfmxl.o: zdfmxl.F90 in_out_man_cut.o phycst.o len_oce.o |
---|
83 | $(FC) -c $(FLAGS) $(NETCDF) zdfmxl.F90 |
---|
84 | |
---|
85 | ldfslp.o: ldfslp.F90 len_oce.o phycst.o in_out_man_cut.o |
---|
86 | $(FC) -c $(FLAGS) $(NETCDF) ldfslp.F90 |
---|
87 | |
---|
88 | tiletype.o: tiletype.F90 |
---|
89 | $(FC) -c $(FLAGS) $(NETCDF) tiletype.F90 |
---|
90 | |
---|
91 | traldf_iso.o: traldf_iso.F90 len_oce.o phycst.o in_out_man_cut.o |
---|
92 | $(FC) -c $(FLAGS) $(NETCDF) traldf_iso.F90 |
---|
93 | |
---|
94 | traldf_iso_tile.o: traldf_iso_tile.F90 len_oce.o phycst.o in_out_man_cut.o tiletype.o |
---|
95 | $(FC) -c $(FLAGS) $(NETCDF) traldf_iso_tile.F90 |
---|
96 | |
---|
97 | 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 |
---|
98 | $(FC) -c $(FLAGS) $(NETCDF) main_bpc_hpg.F90 |
---|
99 | |
---|
100 | clean: |
---|
101 | rm -f *.o *.mod bpc_$(TARGET).exe |
---|
102 | |
---|
103 | bpc_versions: |
---|
104 | mkdir -p ../OpenMP_extract |
---|
105 | mkdir -p ../OpenACC_managed_extract |
---|
106 | mkdir -p ../OpenACC_extract |
---|
107 | for i in *90; do grep -v OMP $$i > ../OpenACC_managed_extract/$$i ; done |
---|
108 | for i in *90; do grep -v OMP $$i > ../OpenACC_extract/$$i ; done |
---|
109 | for i in *90; do grep -v ACC $$i > ../OpenMP_extract/$$i ; done |
---|
110 | cp Makefile ../OpenMP_extract |
---|
111 | cp Makefile ../OpenACC_managed_extract |
---|
112 | cp Makefile ../OpenACC_extract |
---|
113 | |
---|