+ _union_group=nullptr;
+ if (_union_comm != MPI_COMM_NULL)
+ _comm_interface->commFree(&_union_comm);
+ _union_comm = MPI_COMM_NULL;
+ }
+
+ /**
+ * Check that the sources and targets procs form a partition of the world communicator referenced in the groups.
+ * This world communicator is not necessarily MPI_WORLD_COMM, but it has to be covered completely for the DECs to work.
+ */
+ void DisjointDEC::checkPartitionGroup() const
+ {
+ int size = -1;
+ MPIProcessorGroup * tgt = static_cast<MPIProcessorGroup *>(_target_group);
+ MPIProcessorGroup * src = static_cast<MPIProcessorGroup *>(_source_group);
+ MPI_Comm comm_t = tgt->getWorldComm();
+ MPI_Comm comm_s = src->getWorldComm();
+ if (comm_t != comm_s)
+ throw INTERP_KERNEL::Exception("DisjointDEC constructor: Inconsistent world communicator when building DisjointDEC");
+ MPI_Comm_size(comm_t, &size);
+
+ std::set<int> union_ids; // source and target ids in world_comm
+ union_ids.insert(src->getProcIDs().begin(),src->getProcIDs().end());
+ union_ids.insert(tgt->getProcIDs().begin(),tgt->getProcIDs().end());
+ if((int)union_ids.size()!=size)
+ throw INTERP_KERNEL::Exception("DisjointDEC constructor: source_ids and target_ids do not form a partition of the communicator! Restrain the world communicator passed to MPIProcessorGroup ctor.");