]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
LOT7: MED_FILE, MEDCoupling + MED_READER in congig=int64 eap/LOT7_Update
authoreap <eap@opencascade.com>
Mon, 9 Dec 2019 13:45:35 +0000 (16:45 +0300)
committereap <eap@opencascade.com>
Mon, 9 Dec 2019 13:45:35 +0000 (16:45 +0300)
src/INTERP_KERNEL/TransformedTriangleMath.cxx
src/MEDLoader/Swig/MEDLoaderCommon.i
src/MEDLoader/Swig/MEDLoaderTypemaps.i
src/MEDPartitioner/CMakeLists.txt
src/MEDPartitioner/MEDPARTITIONER_Utils.hxx
src/MEDPartitioner/MEDPARTITIONER_UtilsPara.cxx
src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx
src/ParaMEDMEM_Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/ParaMEDMEM.i
src/RENUMBER_Swig/MEDRenumber.i

index 6f896d28da9b1e2ac1c51c7c6426df1332e41683..d55c994c98b91cd0cdedec733dd1e3455c601ce7 100644 (file)
@@ -146,7 +146,7 @@ namespace INTERP_KERNEL
 
             const long double delta = MULT_PREC_F * ( std::fabs(term1) + std::fabs(term2) );
          
-            if( epsilonEqual(_doubleProducts[8*seg + dp], 0.0, THRESHOLD_F * delta))
+            if( epsilonEqual(_doubleProducts[8*seg + dp], 0.0, (double)(THRESHOLD_F * delta)))
               {
                 // debug output
 #if LOG_LEVEL >= 5
@@ -485,7 +485,7 @@ namespace INTERP_KERNEL
     const long double delta = MULT_PREC_F * (std::fabs(p_term) + std::fabs(q_term) + std::fabs(r_term));
 #endif
 
-    if( epsilonEqual( p_term + q_term + r_term, 0.0, THRESHOLD_F * delta) )
+    if( epsilonEqual( p_term + q_term + r_term, 0.0, (double)(THRESHOLD_F * delta)) )
       {
         LOG(4, "Reset imprecise triple product for corner " << corner << " to zero" ); 
         return 0.0;
index f21b93682fcc727159a0bb832623212abdeb1136..261efa111ef0846730900fd66906b5fbd75de23c 100644 (file)
@@ -565,9 +565,9 @@ namespace MEDCoupling
   PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
     {
       std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
-      int size=v.size();
+      std::size_t size=v.size();
       PyObject *ret=PyList_New(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
       return ret;
     }
@@ -1317,9 +1317,9 @@ namespace MEDCoupling
            for(int j=0;j<(int)ret1.size()/3;j++)
              {
                PyObject *retLev2=PyList_New(3);
-               PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
-               PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
-               PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
+               PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
+               PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
+               PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
                PyList_SetItem(retLev1_0,j,retLev2);
              }
            PyTuple_SetItem(ret,1,retLev1_0);
@@ -1328,9 +1328,9 @@ namespace MEDCoupling
            for(int j=0;j<(int)ret2.size()/3;j++)
              {
                PyObject *retLev2=PyList_New(3);
-               PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
-               PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
-               PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
+               PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
+               PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
+               PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
                PyList_SetItem(retLev1_1,j,retLev2);
              }
            PyTuple_SetItem(ret,2,retLev1_1);
@@ -1445,14 +1445,14 @@ namespace MEDCoupling
            PyObject *ret(PyTuple_New(5));
            PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
            PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
-           int sz(a2.size());
+           std::size_t sz(a2.size());
            PyObject *ret2(PyList_New(sz));
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
            PyTuple_SetItem(ret,2,ret2);
            sz=a3.size();
            PyObject *ret3(PyList_New(sz));
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                DataArrayIdType *elt(a3[i]);
                if(elt)
@@ -1472,7 +1472,7 @@ namespace MEDCoupling
            static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
            if(!PyTuple_Check(inp))
              throw INTERP_KERNEL::Exception(MSG);
-           int sz(PyTuple_Size(inp));
+           std::size_t sz(PyTuple_Size(inp));
            if(sz!=5)
              throw INTERP_KERNEL::Exception(MSG);
            std::vector<double> a0;
@@ -2149,9 +2149,9 @@ namespace MEDCoupling
         std::vector< std::vector<std::string> > pfls;
         std::vector< std::vector<std::string> > locs;
         std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
-        int sz=ret.size();
+        std::size_t sz=ret.size();
         PyObject *ret2=PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
                const std::vector<TypeOfField>& typesFI=typesF[i];
@@ -2159,13 +2159,13 @@ namespace MEDCoupling
                const std::vector<std::string>& locsI=locs[i];
                PyObject *elt=PyTuple_New(2);
                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
-               int sz2=ret[i].size();
+               std::size_t sz2=ret[i].size();
                PyObject *elt2=PyList_New(sz2);
-               for(int j=0;j<sz2;j++)
+               for(std::size_t j=0;j<sz2;j++)
                  {
                    PyObject *elt3=PyTuple_New(4);
                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
-                   PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
+                   PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
                    PyTuple_SetItem(elt3,1,elt4);
                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
@@ -2290,9 +2290,9 @@ namespace MEDCoupling
            std::vector< std::vector<std::string> > pfls;
            std::vector< std::vector<std::string> > locs;
            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
-           int sz=ret.size();
+           std::size_t sz=ret.size();
            PyObject *ret2=PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                const std::vector<DataArrayDouble *>& dadsI=ret[i];
                const std::vector<TypeOfField>& typesFI=typesF[i];
@@ -2300,9 +2300,9 @@ namespace MEDCoupling
                const std::vector<std::string>& locsI=locs[i];
                PyObject *elt=PyTuple_New(2);
                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
-               int sz2=ret[i].size();
+               std::size_t sz2=ret[i].size();
                PyObject *elt2=PyList_New(sz2);
-               for(int j=0;j<sz2;j++)
+               for(std::size_t j=0;j<sz2;j++)
                  {
                    PyObject *elt3=PyTuple_New(4);
                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
@@ -2537,7 +2537,7 @@ namespace MEDCoupling
       {
         if(elt0 && PyInt_Check(elt0))
           {//fmts[3]
-            int pos=PyInt_AS_LONG(elt0);
+            int pos=(int)PyInt_AS_LONG(elt0);
             return pos;
           }
         else if(elt0 && PyTuple_Check(elt0))
@@ -2548,8 +2548,8 @@ namespace MEDCoupling
                 PyObject *o1=PyTuple_GetItem(elt0,1);
                 if(PyInt_Check(o0) && PyInt_Check(o1))
                   {//fmts(1,-1)
-                    int iter=PyInt_AS_LONG(o0);
-                    int order=PyInt_AS_LONG(o1);
+                    int iter=(int)PyInt_AS_LONG(o0);
+                    int order=(int)PyInt_AS_LONG(o1);
                     return self->getPosOfTimeStep(iter,order);
                   }
                 else
@@ -2622,9 +2622,9 @@ namespace MEDCoupling
         std::vector< std::vector<std::string> > pfls;
         std::vector< std::vector<std::string> > locs;
         std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
-        int sz=ret.size();
+        std::size_t sz=ret.size();
         PyObject *ret2=PyList_New(sz);
-        for(int i=0;i<sz;i++)
+        for(std::size_t i=0;i<sz;i++)
           {
             const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
             const std::vector<TypeOfField>& typesFI=typesF[i];
@@ -2632,13 +2632,13 @@ namespace MEDCoupling
             const std::vector<std::string>& locsI=locs[i];
             PyObject *elt=PyTuple_New(2);
             PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
-            int sz2=ret[i].size();
+            std::size_t sz2=ret[i].size();
             PyObject *elt2=PyList_New(sz2);
-            for(int j=0;j<sz2;j++)
+            for(std::size_t j=0;j<sz2;j++)
               {
                 PyObject *elt3=PyTuple_New(4);
                 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
-                PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
+                PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
                 PyTuple_SetItem(elt3,1,elt4);
                 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
                 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
@@ -2654,9 +2654,9 @@ namespace MEDCoupling
       {
         if(PyList_Check(elts))
           {
-            int sz=PyList_Size(elts);
+            std::size_t sz=PyList_Size(elts);
             std::vector<int> ret(sz);
-            for(int i=0;i<sz;i++)
+            for(std::size_t i=0;i<sz;i++)
               {
                 PyObject *elt=PyList_GetItem(elts,i);
                 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
@@ -2677,7 +2677,7 @@ namespace MEDCoupling
           {
             Py_ssize_t strt=2,stp=2,step=2;
             GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
-            self->eraseTimeStepIds2(strt,stp,step);
+            self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
           }
         else
           {
@@ -2728,10 +2728,10 @@ namespace MEDCoupling
       {
         if(elt0 && PyList_Check(elt0))
           {
-            int sz=PyList_Size(elt0);
+            std::size_t sz=PyList_Size(elt0);
             MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
             int *pt=da->getPointer();
-            for(int i=0;i<sz;i++,pt++)
+            for(std::size_t i=0;i<sz;i++,pt++)
               {
                 PyObject *elt1=PyList_GetItem(elt0,i);
                 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
@@ -2742,7 +2742,7 @@ namespace MEDCoupling
           {
             Py_ssize_t strt=2,stp=2,step=2;
             GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
-            return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
+            return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
           }
         else
           return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
@@ -2941,9 +2941,9 @@ namespace MEDCoupling
            std::vector< std::vector<std::string> > pfls;
            std::vector< std::vector<std::string> > locs;
            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
-           int sz=ret.size();
+           std::size_t sz=ret.size();
            PyObject *ret2=PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                const std::vector<DataArrayDouble *>& dadsI=ret[i];
                const std::vector<TypeOfField>& typesFI=typesF[i];
@@ -2951,9 +2951,9 @@ namespace MEDCoupling
                const std::vector<std::string>& locsI=locs[i];
                PyObject *elt=PyTuple_New(2);
                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
-               int sz2=ret[i].size();
+               std::size_t sz2=ret[i].size();
                PyObject *elt2=PyList_New(sz2);
-               for(int j=0;j<sz2;j++)
+               for(std::size_t j=0;j<sz2;j++)
                  {
                    PyObject *elt3=PyTuple_New(4);
                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
@@ -2992,8 +2992,8 @@ namespace MEDCoupling
                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
                PyObject *elt3=PyTuple_New(2);
-               PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
-               PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
+               PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
+               PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
                PyTuple_SetItem(elt1,0,elt2);
                PyTuple_SetItem(elt1,1,elt3);
                PyList_SetItem(elt,i,elt1);
@@ -3320,10 +3320,10 @@ namespace MEDCoupling
          {
            if(obj && PyList_Check(obj))
              {
-               int sz=PyList_Size(obj);
+               std::size_t sz=PyList_Size(obj);
                MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
                int *pt=da->getPointer();
-               for(int i=0;i<sz;i++,pt++)
+               for(std::size_t i=0;i<sz;i++,pt++)
                  {
                    PyObject *elt1=PyList_GetItem(obj,i);
                    *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
@@ -3363,7 +3363,7 @@ namespace MEDCoupling
              throw INTERP_KERNEL::Exception(msg);
            if(PyInt_Check(elt0))
              {//fmts[3]
-               return PyInt_AS_LONG(elt0);
+               return (int)PyInt_AS_LONG(elt0);
              }
            return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
          }
@@ -3372,9 +3372,9 @@ namespace MEDCoupling
          {
            if(PyList_Check(elts))
              {
-               int sz=PyList_Size(elts);
+               std::size_t sz=PyList_Size(elts);
                std::vector<int> ret(sz);
-               for(int i=0;i<sz;i++)
+               for(std::size_t i=0;i<sz;i++)
                  {
                    PyObject *elt=PyList_GetItem(elts,i);
                    ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
@@ -3402,7 +3402,7 @@ namespace MEDCoupling
              {
                Py_ssize_t strt=2,stp=2,step=2;
                GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
-               self->destroyFieldsAtPos2(strt,stp,step);
+               self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
              }
            else
              {
@@ -3614,8 +3614,8 @@ namespace MEDCoupling
                 PyObject *o1=PyTuple_GetItem(elt0,1);
                 if(PyInt_Check(o0) && PyInt_Check(o1))
                   {//fmts(1,-1)
-                    int iter=PyInt_AS_LONG(o0);
-                    int order=PyInt_AS_LONG(o1);
+                    int iter=(int)PyInt_AS_LONG(o0);
+                    int order=(int)PyInt_AS_LONG(o1);
                     return self->getPosOfTimeStep(iter,order);
                   }
                 else
@@ -3645,9 +3645,9 @@ namespace MEDCoupling
       {
         if(PyList_Check(elts))
           {
-            int sz=PyList_Size(elts);
+            std::size_t sz=PyList_Size(elts);
             std::vector<int> ret(sz);
-            for(int i=0;i<sz;i++)
+            for(std::size_t i=0;i<sz;i++)
               {
                 PyObject *elt=PyList_GetItem(elts,i);
                 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
@@ -4080,7 +4080,7 @@ namespace MEDCoupling
         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
         PyObject *ret1Py=PyList_New(sz);
         for(std::size_t i=0;i<sz;i++)
-          PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
+          PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
         PyTuple_SetItem(ret,1,ret1Py);
         PyObject *ret2Py(ret2?Py_True:Py_False);
         Py_XINCREF(ret2Py);
index 3c2dbc575aabff3b821a5780a0994d9255c4bd33..e32be543f05e4431de6644a4a06117f7075759f9 100644 (file)
@@ -118,15 +118,15 @@ static std::vector<std::pair<int,int> > convertTimePairIdsFromPy(PyObject *pyLi)
   std::vector<std::pair<int,int> > ret;
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       ret.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
               std::pair<int,int> p;
-              int size2=PyTuple_Size(o);
+              std::size_t size2=PyTuple_Size(o);
               if(size2!=2)
                 throw INTERP_KERNEL::Exception("tuples in list must be of size 2 (dt,it) !");
               PyObject *o0=PyTuple_GetItem(o,0);
@@ -169,9 +169,9 @@ static void converPyListToVecString(PyObject *pyLi, std::vector<std::string>& v)
   static const char msg2[]="Unrecognized python argument : expected a list of string or tuple of string or string !";
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       v.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           v[i]=convertPyObjectToStr(o,msg0);
@@ -180,9 +180,9 @@ static void converPyListToVecString(PyObject *pyLi, std::vector<std::string>& v)
     }
   else if(PyTuple_Check(pyLi))
     {
-      int size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       v.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           v[i]=convertPyObjectToStr(o,msg1);
@@ -195,9 +195,9 @@ static void converPyListToVecString(PyObject *pyLi, std::vector<std::string>& v)
 
 static PyObject *convertFieldDoubleVecToPy(const std::vector<MEDCoupling::MEDCouplingFieldDouble *>& li)
 {
-  int sz=li.size();
+  std::size_t sz=li.size();
   PyObject *ret=PyList_New(sz);
-  for(int i=0;i<sz;i++)
+  for(std::size_t i=0;i<sz;i++)
     {
       PyObject *o=SWIG_NewPointerObj((void*)li[i],SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,SWIG_POINTER_OWN | 0);
       PyList_SetItem(ret,i,o);
@@ -205,15 +205,16 @@ static PyObject *convertFieldDoubleVecToPy(const std::vector<MEDCoupling::MEDCou
   return ret;
 }
 
-PyObject *convertVecPairIntToPy(const std::vector< std::pair<int,int> >& vec)
+template< class T >
+PyObject *convertVecPairIntToPy(const std::vector< std::pair<int,T> >& vec)
 {
   PyObject *ret(PyList_New(vec.size()));
   int rk=0;
-  for(std::vector< std::pair<int,int> >::const_iterator iter=vec.begin();iter!=vec.end();iter++,rk++)
+  for(typename std::vector< std::pair<int,T> >::const_iterator iter=vec.begin();iter!=vec.end();iter++,rk++)
     {
       PyObject *elt=PyTuple_New(2);
       PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
-      PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
+      PyTuple_SetItem(elt,1,PyInt_FromLong((*iter).second));
       PyList_SetItem(ret,rk,elt);
     }
   return ret;
@@ -221,9 +222,9 @@ PyObject *convertVecPairIntToPy(const std::vector< std::pair<int,int> >& vec)
 
 PyObject *convertVecPairVecStToPy(const std::vector< std::pair<std::vector<std::string>, std::string > >& vec)
 {
-  int sz=(int)vec.size();
+  std::size_t sz=vec.size();
   PyObject *ret=PyList_New(sz);
-  for(int i=0;i<sz;i++)
+  for(std::size_t i=0;i<sz;i++)
     {
       PyObject *t=PyTuple_New(2);
       int sz2=(int)vec[i].first.size();
@@ -239,9 +240,9 @@ PyObject *convertVecPairVecStToPy(const std::vector< std::pair<std::vector<std::
 
 PyObject *convertVectPairStToPy(const std::vector< std::pair<std::string, std::string > >& vec)
 {
-  int sz=(int)vec.size();
+  std::size_t sz=vec.size();
   PyObject *ret=PyList_New(sz);
-  for(int i=0;i<sz;i++)
+  for(std::size_t i=0;i<sz;i++)
     {
       PyObject *t=PyTuple_New(2);
       PyTuple_SetItem(t,0,PyString_FromString(vec[i].first.c_str()));
@@ -257,15 +258,15 @@ std::vector< std::pair<std::string, std::string > > convertVecPairStStFromPy(PyO
   const char *msg="convertVecPairStStFromPy : Expecting PyList of Tuples of size 2 ! The first elt in tuple is one string and the 2nd one a string !";
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       ret.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
               std::pair<std::string, std::string> p;
-              int size2=PyTuple_Size(o);
+              std::size_t size2=PyTuple_Size(o);
               if(size2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o0=PyTuple_GetItem(o,0);
@@ -288,23 +289,23 @@ std::vector< std::pair<std::vector<std::string>, std::string > > convertVecPairV
   const char *msg="convertVecPairVecStFromPy : Expecting PyList of Tuples of size 2 ! The first elt in tuple is a list of strings and the 2nd one a string !";
   if(PyList_Check(pyLi))
     {
-      int size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       ret.resize(size);
-      for(int i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
               std::pair<std::vector<std::string>, std::string> p;
-              int size2=PyTuple_Size(o);
+              std::size_t size2=PyTuple_Size(o);
               if(size2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o0=PyTuple_GetItem(o,0);
               if(PyList_Check(o0))
                 {
-                  int size3=PyList_Size(o0);
+                  std::size_t size3=PyList_Size(o0);
                   p.first.resize(size3);
-                  for(int j=0;j<size3;j++)
+                  for(std::size_t j=0;j<size3;j++)
                     {
                       PyObject *o0j=PyList_GetItem(o0,j);
                       p.first[j]=convertPyObjectToStr(o0j,msg);
@@ -342,8 +343,8 @@ int MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(const MEDFileAnyTypeFieldMultiTS
           PyObject *o1=PyTuple_GetItem(elt0,1);
           if(PyInt_Check(o0) && PyInt_Check(o1))
             {//fmts(1,-1)
-              int iter=PyInt_AS_LONG(o0);
-              int order=PyInt_AS_LONG(o1);
+              int iter=(int)PyInt_AS_LONG(o0);
+              int order=(int)PyInt_AS_LONG(o1);
               return self->getPosOfTimeStep(iter,order);
             }
           else
@@ -370,12 +371,12 @@ int MEDFileFieldsgetitemSingleTS__(const MEDFileFields *self, PyObject *obj)
   static const char msg[]="MEDFileFields::__getitem__ : only integer or string with fieldname supported !";
   if(PyInt_Check(obj))
     {
-      return InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfFields());
+      return InterpreteNegativeInt(PyInt_AS_LONG(obj),self->getNumberOfFields());
     }
   return self->getPosFromFieldName(convertPyObjectToStr(obj,msg));
 }
 
-void convertToMapIntDataArrayInt(PyObject *pyMap, std::map<int, MCAuto<DataArrayInt> >& cppMap)
+void convertToMapIntDataArrayInt(PyObject *pyMap, std::map<int, MCAuto<DataArrayIdType> >& cppMap)
 {
   if(!PyDict_Check(pyMap))
     throw INTERP_KERNEL::Exception("convertToMapIntDataArrayInt : input is not a python map !");
@@ -386,16 +387,16 @@ void convertToMapIntDataArrayInt(PyObject *pyMap, std::map<int, MCAuto<DataArray
     {
       if(!PyInt_Check(key))
         throw INTERP_KERNEL::Exception("convertToMapIntDataArrayInt : keys in map must be PyInt !");
-      long k(PyInt_AS_LONG(key));
+      int k((int)PyInt_AS_LONG(key));
       void *argp(0);
-      int status(SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
+      int status(SWIG_ConvertPtr(value,&argp,SWIGTITraits<mcIdType>::TI,0|0));
       if(!SWIG_IsOK(status))
         {
           std::ostringstream oss; oss << "convertToMapIntDataArrayInt : values in map must be DataArrayInt !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
-      DataArrayInt *arg(reinterpret_cast<DataArrayInt*>(argp));
-      MCAuto<DataArrayInt> arg2(arg);
+      DataArrayIdType *arg(reinterpret_cast<DataArrayIdType*>(argp));
+      MCAuto<DataArrayIdType> arg2(arg);
       if(arg)
         arg->incrRef();
       cppMap[k]=arg2;
@@ -405,18 +406,18 @@ void convertToMapIntDataArrayInt(PyObject *pyMap, std::map<int, MCAuto<DataArray
 template<class T>
 PyObject *MEDFileField1TS_getFieldWithProfile(const typename MLFieldTraits<T>::F1TSType *self, TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) 
 {
-  DataArrayInt *ret1(NULL);
+  DataArrayIdType *ret1(NULL);
   typename MEDCoupling::Traits<T>::ArrayType *ret0(self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1));
   PyObject *ret(PyTuple_New(2));
   PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<T>::TI, SWIG_POINTER_OWN | 0 ));
-  PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+  PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
   return ret;
 }
 
 template<class T>
 PyObject *MEDFileField1TS_getUndergroundDataArrayExt(const typename MLFieldTraits<T>::F1TSType *self)
 {
-  std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
+  std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
   typename MEDCoupling::Traits<T>::ArrayType *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
   if(elt0)
     elt0->incrRef();
@@ -431,8 +432,8 @@ PyObject *MEDFileField1TS_getUndergroundDataArrayExt(const typename MLFieldTrait
       PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
       PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
       PyObject *elt3=PyTuple_New(2);
-      PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
-      PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
+      PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
+      PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
       PyTuple_SetItem(elt1,0,elt2);
       PyTuple_SetItem(elt1,1,elt3);
       PyList_SetItem(elt,i,elt1);
index 9f27daa1677c256d7cf9482522be54371bb1141e..41eceb565516e91036d4578c07f3da97881ffcc7 100644 (file)
 
 ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${LIBXML2_DEFINITIONS})
 
+IF (NOT DEFINED MSVC)
+  ADD_DEFINITIONS(-Wsign-compare -Wconversion)
+ENDIF()
+
 INCLUDE_DIRECTORIES(
   ${LIBXML2_INCLUDE_DIR}
   ${MEDFILE_INCLUDE_DIRS}
index 184098369c24098243e1d03b4676576f9551e910..57de1814beb007a2924891d84584266fd4ad9cbe 100644 (file)
@@ -45,7 +45,7 @@ namespace MEDPARTITIONER
                        
   MEDPARTITIONER_EXPORT std::string ReprVectorOfString(const std::vector<std::string>& vec);
   MEDPARTITIONER_EXPORT std::string ReprVectorOfString(const std::vector<std::string>& vec, const std::string separator);
-  MEDPARTITIONER_EXPORT std::string ReprMapOfStringInt(const std::map<std::string,int>& mymap);
+  MEDPARTITIONER_EXPORT std::string ReprMapOfStringInt(const std::map<std::string,mcIdType>& mymap);
   MEDPARTITIONER_EXPORT std::string ReprMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
   MEDPARTITIONER_EXPORT std::string ReprFieldDescriptions(const std::vector<std::string>& vec,const  std::string separator);
   
@@ -54,8 +54,8 @@ namespace MEDPARTITIONER
   MEDPARTITIONER_EXPORT std::vector<std::string> DeserializeToVectorOfString(const std::string& str);
   MEDPARTITIONER_EXPORT std::string EraseTagSerialized(const std::string& fromStr, const std::string& tag);
   
-  MEDPARTITIONER_EXPORT std::vector<std::string> VectorizeFromMapOfStringInt(const std::map<std::string,int>& mymap);
-  MEDPARTITIONER_EXPORT std::map<std::string,int> DevectorizeToMapOfStringInt(const std::vector<std::string>& vec);
+  MEDPARTITIONER_EXPORT std::vector<std::string> VectorizeFromMapOfStringInt(const std::map<std::string,mcIdType>& mymap);
+  MEDPARTITIONER_EXPORT std::map<std::string,mcIdType> DevectorizeToMapOfStringInt(const std::vector<std::string>& vec);
   
   MEDPARTITIONER_EXPORT std::vector<std::string> VectorizeFromMapOfStringVectorOfString(const std::map< std::string,std::vector<std::string> >& mymap);
   MEDPARTITIONER_EXPORT std::map< std::string,std::vector<std::string> > DevectorizeToMapOfStringVectorOfString(const std::vector<std::string>& vec);
@@ -75,8 +75,8 @@ namespace MEDPARTITIONER
                               int& idomain, std::string& fileName, std::string& meshName, std::string& fieldName,
                               int& typeField, int& DT, int& IT);
   MEDPARTITIONER_EXPORT void FieldShortDescriptionToData(const std::string& description,
-                                   std::string& fieldName, int& typeField, int& entity, int& DT, int& IT);
-  
+                                                         std::string& fieldName, int& typeField, int& entity, int& DT, int& IT);
+
   MEDCoupling::DataArrayIdType *CreateDataArrayIntFromVector(const std::vector<mcIdType>& v);
   MEDCoupling::DataArrayIdType *CreateDataArrayIntFromVector(const std::vector<mcIdType>& v, const int nbComponents);
   MEDCoupling::DataArrayDouble *CreateDataArrayDoubleFromVector(const std::vector<double>& v);
@@ -88,6 +88,9 @@ namespace MEDPARTITIONER
   std::vector<std::string> BrowseAllFieldsOnMesh(const std::string& myfile, const std::string& mymesh, const int idomain);
   std::vector<std::string> GetInfosOfField(const char *fileName, const char *meshName, const int idomain );
 
+  MEDCoupling::MCAuto< MEDCoupling::DataArrayInt32 > FromIdTypeVec( const std::vector< mcIdType >& vec );
+
+
 #ifdef HAVE_MPI
   //not advised, interblocking, use sendAndReceive
   //void SendVectorOfString(const std::vector<std::string>& vec, const int target);
@@ -100,9 +103,9 @@ namespace MEDPARTITIONER
   std::vector<double> *RecvDoubleVec(const int source);
   void RecvDoubleVec(std::vector<double>& vec, const int source);
     
-  void SendIntVec(const std::vector<int>& vec, const int target);
+  void SendIntVec(const std::vector<mcIdType>& vec, const int target);
   std::vector<int>* RecvIntVec(int source);
-  void RecvIntVec(std::vector<int>& vec, const int source);
+  void RecvIntVec(std::vector<mcIdType>& vec, const int source);
   
   void SendDataArrayInt(const MEDCoupling::DataArrayInt* da, const int target);
   MEDCoupling::DataArrayInt *RecvDataArrayInt(const int source);
@@ -146,33 +149,33 @@ namespace MEDPARTITIONER
   {
     void * _tree;
     void (BBTreeOfDim::*_PgetElementsAroundPoint)( const double* coordsPtr,
-                                                   std::vector<int>& elems ) const;
+                                                   std::vector<mcIdType>& elems ) const;
     void (BBTreeOfDim::*_PgetIntersectingElems)( const double* bb,
-                                                 std::vector<int>& elems ) const;
+                                                 std::vector<mcIdType>& elems ) const;
 
     template< int dim>
     void _getElementsAroundPoint( const double* coordsPtr,
-                                  std::vector<int>& elems ) const
+                                  std::vector<mcIdType>& elems ) const
     {
-      ((BBTree<dim,int>*)_tree)->getElementsAroundPoint( coordsPtr, elems );
+      ((BBTree<dim,mcIdType>*)_tree)->getElementsAroundPoint( coordsPtr, elems );
     }
     template< int dim>
     void _getIntersectingElems(const double* bb,
-                               std::vector<int>& elems) const
+                               std::vector<mcIdType>& elems) const
     {
-      ((BBTree<dim,int>*)_tree)->getIntersectingElems( bb, elems );
+      ((BBTree<dim,mcIdType>*)_tree)->getIntersectingElems( bb, elems );
     }
   public:
 
-    BBTreeOfDim( int           dim,
+    BBTreeOfDim( std::size_t   dim,
                  const double* bbs,
-                 int*          elems,
+                 mcIdType*     elems,
                  int           level,
-                 int           nbelems,
+                 mcIdType      nbelems,
                  double        epsilon=1e-12);
     ~BBTreeOfDim();
-    void getElementsAroundPoint(const double* coordsPtr, std::vector<int>& elems ) const;
-    void getIntersectingElems  (const double* bb,        std::vector<int>& elems)  const;
+    void getElementsAroundPoint(const double* coordsPtr, std::vector<mcIdType>& elems ) const;
+    void getIntersectingElems  (const double* bb,        std::vector<mcIdType>& elems)  const;
   };
 }
 #endif
index fcd43eaadaf329b2d385269f9a458e659183bfaf..f0231898428d5a96eecaf37d422adbc0feaac970 100644 (file)
@@ -27,6 +27,7 @@
 #include "MEDCouplingFieldDouble.hxx"
 #include "InterpKernelException.hxx"
 #include "MCAuto.hxx"
+#include "MEDCouplingMemArray.txx"
 #include "InterpKernelAutoPtr.hxx"
 
 #include <fstream>
 #include <string>
 
 #ifdef HAVE_MPI
+
 #include <mpi.h>
+
+#ifndef MEDCOUPLING_USE_64BIT_IDS
+#define MPI_ID_TYPE MPI_INT
+#else
+#define MPI_ID_TYPE MPI_LONG
+#endif
+
 #endif
 
 using namespace MEDPARTITIONER;
@@ -54,9 +63,9 @@ std::vector<std::string> MEDPARTITIONER::SendAndReceiveVectorOfString(const std:
   if (rank == source)
     {
       std::string str=SerializeFromVectorOfString(vec);
-      int size=str.length();
+      int size=(int)str.length();
       MPI_Send( &size, 1, MPI_INT, target, tag, MPI_COMM_WORLD );
-      MPI_Send( (void*)str.data(), str.length(), MPI_CHAR, target, tag+100, MPI_COMM_WORLD );
+      MPI_Send( (void*)str.data(), (int)str.length(), MPI_CHAR, target, tag+100, MPI_COMM_WORLD );
     }
   
   int recSize=0;
@@ -83,7 +92,7 @@ std::vector<std::string> MEDPARTITIONER::AllgathervVectorOfString(const std::vec
   std::string str=SerializeFromVectorOfString(vec);
   
   std::vector<int> indexes(world_size);
-  int size=str.length();
+  int size=(int)str.length();
   MPI_Allgather(&size, 1, MPI_INT, 
                 &indexes[0], 1, MPI_INT, MPI_COMM_WORLD);
   
@@ -92,7 +101,7 @@ std::vector<std::string> MEDPARTITIONER::AllgathervVectorOfString(const std::vec
   for (int i=0; i<world_size; i++) disp.push_back( disp.back() + indexes[i] );
   
   std::string recData(disp.back(),'x');
-  MPI_Allgatherv((void*)str.data(), str.length(), MPI_CHAR,
+  MPI_Allgatherv((void*)str.data(), (int)str.length(), MPI_CHAR,
                  (void*)recData.data(), &indexes[0], &disp[0], MPI_CHAR,
                  MPI_COMM_WORLD);
   
@@ -115,7 +124,7 @@ std::vector<std::string> MEDPARTITIONER::AllgathervVectorOfString(const std::vec
 void MEDPARTITIONER::SendDoubleVec(const std::vector<double>& vec, const int target)
 {
   int tag = 111002;
-  int size=vec.size();
+  int size=(int)vec.size();
   if (MyGlobals::_Verbose>1000) 
     std::cout << "proc " << MyGlobals::_Rank << " : --> SendDoubleVec " << size << std::endl;
 #ifdef HAVE_MPI
@@ -164,15 +173,15 @@ void MEDPARTITIONER::RecvDoubleVec(std::vector<double>& vec, const int source)
   \param vec vector to be sent
   \param target processor id of the target
 */
-void MEDPARTITIONER::SendIntVec(const std::vector<int>& vec, const int target)
+void MEDPARTITIONER::SendIntVec(const std::vector<mcIdType>& vec, const int target)
 {
   int tag = 111003;
-  int size=vec.size();
+  int size=(int)vec.size();
   if (MyGlobals::_Verbose>1000)
     std::cout << "proc " << MyGlobals::_Rank << " : --> SendIntVec " << size << std::endl;
 #ifdef HAVE_MPI
-  MPI_Send(&size, 1, MPI_INT, target, tag, MPI_COMM_WORLD);
-  MPI_Send(const_cast<int*>(&vec[0]), size,MPI_INT, target, tag+100, MPI_COMM_WORLD);
+  MPI_Send(&size, 1, MPI_ID_TYPE, target, tag, MPI_COMM_WORLD);
+  MPI_Send(const_cast<mcIdType*>(&vec[0]), size,MPI_ID_TYPE, target, tag+100, MPI_COMM_WORLD);
 #endif
 }
 
@@ -197,7 +206,7 @@ std::vector<int> *MEDPARTITIONER::RecvIntVec(const int source)
   return vec;
 }
 
-void MEDPARTITIONER::RecvIntVec(std::vector<int>& vec, const int source)
+void MEDPARTITIONER::RecvIntVec(std::vector<mcIdType>& vec, const int source)
 {
   int tag = 111003;
   int size;
@@ -207,7 +216,7 @@ void MEDPARTITIONER::RecvIntVec(std::vector<int>& vec, const int source)
   if (MyGlobals::_Verbose>1000)
     std::cout << "proc " << MyGlobals::_Rank << " : <-- RecvIntVec " << size << std::endl;
   vec.resize(size);
-  MPI_Recv(&vec[0], size, MPI_INT, source, tag+100, MPI_COMM_WORLD,&status);
+  MPI_Recv(&vec[0], size, MPI_ID_TYPE, source, tag+100, MPI_COMM_WORLD,&status);
 #endif
 }
 
@@ -223,9 +232,9 @@ void MEDPARTITIONER::SendDataArrayInt(const MEDCoupling::DataArrayInt *da, const
     throw INTERP_KERNEL::Exception("Problem send DataArrayInt* NULL");
   int tag = 111004;
   int size[3];
-  size[0]=da->getNbOfElems();
-  size[1]=da->getNumberOfTuples();
-  size[2]=da->getNumberOfComponents();
+  size[0]=(int)da->getNbOfElems();
+  size[1]=(int)da->getNumberOfTuples();
+  size[2]=(int)da->getNumberOfComponents();
   if (MyGlobals::_Verbose>1000) 
     std::cout << "proc " << MyGlobals::_Rank << " : --> SendDataArrayInt " << size[0] << std::endl;
 #ifdef HAVE_MPI
@@ -271,9 +280,9 @@ void MEDPARTITIONER::SendDataArrayDouble(const MEDCoupling::DataArrayDouble *da,
     throw INTERP_KERNEL::Exception("Problem send DataArrayDouble* NULL");
   int tag = 111005;
   int size[3];
-  size[0]=da->getNbOfElems();
-  size[1]=da->getNumberOfTuples();
-  size[2]=da->getNumberOfComponents();
+  size[0]=(int)da->getNbOfElems();
+  size[1]=(int)da->getNumberOfTuples();
+  size[2]=(int)da->getNumberOfComponents();
   if (MyGlobals::_Verbose>1000) 
     std::cout << "proc " << MyGlobals::_Rank << " : --> SendDataArrayDouble " << size[0] << std::endl;
 #ifdef HAVE_MPI
@@ -380,7 +389,7 @@ void MEDPARTITIONER::TestVectorOfStringMpi()
 void MEDPARTITIONER::TestMapOfStringIntMpi()
 {
   int rank=MyGlobals::_Rank;
-  std::map<std::string,int> myMap;
+  std::map<std::string,mcIdType> myMap;
   myMap["one"]=1;
   myMap["two"]=22;  //a bug
   myMap["three"]=3;
@@ -389,7 +398,7 @@ void MEDPARTITIONER::TestMapOfStringIntMpi()
   if (rank==0)
     {
       std::vector<std::string> v2=VectorizeFromMapOfStringInt(myMap);
-      std::map<std::string,int> m3=DevectorizeToMapOfStringInt(v2);
+      std::map<std::string,mcIdType> m3=DevectorizeToMapOfStringInt(v2);
       if (ReprMapOfStringInt(m3)!=ReprMapOfStringInt(myMap))
         throw INTERP_KERNEL::Exception("Problem in (de)vectorize MapOfStringInt");
     }
@@ -399,7 +408,7 @@ void MEDPARTITIONER::TestMapOfStringIntMpi()
     {
       std::cout << "v2 is : a vector of size " << v2.size() << std::endl;
       std::cout << ReprVectorOfString(v2) << std::endl;
-      std::map<std::string,int> m2=DevectorizeToMapOfStringInt(v2);
+      std::map<std::string,mcIdType> m2=DevectorizeToMapOfStringInt(v2);
       std::cout << "m2 is : a map of size " << m2.size() << std::endl;
       std::cout << ReprMapOfStringInt(m2) << std::endl;
     }
index 0b2d44139a544251f36bdf80b21e4e2b706c413f..9a3b6cc1d9d4b1794219dcc15447887e599b1eca 100644 (file)
@@ -213,8 +213,8 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() {
           mpi_access.status( RecvRequestId[i] , source , tag , error ,
                              outcount ) ;
           if ( i != 0 ) {
-            if ( outcount != 1000*i |
-                 (recvbuf[i][outcount-1] != (outcount-1)) ) {
+            if (( outcount != 1000*i ) ||
+                ((recvbuf[i][outcount-1] != (outcount-1)))) {
               ostringstream strstream ;
               strstream << "========================================================"
                         << endl << "test" << myrank << " outcount " << outcount
index 1e77d563232b7dd301aee6fadecc1a5c4f7320e2..049570efd289a78866dfafb9a3a7be72b1fc462d 100644 (file)
@@ -29,6 +29,9 @@ ELSE()
   SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
 ENDIF()
 SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
+IF(MEDCOUPLING_USE_64BIT_IDS)
+  STRING(APPEND SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS")
+ENDIF(MEDCOUPLING_USE_64BIT_IDS)
 
 INCLUDE_DIRECTORIES(
   ${PYTHON_INCLUDE_DIRS}
index 66266c53833c1e9815ad8f5b4fcb2dcda690407f..411fcae2280d7b8656afe43501956122107be9c1 100644 (file)
@@ -77,6 +77,42 @@ def MEDCouplingDataArrayIntImod(self,*args):
 def MEDCouplingDataArrayIntIpow(self,*args):
     import _ParaMEDMEM
     return _ParaMEDMEM.DataArrayInt____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt32Iadd(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32Isub(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32Imul(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32Idiv(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32Imod(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32____imod___(self, self, *args)
+def MEDCouplingDataArrayInt32Ipow(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt64Iadd(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt64____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64Isub(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt64____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64Imul(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt64____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64Idiv(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt64____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64Imod(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt64____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64Ipow(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt64____ipow___(self, self, *args)
 def MEDCouplingDataArrayFloatIadd(self,*args):
     import _ParaMEDMEM
     return _ParaMEDMEM.DataArrayFloat____iadd___(self, self, *args)
@@ -101,21 +137,36 @@ def MEDCouplingDataArrayDoubleTupleImul(self,*args):
 def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
     import _ParaMEDMEM
     return _ParaMEDMEM.DataArrayDoubleTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayInt32TupleIadd(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIsub(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImul(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIdiv(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImod(self,*args):
+    import _ParaMEDMEM
+    return _ParaMEDMEM.DataArrayInt32Tuple____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIadd(self,*args):
     import _ParaMEDMEM
-    return _ParaMEDMEM.DataArrayIntTuple____iadd___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIsub(self,*args):
+    return _ParaMEDMEM.DataArrayInt64Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIsub(self,*args):
     import _ParaMEDMEM
-    return _ParaMEDMEM.DataArrayIntTuple____isub___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImul(self,*args):
+    return _ParaMEDMEM.DataArrayInt64Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImul(self,*args):
     import _ParaMEDMEM
-    return _ParaMEDMEM.DataArrayIntTuple____imul___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIdiv(self,*args):
+    return _ParaMEDMEM.DataArrayInt64Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIdiv(self,*args):
     import _ParaMEDMEM
-    return _ParaMEDMEM.DataArrayIntTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImod(self,*args):
+    return _ParaMEDMEM.DataArrayInt64Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImod(self,*args):
     import _ParaMEDMEM
-    return _ParaMEDMEM.DataArrayIntTuple____imod___(self, self, *args)
+    return _ParaMEDMEM.DataArrayInt64Tuple____imod___(self, self, *args)
 def MEDCouplingDenseMatrixIadd(self,*args):
     import _ParaMEDMEM
     return _ParaMEDMEM.DenseMatrix____iadd___(self, self, *args)
index 2060dd0e1cd11a46d60886821e139293a81eece8..1a4c7bdbe97336efcc7785f36a36dfed52a09eeb 100644 (file)
@@ -37,24 +37,42 @@ def MEDCouplingDataArrayDoubleIdiv(self,*args):
 def MEDCouplingDataArrayDoubleIpow(self,*args):
     import _MEDRenumber
     return _MEDRenumber.DataArrayDouble____ipow___(self, self, *args)
-def MEDCouplingDataArrayIntIadd(self,*args):
+def MEDCouplingDataArrayInt32Iadd(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayInt____iadd___(self, self, *args)
-def MEDCouplingDataArrayIntIsub(self,*args):
+    return _MEDRenumber.DataArrayInt32____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32Isub(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayInt____isub___(self, self, *args)
-def MEDCouplingDataArrayIntImul(self,*args):
+    return _MEDRenumber.DataArrayInt32____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32Imul(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayInt____imul___(self, self, *args)
-def MEDCouplingDataArrayIntIdiv(self,*args):
+    return _MEDRenumber.DataArrayInt32____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32Idiv(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayInt____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntImod(self,*args):
+    return _MEDRenumber.DataArrayInt32____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32Imod(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayInt____imod___(self, self, *args)
-def MEDCouplingDataArrayIntIpow(self,*args):
+    return _MEDRenumber.DataArrayInt32____imod___(self, self, *args)
+def MEDCouplingDataArrayInt32Ipow(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayInt____ipow___(self, self, *args)
+    return _MEDRenumber.DataArrayInt32____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt64Iadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64Isub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64Imul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64Idiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64Imod(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64Ipow(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____ipow___(self, self, *args)
 def MEDCouplingDataArrayFloatIadd(self,*args):
     import _MEDRenumber
     return _MEDRenumber.DataArrayFloat____iadd___(self, self, *args)
@@ -79,21 +97,36 @@ def MEDCouplingDataArrayDoubleTupleImul(self,*args):
 def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
     import _MEDRenumber
     return _MEDRenumber.DataArrayDoubleTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayInt32TupleIadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIsub(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayIntTuple____iadd___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIsub(self,*args):
+    return _MEDRenumber.DataArrayInt32Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImul(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayIntTuple____isub___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImul(self,*args):
+    return _MEDRenumber.DataArrayInt32Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIdiv(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayIntTuple____imul___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIdiv(self,*args):
+    return _MEDRenumber.DataArrayInt32Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImod(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayIntTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImod(self,*args):
+    return _MEDRenumber.DataArrayInt32Tuple____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIadd(self,*args):
     import _MEDRenumber
-    return _MEDRenumber.DataArrayIntTuple____imod___(self, self, *args)
+    return _MEDRenumber.DataArrayInt64Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIsub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIdiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImod(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____imod___(self, self, *args)
 %}
 
 
@@ -106,44 +139,79 @@ DataArrayDouble.__imul__=MEDCouplingDataArrayDoubleImul
 DataArrayDouble.__idiv__=MEDCouplingDataArrayDoubleIdiv
 DataArrayDouble.__ipow__=MEDCouplingDataArrayDoubleIpow
 
-DataArrayInt.__reduce__=MEDCouplingDataArrayIntReduce
-DataArrayInt.__iadd__=MEDCouplingDataArrayIntIadd
-DataArrayInt.__isub__=MEDCouplingDataArrayIntIsub
-DataArrayInt.__imul__=MEDCouplingDataArrayIntImul
-DataArrayInt.__idiv__=MEDCouplingDataArrayIntIdiv
-DataArrayInt.__imod__=MEDCouplingDataArrayIntImod
-DataArrayInt.__ipow__=MEDCouplingDataArrayIntIpow
+DataArrayInt32.__reduce__=MEDCouplingDataArrayInt32Reduce
+DataArrayInt32.__iadd__=MEDCouplingDataArrayInt32Iadd
+DataArrayInt32.__isub__=MEDCouplingDataArrayInt32Isub
+DataArrayInt32.__imul__=MEDCouplingDataArrayInt32Imul
+DataArrayInt32.__idiv__=MEDCouplingDataArrayInt32Idiv
+DataArrayInt32.__imod__=MEDCouplingDataArrayInt32Imod
+DataArrayInt32.__ipow__=MEDCouplingDataArrayInt32Ipow
+DataArrayInt64.__reduce__=MEDCouplingDataArrayInt64Reduce
+DataArrayInt64.__iadd__=MEDCouplingDataArrayInt64Iadd
+DataArrayInt64.__isub__=MEDCouplingDataArrayInt64Isub
+DataArrayInt64.__imul__=MEDCouplingDataArrayInt64Imul
+DataArrayInt64.__idiv__=MEDCouplingDataArrayInt64Idiv
+DataArrayInt64.__imod__=MEDCouplingDataArrayInt64Imod
+DataArrayInt64.__ipow__=MEDCouplingDataArrayInt64Ipow
 
 DataArrayDoubleTuple.__iadd__=MEDCouplingDataArrayDoubleTupleIadd
 DataArrayDoubleTuple.__isub__=MEDCouplingDataArrayDoubleTupleIsub
 DataArrayDoubleTuple.__imul__=MEDCouplingDataArrayDoubleTupleImul
 DataArrayDoubleTuple.__idiv__=MEDCouplingDataArrayDoubleTupleIdiv
 
-DataArrayIntTuple.__iadd__=MEDCouplingDataArrayIntTupleIadd
-DataArrayIntTuple.__isub__=MEDCouplingDataArrayIntTupleIsub
-DataArrayIntTuple.__imul__=MEDCouplingDataArrayIntTupleImul
-DataArrayIntTuple.__idiv__=MEDCouplingDataArrayIntTupleIdiv
-DataArrayIntTuple.__imod__=MEDCouplingDataArrayIntTupleImod
+DataArrayInt32Tuple.__iadd__=MEDCouplingDataArrayInt32TupleIadd
+DataArrayInt32Tuple.__isub__=MEDCouplingDataArrayInt32TupleIsub
+DataArrayInt32Tuple.__imul__=MEDCouplingDataArrayInt32TupleImul
+DataArrayInt32Tuple.__idiv__=MEDCouplingDataArrayInt32TupleIdiv
+DataArrayInt32Tuple.__itruediv__=MEDCouplingDataArrayInt32TupleIdiv
+DataArrayInt32Tuple.__ifloordiv__=MEDCouplingDataArrayInt32TupleIdiv
+DataArrayInt32Tuple.__imod__=MEDCouplingDataArrayInt32TupleImod
+
+DataArrayInt64Tuple.__iadd__=MEDCouplingDataArrayInt64TupleIadd
+DataArrayInt64Tuple.__isub__=MEDCouplingDataArrayInt64TupleIsub
+DataArrayInt64Tuple.__imul__=MEDCouplingDataArrayInt64TupleImul
+DataArrayInt64Tuple.__idiv__=MEDCouplingDataArrayInt64TupleIdiv
+DataArrayInt64Tuple.__itruediv__=MEDCouplingDataArrayInt64TupleIdiv
+DataArrayInt64Tuple.__ifloordiv__=MEDCouplingDataArrayInt64TupleIdiv
+DataArrayInt64Tuple.__imod__=MEDCouplingDataArrayInt64TupleImod
+
+
+
 
 del INTERPKERNELExceptionReduce
-del MEDCouplingDataArrayDoubleReduce
-del MEDCouplingDataArrayIntReduce
 del MEDCouplingDataArrayDoubleIadd
-del MEDCouplingDataArrayDoubleIsub
-del MEDCouplingDataArrayDoubleImul
 del MEDCouplingDataArrayDoubleIdiv
-del MEDCouplingDataArrayIntIadd
-del MEDCouplingDataArrayIntIsub
-del MEDCouplingDataArrayIntImul
-del MEDCouplingDataArrayIntIdiv
-del MEDCouplingDataArrayIntImod
+del MEDCouplingDataArrayDoubleImul
+del MEDCouplingDataArrayDoubleIpow
+del MEDCouplingDataArrayDoubleIsub
+del MEDCouplingDataArrayDoubleReduce
 del MEDCouplingDataArrayDoubleTupleIadd
-del MEDCouplingDataArrayDoubleTupleIsub
-del MEDCouplingDataArrayDoubleTupleImul
 del MEDCouplingDataArrayDoubleTupleIdiv
-del MEDCouplingDataArrayIntTupleIadd
-del MEDCouplingDataArrayIntTupleIsub
-del MEDCouplingDataArrayIntTupleImul
-del MEDCouplingDataArrayIntTupleIdiv
-del MEDCouplingDataArrayIntTupleImod
+del MEDCouplingDataArrayDoubleTupleImul
+del MEDCouplingDataArrayDoubleTupleIsub
+del MEDCouplingDataArrayInt32Iadd
+del MEDCouplingDataArrayInt32Idiv
+del MEDCouplingDataArrayInt32Imod
+del MEDCouplingDataArrayInt32Imul
+del MEDCouplingDataArrayInt32Ipow
+del MEDCouplingDataArrayInt32Isub
+del MEDCouplingDataArrayInt32Reduce
+del MEDCouplingDataArrayInt32TupleIadd
+del MEDCouplingDataArrayInt32TupleIdiv
+del MEDCouplingDataArrayInt32TupleImod
+del MEDCouplingDataArrayInt32TupleImul
+del MEDCouplingDataArrayInt32TupleIsub
+del MEDCouplingDataArrayInt64Iadd
+del MEDCouplingDataArrayInt64Idiv
+del MEDCouplingDataArrayInt64Imod
+del MEDCouplingDataArrayInt64Imul
+del MEDCouplingDataArrayInt64Ipow
+del MEDCouplingDataArrayInt64Isub
+del MEDCouplingDataArrayInt64Reduce
+del MEDCouplingDataArrayInt64TupleIadd
+del MEDCouplingDataArrayInt64TupleIdiv
+del MEDCouplingDataArrayInt64TupleImod
+del MEDCouplingDataArrayInt64TupleImul
+del MEDCouplingDataArrayInt64TupleIsub
+
 %}