From: abn Date: Fri, 29 Jan 2021 08:50:42 +0000 (+0100) Subject: ParaMEDMemTest: nasty bug: stack data was declared at the wrong scope X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2042fdbb24bad20fe0227eabcc04f29d69587697;p=tools%2Fmedcoupling.git ParaMEDMemTest: nasty bug: stack data was declared at the wrong scope + caused random crashes on random platforms in Release mode --- diff --git a/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx b/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx index 9267c6621..b2a99da52 100644 --- a/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx +++ b/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx @@ -1405,6 +1405,12 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P1P1P0() ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source); // MPI_Barrier(MPI_COMM_WORLD); + // Global nodal indexing - declared here since the data needs to stay alive for the + // synchronize() and sendRecv() parts: + const mcIdType globalNumberingP2[5]={0,1,2,3,4}; + const mcIdType globalNumberingP3[3]={4,2,5}; + const mcIdType globalNumberingP4[6]={3,6,7,4,8,5}; + if(source_group->containsMyRank()) { if(rank==0) @@ -1476,7 +1482,6 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P1P1P0() myCoords->decrRef(); paramesh=new ParaMESH(mesh,*target_group,targetMeshName); DataArrayIdType *da=DataArrayIdType::New(); - const mcIdType globalNumberingP2[5]={0,1,2,3,4}; da->useArray(globalNumberingP2,false,DeallocType::CPP_DEALLOC,5,1); paramesh->setNodeGlobal(da); da->decrRef(); @@ -1497,7 +1502,6 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P1P1P0() myCoords->decrRef(); paramesh=new ParaMESH(mesh,*target_group,targetMeshName); DataArrayIdType *da=DataArrayIdType::New(); - const mcIdType globalNumberingP3[3]={4,2,5}; da->useArray(globalNumberingP3,false,DeallocType::CPP_DEALLOC,3,1); paramesh->setNodeGlobal(da); da->decrRef(); @@ -1519,7 +1523,6 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P1P1P0() myCoords->decrRef(); paramesh=new ParaMESH(mesh,*target_group,targetMeshName); DataArrayIdType *da=DataArrayIdType::New(); - const mcIdType globalNumberingP4[6]={3,6,7,4,8,5}; da->useArray(globalNumberingP4,false,DeallocType::CPP_DEALLOC,6,1); paramesh->setNodeGlobal(da); da->decrRef();