From 080fa2554462be9845bbc0df6fc87dc94e94e0f1 Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Fri, 6 Mar 2020 14:43:29 -0500 Subject: [PATCH 1/4] FMS and mkmf moved to deps directory Moving FMS and mkmf to the `build` directory led to conflicts in the `build/%/Makefile` and `build/%/path_names` rules, which were causing redundant builds. This patch moves these repositories back into a local `deps` directory, now kept inside of `.testing`. --- .testing/Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.testing/Makefile b/.testing/Makefile index 0471499528..37dd36e1f1 100644 --- a/.testing/Makefile +++ b/.testing/Makefile @@ -9,17 +9,18 @@ DO_REPRO_TESTS ?= true #--- # Dependencies +DEPS = deps # mkmf, list_paths (GFDL build toolchain) MKMF_URL ?= https://github.com/NOAA-GFDL/mkmf.git MKMF_COMMIT ?= master -LIST_PATHS := $(abspath build/mkmf/bin/list_paths) -MKMF := $(abspath build/mkmf/bin/mkmf) +LIST_PATHS := $(abspath $(DEPS)/mkmf/bin/list_paths) +MKMF := $(abspath $(DEPS)/mkmf/bin/mkmf) # FMS framework FMS_URL ?= https://github.com/NOAA-GFDL/FMS.git FMS_COMMIT ?= f2e2c86f6c0eb6d389a20509a8a60fa22924e16b -FMS := build/fms +FMS := $(DEPS)/fms #--- # Build configuration @@ -85,7 +86,7 @@ SOURCE = \ MOM_SOURCE = $(call SOURCE,../src) $(wildcard ../config_src/solo_driver/*.F90) TARGET_SOURCE = $(call SOURCE,build/target_codebase/src) \ $(wildcard build/target_codebase/config_src/solo_driver/*.F90) -FMS_SOURCE = $(call SOURCE,build/fms/src) +FMS_SOURCE = $(call SOURCE,$(DEPS)/fms/src) #--- # Rules @@ -117,9 +118,9 @@ build/%/Makefile: build/%/path_names cp $(MKMF_TEMPLATE) $(@D) cd $(@D) && $(MKMF) \ -t $(notdir $(MKMF_TEMPLATE)) \ - -o '-I ../fms/build' \ + -o '-I ../../$(DEPS)/fms/build' \ -p MOM6 \ - -l '../fms/lib/libfms.a' \ + -l '../../$(DEPS)/fms/lib/libfms.a' \ -c $(MKMF_CPP) \ path_names @@ -173,8 +174,8 @@ $(FMS)/src: # Build Toolchain $(LIST_PATHS) $(MKMF): - git clone $(MKMF_URL) build/mkmf - cd build/mkmf; git checkout $(MKMF_COMMIT) + git clone $(MKMF_URL) $(DEPS)/mkmf + cd $(DEPS)/mkmf; git checkout $(MKMF_COMMIT) #---- From bfc2b6f5b9e5c1f00370e48fcb3d7f79c9ba7e0e Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Fri, 6 Mar 2020 14:45:50 -0500 Subject: [PATCH 2/4] Travis environment updated to bionic The Travis environment was updated in order to get a newer GCC compiler version. This was done to enable more aggressive initialization. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2cefbd8771..ac7cab1b14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ # This is a not a c-language project but we use the same environment. language: c -dist: xenial +dist: bionic # --depth flag is breaking our merge, try disabling it # NOTE: We may be able to go back to depth=50 in production From 751616b6fc40c2f34507ba04bd5fa464879756e9 Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Fri, 6 Mar 2020 14:47:20 -0500 Subject: [PATCH 3/4] FMS version updated to 2019.01.01 tag The FMS version has been updated in order to permit more aggressive initialization settings in MOM6. This requires a few bugfixes in the newer FMS release. --- .testing/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.testing/Makefile b/.testing/Makefile index 37dd36e1f1..1127677e00 100644 --- a/.testing/Makefile +++ b/.testing/Makefile @@ -19,7 +19,7 @@ MKMF := $(abspath $(DEPS)/mkmf/bin/mkmf) # FMS framework FMS_URL ?= https://github.com/NOAA-GFDL/FMS.git -FMS_COMMIT ?= f2e2c86f6c0eb6d389a20509a8a60fa22924e16b +FMS_COMMIT ?= 2019.01.01 FMS := $(DEPS)/fms #--- From 65b95e4e4b7969606e783d4fbc95139a6b02d834 Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Fri, 6 Mar 2020 15:51:04 -0500 Subject: [PATCH 4/4] Enable aggressive initialization Flags for initializing reals on stack as signaling NaNs (SNaN) and integers as 2**31 - 1 have been added in this build. --- .testing/Makefile | 8 ++++---- .testing/linux-ubuntu-xenial-gnu.mk | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.testing/Makefile b/.testing/Makefile index 1127677e00..8067e4218d 100644 --- a/.testing/Makefile +++ b/.testing/Makefile @@ -102,11 +102,11 @@ BUILD_TARGETS = MOM6 Makefile path_names # Conditionally build symmetric with coverage support COVFLAG=$(if $(REPORT_COVERAGE),COVERAGE=1,) -build/target/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 -build/symmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 $(COVFLAG) -build/asymmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 +build/target/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 INIT=1 +build/symmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 INIT=1 $(COVFLAG) +build/asymmetric/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 INIT=1 build/repro/MOM6: MOMFLAGS=NETCDF=3 REPRO=1 -build/openmp/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 OPENMP=1 +build/openmp/MOM6: MOMFLAGS=NETCDF=3 DEBUG=1 OPENMP=1 INIT=1 build/asymmetric/path_names: GRID_SRC=config_src/dynamic build/%/path_names: GRID_SRC=config_src/dynamic_symmetric diff --git a/.testing/linux-ubuntu-xenial-gnu.mk b/.testing/linux-ubuntu-xenial-gnu.mk index 8c96c8c5c6..04ba952408 100644 --- a/.testing/linux-ubuntu-xenial-gnu.mk +++ b/.testing/linux-ubuntu-xenial-gnu.mk @@ -24,7 +24,7 @@ LD = mpif90 $(MAIN_PROGRAM) DEBUG = # If non-blank, perform a debug build (Cannot be # mixed with REPRO or TEST) -REPRO = # If non-blank, erform a build that guarentees +REPRO = # If non-blank, perform a build that guarentees # reprodicuibilty from run to run. Cannot be used # with DEBUG or TEST @@ -54,6 +54,8 @@ SSE = # The SSE options to be used to compile. If blank, COVERAGE = # Add the code coverage compile options. +INIT = # Enable aggressive initialization + # Need to use at least GNU Make version 3.81 need := 3.81 ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))) @@ -89,6 +91,10 @@ FFLAGS := -fcray-pointer -fdefault-double-8 -fdefault-real-8 -Waliasing -ffree-l FFLAGS_OPT = -O3 FFLAGS_REPRO = -O2 -fbounds-check FFLAGS_DEBUG = -O0 -g -W -Wno-compare-reals -fbounds-check -fbacktrace -ffpe-trap=invalid,zero,overflow +# Enable aggressive initialization +ifdef INIT +FFLAGS_DEBUG += -finit-real=snan -finit-integer=2147483647 -finit-derived +endif # Flags to add additional build options FFLAGS_OPENMP = -fopenmp