From 754fbb4cd3c1408172deeb69c81f031f45aa5f40 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 20 Feb 2017 14:19:05 +0100 Subject: [PATCH] Compilation with MPI --- .../MEDCouplingDataArrayTypemaps.i | 15 ++++++++ src/MEDCoupling_Swig/MEDCouplingTypemaps.i | 15 -------- .../MEDPARTITIONER_ParaDomainSelector.cxx | 2 +- .../ParaMEDMEMTest_InterpKernelDEC.cxx | 36 +++++++++---------- .../ParaMEDMEMTest_OverlapDEC.cxx | 8 ++--- src/RENUMBER_Swig/MEDRenumberCommon.i | 2 +- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i index 1687f44c2..8cb326457 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i @@ -2662,5 +2662,20 @@ static PyObject *NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(PyObject *cls return instance; } +static PyObject *convertPartDefinition(MEDCoupling::PartDefinition *pd, int owner) throw(INTERP_KERNEL::Exception) +{ + PyObject *ret=0; + if(!pd) + { + Py_XINCREF(Py_None); + return Py_None; + } + if(dynamic_cast(pd)) + ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__DataArrayPartDefinition,owner); + else + ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__SlicePartDefinition,owner); + return ret; +} + #endif diff --git a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i index ae568df97..6bb7ee801 100644 --- a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i @@ -98,21 +98,6 @@ static PyObject* convertMultiFields(MEDCoupling::MEDCouplingMultiFields *mfs, in return ret; } -static PyObject *convertPartDefinition(MEDCoupling::PartDefinition *pd, int owner) throw(INTERP_KERNEL::Exception) -{ - PyObject *ret=0; - if(!pd) - { - Py_XINCREF(Py_None); - return Py_None; - } - if(dynamic_cast(pd)) - ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__DataArrayPartDefinition,owner); - else - ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__SlicePartDefinition,owner); - return ret; -} - static PyObject *convertCartesianAMRMesh(MEDCoupling::MEDCouplingCartesianAMRMeshGen *mesh, int owner) throw(INTERP_KERNEL::Exception) { if(!mesh) diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx index f91be6f25..c72d7e365 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx @@ -340,7 +340,7 @@ std::auto_ptr MEDPARTITIONER::ParaDomainSelector::gatherG int value_size = graph_index[ index_size-1 ] - graph_index[ 0 ]; int *graph_value = new int[ value_size ]; - const int *value = graph->getGraph()->getValue(); + const int *value = graph->getGraph()->getValues(); MPI_Allgatherv((void*) value, // send local value value_size_of_proc[_rank], // value size on this proc diff --git a/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx b/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx index 21e1138ba..7f6ef3893 100644 --- a/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx +++ b/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx @@ -235,14 +235,14 @@ void ParaMEDMEMTest::testInterpKernelDEC_1D() const double *res=parafieldP0->getField()->getArray()->getConstPointer(); if(rank==3) { - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfComponents()); CPPUNIT_ASSERT_DOUBLES_EQUAL(7.4,res[0],1e-12); } if(rank==4) { - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfComponents()); CPPUNIT_ASSERT_DOUBLES_EQUAL(9.0540540540540526,res[0],1e-12); } dec.sendData(); @@ -424,14 +424,14 @@ void ParaMEDMEMTest::testInterpKernelDEC_2DCurve() const double *res=parafieldP0->getField()->getArray()->getConstPointer(); if(rank==3) { - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfComponents()); CPPUNIT_ASSERT_DOUBLES_EQUAL(7.4,res[0],1e-12); } if(rank==4) { - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,parafieldP0->getField()->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP0->getField()->getNumberOfComponents()); CPPUNIT_ASSERT_DOUBLES_EQUAL(9.0540540540540526,res[0],1e-12); } dec.sendData(); @@ -1266,7 +1266,7 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P0() dec5.setForcedRenormalization(false); dec5.recvData(); const double *res=parafield->getField()->getArray()->getConstPointer(); - CPPUNIT_ASSERT_EQUAL(1,parafield->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafield->getField()->getNumberOfTuples()); const double expected[]={37.8518518518519,43.5333333333333}; CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[rank],res[0],1e-13); } @@ -1293,7 +1293,7 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P0() dec6.setForcedRenormalization(false); dec6.recvData(); const double *res=parafield->getField()->getArray()->getConstPointer(); - CPPUNIT_ASSERT_EQUAL(1,parafield->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafield->getField()->getNumberOfTuples()); const double expected[]={0.794600591715977,1.35631163708087}; CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[rank],res[0],1e-13); } @@ -1320,7 +1320,7 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P0() dec7.setForcedRenormalization(false); dec7.recvData(); const double *res=parafield->getField()->getArray()->getConstPointer(); - CPPUNIT_ASSERT_EQUAL(1,parafield->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafield->getField()->getNumberOfTuples()); const double expected[]={36.4592592592593,44.5407407407407}; CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[rank],res[0],1e-13); } @@ -1347,7 +1347,7 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P0() dec8.setForcedRenormalization(false); dec8.recvData(); const double *res=parafield->getField()->getArray()->getConstPointer(); - CPPUNIT_ASSERT_EQUAL(1,parafield->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafield->getField()->getNumberOfTuples()); const double expected[]={0.81314102564102553,1.3428994082840233}; CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[rank],res[0],1e-13); } @@ -1561,24 +1561,24 @@ void ParaMEDMEMTest::testInterpKernelDECNonOverlapp_2D_P0P1P1P0() if(rank==2) { const double expectP2[5]={39.0, 31.0, 31.0, 47.0, 39.0}; - CPPUNIT_ASSERT_EQUAL(5,parafieldP1->getField()->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,parafieldP1->getField()->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(5,(int)parafieldP1->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP1->getField()->getNumberOfComponents()); for(int kk=0;kk<5;kk++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expectP2[kk],res[kk],1e-12); } if(rank==3) { const double expectP3[3]={39.0, 31.0, 31.0}; - CPPUNIT_ASSERT_EQUAL(3,parafieldP1->getField()->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,parafieldP1->getField()->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(3,(int)parafieldP1->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP1->getField()->getNumberOfComponents()); for(int kk=0;kk<3;kk++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expectP3[kk],res[kk],1e-12); } if(rank==4) { const double expectP4[6]={47.0, 47.0, 47.0, 39.0, 39.0, 31.0}; - CPPUNIT_ASSERT_EQUAL(6,parafieldP1->getField()->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,parafieldP1->getField()->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(6,(int)parafieldP1->getField()->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)parafieldP1->getField()->getNumberOfComponents()); for(int kk=0;kk<6;kk++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expectP4[kk],res[kk],1e-12); } diff --git a/src/ParaMEDMEMTest/ParaMEDMEMTest_OverlapDEC.cxx b/src/ParaMEDMEMTest/ParaMEDMEMTest_OverlapDEC.cxx index d01960c13..5969e2be0 100644 --- a/src/ParaMEDMEMTest/ParaMEDMEMTest_OverlapDEC.cxx +++ b/src/ParaMEDMEMTest/ParaMEDMEMTest_OverlapDEC.cxx @@ -590,7 +590,7 @@ void ParaMEDMEMTest::testOverlapDEC3() MEDCouplingFieldDouble * resField = parafieldT->getField(); if(rank==0) { - CPPUNIT_ASSERT_EQUAL(8, resField->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(8, (int)resField->getNumberOfTuples()); for(int i=0;i<4;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0,resField->getArray()->getIJ(i,0),1e-12); for(int i=4;i<8;i++) @@ -598,7 +598,7 @@ void ParaMEDMEMTest::testOverlapDEC3() } if(rank==1) { - CPPUNIT_ASSERT_EQUAL(12, resField->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(12, (int)resField->getNumberOfTuples()); for(int i=0;i<4;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0,resField->getArray()->getIJ(i,0),1e-12); for(int i=4;i<8;i++) @@ -660,7 +660,7 @@ void ParaMEDMEMTest::testOverlapDEC4() MEDCouplingFieldDouble * resField = parafieldT->getField(); if(rank==0) { - CPPUNIT_ASSERT_EQUAL(8, resField->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(8, (int)resField->getNumberOfTuples()); for(int i=0;i<4;i++) { CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0,resField->getArray()->getIJ(i*2,0),1e-12); @@ -674,7 +674,7 @@ void ParaMEDMEMTest::testOverlapDEC4() } if(rank==1) { - CPPUNIT_ASSERT_EQUAL(12, resField->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(12, (int)resField->getNumberOfTuples()); for(int i=0;i<4;i++) { CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0,resField->getArray()->getIJ(i*2,0),1e-12); diff --git a/src/RENUMBER_Swig/MEDRenumberCommon.i b/src/RENUMBER_Swig/MEDRenumberCommon.i index 1c2e20ef5..6f8782e8b 100644 --- a/src/RENUMBER_Swig/MEDRenumberCommon.i +++ b/src/RENUMBER_Swig/MEDRenumberCommon.i @@ -24,7 +24,7 @@ %include std_string.i %{ -#include "MEDCouplingMemArray.hxx" +#include "MEDCouplingMemArray.txx" #include "MCAuto.hxx" #include "MEDCouplingDataArrayTypemaps.i" -- 2.39.2