From 4b208806ede5ee2f256c4c3d63bd59b51e5bfd4a Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 14:07:24 +0000 Subject: [PATCH 01/15] Bump version to 4.2.2 --- CITATION.cff | 4 ++-- configure | 22 +++++++++++----------- configure.ac | 2 +- manual/doxygen/Doxyfile | 2 +- manual/doxygen/Doxyfile_readthedocs | 2 +- manual/sphinx/conf.py | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index cbbc4bc5ab..35cd535e53 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -142,8 +142,8 @@ authors: - family-names: Wang given-names: Zhanhui -version: 4.2.1 -date-released: 2019-01-23 +version: 4.2.2 +date-released: 2019-02-27 repository-code: https://github.com/boutproject/BOUT-dev url: http://boutproject.github.io/ doi: 10.5281/zenodo.2530733 diff --git a/configure b/configure index e0c8436a64..1458df5951 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for BOUT++ 4.2.1. +# Generated by GNU Autoconf 2.69 for BOUT++ 4.2.2. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='BOUT++' PACKAGE_TARNAME='bout--' -PACKAGE_VERSION='4.2.1' -PACKAGE_STRING='BOUT++ 4.2.1' +PACKAGE_VERSION='4.2.2' +PACKAGE_STRING='BOUT++ 4.2.2' PACKAGE_BUGREPORT='bd512@york.ac.uk' PACKAGE_URL='' @@ -1359,7 +1359,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures BOUT++ 4.2.1 to adapt to many kinds of systems. +\`configure' configures BOUT++ 4.2.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1421,7 +1421,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of BOUT++ 4.2.1:";; + short | recursive ) echo "Configuration of BOUT++ 4.2.2:";; esac cat <<\_ACEOF @@ -1550,7 +1550,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -BOUT++ configure 4.2.1 +BOUT++ configure 4.2.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2131,7 +2131,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by BOUT++ $as_me 4.2.1, which was +It was created by BOUT++ $as_me 4.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -12787,7 +12787,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by BOUT++ $as_me 4.2.1, which was +This file was extended by BOUT++ $as_me 4.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12840,7 +12840,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -BOUT++ config.status 4.2.1 +BOUT++ config.status 4.2.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -14015,7 +14015,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by BOUT++ $as_me 4.2.1, which was +This file was extended by BOUT++ $as_me 4.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14068,7 +14068,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -BOUT++ config.status 4.2.1 +BOUT++ config.status 4.2.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 44f8c58477..4a6e517a36 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ # AC_PREREQ([2.69]) -AC_INIT([BOUT++],[4.2.1],[bd512@york.ac.uk]) +AC_INIT([BOUT++],[4.2.2],[bd512@york.ac.uk]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/manual/doxygen/Doxyfile b/manual/doxygen/Doxyfile index 3a979c7a5e..cdad3228c0 100644 --- a/manual/doxygen/Doxyfile +++ b/manual/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = BOUT++ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.2.1 +PROJECT_NUMBER = 4.2.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/manual/doxygen/Doxyfile_readthedocs b/manual/doxygen/Doxyfile_readthedocs index 8d766ec7fa..0061b92cb1 100644 --- a/manual/doxygen/Doxyfile_readthedocs +++ b/manual/doxygen/Doxyfile_readthedocs @@ -38,7 +38,7 @@ PROJECT_NAME = BOUT++ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.2.1 +PROJECT_NUMBER = 4.2.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/manual/sphinx/conf.py b/manual/sphinx/conf.py index 3d16e862f9..fc6cfb6088 100755 --- a/manual/sphinx/conf.py +++ b/manual/sphinx/conf.py @@ -133,7 +133,7 @@ def __getattr__(cls, name): # The short X.Y version. version = '4.2' # The full version, including alpha/beta/rc tags. -release = '4.2.1' +release = '4.2.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From b4ccc1dbad67bb32d09990af851d5629da496625 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 14:34:46 +0000 Subject: [PATCH 02/15] Bump Zenodo DOI (reserved, unpublished) --- CITATION.bib | 13 +++++++------ CITATION.cff | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CITATION.bib b/CITATION.bib index 9c1933b15b..70d1370641 100644 --- a/CITATION.bib +++ b/CITATION.bib @@ -1,4 +1,4 @@ -@misc{BOUTv4-1-2, +@misc{BOUTv4-2-2, author = { Benjamin Daniel Dudson and Peter Alec Hill and @@ -6,6 +6,7 @@ @misc{BOUTv4-1-2 Joseph Parker and Adam Dempsey and Andrew Allen and + Arka Bokshi and Brendan Shanahan and Brett Friedman and Chenhao Ma and @@ -42,11 +43,11 @@ @misc{BOUTv4-1-2 Xueqiao Xu and Zhanhui Wang }, - title = {BOUT++}, - month = {12}, - year = {2017}, - doi = {10.5281/zenodo.1423213}, - url = {https://github.com/boutproject/BOUT-dev} +title = {BOUT++}, +month = {2}, +year = {2019}, +doi = {10.5281/zenodo.2579077}, +url = {https://github.com/boutproject/BOUT-dev} } @article{Dudson2009, diff --git a/CITATION.cff b/CITATION.cff index 35cd535e53..a96967799e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -146,7 +146,7 @@ version: 4.2.2 date-released: 2019-02-27 repository-code: https://github.com/boutproject/BOUT-dev url: http://boutproject.github.io/ -doi: 10.5281/zenodo.2530733 +doi: 10.5281/zenodo.2579077 license: 'LGPL-3.0-or-later' references: - type: article From 7e118c265b62a1a178e408908747d7437d095a02 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 14:48:23 +0000 Subject: [PATCH 03/15] Update changelog --- CHANGELOG.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c697d7a7f9..9f57ce658a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,25 @@ -# Changelog +# Change Log + +## [v4.2.2](https://github.com/boutproject/BOUT-dev/tree/v4.2.2) (2019-02-27) + +[Full Changelog](https://github.com/boutproject/BOUT-dev/compare/v4.2.1...v4.2.2) + +**Merged pull requests:** + +- Fix FV::Div\_a\_Laplace\_perp and FV::Div\_par\_K\_Grad\_par [\#1606](https://github.com/boutproject/BOUT-dev/pull/1606) ([bendudson](https://github.com/bendudson)) +- Bugfix laplacexz [\#1605](https://github.com/boutproject/BOUT-dev/pull/1605) ([bendudson](https://github.com/bendudson)) +- Initialise some mesh variables to sensible defaults [\#1604](https://github.com/boutproject/BOUT-dev/pull/1604) ([ZedThree](https://github.com/ZedThree)) +- Fix prototype Div\(v2d, f2d\) in header [\#1603](https://github.com/boutproject/BOUT-dev/pull/1603) ([bendudson](https://github.com/bendudson)) +- Hypnotoad version numbering [\#1595](https://github.com/boutproject/BOUT-dev/pull/1595) ([johnomotani](https://github.com/johnomotani)) +- Provide formatting string [\#1588](https://github.com/boutproject/BOUT-dev/pull/1588) ([dschwoerer](https://github.com/dschwoerer)) +- Fix bug in FCI: missed last point in Z for corner displacements [\#1587](https://github.com/boutproject/BOUT-dev/pull/1587) ([ZedThree](https://github.com/ZedThree)) +- use MPIRUN if set [\#1585](https://github.com/boutproject/BOUT-dev/pull/1585) ([dschwoerer](https://github.com/dschwoerer)) +- Prevent failures on parallel, clean build [\#1583](https://github.com/boutproject/BOUT-dev/pull/1583) ([dschwoerer](https://github.com/dschwoerer)) +- More printf [\#1581](https://github.com/boutproject/BOUT-dev/pull/1581) ([dschwoerer](https://github.com/dschwoerer)) +- Provide argument for printf [\#1580](https://github.com/boutproject/BOUT-dev/pull/1580) ([dschwoerer](https://github.com/dschwoerer)) +- Ensure Coordinates is a complete type when trying to swap [\#1574](https://github.com/boutproject/BOUT-dev/pull/1574) ([ZedThree](https://github.com/ZedThree)) +- Compile with BOUT\_FLAGS [\#1573](https://github.com/boutproject/BOUT-dev/pull/1573) ([dschwoerer](https://github.com/dschwoerer)) +- Swap coordinates when adding - to master [\#1549](https://github.com/boutproject/BOUT-dev/pull/1549) ([johnomotani](https://github.com/johnomotani)) ## [v4.2.1](https://github.com/boutproject/BOUT-dev/tree/v4.2.1) (2019-01-23) From 5d65844720c07fdcc5eeb8343ed39b4491a937f6 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Wed, 27 Feb 2019 14:58:30 +0000 Subject: [PATCH 04/15] Fix a couple of small(ish) bugs in FV::Div_par_K_Grad_par - Incorrect region used (RGN_ALL rather than RGN_NOBNDRY) - Metric tensor component g_22 at cell boundary calculated incorrectly (using index `i` rather than `iym`. --- src/mesh/fv_ops.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/fv_ops.cxx b/src/mesh/fv_ops.cxx index ec645c1ccc..fefdd039f7 100644 --- a/src/mesh/fv_ops.cxx +++ b/src/mesh/fv_ops.cxx @@ -197,7 +197,7 @@ namespace FV { Coordinates *coord = fin.getCoordinates(); - BOUT_FOR(i, mesh->getRegion3D("RGN_ALL")) { + BOUT_FOR(i, mesh->getRegion3D("RGN_NOBNDRY")) { // Calculate flux at upper surface const auto iyp = i.yp(); @@ -221,7 +221,7 @@ namespace FV { BoutReal c = 0.5*(K[i] + Kdown[iym]); // K at the lower boundary BoutReal J = 0.5*(coord->J[i] + coord->J[iym]); // Jacobian at boundary - BoutReal g_22 = 0.5*(coord->g_22[i] + coord->g_22[i]); + BoutReal g_22 = 0.5*(coord->g_22[i] + coord->g_22[iym]); BoutReal gradient = 2.*(f[i] - fdown[iym]) / (coord->dy[i] + coord->dy[iym]); From 62150187189ecf4292b8950e39e2c057a970759f Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 15:07:34 +0000 Subject: [PATCH 05/15] Check if we need to link against libdl for dladdr Fixes #1011 --- configure | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 4 ++++ 2 files changed, 67 insertions(+) diff --git a/configure b/configure index 1458df5951..e0514d88e8 100755 --- a/configure +++ b/configure @@ -6094,6 +6094,69 @@ fi done +fi + + if test $works = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dladdr" >&5 +$as_echo_n "checking for library containing dladdr... " >&6; } +if ${ac_cv_search_dladdr+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dladdr (); +int +main () +{ +return dladdr (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_dladdr=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_dladdr+:} false; then : + break +fi +done +if ${ac_cv_search_dladdr+:} false; then : + +else + ac_cv_search_dladdr=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dladdr" >&5 +$as_echo "$ac_cv_search_dladdr" >&6; } +ac_res=$ac_cv_search_dladdr +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + works=yes +else + works=no; break +fi + + fi if test $works = yes; then : diff --git a/configure.ac b/configure.ac index 4a6e517a36..f84047dbc0 100644 --- a/configure.ac +++ b/configure.ac @@ -357,6 +357,10 @@ AS_IF([test "x$enable_backtrace" = "xyes" || test "x$enable_backtrace" = "xmaybe AC_CHECK_HEADERS([execinfo.h dlfcn.h], [works=yes], [works=no; break]) ]) + AS_IF([test $works = yes], [ + AC_SEARCH_LIBS([dladdr], [dl], [works=yes], [works=no; break]) + ]) + AS_IF([test $works = yes], [ AC_MSG_NOTICE([Native backtrace enabled]) CXXFLAGS="$CXXFLAGS -DBACKTRACE" From 14077bf11da91e17135a62c56b6349058f9502e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Schw=C3=B6rer?= Date: Thu, 7 Feb 2019 10:42:50 +0000 Subject: [PATCH 06/15] Prevent data corruption Returning 1 throws an exception, which can cause to corrupted data --- src/bout++.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bout++.cxx b/src/bout++.cxx index a81421b58b..7a143e2298 100644 --- a/src/bout++.cxx +++ b/src/bout++.cxx @@ -633,11 +633,10 @@ int BoutMonitor::call(Solver *solver, BoutReal t, int iter, int NOUT) { // Check if enough time left BoutReal t_remain = mpi_start_time + wall_limit - MPI_Wtime(); - if (t_remain < wtime) { - // Less than 1 time-step left - output_warn.write("Only %e seconds left. Quitting\n", t_remain); - - return 1; // Return an error code to quit + if (t_remain < wtime*2) { + // Less than 2 time-steps left + output_warn.write("Only %e seconds (%.2f steps) left. Quitting\n", t_remain,t_remain/wtime); + user_requested_exit=true; } else { output_progress.print(" Wall %s", (time_to_hms(t_remain)).c_str()); } @@ -649,7 +648,7 @@ int BoutMonitor::call(Solver *solver, BoutReal t, int iter, int NOUT) { if (f.good()) { output << "\n" << "File " << stopCheckName << " exists -- triggering exit." << endl; - return 1; + user_requested_exit=true; } } From eebf9a52884595e48186c6ec3d75a68fec7f0af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Schw=C3=B6rer?= Date: Thu, 7 Feb 2019 11:30:40 +0000 Subject: [PATCH 07/15] Check after monitor-calls again for user_requested_exit --- src/solver/solver.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/solver/solver.cxx b/src/solver/solver.cxx index ac3038e730..22bc37657b 100644 --- a/src/solver/solver.cxx +++ b/src/solver/solver.cxx @@ -704,7 +704,10 @@ int Solver::call_monitors(BoutReal simtime, int iter, int NOUT) { throw; } - if ( iter == NOUT ){ + // Check if any of the monitors has asked to quit + MPI_Allreduce(&user_requested_exit,&abort,1,MPI_C_BOOL,MPI_LOR,MPI_COMM_WORLD); + + if ( iter == NOUT || abort ){ for (const auto &it : monitors){ it->cleanup(); } @@ -715,7 +718,7 @@ int Solver::call_monitors(BoutReal simtime, int iter, int NOUT) { output.write("User signalled to quit. Returning\n"); return 1; } - + return 0; } From 475fe3a5933b199be3025cde1efa7b697cd6ac94 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 17:20:05 +0000 Subject: [PATCH 08/15] Remove unused private members from BoutMask --- include/mask.hxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/mask.hxx b/include/mask.hxx index cc1539e550..11fc9558f6 100644 --- a/include/mask.hxx +++ b/include/mask.hxx @@ -46,15 +46,10 @@ * } */ class BoutMask { - // Dimensions of mask - int nx; - int ny; - int nz; // Internal data Tensor mask; public: BoutMask(int nx, int ny, int nz, bool value=false) : - nx(nx), ny(ny), nz(nz), mask(nx, ny, nz) { mask = value; } From 3ccb78d89f363a0699ccabea388062a0daaa3dca Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 17:20:29 +0000 Subject: [PATCH 09/15] Remove dead store in Coordinates, narrow scope of zperiod --- src/mesh/coordinates.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mesh/coordinates.cxx b/src/mesh/coordinates.cxx index 9f32694130..643bd10627 100644 --- a/src/mesh/coordinates.cxx +++ b/src/mesh/coordinates.cxx @@ -46,18 +46,16 @@ Coordinates::Coordinates(Mesh *mesh) if (mesh->get(dz, "dz")) { // Couldn't read dz from input - int zperiod; BoutReal ZMIN, ZMAX; Options *options = Options::getRoot(); if (options->isSet("zperiod")) { + int zperiod; OPTION(options, zperiod, 1); ZMIN = 0.0; ZMAX = 1.0 / static_cast(zperiod); } else { OPTION(options, ZMIN, 0.0); OPTION(options, ZMAX, 1.0); - - zperiod = ROUND(1.0 / (ZMAX - ZMIN)); } dz = (ZMAX - ZMIN) * TWOPI / nz; From 05e3778a8f69dcd8d17af6595bc20dbcb40fa610 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 17:20:45 +0000 Subject: [PATCH 10/15] Remove useless cast on nullptr --- src/sys/output.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/output.cxx b/src/sys/output.cxx index 7c43756ee3..4b964ba670 100644 --- a/src/sys/output.cxx +++ b/src/sys/output.cxx @@ -41,7 +41,7 @@ void Output::disable() { int Output::open(const char *fname, ...) { - if (fname == (const char *)nullptr) { + if (fname == nullptr) { return 1; } From 71918e34eff32b0463b49339e02140128bf7e8f0 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 27 Feb 2019 17:22:35 +0000 Subject: [PATCH 11/15] Avoid calls to virtual functions in constructors/destructors --- include/output.hxx | 4 ++-- src/fileio/impls/hdf5/h5_format.cxx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/output.hxx b/include/output.hxx index 02705ab06a..378267ca8a 100644 --- a/include/output.hxx +++ b/include/output.hxx @@ -65,7 +65,7 @@ public: Output() : multioutbuf_init(), std::basic_ostream(multioutbuf_init::buf()) { buffer_len = BUFFER_LEN; buffer = new char[buffer_len]; - enable(); + Output::enable(); } /// Specify a log file to open @@ -73,7 +73,7 @@ public: : multioutbuf_init(), std::basic_ostream(multioutbuf_init::buf()) { buffer_len = BUFFER_LEN; buffer = new char[buffer_len]; - enable(); + Output::enable(); open("%s",fname); } ~Output() override { diff --git a/src/fileio/impls/hdf5/h5_format.cxx b/src/fileio/impls/hdf5/h5_format.cxx index 378220cfd4..081409541c 100644 --- a/src/fileio/impls/hdf5/h5_format.cxx +++ b/src/fileio/impls/hdf5/h5_format.cxx @@ -102,11 +102,11 @@ H5Format::H5Format(const char *name, bool parallel_in) { if (H5Eset_auto(H5E_DEFAULT, nullptr, nullptr) < 0) throw BoutException("Failed to set error stack to not print errors"); - openr(name); + H5Format::openr(name); } H5Format::~H5Format() { - close(); + H5Format::close(); H5Pclose(dataFile_plist); } @@ -154,7 +154,7 @@ bool H5Format::is_valid() { void H5Format::close() { TRACE("H5Format::close"); - if (is_valid()) { + if (H5Format::is_valid()) { H5Fclose(dataFile); dataFile = -1; } From 2f6aa9ec4ec4cf4c478a6f4e46133acabc996608 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Thu, 28 Feb 2019 10:01:03 +0000 Subject: [PATCH 12/15] Replace repeated bounds-checking with TRACE macro Both `BoutMask::operator()` and `Tensor::operator()` did bounds-checking. Let `Tensor` handle it, but include `TRACE` in the `BoutMask` version --- include/mask.hxx | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/include/mask.hxx b/include/mask.hxx index 11fc9558f6..481df97f29 100644 --- a/include/mask.hxx +++ b/include/mask.hxx @@ -25,8 +25,8 @@ #include #include "bout/mesh.hxx" -#include "boutexception.hxx" #include "globals.hxx" +#include "msg_stack.hxx" /** * 3D array of bools to mask Field3Ds @@ -64,32 +64,14 @@ public: return *this; } - inline bool& operator()(int jx,int jy,int jz) { -#if CHECK > 2 - // Perform bounds checking - if((jx < 0) || (jx >= nx) || - (jy < 0) || (jy >= ny) || - (jz < 0) || (jz >= nz)) - throw BoutException("BoutMask: (%d, %d, %d) operator out of bounds (%d, %d, %d)", - jx, jy, jz, nx, ny, nz); -#endif + inline bool& operator()(int jx, int jy, int jz) { + TRACE("BoutMask::operator()(%d, %d, %d)", jx, jy, jz); return mask(jx, jy, jz); } - inline const bool& operator()(int jx,int jy,int jz) const { -#if CHECK > 2 - // Perform bounds checking - if((jx < 0) || (jx >= nx) || - (jy < 0) || (jy >= ny) || - (jz < 0) || (jz >= nz)) - throw BoutException("BoutMask: (%d, %d, %d) operator out of bounds (%d, %d, %d)", - jx, jy, jz, nx, ny, nz); -#endif + inline const bool& operator()(int jx, int jy, int jz) const { + TRACE("BoutMask::operator()(%d, %d, %d)", jx, jy, jz); return mask(jx, jy, jz); } - }; - - - #endif //__MASK_H__ From c63ec5ca43699443fdebe7ad7f68bda206e35bd6 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Fri, 1 Mar 2019 10:36:29 +0000 Subject: [PATCH 13/15] Update changelog with release candidate PRs --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f57ce658a..0689b2259c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ **Merged pull requests:** +- Fix some clang-tidy warnings [\#1612](https://github.com/boutproject/BOUT-dev/pull/1612) ([ZedThree](https://github.com/ZedThree)) +- Check if we need to link against libdl for dladdr [\#1611](https://github.com/boutproject/BOUT-dev/pull/1611) ([ZedThree](https://github.com/ZedThree)) +- Fix unclean exit [\#1610](https://github.com/boutproject/BOUT-dev/pull/1610) ([dschwoerer](https://github.com/dschwoerer)) +- Fix a couple of small(ish) bugs in FV::Div\_par\_K\_Grad\_par [\#1609](https://github.com/boutproject/BOUT-dev/pull/1609) ([bendudson](https://github.com/bendudson)) - Fix FV::Div\_a\_Laplace\_perp and FV::Div\_par\_K\_Grad\_par [\#1606](https://github.com/boutproject/BOUT-dev/pull/1606) ([bendudson](https://github.com/bendudson)) - Bugfix laplacexz [\#1605](https://github.com/boutproject/BOUT-dev/pull/1605) ([bendudson](https://github.com/bendudson)) - Initialise some mesh variables to sensible defaults [\#1604](https://github.com/boutproject/BOUT-dev/pull/1604) ([ZedThree](https://github.com/ZedThree)) @@ -18,7 +22,7 @@ - More printf [\#1581](https://github.com/boutproject/BOUT-dev/pull/1581) ([dschwoerer](https://github.com/dschwoerer)) - Provide argument for printf [\#1580](https://github.com/boutproject/BOUT-dev/pull/1580) ([dschwoerer](https://github.com/dschwoerer)) - Ensure Coordinates is a complete type when trying to swap [\#1574](https://github.com/boutproject/BOUT-dev/pull/1574) ([ZedThree](https://github.com/ZedThree)) -- Compile with BOUT\_FLAGS [\#1573](https://github.com/boutproject/BOUT-dev/pull/1573) ([dschwoerer](https://github.com/dschwoerer)) +- Compile with BOUT_FLAGS [\#1573](https://github.com/boutproject/BOUT-dev/pull/1573) ([dschwoerer](https://github.com/dschwoerer)) - Swap coordinates when adding - to master [\#1549](https://github.com/boutproject/BOUT-dev/pull/1549) ([johnomotani](https://github.com/johnomotani)) ## [v4.2.1](https://github.com/boutproject/BOUT-dev/tree/v4.2.1) (2019-01-23) From 584fd7e2c87121f049a75f4163d9697cb71a0415 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Fri, 1 Mar 2019 11:04:27 +0000 Subject: [PATCH 14/15] Fix printf format type for cvode --- src/solver/impls/cvode/cvode.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/solver/impls/cvode/cvode.cxx b/src/solver/impls/cvode/cvode.cxx index b590e1bee7..b2ca52f2be 100644 --- a/src/solver/impls/cvode/cvode.cxx +++ b/src/solver/impls/cvode/cvode.cxx @@ -371,13 +371,13 @@ int CvodeSolver::run() { long int nonlin_fails; CVodeGetNumNonlinSolvConvFails(cvode_mem, &nonlin_fails); - output.write(" -> Local error fails: %d, nonlinear convergence fails: %d\n", num_fails, nonlin_fails); + output.write(" -> Local error fails: %ld, nonlinear convergence fails: %ld\n", num_fails, nonlin_fails); // Stability limit order reductions long int stab_lims; CVodeGetNumStabLimOrderReds(cvode_mem, &stab_lims); - output.write(" -> Stability limit order reductions: %d\n", stab_lims); + output.write(" -> Stability limit order reductions: %ld\n", stab_lims); } From 890148a92864b690ae5f6dde04003f11d95b6c28 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Fri, 1 Mar 2019 11:05:08 +0000 Subject: [PATCH 15/15] Update release date for v4.2.2 --- CITATION.bib | 2 +- CITATION.cff | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CITATION.bib b/CITATION.bib index 70d1370641..f1e4876354 100644 --- a/CITATION.bib +++ b/CITATION.bib @@ -44,7 +44,7 @@ @misc{BOUTv4-2-2 Zhanhui Wang }, title = {BOUT++}, -month = {2}, +month = {3}, year = {2019}, doi = {10.5281/zenodo.2579077}, url = {https://github.com/boutproject/BOUT-dev} diff --git a/CITATION.cff b/CITATION.cff index a96967799e..6f3294c395 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -143,7 +143,7 @@ authors: - family-names: Wang given-names: Zhanhui version: 4.2.2 -date-released: 2019-02-27 +date-released: 2019-03-01 repository-code: https://github.com/boutproject/BOUT-dev url: http://boutproject.github.io/ doi: 10.5281/zenodo.2579077