void DisjointDEC::copyInstance(const DisjointDEC& other)
{
DEC::copyFrom(other);
- if(other._target_group)
+ if (other._union_comm != MPI_COMM_NULL)
{
- _target_group=other._target_group->deepCpy();
- _owns_groups=true;
- }
- if(other._source_group)
- {
- _source_group=other._source_group->deepCpy();
- _owns_groups=true;
+ // Tricky: the DEC is responsible for the management of _union_comm. And this comm is referenced by
+ // the MPIProcGroups (source/targets). In the case where _union_comm is not NULL we must take care of rebuilding the
+ // MPIProcGroups with a communicator that will survive the destruction of 'other'.
+ _owns_groups = true;
+ MPI_Comm_dup(other._union_comm, &_union_comm);
+// std::cout << "DUP union comm - new is "<< _union_comm << "\n";
+ _target_group = new MPIProcessorGroup(*_comm_interface, other._target_group->getProcIDs(), _union_comm);
+ _source_group = new MPIProcessorGroup(*_comm_interface, other._source_group->getProcIDs(), _union_comm);
}
+ else{
+ if(other._target_group)
+ {
+ _target_group=other._target_group->deepCpy();
+ _owns_groups=true;
+ }
+ if(other._source_group)
+ {
+ _source_group=other._source_group->deepCpy();
+ _owns_groups=true;
+ }
+ }
if (_source_group && _target_group)
_union_group = _source_group->fuse(*_target_group);
}
CPPUNIT_TEST(testGauthier1); // 4 procs
CPPUNIT_TEST(testGauthier2); // >= 2 procs
CPPUNIT_TEST(testGauthier3); // 4 procs
+ CPPUNIT_TEST(testGauthier3_bis); // 4 procs
CPPUNIT_TEST(testGauthier4); // 3 procs
CPPUNIT_TEST(testFabienAPI1); // 3 procs
CPPUNIT_TEST(testFabienAPI2); // 3 procs
void testGauthier1();
void testGauthier2();
void testGauthier3();
+ void testGauthier3_bis();
void testGauthier4();
void testFabienAPI1();
void testFabienAPI2();
void testInterpKernelDEC_2D_(const char *srcMeth, const char *targetMeth);
void testInterpKernelDEC2_2D_(const char *srcMeth, const char *targetMeth);
void testInterpKernelDEC_3D_(const char *srcMeth, const char *targetMeth);
-
+ void testGauthier3_GEN(bool);
};
// to automatically remove temporary files from disk
}
}
+void ParaMEDMEMTest::testGauthier3()
+{
+ testGauthier3_GEN(true);
+}
+
+void ParaMEDMEMTest::testGauthier3_bis()
+{
+ testGauthier3_GEN(false);
+}
+
/*!
* Non regression test testing copy constructor of InterpKernelDEC.
*/
-void ParaMEDMEMTest::testGauthier3()
+void ParaMEDMEMTest::testGauthier3_GEN(bool withIDs)
{
int num_cas=0;
int rank, size;
for (int rec=0;rec<2;rec++)
{
std::vector<InterpKernelDEC> decu(1);
- decu[0]=InterpKernelDEC(emetteur_group,recepteur_group);
+// decu[0]=InterpKernelDEC(emetteur_group,recepteur_group);
+ decu[0]=InterpKernelDEC(emetteur_ids,recepteur_ids);
InterpKernelDEC& dec_emetteur=decu[0];
ParaMEDMEM::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
ParaMEDMEM::ParaMESH *paramesh(0);