Finalization order
- Dominant language
- C++
- Stars
- 161
- Forks
- 59
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 7
Description
Julia is a garbage collected language. That means that it is very difficult, if not impossible, to ensure that objects are finalized (destroyed) in a particular order or at a particular time. One particular problem is ensuring that the last openPMD object is finalized before `MPI_Finalize` is called.
This does not involve writing to files, since any correct code will need to call `Series::flush` or similar anyway. However, when a Series object is open in read-only mode, then it would be quite convenient to check, via calling `MPI_Finalized`, whether MPI is still active, and if not, forego certain parallel cleanup actions that have no externally visible consequences anyway since the application is already being shut down.
The symptoms I am seeing is output such as
```
Attempting to use an MPI routine after finalizing MPICH
```
which (presumably) is caused either by openPMD or by ADIOS2. At this time, a file `hello.bp` is probably still open for reading. It might also still be open for writing but has been flushed.
Contributor guide
Assessment
This issue has not been assessed yet.