From f4ea749d3ec78345a5c76f7927f7fd5197c67e51 Mon Sep 17 00:00:00 2001 From: Carl Ponder Date: Tue, 17 Oct 2017 10:34:27 -0500 Subject: [PATCH] Replacing explicit OpenACC with build variable. I think it's a mistake to embed explicit flags like "-ta=tesla:cc60" in the deep Makefile's. It takes some work to figure out what needs to be changed, so it's too easy to lose track of the individual changes, and get the configuration files into an inconsistent state. I recommend adding this $(OPENACC) variable to the Makefile instead. I'll be setting it in my top-level build-script so I can manage it as part of my "thin layer". In the top-level Makefile, you may want to duplicate the "pgi" target as "pgi-openacc" and add this line OPENACC = -acc -Minfo=accel -ta=tesla:cc60,cuda8.0 I recommend cc60 & cuda8.0 for now because we're working mainly with Pascal's and the cuda9.0 is too new to rely on. On the other hand I won't be using the Makefile setting, I'll be controlling the $(OPENACC) variable from my top-level build script. --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index d5f158404..7b5f8da92 100644 --- a/src/Makefile +++ b/src/Makefile @@ -15,7 +15,7 @@ endif all: mpas mpas: $(AUTOCLEAN_DEPS) externals frame ops dycore drver - $(LINKER) $(LDFLAGS) -o $(EXE_NAME) driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time -r8 -O3 -byteswapio -Mfree -m64 -Mnofma -acc -ta=tesla:cc60 + $(LINKER) $(LDFLAGS) -o $(EXE_NAME) driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time -r8 -O3 -byteswapio -Mfree -m64 -Mnofma $(OPENACC) externals: $(AUTOCLEAN_DEPS) ( cd external; $(MAKE) FC="$(FC)" SFC="$(SFC)" CC="$(CC)" SCC="$(SCC)" FFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" NETCDF="$(NETCDF)" CORE="$(CORE)" all )