Opened 11 years ago
Closed 9 years ago
#6436 closed Patches (fixed)
Exception on destruction of communicator mpi_comm_null
Reported by: | Owned by: | Matthias Troyer | |
---|---|---|---|
Milestone: | To Be Determined | Component: | mpi |
Version: | Boost 1.48.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Using boost trunk mpi the communicator destructor does not check for the possibility of an MPI_COMM_NULL underlying communicator, code which produces a null underlying can exception on ref counted destruction.
For instance, this code:
void pool(bmpi::communicator &world, bmpi::communicator &local) {
LDEBUG(PSTR("Pool - local: "), pantheios::integer(local.rank()), PSTR(" of "), pantheios::integer(local.size()));
bmpi::group localGroup = local.group();
dump_group(localGroup);
std::vector<int> inc(1, 0); bmpi::group tinyGroup = localGroup.include(inc.begin(), inc.end()); dump_group(tinyGroup);
bmpi::communicator tinyCom(local, tinyGroup);
}
When tinyCom goes out of scope, this exception gets thrown:
"MPI_Comm_free: MPI_ERR_COMM: invalid communicator"
Attachments (2)
Change History (5)
by , 11 years ago
Attachment: | aelaguizy_mpi_destructor.patch added |
---|
comment:1 by , 11 years ago
Attached a better fix, the real problem is that the subgroup constructor allows direct assignment to the underlying of MPI_COMM_NULL without a check, modified this to call the normal constructor with a take ownership flag
comment:2 by , 10 years ago
Owner: | changed from | to
---|
comment:3 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Proposed patch to check for MPI_COMM_NULL on destruction