boutproject / BOUT-dev

BOUT++: Plasma fluid finite-difference simulation code in curvilinear coordinate systems
http://boutproject.github.io/
GNU Lesser General Public License v3.0
184 stars 95 forks source link

test-restarting fails without netcdf #2003

Closed dschwoerer closed 3 years ago

dschwoerer commented 4 years ago

Seems to be broken:

====== Exception path ======
[bt] #10 ./test_restarting() [0x40ee1d]
_start at ??:?
[bt] #9 /usr//lib64/libc.so.6(__libc_start_main+0xf5) [0x2b7869aecb15]
__libc_start_main at ??:?
[bt] #8 ./test_restarting() [0x40b1be]
std::_MakeUniq<BoutMonitor>::__single_object std::make_unique<BoutMonitor>() at /marconi/prod/opt/compilers/gnu/7.3.0/none/include/c++/7.3.0/bits/unique_ptr.h:825
 (inlined by) main at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/tests/integrated/test-restarting/test_restarting.cxx:22
[bt] #7 ./test_restarting() [0x435118]
PhysicsModel::initialise(Solver*) at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/src/solver/../../include/bout/physicsmodel.hxx:85
 (inlined by) Solver::setModel(PhysicsModel*) at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/src/solver/solver.cxx:89
[bt] #6 ./test_restarting() [0x421aa2]
PhysicsModel::postInit(bool) at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/src/physics/physicsmodel.cxx:125
[bt] #5 ./test_restarting() [0x56cb54]
Datafile::read() at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/src/fileio/datafile.cxx:990
[bt] #4 ./test_restarting() [0x56687f]
Datafile::read_f2d(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Field2D*, bool) at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests
/src/fileio/datafile.cxx:1326
[bt] #3 ./test_restarting() [0x571a1a]
DataFormat::readFieldAttributes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Field&) at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-
tests/src/fileio/dataformat.cxx:61
[bt] #2 ./test_restarting() [0x48a495]
safeAt<CELL_LOC> at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/src/sys/bout_types.cxx:22
 (inlined by) CELL_LOCFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/src/sys/bout_types.cxx:43
[bt] #1 ./test_restarting() [0x48c319]
BoutException::BoutException<char [23], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const (&) [23], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at /marconi/home/userexternal/dschwoer/soft/bout-dev/parallel-tests/src/sys/../../include/boutexception.hxx:26
====== Back trace ======
 -> H5Format::close on line 153 of 'h5_format.cxx'
 -> const T& {anonymous}::safeAt(const std::map<std::__cxx11::basic_string<char>, T>&, const string&) [with T = CELL_LOC; std::__cxx11::string = std::__cxx11::basic_string<char>] on line 19 of 'bout_types.cxx'
 -> CELL_LOC CELL_LOCFromString(const string&) on line 38 of 'bout_types.cxx'
 -> PhysicsModel::postInit on line 93 of 'physicsmodel.cxx'

====== Exception thrown ======
Did not find enum
loeiten commented 4 years ago

I'm experiencing the same error on the next branch. Discussed further here: https://bout-project.slack.com/archives/C342FU99V/p1598625050056600

johnomotani commented 4 years ago

It looks like we don't include --with-hdf to the configuration on any of the Travis builds, even though some (all?) have HDF5 installed. I think we probably should test it, and remove the #requires: all_tests from test-io_hdf5/runtest so we have some testing. Not sure it would have caught this issue, unless we make one of the tests only use HDF5 with netCDF disabled (which might not be a bad idea also!).

ZedThree commented 4 years ago

I've got a fix for this. It turns out that when reading/writing a variable length string, you need to pass char**. There is actually a C++ API for HDF5 that we might want to use instead, but it's not built by default. It looks like most of the major distros package it at least. I'm not sure how prevalent it is on clusters/supercomputers though.

I will enable HDF5 on Travis, but I've now found test-restart-io_hdf5 fails -- just trying to fix that first.

ZedThree commented 3 years ago

Fixed in #2102