Skip to content

Commit

Permalink
Update CIME to ESMCI cime5.8.7-2 (PR #3126)
Browse files Browse the repository at this point in the history
Update CIME to ESMCI cime5.8.7-2

Squash merge of jgfouca/branch-for-to-acme-2019-08-14

Features:
* Update to latest NCAR PIO2 version
* improve the config_compilers.xml schema to catch case errors

Bug fixes:
* make sure output_root path is abspath
* make sure ~/.cime/config_compilers.xml file is also checked against schema
* fix indentation bug in get_timing

[BFB]
  • Loading branch information
jgfouca committed Aug 15, 2019
1 parent a59b46a commit 401031d
Show file tree
Hide file tree
Showing 99 changed files with 7,528 additions and 2,118 deletions.
4 changes: 2 additions & 2 deletions cime/config/cesm/config_grids.xml
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,11 @@
<mask>gx3v7</mask>
</model_grid>

<model_grid alias="ne16pg3_ne16pg3_mg37" not_compset="_POP|_CLM">
<model_grid alias="ne16pg3_ne16pg3_mg17" not_compset="_POP|_CLM">
<grid name="atm">ne16np4.pg3</grid>
<grid name="lnd">ne16np4.pg3</grid>
<grid name="ocnice">ne16np4.pg3</grid>
<mask>gx3v7</mask>
<mask>gx1v7</mask>
</model_grid>

<model_grid alias="ne30pg3_ne30pg3_mg17" not_compset="_POP">
Expand Down
6 changes: 3 additions & 3 deletions cime/scripts/lib/CIME/XML/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ def __init__(self, machobj, infile=None, compiler=None, mpilib=None, files=None,
if files is None:
files = Files()
infile = files.get_value("COMPILERS_SPEC_FILE")
schema = files.get_schema("COMPILERS_SPEC_FILE")
schema = files.get_schema("COMPILERS_SPEC_FILE")

GenericXML.__init__(self, infile, schema)
self._machobj = machobj
if version is not None:
# this is used in scripts_regression_tests to force version 2, it should not be used otherwise
self._version = version
else:
self._version = self.get_version()

self._machobj = machobj
self.machine = machobj.get_machine_name()
self.os = machobj.get_value("OS")
if compiler is None:
Expand All @@ -52,7 +52,7 @@ def __init__(self, machobj, infile=None, compiler=None, mpilib=None, files=None,
#This could cause problems if node matchs are repeated when only one is expected
infile = os.path.join(os.environ.get("HOME"),".cime","config_compilers.xml")
if os.path.exists(infile):
GenericXML.read(self, infile)
GenericXML.read(self, infile, schema=schema)

if self.compiler is not None:
self.set_compiler(compiler)
Expand Down
1 change: 1 addition & 0 deletions cime/scripts/lib/CIME/case/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@ def configure(self, compset_name, grid_name, machine_name=None,
# we don't want to resolve variables until we need them
if output_root is None:
output_root = self.get_value("CIME_OUTPUT_ROOT")
output_root = os.path.abspath(output_root)
self.set_value("CIME_OUTPUT_ROOT", output_root)
if non_local:
self.set_value("EXEROOT", os.path.join(output_root, self.get_value("CASE"), "bld"))
Expand Down
2 changes: 1 addition & 1 deletion cime/scripts/lib/CIME/get_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def _getTiming(self, inst=0):
for k in self.case.get_values("COMP_CLASSES"):
m = self.models[k]
self.write(" {} Run Time: {:10.3f} seconds {:10.3f} seconds/mday {:10.2f} myears/wday \n".format(k, m.tmax, m.tmax/adays, m.tmaxr))
self.write(" CPL COMM Time: {:10.3f} seconds {:10.3f} seconds/mday {:10.2f} myears/wday \n".format(xmax, xmax/adays, xmaxr))
self.write(" CPL COMM Time: {:10.3f} seconds {:10.3f} seconds/mday {:10.2f} myears/wday \n".format(xmax, xmax/adays, xmaxr))

pstrlen = 25
hoffset = 1
Expand Down
10 changes: 10 additions & 0 deletions cime/src/drivers/mct/cime_config/config_component_cesm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,13 @@
<value compset="_DATM%COPYALL_NPS">72</value>
<value compset="_DATM.*_CLM">48</value>
<value compset="_DATM.*_DICE.*_POP2">4</value>
<value compset="_DATM.*_DICE.*_MOM6">24</value>
<value compset="_DATM.*_SLND.*_CICE.*_POP2">24</value>
<value compset="_DATM.*_SLND.*_CICE.*_MOM6">24</value>
<value compset="_DATM.*_CICE.*_DOCN">24</value>
<value compset="_DATM.*_DOCN%US20">24</value>
<value compset="_DATM%CPLHIST.+POP\d">48</value>
<value compset="_DATM%CPLHIST.+MOM\d">48</value>
<value compset="_MPAS">1</value>
<value compset=".+" grid="a%0.23x0.31">96</value>
<value compset=".+" grid="a%ne60np4">96</value>
Expand All @@ -252,7 +255,9 @@
<value compset=".+" grid="1x1_vancou">24</value>
<value compset="_DLND.*_CISM\d">1</value>
<value compset="_DATM.*_DICE.*_POP2.*_WW3">4</value>
<value compset="_DATM.*_DICE.*_MOM6.*_WW3">4</value>
<value compset="_DATM.*_DICE.*_POP2.*_DWAV">4</value>
<value compset="_DATM.*_DICE.*_MOM6.*_DWAV">4</value>
</values>
<group>run_coupling</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -292,6 +297,7 @@
<default_value>$ATM_NCPL</default_value>
<values match="last">
<value compset="_POP2">1</value>
<value compset="_MOM6">24</value>
<value compset="_POP2" grid="oi%tx0.1v2">4</value>
<value compset="_POP2" grid="oi%gx1v6">24</value>
<value compset="_POP2" grid="oi%gx1v7">24</value>
Expand All @@ -316,6 +322,7 @@
<value compset="_DLND.*_CISM\d">1</value>
<value compset="_SGLC">$ATM_NCPL</value>
<value compset="_XGLC">$ATM_NCPL</value>
<value compset="_MOM6">1</value>
</values>
<group>run_coupling</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -348,9 +355,11 @@
<default_value>8</default_value>
<values match="last">
<value compset="_DATM.*_POP2.*_DROF">$ATM_NCPL</value>
<value compset="_DATM.*_MOM6.*_DROF">$ATM_NCPL</value>
<value compset="_DATM.*_DOCN%SOM">$ATM_NCPL</value>
<value compset="_DATM.*_SLND.*_DICE.*_DOCN">$ATM_NCPL</value>
<value compset="_DATM%CPLHIST.+POP\d">8</value>
<value compset="_DATM%CPLHIST.+MOM\d">8</value>
<value compset="_XATM.*_XLND.*_XICE.*_XOCN">$ATM_NCPL</value>
<value compset="_DLND.*_CISM\d">1</value>
<value compset="_SROF">$ATM_NCPL</value>
Expand Down Expand Up @@ -433,6 +442,7 @@
<values match="last">
<value compset="_DATM.*_DOCN%SOM" >CESM1_MOD</value>
<value compset="_POP2" >CESM1_MOD</value>
<value compset="_MOM6" >RASM_OPTION1</value>
<value compset="_POP2" grid="oi%gx1v6" >RASM_OPTION1</value>
<value compset="_POP2" grid="oi%gx1v7" >RASM_OPTION1</value>
<value compset="_DATM%NYF.*_SLND.*_DICE.*_DOCN" >CESM1_MOD</value>
Expand Down
7 changes: 3 additions & 4 deletions cime/src/externals/pio2/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ env:
- LDFLAGS='-L/usr/lib'

script:
- ls -l /usr/include
- autoreconf -i
- export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer'
- export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror'
- export FFLAGS='-fsanitize=address -fno-omit-frame-pointer'
- export FCFLAGS='-fsanitize=address -fno-omit-frame-pointer'
- export FCFLAGS='-fsanitize=address -fno-omit-frame-pointer -Werror'
- export DISTCHECK_CONFIGURE_FLAGS='--enable-fortran'
- ./configure --enable-fortran --enable-developer-docs
- make
- make -j distcheck
- make -j distclean
- rm -rf build
- mkdir build
- cd build
Expand Down
75 changes: 57 additions & 18 deletions cime/src/externals/pio2/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AC_SUBST([VERSION_PATCH], [4])
AC_CONFIG_MACRO_DIR([m4])

# Libtool initialisation.
LD=ld # Required for MPE to work.
LT_INIT

# Find and learn about the C compiler.
Expand Down Expand Up @@ -52,22 +53,6 @@ if test "x$enable_logging" = xyes; then
AC_DEFINE([PIO_ENABLE_LOGGING], 1, [If true, turn on logging.])
fi

# Does the user want to use MPE library?
AC_MSG_CHECKING([whether use of MPE library is enabled])
AC_ARG_ENABLE([mpe],
[AS_HELP_STRING([--enable-mpe],
[enable use of MPE library for timing and diagnostic info (may negatively impact performance).])])
test "x$enable_mpe" = xyes || enable_mpe=no
AC_MSG_RESULT([$enable_mpe])
if test "x$enable_mpe" = xyes; then
AC_SEARCH_LIBS([MPE_Log_get_event_number], [mpe], [HAVE_LIBMPE=yes], [HAVE_LIBMPE=no], [-lpthread -lm])
AC_CHECK_HEADERS([mpe.h], [HAVE_MPE=yes], [HAVE_MPE=no])
if test "x$HAVE_LIBMPE" = xno -o "x$HAVE_MPE" = xno; then
AC_MSG_ERROR([MPE not found but --enable-mpe used.])
fi
AC_DEFINE([USE_MPE], 1, [If true, use MPE timing library.])
fi

# Does the user want to enable timing?
AC_MSG_CHECKING([whether GPTL timing library is used])
AC_ARG_ENABLE([timing],
Expand Down Expand Up @@ -104,6 +89,32 @@ test "x$enable_fortran" = xyes || enable_fortran=no
AC_MSG_RESULT([$enable_fortran])
AM_CONDITIONAL(BUILD_FORTRAN, [test "x$enable_fortran" = xyes])

# Does the user want to use MPE library?
AC_MSG_CHECKING([whether use of MPE library is enabled])
AC_ARG_ENABLE([mpe],
[AS_HELP_STRING([--enable-mpe],
[enable use of MPE library for timing and diagnostic info (may negatively impact performance).])])
test "x$enable_mpe" = xyes || enable_mpe=no
AC_MSG_RESULT([$enable_mpe])
if test "x$enable_mpe" = xyes; then

AC_SEARCH_LIBS([pthread_setspecific], [pthread], [], [], [])
dnl AC_SEARCH_LIBS([MPE_Log_get_event_number], [mpe], [HAVE_LIBMPE=yes], [HAVE_LIBMPE=no], [])
dnl AC_SEARCH_LIBS([MPE_Init_mpi_core], [lmpe], [HAVE_LIBLMPE=yes], [HAVE_LIBLMPE=no], [])
AC_CHECK_HEADERS([mpe.h], [HAVE_MPE=yes], [HAVE_MPE=no])
dnl if test "x$HAVE_LIBMPE" != xyes; then
dnl AC_MSG_ERROR([-lmpe not found but --enable-mpe used.])
dnl fi
dnl if test "x$HAVE_LIBLMPE" != xyes; then
dnl AC_MSG_ERROR([-llmpe not found but --enable-mpe used.])
dnl fi
if test $enable_fortran = yes; then
AC_MSG_ERROR([MPE not implemented in Fortran tests and examples. Build without --enable-fortran])
fi
AC_DEFINE([USE_MPE], 1, [If true, use MPE timing library.])

fi

# Does the user want to disable pnetcdf?
AC_MSG_CHECKING([whether pnetcdf is to be used])
AC_ARG_ENABLE([pnetcdf],
Expand Down Expand Up @@ -150,9 +161,9 @@ if test "x$enable_docs" = xyes; then
fi
AC_SUBST([FORTRAN_SRC_FILES], ["../src/flib/piodarray.f90 ../src/flib/pio.F90 ../src/flib/pio_kinds.F90 ../src/flib/piolib_mod.f90 ../src/flib/pionfatt_mod_2.f90 ../src/flib/pio_nf.F90 ../src/flib/pionfget_mod_2.f90 ../src/flib/pionfput_mod.f90 ../src/flib/pio_support.F90 ../src/flib/pio_types.F90"])
if test "x$enable_developer_docs" = xyes; then
AC_SUBST([C_SRC_FILES], ["../src/clib"])
AC_SUBST([C_SRC_FILES], ["../src/clib ../src/ncint"])
else
AC_SUBST([C_SRC_FILES], ["../src/clib/pio_nc.c ../src/clib/pio_nc4.c ../src/clib/pio_darray.c ../src/clib/pio_get_nc.c ../src/clib/pio_put_nc.c ../src/clib/pioc_support.c ../src/clib/pioc.c ../src/clib/pio_file.c ../src/clib/pio.h ../src/clib/pio_get_vard.c ../src/clib/pio_put_vard.c"])
AC_SUBST([C_SRC_FILES], ["../src/clib/pio_nc.c ../src/clib/pio_nc4.c ../src/clib/pio_darray.c ../src/clib/pio_get_nc.c ../src/clib/pio_put_nc.c ../src/clib/pioc_support.c ../src/clib/pioc.c ../src/clib/pio_file.c ../src/clib/pio.h ../src/clib/pio_get_vard.c ../src/clib/pio_put_vard.c ../src/ncint/ncint_pio.c ../src/ncint/nc_put_vard.c ../src/ncint/nc_get_vard.c"])
fi
AC_CONFIG_FILES([doc/Doxyfile])
fi
Expand Down Expand Up @@ -251,6 +262,30 @@ if test "x$enable_timing" = xyes; then
fi
AM_CONDITIONAL([HAVE_PAPI], [test "x$have_papi" = xyes])

# Does the user want to build netcdf-c integration layer?
AC_MSG_CHECKING([whether netcdf-c integration layer should be build])
AC_ARG_ENABLE([netcdf-integration],
[AS_HELP_STRING([--enable-netcdf-integration],
[enable building of netCDF C API integration.])])
test "x$enable_netcdf_integration" = xyes || enable_netcdf_integration=no
AC_MSG_RESULT([$enable_netcdf_integration])
if test "x$enable_netcdf_integration" = xyes -a "x$enable_timing" = xyes; then
AC_MSG_ERROR([Cannot use GPTL timing library with netCDF interation.])
fi
if test "x$enable_netcdf_integration" = xyes -a "x$have_netcdf_par" = xno; then
AC_MSG_ERROR([Cannot use netCDF integration unless netCDF library was built for parallel I/O.])
fi
# These are needed by ncdispatch.h. Only build with HDF5 parallel
# versions of netCDF. */
if test "x$enable_netcdf_integration" = xyes; then
AC_DEFINE([HDF5_PARALLEL],[1],[Does HDF5 library provide parallel access])
AC_DEFINE([USE_NETCDF4],[1],[Does HDF5 library provide parallel access])
AC_DEFINE([NETCDF_INTEGRATION],[1],[Are we building with netCDF integration])
fi

AM_CONDITIONAL(BUILD_NCINT, [test "x$enable_netcdf_integration" = xyes])
AM_CONDITIONAL(NETCDF_INTEGRATION, [test "x$enable_netcdf_integration" = xyes])

AC_CONFIG_FILES([tests/general/pio_tutil.F90:tests/general/util/pio_tutil.F90])

AC_CONFIG_LINKS([tests/unit/input.nl:tests/unit/input.nl])
Expand All @@ -262,10 +297,13 @@ AC_CONFIG_HEADERS([config.h])
AC_OUTPUT(Makefile
src/Makefile
src/clib/Makefile
src/ncint/Makefile
src/flib/Makefile
src/gptl/Makefile
tests/Makefile
tests/cunit/Makefile
tests/ncint/Makefile
tests/fncint/Makefile
tests/unit/Makefile
tests/general/Makefile
tests/general/util/Makefile
Expand All @@ -275,4 +313,5 @@ AC_OUTPUT(Makefile
doc/images/Makefile
examples/Makefile
examples/c/Makefile
examples/f03/Makefile
scripts/Makefile)
22 changes: 22 additions & 0 deletions cime/src/externals/pio2/doc/source/netcdf_integration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** @page netcdf_integration NetCDF API Integration

The netCDF integration feature allows existing netCDF codes, in C or
Fortran, to be easily converted to use PIO.

# Building and Using PIO with NetCDF Integration

In order to use netCDF integration:

* The PIO configure must use the option --enable-netcdf-integration.

* The latest master of the netcdf-c library must be built and used,
and the PIO build must include the netcdf-c/include directory in its
CPPFLAGS, in order to find internal netCDF header files needed for
netCDF integration. (The netcdf-c library is being modified to export
publically everything needed, so future releases of netcdf-c will no
longer require this.)

Once PIO is build for netCDF integration, it provides the nc_* and
nf_* functions required to fully integrate PIO and netCDF.

*/
1 change: 1 addition & 0 deletions cime/src/externals/pio2/doc/source/users_guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ releases.
- @ref decomp
- @ref error
- @ref examp
- @ref netcdf_integration
- @ref faq
- @ref api
- @ref c_api
Expand Down
5 changes: 4 additions & 1 deletion cime/src/externals/pio2/examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

# Ed Hartnett

SUBDIRS = c
if BUILD_FORTRAN
F03 = f03
endif # BUILD_FORTRAN

SUBDIRS = c ${F03}
4 changes: 2 additions & 2 deletions cime/src/externals/pio2/examples/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Ed Hartnett 5/7/18

# Link to our assembled library.
AM_LDFLAGS = ${top_builddir}/src/clib/libpio.la
LDADD = ${top_builddir}/src/clib/libpioc.la
AM_CPPFLAGS = -I$(top_srcdir)/src/clib

# Build the tests for make check.
Expand All @@ -19,4 +19,4 @@ endif # RUN_TESTS
EXTRA_DIST = run_tests.sh

# Clean up files produced during testing.
CLEANFILES = *.nc *.log
CLEANFILES = *.nc *.log *.clog2 *.slog2
25 changes: 0 additions & 25 deletions cime/src/externals/pio2/examples/c/darray_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,6 @@ int dim_len[NDIM3] = {NC_UNLIMITED, DIM_LEN_X, DIM_LEN_Y};
/* Names of dimensions. */
char dim_name[NDIM3][PIO_MAX_NAME + 1] = {"unlimted", "x", "y"};

/* Handle MPI errors. This should only be used with MPI library
* function calls. */
#define MPIERR(e) do { \
MPI_Error_string(e, err_buffer, &resultlen); \
printf("MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \
MPI_Finalize(); \
return 2; \
} while (0)

/* Handle non-MPI errors by finalizing the MPI library and exiting
* with an exit code. */
#define ERR(e) do { \
MPI_Finalize(); \
return e; \
} while (0)

/* Global err buffer for MPI. When there is an MPI error, this buffer
* is used to store the error message that is associated with the MPI
* error. */
char err_buffer[MPI_MAX_ERROR_STRING];

/* This is the length of the most recent MPI error message, stored
* int the global error string. */
int resultlen;

/* @brief Check the output file.
*
* Use netCDF to check that the output is as expected.
Expand Down
Loading

0 comments on commit 401031d

Please sign in to comment.