adios2 constructor required MPI comm
Created by: stevenwalton
You may not remember my summer project, but I was integrating Ascent and ADIOS2. I am going back to some of that work and found a bug that prevents building. I have a line (link to source)
adios2(std::make_shared<adios2::ADIOS>(adios2::DebugON))
that causes a crash, with the below error [0]. It builds fine if I remove adios2::DebugON
from the constructor. (this line is for the one built without MPI)
This seems like the overload only happens for calls with MPI. Working with some of my simpler test code I can reproduce the error Working lines
adios2::ADIOS adios(MPI_COMM_WORLD, adios2::DebugON);
adios2::ADIOS adios(MPI_COMM_WORLD);
Broken line
adios2::ADIOS adios(adios2::DebugON);
If the initial MPI calls (MPI_Init, etc) are removed and we just call the constructor like above we get the same error. But if we call it with no parameters
adios2::ADIOS adios();
we get a resulting error [1] on DeclareIO with a message about non-class type adios2::ADIOS()
Did the overloading change? IIRC these used to work. Certainty the original case worked originally. Does ADIOS2 only work with MPI now?
[0] Main Error:
[ 27%] Building CXX object ascent/CMakeFiles/ascent_mpi.dir/runtimes/flow_filters/ascent_runtime_adios2_filters.cpp.o
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
from /usr/include/c++/5/bits/allocator.h:46,
from /usr/include/c++/5/string:41,
from /home/walton/Programming/ORNL/conduit-install/include/conduit/conduit_core.hpp:57,
from /home/walton/Programming/ORNL/conduit-install/include/conduit/conduit.hpp:59,
from /home/walton/Programming/ORNL/ascent-adios2/src/flow/flow_filter.hpp:55,
from /home/walton/Programming/ORNL/ascent-adios2/src/ascent/runtimes/flow_filters/ascent_runtime_adios2_filters.hpp:55,
from /home/walton/Programming/ORNL/ascent-adios2/src/ascent/runtimes/flow_filters/ascent_runtime_adios2_filters.cpp:57:
/usr/include/c++/5/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = adios2::ADIOS; _Args = {const bool&}; _Tp = adios2::ADIOS]’:
/usr/include/c++/5/bits/alloc_traits.h:530:4: required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = adios2::ADIOS; _Args = {const bool&}; _Tp = adios2::ADIOS; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<adios2::ADIOS>]’
/usr/include/c++/5/bits/shared_ptr_base.h:522:39: required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {const bool&}; _Tp = adios2::ADIOS; _Alloc = std::allocator<adios2::ADIOS>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’
/usr/include/c++/5/bits/shared_ptr_base.h:617:4: required from ‘std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = adios2::ADIOS; _Alloc = std::allocator<adios2::ADIOS>; _Args = {const bool&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’
/usr/include/c++/5/bits/shared_ptr_base.h:1097:35: required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<adios2::ADIOS>; _Args = {const bool&}; _Tp = adios2::ADIOS; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’
/usr/include/c++/5/bits/shared_ptr.h:319:64: required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<adios2::ADIOS>; _Args = {const bool&}; _Tp = adios2::ADIOS]’
/usr/include/c++/5/bits/shared_ptr.h:620:39: required from ‘std::shared_ptr<_Tp1> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = adios2::ADIOS; _Alloc = std::allocator<adios2::ADIOS>; _Args = {const bool&}]’
/usr/include/c++/5/bits/shared_ptr.h:635:39: required from ‘std::shared_ptr<_Tp1> std::make_shared(_Args&& ...) [with _Tp = adios2::ADIOS; _Args = {const bool&}]’
/home/walton/Programming/ORNL/ascent-adios2/src/ascent/runtimes/flow_filters/ascent_runtime_adios2_filters.cpp:222:60: required from here
/usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to ‘adios2::ADIOS::ADIOS(const bool&)’
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^
In file included from /home/walton/Programming/ORNL/adios2-install/include/adios2.h:18:0,
from /home/walton/Programming/ORNL/ascent-adios2/src/ascent/runtimes/flow_filters/ascent_runtime_adios2_filters.hpp:56,
from /home/walton/Programming/ORNL/ascent-adios2/src/ascent/runtimes/flow_filters/ascent_runtime_adios2_filters.cpp:57:
/home/walton/Programming/ORNL/adios2-install/include/cxx11/ADIOS.h:64:5: note: candidate: adios2::ADIOS::ADIOS(const string&, MPI_Comm, bool)
ADIOS(const std::string &configFile = "", MPI_Comm comm = MPI_COMM_SELF,
^
/home/walton/Programming/ORNL/adios2-install/include/cxx11/ADIOS.h:64:5: note: no known conversion for argument 1 from ‘const bool’ to ‘const string& {aka const std::__cxx11::basic_string<char>&}’
/home/walton/Programming/ORNL/adios2-install/include/cxx11/ADIOS.h:52:5: note: candidate: adios2::ADIOS::ADIOS(MPI_Comm, bool)
ADIOS(MPI_Comm comm, const bool debugMode = true);
^
/home/walton/Programming/ORNL/adios2-install/include/cxx11/ADIOS.h:52:5: note: no known conversion for argument 1 from ‘const bool’ to ‘MPI_Comm {aka ompi_communicator_t*}’
ascent/CMakeFiles/ascent_mpi.dir/build.make:348: recipe for target 'ascent/CMakeFiles/ascent_mpi.dir/runtimes/flow_filters/ascent_runtime_adios2_filters.cpp.o' failed
make[2]: *** [ascent/CMakeFiles/ascent_mpi.dir/runtimes/flow_filters/ascent_runtime_adios2_filters.cpp.o] Error 1
CMakeFiles/Makefile2:1701: recipe for target 'ascent/CMakeFiles/ascent_mpi.dir/all' failed
make[1]: *** [ascent/CMakeFiles/ascent_mpi.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
[1] Declare Error
/home/walton/Programming/ORNL/a2Scripts/rOverDM2.cpp: In function ‘int main(int, char**)’:
/home/walton/Programming/ORNL/a2Scripts/rOverDM2.cpp:23:32: error: request for member ‘DeclareIO’ in ‘adios’, which is of non-class type ‘adios2::ADIOS()’
adios2::IO sstRIO = adios.DeclareIO("sstIO");
^
/home/walton/Programming/ORNL/a2Scripts/rOverDM2.cpp:74:30: error: request for member ‘DeclareIO’ in ‘adios’, which is of non-class type ‘adios2::ADIOS()’
adios2::IO bpWIO = adios.DeclareIO("BPWrite");
^
CMakeFiles/rOverDM2.dir/build.make:62: recipe for target 'CMakeFiles/rOverDM2.dir/rOverDM2.cpp.o' failed
make[2]: *** [CMakeFiles/rOverDM2.dir/rOverDM2.cpp.o] Error 1
CMakeFiles/Makefile2:252: recipe for target 'CMakeFiles/rOverDM2.dir/all' failed
make[1]: *** [CMakeFiles/rOverDM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2