Skip to content
  • Huck, Kevin's avatar
    helper: Avoid freeing Comm-held MPI_Comm more than once · 7b2ee235
    Huck, Kevin authored
    The `Comm::Free` method may be called more than once by applications.
    Although some MPI vendors document that `MPI_Comm_free` sets the
    given handle to `MPI_COMM_NULL`, this does not always happen in
    practice.  Set the handle to `MPI_COMM_NULL` explicitly to avoid
    calling `MPI_Comm_free` more than once for the same handle.
    
    Without this, when compiled with PGI and executed with TAU profiling,
    a double-free occurs and causes memory to be corrupted.
    7b2ee235