mfem: Error while building parallel version of Mfem with ADIOS2 being used

Not sure if this is the correct place to ask, but I couldn’t find anything on this elsewhere on the web. While building mfem’s parallel version, the compiler throws the following error

mpicxx   -O3 -std=c++11 -I./../hypre/src/hypre/include -I/home/pratham/fem_packs/metis-5.1.0/installDir/include  -I/home/pratham/fem_packs/petsc/installDir/include  -c general/adios2stream.cpp -o general/adios2stream.o
general/adios2stream.cpp: In constructor ‘mfem::adios2stream::adios2stream(const string&, mfem::adios2stream::openmode, MPI_Comm, std::string)’:
general/adios2stream.cpp:118:34: error: use of deleted function ‘adios2::ADIOS::ADIOS(int)’
  118 |      adios(new adios2::ADIOS(comm)),
      |                                  ^
In file included from /usr/local/include/adios2.h:27,
                 from general/adios2stream.hpp:32,
                 from general/adios2stream.cpp:16:
/usr/local/include/adios2/cxx11/ADIOS.h:90:5: note: declared here
   90 |     ADIOS(int define_ADIOS2_USE_MPI_to_use_MPI_constructor) = delete;
      |     ^~~~~
make[1]: *** [makefile:436: general/adios2stream.o] Error 1
make[1]: Leaving directory '/home/pratham/fem_packs/mfem'
make: *** [makefile:478: parallel] Error 2

I have edited the config/default.mk file to use ADIOS2, and ADIOS2 is installed in the default paths so the compiler can easily find it. Is there any error in the code or did I do something wrong ? Please let me know if additional info is required.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (13 by maintainers)

Most upvoted comments

@williamfgc I am sorry for the super late reply. I had recently switched from mpich to openmpi, and to my surprise the mfem compilation worked even with master version of adios2( without pulling latest code for either mfem or adios2). I pulled the latest code for both adios2 and mfem, and everything works fine. It may work with mpich too, but I’m afraid I cant switch back to mpich

@prathamgit would you be able to try either version 2.5 or 2.6 of ADIOS2? I’d just be curious to see if the issue is with the develop/master branch of ADIOS2, since it seems that’s what you’re using. I’ve used ADIOS2 v2.5 and v2.6 builds for my own MFEM-based code on Summit and my own personal ubuntu desktop with success when using mpich.

It worked with adios2 V2.5

@prathamgit thanks for the reply, it’s helpful. I’m able to reproduce. Are you compiling adios2 with OpenMPI by any chance? It seems that the symbols don’t recognize typedef int MPI_Comm; in MPICH. Please try recompiling adios2 with MPICH and see if it works (FYI, hypre built with OpenMPI doesn’t work with MPICH MFEM builds). What happens is that OpenMPI uses a void pointer instead for the MPI_Comm type, while MPICH uses int that’s why ADIOS2 delete those constructors explicitly. I might report this upstream.

No worries, the best way to learn is to go through open-source codes like MFEM developed by an awesome community 👍

@williamfgc so I can’t seem to open ADIOS2 files using paraview 5.9.1/5.8.1 on ORNL’s Andes platform when at least doing things remotely as it doesn’t appear to be a known data type 😦 . However, data I’ve generated on Summit and saved off using ADIOS2 also crashed in Paraview when moving to the next frame on my home desktop. So, I’ll work on a small reproducer data set and open an issue, but this will probably won’t be until next week.

@williamfgc I ran into this issue as well while using a v2.7.1 build with a cmake build of mfem. I found I had to add the following to my cmake invocation to get things to work: -DCMAKE_CXX_FLAGS=-DADIOS2_USE_MPI . I was able to compare the v2.5.0 and v2.7.1 branches and found that sometime between the two that ADIOS(int define_ADIOS2_USE_MPI_to_use_MPI_constructor) = delete; definition was added and hidden behind some macro defines.

It would be nice if these sorts of defines were automatically generated by cmake during y’all’s build process and were kept in something like a adios2_config.h file that way we wouldn’t have to pass in these sorts of defines to our build process.

Thanks @williamfgc !

@tzanio sure, let me take a look. Sounds about right, the int vs void comm that different MPI implementations use gets mixed with a recent API change. @prathamgit which adios2 version are you targeting? Are you using MPICH Also, adios2 should have a adios2-config binary to fill the appropriate CFLAGS, LDFLAGS for non-cmake linking (e.g. make), please see here.