+#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MEDLoader.hxx"
+#include "MEDLoaderBase.hxx"
+#include "MEDCouplingFieldDouble.hxx"
+#include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingRemapper.hxx"
+
+using namespace ParaMEDMEM;
+
+typedef MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> MUMesh;
+typedef MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> MFDouble;
+
+//void ParaMEDMEMTest::testOverlapDEC_LMEC_seq()
+//{
+// // T_SC_Trio_src.med -- "SupportOf_"
+// // T_SC_Trio_dst.med -- "SupportOf_T_SC_Trio"
+// // h_TH_Trio_src.med -- "SupportOf_"
+// // h_TH_Trio_dst.med -- "SupportOf_h_TH_Trio"
+// string rep("/export/home/adrien/support/antoine_LMEC/");
+// string src_mesh_nam(rep + string("T_SC_Trio_src.med"));
+// string tgt_mesh_nam(rep + string("T_SC_Trio_dst.med"));
+//// string src_mesh_nam(rep + string("h_TH_Trio_src.med"));
+//// string tgt_mesh_nam(rep + string("h_TH_Trio_dst.med"));
+// MUMesh src_mesh=MEDLoader::ReadUMeshFromFile(src_mesh_nam,"SupportOf_",0);
+// MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_T_SC_Trio",0);
+//// MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_h_TH_Trio",0);
+//
+// MFDouble srcField = MEDCouplingFieldDouble::New(ON_CELLS, ONE_TIME);
+// srcField->setMesh(src_mesh);
+// DataArrayDouble * dad = DataArrayDouble::New(); dad->alloc(src_mesh->getNumberOfCells(),1);
+// dad->fillWithValue(1.0);
+// srcField->setArray(dad);
+// srcField->setNature(ConservativeVolumic);
+//
+// MEDCouplingRemapper remap;
+// remap.setOrientation(2); // always consider surface intersections as absolute areas.
+// remap.prepare(src_mesh, tgt_mesh, "P0P0");
+// MFDouble tgtField = remap.transferField(srcField, 1.0e+300);
+// tgtField->setName("result");
+// string out_nam(rep + string("adrien.med"));
+// MEDLoader::WriteField(out_nam,tgtField, true);
+// cout << "wrote: " << out_nam << "\n";
+// double integ1 = 0.0, integ2 = 0.0;
+// srcField->integral(true, &integ1);
+// tgtField->integral(true, &integ2);
+//// tgtField->reprQuickOverview(cout);
+// CPPUNIT_ASSERT_DOUBLES_EQUAL(integ1,integ2,1e-8);
+//
+// dad->decrRef();
+//}
+//
+//void ParaMEDMEMTest::testOverlapDEC_LMEC_para()
+//{
+// using namespace ParaMEDMEM;
+//
+// int size;
+// int rank;
+// MPI_Comm_size(MPI_COMM_WORLD,&size);
+// MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+//
+// if (size != 1) return ;
+//
+// int nproc = 1;
+// std::set<int> procs;
+//
+// for (int i=0; i<nproc; i++)
+// procs.insert(i);
+//
+// CommInterface interface;
+// OverlapDEC dec(procs);
+//
+// ParaMESH* parameshS=0;
+// ParaMESH* parameshT=0;
+// ParaFIELD* parafieldS=0;
+// ParaFIELD* parafieldT=0;
+// MFDouble srcField;
+//
+// // **** FILE LOADING
+// // T_SC_Trio_src.med -- "SupportOf_"
+// // T_SC_Trio_dst.med -- "SupportOf_T_SC_Trio"
+// // h_TH_Trio_src.med -- "SupportOf_"
+// // h_TH_Trio_dst.med -- "SupportOf_h_TH_Trio"
+// string rep("/export/home/adrien/support/antoine_LMEC/");
+// string src_mesh_nam(rep + string("T_SC_Trio_src.med"));
+// string tgt_mesh_nam(rep + string("T_SC_Trio_dst.med"));
+//
+//
+// MPI_Barrier(MPI_COMM_WORLD);
+// if(rank==0)
+// {
+// // string src_mesh_nam(rep + string("h_TH_Trio_src.med"));
+// // string tgt_mesh_nam(rep + string("h_TH_Trio_dst.med"));
+// MUMesh src_mesh=MEDLoader::ReadUMeshFromFile(src_mesh_nam,"SupportOf_",0);
+// MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_T_SC_Trio",0);
+// // MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_h_TH_Trio",0);
+//
+// // **** SOURCE
+// srcField = MEDCouplingFieldDouble::New(ON_CELLS, ONE_TIME);
+// srcField->setMesh(src_mesh);
+// DataArrayDouble * dad = DataArrayDouble::New(); dad->alloc(src_mesh->getNumberOfCells(),1);
+// dad->fillWithValue(1.0);
+// srcField->setArray(dad);
+// srcField->setNature(ConservativeVolumic);
+//
+// ComponentTopology comptopo;
+// parameshS = new ParaMESH(src_mesh,*dec.getGroup(),"source mesh");
+// parafieldS = new ParaFIELD(ON_CELLS,ONE_TIME,parameshS,comptopo);
+// parafieldS->getField()->setNature(ConservativeVolumic);//IntegralGlobConstraint
+// parafieldS->getField()->setArray(dad);
+//
+// // **** TARGET
+// parameshT=new ParaMESH(tgt_mesh,*dec.getGroup(),"target mesh");
+// parafieldT=new ParaFIELD(ON_CELLS,ONE_TIME,parameshT,comptopo);
+// parafieldT->getField()->setNature(ConservativeVolumic);//IntegralGlobConstraint
+// parafieldT->getField()->getArray()->fillWithValue(1.0e300);
+//// valsT[0]=7.;
+// }
+// dec.setOrientation(2);
+// dec.attachSourceLocalField(parafieldS);
+// dec.attachTargetLocalField(parafieldT);
+// dec.synchronize();
+// dec.sendRecvData(true);
+// //
+// if(rank==0)
+// {
+// double integ1 = 0.0, integ2 = 0.0;
+// MEDCouplingFieldDouble * tgtField;
+//
+// srcField->integral(true, &integ1);
+// tgtField = parafieldT->getField();
+//// tgtField->reprQuickOverview(cout);
+// tgtField->integral(true, &integ2);
+// tgtField->setName("result");
+// string out_nam(rep + string("adrien_para.med"));
+// MEDLoader::WriteField(out_nam,tgtField, true);
+// cout << "wrote: " << out_nam << "\n";
+// CPPUNIT_ASSERT_DOUBLES_EQUAL(integ1,integ2,1e-8);
+// }
+// delete parafieldS;
+// delete parafieldT;
+// delete parameshS;
+// delete parameshT;
+//
+// MPI_Barrier(MPI_COMM_WORLD);
+//}
+
+void prepareData1(int rank, ProcessorGroup * grp,
+ MEDCouplingUMesh *& meshS, MEDCouplingUMesh *& meshT,
+ ParaMESH*& parameshS, ParaMESH*& parameshT,
+ ParaFIELD*& parafieldS, ParaFIELD*& parafieldT)
+{