Opened 11 years ago

Closed 9 years ago

#6436 closed Patches (fixed)

Exception on destruction of communicator mpi_comm_null

Reported by: aelaguiz@… 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)

aelaguizy_mpi_destructor.patch (446 bytes ) - added by aelaguiz@… 11 years ago.
Proposed patch to check for MPI_COMM_NULL on destruction
aelaguizy_mpi_comm_null.patch (565 bytes ) - added by aelaguiz@… 11 years ago.
better fix

Download all attachments as: .zip

Change History (5)

by aelaguiz@…, 11 years ago

Proposed patch to check for MPI_COMM_NULL on destruction

by aelaguiz@…, 11 years ago

better fix

comment:1 by anonymous, 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 Matthias Troyer, 10 years ago

Owner: changed from Douglas Gregor to Matthias Troyer

comment:3 by Matthias Troyer, 9 years ago

Resolution: fixed
Status: newclosed

(In [84739]) Fixed #6436 #5596 and added threaded initialization

Note: See TracTickets for help on using tickets.