]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
ParaMEDMemTest: nasty bug: stack data was declared at the wrong scope abn/parat_fix
authorabn <adrien.bruneton@cea.fr>
Fri, 29 Jan 2021 08:50:42 +0000 (09:50 +0100)
committerabn <adrien.bruneton@cea.fr>
Fri, 29 Jan 2021 08:50:42 +0000 (09:50 +0100)
+ caused random crashes on random platforms in Release mode

src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx

index 9267c66210577ddcb386c7f49a2d210bb83024ac..b2a99da5284e1181d90f0eb41fd190940df4ac11 100644 (file)
@@ -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();