Salome HOME
PTScotch with MEDCOUPLING_USE_64BIT_IDS=ON
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 8 Sep 2020 14:14:58 +0000 (16:14 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 8 Sep 2020 14:14:58 +0000 (16:14 +0200)
src/MEDPartitioner/MEDPARTITIONER_PTScotchGraph.cxx

index 64d21b8989fe30e5b7de6a95971efc953fb9d784..f496ad0dcde2b7eb8bd0e4022372860f2f1a358b 100644 (file)
@@ -72,8 +72,17 @@ void PTSCOTCHGraph::partGraph(int ndomain, const std::string& options_string, Pa
   //output parameters
   int* partition = new int[n+1];
   
-  int* vlbloctab = _vlbloctab?const_cast<int*>(_vlbloctab->begin()):0;
-  
+#ifdef MEDCOUPLING_USE_64BIT_IDS
+  std::vector<int> vlbloctabVec;
+  int *vlbloctab(nullptr);
+  if( _vlbloctab )
+    {
+      vlbloctabVec.insert( vlbloctabVec.end() , _vlbloctab->begin() , _vlbloctab->end() );
+      vlbloctab = vlbloctabVec.data();
+    }
+#else
+  mcIdType *vlbloctab = _vlbloctab?const_cast<mcIdType*>(_vlbloctab->begin()):nullptr;
+#endif
   SCOTCH_randomReset();
   SCOTCH_Dgraph scotch_graph;
   SCOTCH_dgraphInit(&scotch_graph, MPI_COMM_WORLD);