ippl icon indicating copy to clipboard operation
ippl copied to clipboard

Environment destructor causes error in cleanup

Open aaadelmann opened this issue 1 year ago • 1 comments

This was found in OPAX on Gwendolen

partial ==== backtrace (tid:2019130) ====

  1. ...
  2. 13 0x000000000022394b mca_pml_ucx_cleanup() ???:0
  3. 14 0x0000000000082a5f ompi_mpi_finalize() ???:0
  4. 15 0x0000000000d0cbcf ippl::mpi::Environment::~Environment() ???:0
  5. 16 0x000000000045033a std::default_deleteippl::mpi::Environment::operator()() ???:0
  6. 17 0x00000000004501f2 std::unique_ptr<ippl::mpi::Environment, std::default_deleteippl::mpi::Environment >::~unique_ptr() ???:0

It looks like mca_pml_ucx_cleanup( is triggering ompi_mpi_finalize() and subsequently in the Environment destructor

bool Environment::finalized() { int flag = 0; MPI_Finalized(&flag); return (flag != 0); }

In case I do not use Environment::finalized() the error goes away!

aaadelmann avatar Oct 02 '24 16:10 aaadelmann

MPI_Finalized is only checking if the MPI environment got terminated with MPI_Finalize. I do not understand why the call to Environment::finalized in Environment::~Environment() causes the issue.

matt-frey avatar Oct 03 '24 08:10 matt-frey