//
// Author : Anthony Geay (EDF R&D)
-#include "ParaDataArray.hxx"
+#include "ParaDataArray.txx"
#include "MCType.hxx"
#include "MEDCouplingMemArray.hxx"
#include <iostream>
#include <cstring>
-#include <string>
-#include <sstream>
#ifndef WIN32
#include <unistd.h>
}
MPI2Connector::~MPI2Connector()
-= default;
+{
+}
MPI_Comm MPI2Connector::remoteMPI2Connect(const std::string& service)
{
/* If rank 0 is server, all processes call MPI_Comm_accept */
/* If rank 0 is not server, all processes call MPI_Comm_connect */
- int const srv = (int)_srv;
+ int srv = (int)_srv;
MPI_Bcast(&srv,1,MPI_INT,0,MPI_COMM_WORLD);
_srv = (bool)srv;
if ( _srv )
#include <mpi.h>
#include <string>
+#include <sstream>
class MPI2Connector
{
//
#include "MPIAccessDECTest.hxx"
+#include <cppunit/TestAssert.h>
+#include <sstream>
#include <cmath>
-#include <string>
#ifndef WIN32
#include <unistd.h>
#ifndef _MPIACCESSDECTEST_HXX_
#define _MPIACCESSDECTEST_HXX_
-#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
+#include <set>
#include <string>
#include <iostream>
#include "mpi.h"
public:
MPIAccessDECTest():CppUnit::TestFixture(){}
- ~MPIAccessDECTest() override= default;
- void setUp() override{}
- void tearDown() override{}
+ ~MPIAccessDECTest(){}
+ void setUp(){}
+ void tearDown(){}
void test_AllToAllDECSynchronousPointToPoint() ;
void test_AllToAllDECAsynchronousPointToPoint() ;
void test_AllToAllvDECSynchronousPointToPoint() ;
class MPIAccessDECTest_TmpFilesRemover
{
public:
- MPIAccessDECTest_TmpFilesRemover() = default;
+ MPIAccessDECTest_TmpFilesRemover() {}
~MPIAccessDECTest_TmpFilesRemover();
bool Register(const std::string theTmpFile);
//
#include "MPIAccessTest.hxx"
+#include <cppunit/TestAssert.h>
+#include <sstream>
#include <cmath>
-#include <string>
#ifndef WIN32
#include <unistd.h>
#ifndef _MPIACCESSTEST_HXX_
#define _MPIACCESSTEST_HXX_
-#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
+#include <set>
#include <string>
#include <iostream>
#include "mpi.h"
public:
MPIAccessTest():CppUnit::TestFixture(){}
- ~MPIAccessTest() override= default;
- void setUp() override{}
- void tearDown() override{}
+ ~MPIAccessTest(){}
+ void setUp(){}
+ void tearDown(){}
void test_MPI_Access_Send_Recv() ;
void test_MPI_Access_Cyclic_Send_Recv() ;
void test_MPI_Access_SendRecv() ;
class MPIAccessTest_TmpFilesRemover
{
public:
- MPIAccessTest_TmpFilesRemover() = default;
+ MPIAccessTest_TmpFilesRemover() {}
~MPIAccessTest_TmpFilesRemover();
bool Register(const std::string theTmpFile);
// --- include all MPIAccess Test
//
#include "MPIAccessTest.hxx"
-#include <cppunit/extensions/HelperMacros.h>
// --- Registers the fixture into the 'registry'
// --- generic Main program from KERNEL_SRC/src/Basics/Test
+#include "MPIMainTest.hxx"
// --- include all MPIAccessDEC Test
//
#include "MPIAccessDECTest.hxx"
-#include <cppunit/extensions/HelperMacros.h>
// --- Registers the fixture into the 'registry'
// --- generic Main program from KERNEL_SRC/src/Basics/Test
+#include "MPIMainTest.hxx"
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "MPIAccess.hxx"
-#include "CommInterface.hxx"
#include "MPIAccessDECTest.hxx"
#include <cppunit/TestAssert.h>
#include "../ParaMEDMEM/MPIAccess/MPIAccessDEC.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
targetprocs.insert(i);
}
- auto* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
- auto* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
- auto * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
+ MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
#define datamsglength 10
// int sts ;
- int const sendcount = datamsglength ;
- int const recvcount = datamsglength ;
+ int sendcount = datamsglength ;
+ int recvcount = datamsglength ;
int * recvbuf = new int[datamsglength*size] ;
int ireq ;
MyMPIAccessDEC->allToAll( sendbuf, sendcount , MPI_INT ,
recvbuf, recvcount , MPI_INT ) ;
- int const nRecvReq = mpi_access->recvRequestIdsSize() ;
+ int nRecvReq = mpi_access->recvRequestIdsSize() ;
int *ArrayOfRecvRequests = new int[nRecvReq] ;
- int const nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
+ int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
mpi_access->deleteRequests( nReq , ArrayOfRecvRequests ) ;
delete [] ArrayOfRecvRequests ;
}
- int const nSendReq = mpi_access->sendRequestIdsSize() ;
+ int nSendReq = mpi_access->sendRequestIdsSize() ;
debugStream << "test_AllToAllDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
<< endl ;
if ( nSendReq ) {
int *ArrayOfSendRequests = new int[nSendReq] ;
- int const nReq = mpi_access->sendRequestIds( nSendReq, ArrayOfSendRequests ) ;
+ int nReq = mpi_access->sendRequestIds( nSendReq, ArrayOfSendRequests ) ;
mpi_access->waitAll( nReq , ArrayOfSendRequests ) ;
delete [] ArrayOfSendRequests ;
}
- int const nRecvReq = mpi_access->recvRequestIdsSize() ;
+ int nRecvReq = mpi_access->recvRequestIdsSize() ;
if ( nRecvReq ) {
ostringstream strstream ;
strstream << "test_AllToAllDEC" << myrank << " final RecvRequestIds " << nRecvReq
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "MPIAccess.hxx"
-#include "CommInterface.hxx"
-#include "DECOptions.hxx"
#include "MPIAccessDECTest.hxx"
#include <cppunit/TestAssert.h>
//#include "CommInterface.hxx"
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
-#include "MPIProcessorGroup.hxx"
+#include "LinearTimeInterpolator.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
targetprocs.insert(i);
}
- auto* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
- auto* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
// LinearTimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0.5 ) ;
- auto * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
+ MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
// Asynchronous , LinearInterp , 0.5 ) ;
MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp ) ;
#define datamsglength 10
int sts ;
- int const sendcount = datamsglength ;
- int const recvcount = datamsglength ;
+ int sendcount = datamsglength ;
+ int recvcount = datamsglength ;
double time = 0 ;
// double deltatime[maxproc] = {1.,2.1,3.2,4.3,5.4,6.5,7.6,8.7,9.8,10.9,11.} ;
- double const deltatime[maxproc] = {1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.} ;
- double const maxtime = maxreq ;
+ double deltatime[maxproc] = {1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.} ;
+ double maxtime = maxreq ;
double nextdeltatime = deltatime[myrank] ;
// MyMPIAccessDEC->InitTime( time , deltatime[myrank] , maxtime ) ;
// for ( time = 0 ; time <= maxtime ; time+=deltatime[myrank] ) {
<< endl << "============================================================="
<< endl ;
int *ArrayOfRecvRequests = new int[nRecvReq] ;
- int const nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
+ int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
delete [] ArrayOfRecvRequests ;
debugStream << strstream.str() << endl ;
CPPUNIT_FAIL( strstream.str() ) ;
}
- int const nSendReq = mpi_access->sendRequestIdsSize() ;
+ int nSendReq = mpi_access->sendRequestIdsSize() ;
debugStream << "test_AllToAllTimeDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
<< endl ;
if ( nSendReq ) {
int *ArrayOfSendRequests = new int[nSendReq] ;
- int const nReq = mpi_access->sendRequestIds( nSendReq, ArrayOfSendRequests ) ;
+ int nReq = mpi_access->sendRequestIds( nSendReq, ArrayOfSendRequests ) ;
mpi_access->waitAll( nReq , ArrayOfSendRequests ) ;
delete [] ArrayOfSendRequests ;
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "MPIAccess.hxx"
-#include "CommInterface.hxx"
#include "MPIAccessDECTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "../ParaMEDMEM/MPIAccess/MPIAccessDEC.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
targetprocs.insert(i);
}
- auto* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
- auto* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
- auto * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
+ MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
MPIAccess * mpi_access = MyMPIAccessDEC->getMPIAccess() ;
// debugStream << "test_AllToAllvDEC" << myrank << " sendbuf " << sendbuf << endl ;
// MyMPIAccessDEC->CheckSent() ;
- int const nRecvReq = mpi_access->recvRequestIdsSize() ;
+ int nRecvReq = mpi_access->recvRequestIdsSize() ;
// debugStream << "test_AllToAllvDEC" << myrank << " WaitAllRecv " << nRecvReq << " Requests" << endl ;
int *ArrayOfRecvRequests = new int[nRecvReq] ;
- int const nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
+ int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
mpi_access->deleteRequests( nReq , ArrayOfRecvRequests ) ;
delete [] ArrayOfRecvRequests ;
// debugStream << "test_AllToAllvDEC" << myrank << " final CheckSent" << endl ;
// MyMPIAccessDEC->CheckSent() ;
- int const nSendReq = mpi_access->sendRequestIdsSize() ;
+ int nSendReq = mpi_access->sendRequestIdsSize() ;
debugStream << "test_AllToAllvDEC" << myrank << " final SendRequestIds " << nSendReq << " SendRequests"
<< endl ;
if ( nSendReq ) {
int *ArrayOfSendRequests = new int[nSendReq] ;
- int const nReq = mpi_access->sendRequestIds( nSendReq, ArrayOfSendRequests ) ;
+ int nReq = mpi_access->sendRequestIds( nSendReq, ArrayOfSendRequests ) ;
mpi_access->waitAll( nReq , ArrayOfSendRequests ) ;
delete [] ArrayOfSendRequests ;
}
- int const nRecvReq = mpi_access->recvRequestIdsSize() ;
+ int nRecvReq = mpi_access->recvRequestIdsSize() ;
if ( nRecvReq ) {
ostringstream strstream ;
strstream << "test_AllToAllvDEC" << myrank << " final RecvRequestIds " << nRecvReq
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
#include <ctime>
-#include "MPIAccess.hxx"
-#include "CommInterface.hxx"
-#include "DECOptions.hxx"
#include "MPIAccessDECTest.hxx"
#include <cppunit/TestAssert.h>
//#include "CommInterface.hxx"
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
-#include "MPIProcessorGroup.hxx"
+#include "LinearTimeInterpolator.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
}
// int Asynchronous = atoi(argv[1]) ;
- int const UseMPI_Alltoallv = UseMPINative ;
+ int UseMPI_Alltoallv = UseMPINative ;
// if ( argc == 3 ) {
// UseMPI_Alltoallv = atoi(argv[2]) ;
// }
targetprocs.insert(i);
}
- auto* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
- auto* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
// TimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0.5 ) ;
- auto * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
+ MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
// Asynchronous , LinearInterp , 0.5 ) ;
MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp , 0.5 ) ;
}
double timeLoc = 0 ;
- double const deltatime[maxproc] = {1.,2.1,3.2,4.3,5.4,6.5,7.6,8.7,9.8,10.9,11.} ;
+ double deltatime[maxproc] = {1.,2.1,3.2,4.3,5.4,6.5,7.6,8.7,9.8,10.9,11.} ;
double maxtime ;
double nextdeltatime = deltatime[myrank] ;
if ( UseMPI_Alltoallv ) {
maxtime = maxreq ;
// MyMPIAccessDEC->InitTime( time , nextdeltatime , maxtime ) ;
}
- time_t const begintime = time(nullptr) ;
+ time_t begintime = time(NULL) ;
// for ( time = 0 ; time <= maxtime ; time+=deltatime[myrank] ) {
for ( timeLoc = 0 ; timeLoc <= maxtime && nextdeltatime != 0 ; timeLoc+=nextdeltatime ) {
nextdeltatime = deltatime[myrank] ;
if ( UseMPI_Alltoallv ) {
const MPI_Comm* comm = MyMPIAccessDEC->getComm();
- auto * aSendTimeMessage = new TimeMessage ;
+ TimeMessage * aSendTimeMessage = new TimeMessage ;
aSendTimeMessage->time = timeLoc ;
// aSendTimeMessage->deltatime = deltatime[myrank] ;
aSendTimeMessage->deltatime = nextdeltatime ;
// aSendTimeMessage->maxtime = maxtime ;
aSendTimeMessage->tag = (int ) (timeLoc/deltatime[myrank]) ;
- auto * aRecvTimeMessage = new TimeMessage[size] ;
+ TimeMessage * aRecvTimeMessage = new TimeMessage[size] ;
interface.allToAllV(aSendTimeMessage, sendtimecounts , stimedispls ,
mpi_access->timeType() ,
aRecvTimeMessage, recvtimecounts , rtimedispls ,
<< endl << "============================================================="
<< endl ;
int *ArrayOfRecvRequests = new int[nRecvReq] ;
- int const nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
+ int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
delete [] ArrayOfRecvRequests ;
debugStream << strstream.str() << endl ;
bool badrecvbuf = false ;
for ( i = 0 ; i < size ; i++ ) {
for ( int jj = 0 ; jj < datamsglength ; jj++ ) {
- int const index = i*datamsglength+jj ;
+ int index = i*datamsglength+jj ;
if ( jj < recvcounts[i] ) {
if ( recvbuf[index] != (index/datamsglength)*1000000 + myrank*1000 +
myrank*datamsglength+(index%datamsglength) ) {
<< " RecvRequests = 0 OK" << endl ;
}
- time_t endtime = time(nullptr) ;
+ time_t endtime = time(NULL) ;
debugStream << "test_AllToAllvTimeDEC" << myrank << " begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank]
<< " calls to AllToAll" << endl ;
// MPI_Finalize();
- endtime = time(nullptr) ;
+ endtime = time(NULL) ;
debugStream << "test_AllToAllvTimeDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank]
//
#include <math.h>
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
#include <ctime>
-#include "MPIAccess.hxx"
-#include "CommInterface.hxx"
-#include "DECOptions.hxx"
#include "MPIAccessDECTest.hxx"
#include <cppunit/TestAssert.h>
//#include "CommInterface.hxx"
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
-#include "MPIProcessorGroup.hxx"
+#include "LinearTimeInterpolator.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
targetprocs.insert(i);
}
- auto* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
- auto* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
// TimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0 ) ;
- auto * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
+ MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
// Asynchronous , LinearInterp , 0.5 ) ;
MyMPIAccessDEC->setTimeInterpolator( LinearTimeInterp ) ;
}
double timeLoc[maxproc] ;
- double const deltatime[maxproc] = {1.,2.1,3.2,4.3,5.4,6.5,7.6,8.7,9.8,10.9,11.} ;
+ double deltatime[maxproc] = {1.,2.1,3.2,4.3,5.4,6.5,7.6,8.7,9.8,10.9,11.} ;
double maxtime[maxproc] ;
double nextdeltatime[maxproc] ;
for ( i = 0 ; i < size ; i++ ) {
maxtime[i] = maxreq ;
nextdeltatime[i] = deltatime[i] ;
}
- time_t const begintime = time(nullptr) ;
+ time_t begintime = time(NULL) ;
for ( timeLoc[myrank] = 0 ; timeLoc[myrank] <= maxtime[myrank] && nextdeltatime[myrank] != 0 ;
timeLoc[myrank]+=nextdeltatime[myrank] ) {
//local and target times
debugStream << "test" << myrank << "=====TIME " << timeLoc[myrank] << "=====DELTATIME "
<< nextdeltatime[myrank] << "=====MAXTIME " << maxtime[myrank] << " ======"
<< endl ;
- auto * sendbuf = new double[datamsglength*size] ;
+ double * sendbuf = new double[datamsglength*size] ;
// double * sendbuf = (double *) malloc(sizeof(double)*datamsglength*size) ;
- auto * recvbuf = new double[datamsglength*size] ;
+ double * recvbuf = new double[datamsglength*size] ;
int j ;
//debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " sendbuf" ;
for ( target = 0 ; target < size ; target++ ) {
<< endl << "============================================================"
<< endl ;
int *ArrayOfRecvRequests = new int[nRecvReq] ;
- int const nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
+ int nReq = mpi_access->recvRequestIds( nRecvReq, ArrayOfRecvRequests ) ;
mpi_access->waitAll( nReq , ArrayOfRecvRequests ) ;
delete [] ArrayOfRecvRequests ;
debugStream << strstream.str() << endl ;
bool badrecvbuf = false ;
for ( target = 0 ; target < size ; target++ ) {
for ( int jj = 0 ; jj < datamsglength ; jj++ ) {
- int const index = target*datamsglength+jj ;
+ int index = target*datamsglength+jj ;
if ( jj < recvcounts[target] ) {
if ( fabs(recvbuf[index] - (target*1000000 + myrank*10000 +
(timeLoc[target]/deltatime[target])*100 + jj)) > 101) {
<< " RecvRequests = 0 OK" << endl ;
}
- time_t endtime = time(nullptr) ;
+ time_t endtime = time(NULL) ;
debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank]
<< " calls to AllToAll" << endl ;
// MPI_Finalize();
- endtime = time(nullptr) ;
+ endtime = time(NULL) ;
debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime
<< " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank]
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
-#include "CommInterface.hxx"
-#include "MPIProcessorGroup.hxx"
+#include <time.h>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
debugStream << "test_MPI_Access_Cancel" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_Cyclic_ISend_IRecv" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
return ;
}
- int const alltarget[3] = {1 , 2 , 0 } ;
- int const allsource[3] = {2 , 0 , 1 } ;
+ int alltarget[3] = {1 , 2 , 0 } ;
+ int allsource[3] = {2 , 0 , 1 } ;
int SendRequestId[maxsend] ;
int RecvRequestId[maxsend] ;
int sendbuf[maxsend] ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_Cyclic_Send_Recv" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
return ;
}
- int const alltarget[3] = {1 , 2 , 0 } ;
- int const allsource[3] = {2 , 0 , 1 } ;
+ int alltarget[3] = {1 , 2 , 0 } ;
+ int allsource[3] = {2 , 0 , 1 } ;
int RequestId[10] ;
int sts ;
int i = 0 ;
}
if ( myrank == 0 ) {
if ( i != 9 ) {
- int const ii = i + 1 ;
+ int ii = i + 1 ;
sts = mpi_access.send(&ii,1,MPI_INT,alltarget[myrank], RequestId[i]) ;
debugStream << "test" << myrank << " Send RequestId " << RequestId[i]
<< " tag " << mpi_access.sendMPITag(alltarget[myrank]) << endl ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
-#include "CommInterface.hxx"
-#include "MPIProcessorGroup.hxx"
+#include <time.h>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
debugStream << "test_MPI_Access_IProbe" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_ISendRecv" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_ISend_IRecv" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <time.h>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_ISend_IRecv_BottleNeck" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
return ;
}
- int const target = 1 - myrank ;
+ int target = 1 - myrank ;
int SendRequestId[maxreq] ;
int RecvRequestId[maxreq] ;
int sts ;
size2 = mpi_access.sendRequestIdsSize() ;
debugStream << "test" << myrank << " after WaitAll sendreqsize " << size2 << endl ;
int * ArrayOfSendRequests = new int[ size2 ] ;
- int const nSendRequest = mpi_access.sendRequestIds( size2 , ArrayOfSendRequests ) ;
+ int nSendRequest = mpi_access.sendRequestIds( size2 , ArrayOfSendRequests ) ;
for ( i = 0 ; i < nSendRequest ; i++ ) {
mpi_access.deleteRequest( ArrayOfSendRequests[i] ) ;
}
size2 = mpi_access.recvRequestIdsSize() ;
debugStream << "test" << myrank << " after WaitAll recvreqsize " << size2 << endl ;
int * ArrayOfRecvRequests = new int[ size2 ] ;
- int const nRecvRequest = mpi_access.recvRequestIds( size2 , ArrayOfRecvRequests ) ;
+ int nRecvRequest = mpi_access.recvRequestIds( size2 , ArrayOfRecvRequests ) ;
for ( i = 0 ; i < nRecvRequest ; i++ ) {
mpi_access.deleteRequest( ArrayOfRecvRequests[i] ) ;
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_ISend_IRecv_Length" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
return ;
}
- int const target = 1 - myrank ;
+ int target = 1 - myrank ;
int SendRequestId[maxreq] ;
int RecvRequestId[maxreq] ;
int sts ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_ISend_IRecv_Length_1" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_Probe" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "MPIAccessTest::test_MPI_Access_SendRecv" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
return ;
}
- int const target = 1 - myrank ;
+ int target = 1 - myrank ;
int sendRequestId[10] ;
int recvRequestId[10] ;
int sts ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_Send_Recv" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
return ;
}
- int const target = 1 - myrank ;
+ int target = 1 - myrank ;
int RequestId[10] ;
int sts ;
int i ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_Send_Recv_Length" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
return ;
}
- int const target = 1 - myrank ;
+ int target = 1 - myrank ;
int RequestId[10] ;
int sendbuf[9000] ;
int recvbuf[9000] ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
debugStream << "test_MPI_Access_Time" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
MEDCoupling::MPIAccess mpi_access( group ) ;
MEDCoupling::TimeMessage aSendTimeMsg[maxreq] ;
MEDCoupling::TimeMessage aRecvTimeMsg[maxreq] ;
double t ;
- double const dt = 1. ;
- double const maxt = 10. ;
+ double dt = 1. ;
+ double maxt = 10. ;
for ( t = 0 ; t < maxt ; t = t+dt ) {
if ( myrank == 0 ) {
aSendTimeMsg[i].time = t ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <sstream>
+#include <string>
+#include <vector>
+#include <map>
#include <iostream>
#include <mpi.h>
-#include "CommInterface.hxx"
#include "MPIAccessTest.hxx"
#include <cppunit/TestAssert.h>
//#include "ProcessorGroup.hxx"
//#include "MPIProcessorGroup.hxx"
#include "MPIAccess.hxx"
-#include "MPIProcessorGroup.hxx"
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
#define maxreq 100
double t ;
- double const dt[2] = {2., 1.} ;
- double const maxt = maxreq/dt[myrank] ;
+ double dt[2] = {2., 1.} ;
+ double maxt = maxreq/dt[myrank] ;
debugStream << "test_MPI_Access_Time_0 rank" << myrank << endl ;
- MEDCoupling::CommInterface const interface ;
+ MEDCoupling::CommInterface interface ;
- auto* group = new MEDCoupling::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- auto * mpi_access = new MEDCoupling::MPIAccess( group ) ;
+ MEDCoupling::MPIAccess * mpi_access = new MEDCoupling::MPIAccess( group ) ;
if ( myrank >= 2 ) {
debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ;
//CheckSent
//=========
int sendrequests[2*maxreq] ;
- int const sendreqsize = mpi_access->sendRequestIds( target , 2*maxreq ,
+ int sendreqsize = mpi_access->sendRequestIds( target , 2*maxreq ,
sendrequests ) ;
int j , flag ;
for ( j = 0 ; j < sendreqsize ; j++ ) {
}
mpi_access->deleteRequest( RecvTimeRequestId[lasttime] ) ;
- double const deltatime = aRecvTimeMsg[lasttime].deltatime ;
+ double deltatime = aRecvTimeMsg[lasttime].deltatime ;
//double maxtime = aRecvTimeMsg[lasttime].maxtime ;
double nexttime = aRecvTimeMsg[lasttime].time + deltatime ;
debugStream << "test" << myrank << " t " << t << " lasttime " << lasttime
//==============
debugStream << "test" << myrank << " CheckFinalSent :" << endl ;
int sendrequests[2*maxreq] ;
- int const sendreqsize = mpi_access->sendRequestIds( target , 2*maxreq , sendrequests ) ;
+ int sendreqsize = mpi_access->sendRequestIds( target , 2*maxreq , sendrequests ) ;
int j ;
for ( j = 0 ; j < sendreqsize ; j++ ) {
sts = mpi_access->wait( sendrequests[j] ) ;
else {
debugStream << "test" << myrank << " CheckFinalRecv :" << endl ;
int recvrequests[2*maxreq] ;
- int const recvreqsize = mpi_access->recvRequestIds( target , 2*maxreq , recvrequests ) ;
+ int recvreqsize = mpi_access->recvRequestIds( target , 2*maxreq , recvrequests ) ;
int cancelflag ;
int j ;
for ( j = 0 ; j < recvreqsize ; j++ ) {
#define _MPIMAINTEST_HXX_
#include <cppunit/CompilerOutputter.h>
-#include <cppunit/Portability.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
+#include <cppunit/TextTestProgressListener.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestRunner.h>
-#include <sstream>
+#include <stdexcept>
#include <mpi.h>
// --- Run the tests.
- bool const wasSucessful = result.wasSuccessful();
+ bool wasSucessful = result.wasSuccessful();
testFile.close();
// --- Return error code 1 if the one of test failed.
//
#include "ParaMEDMEMTest.hxx"
+#include "TestInterpKernelUtils.hxx"
+#include <cppunit/TestAssert.h>
+#include <sstream>
#include <cmath>
+#include <list>
#include <stdexcept>
#include <stdlib.h>
-#include <string>
-#include <list>
#ifndef WIN32
#include <unistd.h>
std::string ParaMEDMEMTest::getTmpDirectory()
{
- std::string const path;
+ std::string path;
std::list<std::string> dirs;
if ( getenv("TMP") ) dirs.push_back( getenv("TMP" ));
#ifndef _ParaMEDMEMTEST_HXX_
#define _ParaMEDMEMTEST_HXX_
-#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
+#include <set>
#include <string>
#include <iostream>
#include "mpi.h"
public:
ParaMEDMEMTest():CppUnit::TestFixture(){}
- ~ParaMEDMEMTest() override= default;
- void setUp() override{}
- void tearDown() override{}
+ ~ParaMEDMEMTest(){}
+ void setUp(){}
+ void tearDown(){}
void testMPIProcessorGroup_constructor();
void testMPIProcessorGroup_boolean();
void testMPIProcessorGroup_rank();
class ParaMEDMEMTest_TmpFilesRemover
{
public:
- ParaMEDMEMTest_TmpFilesRemover() = default;
+ ParaMEDMEMTest_TmpFilesRemover() {}
~ParaMEDMEMTest_TmpFilesRemover();
bool Register(const std::string theTmpFile);
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestAssert.h>
#include <cppunit/extensions/HelperMacros.h>
-#include "MCIdType.hxx"
-#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingNatureOfFieldEnum"
#include "MPI2Connector.hxx"
-#include "NormalizedGeometricTypes"
#include "ParaMESH.hxx"
#include "ParaFIELD.hxx"
#include "MEDCouplingUMesh.hxx"
+#include "MEDCouplingFieldDouble.hxx"
#include "InterpKernelDEC.hxx"
#include "MPIProcessorGroup.hxx"
#include "CommInterface.hxx"
#include <mpi.h>
#include <iostream>
-#include <sstream>
#include <stdlib.h>
-#include <string>
class MPI2ParaMEDMEMTest : public CppUnit::TestFixture
{
MPI_Comm gcom;
std::string service = "SERVICE";
std::ostringstream meshfilename, meshname;
- MEDCoupling::ParaMESH *paramesh=nullptr;
+ MEDCoupling::ParaMESH *paramesh=0;
MEDCoupling::MEDCouplingUMesh *mesh;
- MEDCoupling::ParaFIELD *parafield=nullptr;
+ MEDCoupling::ParaFIELD *parafield=0;
MEDCoupling::CommInterface *interface;
MEDCoupling::MPIProcessorGroup *source, *target;
}
/* Connection to remote program */
- auto *mpio = new MPI2Connector;
+ MPI2Connector *mpio = new MPI2Connector;
gcom = mpio->remoteMPI2Connect(service);
MPI_Comm_size( gcom, &gsize );
MPI_Comm_rank( gcom, &grank );
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*source,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *value=parafield->getField()->getArray()->getPointer();
value[0]=34+13*((double)grank);
CPPUNIT_TEST_SUITE_REGISTRATION( MPI2ParaMEDMEMTest );
+#include "MPIMainTest.hxx"
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestAssert.h>
#include <cppunit/extensions/HelperMacros.h>
-#include "MCIdType.hxx"
-#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingNatureOfFieldEnum"
#include "MPI2Connector.hxx"
-#include "NormalizedGeometricTypes"
#include "ParaMESH.hxx"
#include "ParaFIELD.hxx"
#include "MEDCouplingUMesh.hxx"
+#include "MEDCouplingFieldDouble.hxx"
#include "InterpKernelDEC.hxx"
#include "MPIProcessorGroup.hxx"
#include "CommInterface.hxx"
#include <mpi.h>
#include <iostream>
-#include <sstream>
#include <stdlib.h>
-#include <string>
class MPI2ParaMEDMEMTest : public CppUnit::TestFixture
{
MPI_Comm gcom;
std::string service = "SERVICE";
std::ostringstream meshfilename, meshname;
- MEDCoupling::ParaMESH *paramesh=nullptr;
+ MEDCoupling::ParaMESH *paramesh=0;
MEDCoupling::MEDCouplingUMesh* mesh;
- MEDCoupling::ParaFIELD *parafield=nullptr;
+ MEDCoupling::ParaFIELD *parafield=0;
MEDCoupling::CommInterface* interface;
MEDCoupling::MPIProcessorGroup* source, *target;
}
/* Connection to remote program */
- auto *mpio = new MPI2Connector;
+ MPI2Connector *mpio = new MPI2Connector;
gcom = mpio->remoteMPI2Connect(service);
MPI_Comm_size( gcom, &gsize );
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target,"target mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
MEDCoupling::InterpKernelDEC dec(*source,*target);
CPPUNIT_TEST_SUITE_REGISTRATION( MPI2ParaMEDMEMTest );
+#include "MPIMainTest.hxx"
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MCIdType.hxx"
#include "ParaMEDMEMTest.hxx"
#include <cppunit/TestAssert.h>
+#include "InterpolationUtils.hxx"
#include "CommInterface.hxx"
+#include "ProcessorGroup.hxx"
#include "MPIProcessorGroup.hxx"
+#include "Topology.hxx"
#include "BlockTopology.hxx"
-#include <utility>
+#include <string>
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
MPI_Comm_size(MPI_COMM_WORLD,&size);
int rank;
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
- CommInterface const interface;
- MPIProcessorGroup const group(interface);
+ CommInterface interface;
+ MPIProcessorGroup group(interface);
BlockTopology blocktopo(group,1);
CPPUNIT_ASSERT_EQUAL(ToIdType(1),blocktopo.getNbLocalElements());
CPPUNIT_ASSERT_EQUAL(ToIdType(size),blocktopo.getNbElements());
MPI_Comm_size(MPI_COMM_WORLD,&size);
int rank;
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
- CommInterface const interface;
- MPIProcessorGroup const group(interface);
+ CommInterface interface;
+ MPIProcessorGroup group(interface);
BlockTopology blocktopo(group,3);
//testing the serialization process that is used to transfer a
#include "ParaMEDMEMTest.hxx"
#include <cppunit/TestAssert.h>
#include "CommInterface.hxx"
+#include "ProcessorGroup.hxx"
#include "ByStringMPIProcessorGroup.hxx"
#include <string>
void ParaMEDMEMTest::testByStringMPIProcessorGroup_constructor()
{
- CommInterface const comm_interface;
- auto* group = new ByStringMPIProcessorGroup(comm_interface);
+ CommInterface comm_interface;
+ ByStringMPIProcessorGroup* group = new ByStringMPIProcessorGroup(comm_interface);
int size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
CPPUNIT_ASSERT_EQUAL(size,group->size());
else
myTag = "gr1";
- CommInterface const comm_interface;
+ CommInterface comm_interface;
ByStringMPIProcessorGroup * group = new ByStringMPIProcessorGroup(comm_interface,myTag,MPI_COMM_WORLD);
- auto * copygroup = new ByStringMPIProcessorGroup(*group);
+ ByStringMPIProcessorGroup * copygroup = new ByStringMPIProcessorGroup(*group);
CPPUNIT_ASSERT(group);
CPPUNIT_ASSERT(copygroup);
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MEDCouplingMemArray.hxx"
-#include "MCIdType.hxx"
-#include "NormalizedGeometricTypes"
-#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingNatureOfFieldEnum"
#include "ParaMEDMEMTest.hxx"
#include "CommInterface.hxx"
+#include "ProcessorGroup.hxx"
#include "MPIProcessorGroup.hxx"
#include "InterpKernelDEC.hxx"
#include "MEDCouplingUMesh.hxx"
#include "ParaFIELD.hxx"
#include "ComponentTopology.hxx"
-#include <cppunit/TestAssert.h>
+#include <set>
using namespace MEDCoupling;
//
if(size!=3)
return ;
- int const procs_source_c[1]={0};
+ int procs_source_c[1]={0};
std::set<int> procs_source(procs_source_c,procs_source_c+1);
- int const procs_target_c[1]={1};
+ int procs_target_c[1]={1};
std::set<int> procs_target(procs_target_c,procs_target_c+1);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafield=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- MEDCoupling::CommInterface const interface;
+ MEDCoupling::CommInterface interface;
//
MPI_Barrier(MPI_COMM_WORLD);
double targetCoords[8]={ 0.,0., 1., 0., 0., 1., 1., 1. };
- CommInterface const comm;
+ CommInterface comm;
//
- auto *dec=new MEDCoupling::InterpKernelDEC(procs_source,procs_target);
+ MEDCoupling::InterpKernelDEC *dec=new MEDCoupling::InterpKernelDEC(procs_source,procs_target);
if(dec->isInSourceSide())
{
mesh=MEDCouplingUMesh::New();
mesh->allocateCells(1);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
mesh->finishInsertingCells();
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getSourceGrp(),"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+3);
mesh->finishInsertingCells();
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getTargetGrp(),"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
//
if(size!=3)
return ;
- int const procs_source_c[1]={2};//difference with testFabienAPI1
+ int procs_source_c[1]={2};//difference with testFabienAPI1
std::set<int> procs_source(procs_source_c,procs_source_c+1);
- int const procs_target_c[1]={1};
+ int procs_target_c[1]={1};
std::set<int> procs_target(procs_target_c,procs_target_c+1);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafield=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- MEDCoupling::CommInterface const interface;
+ MEDCoupling::CommInterface interface;
//
MPI_Barrier(MPI_COMM_WORLD);
double targetCoords[8]={ 0.,0., 1., 0., 0., 1., 1., 1. };
- CommInterface const comm;
+ CommInterface comm;
//
- auto *dec=new MEDCoupling::InterpKernelDEC(procs_source,procs_target);
+ MEDCoupling::InterpKernelDEC *dec=new MEDCoupling::InterpKernelDEC(procs_source,procs_target);
if(dec->isInSourceSide())
{
mesh=MEDCouplingUMesh::New();
mesh->allocateCells(1);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
mesh->finishInsertingCells();
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getSourceGrp(),"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+3);
mesh->finishInsertingCells();
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getTargetGrp(),"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MEDCouplingMemArray.hxx"
-#include "MCAuto.hxx"
-#include "MCIdType.hxx"
-#include "NormalizedGeometricTypes"
-#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingNatureOfFieldEnum"
-#include "InterpKernelException.hxx"
-#include "InterpolationOptions.hxx"
#include "ParaMEDMEMTest.hxx"
#include <cppunit/TestAssert.h>
#include "ComponentTopology.hxx"
#include "BlockTopology.hxx"
-#include <cstddef>
-#include <sstream>
+#include <set>
+#include <time.h>
#include <iostream>
#include <assert.h>
#include <string>
{1.,1.,1e200,1e200},
{20.5,1.,1e200,1e200}
};
- int const expectedLgth[8]={4,4,2,2,4,4,2,2};
+ int expectedLgth[8]={4,4,2,2,4,4,2,2};
for (int send=0;send<2;send++)
for (int rec=0;rec<2;rec++)
{
InterpKernelDEC dec_emetteur(emetteur_group, recepteur_group);
- MEDCoupling::ParaFIELD *champ_emetteur(nullptr),*champ_recepteur(nullptr);
- MEDCoupling::ParaMESH *paramesh(nullptr);
+ MEDCoupling::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
+ MEDCoupling::ParaMESH *paramesh(0);
MCAuto<MEDCouplingUMesh> mesh;
dec_emetteur.setOrientation(2);
if (send==0)
mesh=init_triangleGauthier1(is_master);
}
paramesh=new MEDCoupling::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"emetteur mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
champ_emetteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
champ_emetteur->getField()->setNature(IntensiveMaximum);
champ_emetteur->setOwnSupport(true);
//bool ok=false; // Is the time interval successfully solved ?
// Loop on the time interval tries
- if(true) {
+ if(1) {
if (cas=="emetteur")
void ParaMEDMEMTest::testGauthier2()
{
std::cout << "testGauthier2\n";
- double const valuesExpected1[2]={0.,0.};
- double const valuesExpected2[2]={0.95,0.970625};
+ double valuesExpected1[2]={0.,0.};
+ double valuesExpected2[2]={0.95,0.970625};
double valuesExpected30[]={0., 0., 0.05, 0., 0., 0.15, 0., 0., 0.25, 0., 0., 0.35, 0., 0., 0.45, 0., 0., 0.55, 0., 0., 0.65, 0., 0., 0.75, 0., 0., 0.85, 0., 0., 0.95};
double valuesExpected31[]={0., 0., 0.029375, 0., 0., 0.029375, 0., 0., 0.1, 0., 0., 0.1, 0., 0., 0.2, 0., 0., 0.2, 0., 0., 0.3, 0., 0., 0.3, 0., 0., 0.4, 0., 0., 0.4, 0., 0., 0.5, 0., 0., 0.5, 0., 0., 0.6, 0., 0., 0.6, 0., 0., 0.7, 0., 0., 0.7, 0., 0., 0.8, 0., 0., 0.8, 0., 0., 0.9, 0., 0., 0.9, 0., 0., 0.970625, 0., 0., 0.970625 };
MPIProcessorGroup entree_chaude_group(comm,entree_chaude_ids);
MPIProcessorGroup Genepi_group(comm,Genepi_ids);
- MEDCoupling::ParaFIELD *vitesse(nullptr);
+ MEDCoupling::ParaFIELD *vitesse(0);
InterpKernelDEC dec_vit_in_chaude(entree_chaude_group, Genepi_group);
if ( entree_chaude_group.containsMyRank())
arr=DataArrayDouble::New(); arr->alloc(63,3);
std::copy(valsOfField,valsOfField+189,arr->getPointer());
f->setArray(arr); f->setNature(IntensiveMaximum);
- auto *paramesh(new MEDCoupling::ParaMESH(mesh,entree_chaude_group,"emetteur mesh"));
+ MEDCoupling::ParaMESH *paramesh(new MEDCoupling::ParaMESH(mesh,entree_chaude_group,"emetteur mesh"));
vitesse=new MEDCoupling::ParaFIELD(f,paramesh,entree_chaude_group);
vitesse->setOwnSupport(true);
dec_vit_in_chaude.setMethod("P1");
f->setMesh(mesh); f->setName("vitesse_in_chaude");
arr=DataArrayDouble::New(); arr->alloc(f->getNumberOfTuplesExpected()*3); arr->fillWithZero(); arr->rearrange(3);
f->setArray(arr); f->setNature(IntensiveMaximum);
- auto *paramesh(new MEDCoupling::ParaMESH(mesh,Genepi_group,"recepteur mesh"));
+ MEDCoupling::ParaMESH *paramesh(new MEDCoupling::ParaMESH(mesh,Genepi_group,"recepteur mesh"));
vitesse=new MEDCoupling::ParaFIELD(f,paramesh,Genepi_group);
vitesse->setOwnSupport(true);
dec_vit_in_chaude.setMethod(f->getDiscretization()->getRepr());
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected1[type],pmin,1e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected2[type],pmax,1e-12);
- std::size_t const nbCompo(vitesse->getField()->getNumberOfComponents());
+ std::size_t nbCompo(vitesse->getField()->getNumberOfComponents());
p=vitesse->getField()->getArray()->begin();
for(int i=0;i<vitesse->getField()->getNumberOfTuples();i++)
for(std::size_t c=0;c<nbCompo;c++,p++)
{1.,1.,1e200,1e200},
{20.5,1.,1e200,1e200}
};
- int const expectedLgth[8]={4,4,2,2,4,4,2,2};
+ int expectedLgth[8]={4,4,2,2,4,4,2,2};
for (int send=0;send<2;send++)
for (int rec=0;rec<2;rec++)
else
decu[0] = InterpKernelDEC(emetteur_group,recepteur_group);
InterpKernelDEC& dec_emetteur=decu[0];
- MEDCoupling::ParaFIELD *champ_emetteur(nullptr),*champ_recepteur(nullptr);
- MEDCoupling::ParaMESH *paramesh(nullptr);
+ MEDCoupling::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
+ MEDCoupling::ParaMESH *paramesh(0);
MCAuto<MEDCouplingUMesh> mesh;
dec_emetteur.setOrientation(2);
if (send==0)
if (cas!="vide")
{
paramesh=new MEDCoupling::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"emetteur mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
champ_emetteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
champ_emetteur->getField()->setNature(IntensiveMaximum);
champ_emetteur->setOwnSupport(true);
//bool ok=false; // Is the time interval successfully solved ?
// Loop on the time interval tries
- if(true) {
+ if(1) {
if (cas=="emetteur")
//
if(size!=3)
return ;
- int const nproc_source = 1;
+ int nproc_source = 1;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
procs_target.insert(i);
self_procs.insert(rank);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD* parafield=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD* parafield=0;
//
MEDCoupling::CommInterface interface;
//
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh,comptopo);
double *value=parafield->getField()->getArray()->getPointer();
std::copy(sourceVals,sourceVals+19,value);
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
}
else if(rank==2)
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
}
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MCAuto.hxx"
-#include "MEDCouplingMemArray.hxx"
-#include "MCIdType.hxx"
-#include "NormalizedGeometricTypes"
-#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingNatureOfFieldEnum"
#include "ParaMEDMEMTest.hxx"
#include "CommInterface.hxx"
+#include "ProcessorGroup.hxx"
#include "MPIProcessorGroup.hxx"
#include "ComponentTopology.hxx"
#include "ParaMESH.hxx"
#include "MEDCouplingUMesh.hxx"
+#include <set>
#include <string>
#include <time.h>
#include <iostream>
using namespace MEDCoupling;
using namespace ICoCo;
-using synctype = enum {sync_and,sync_or};
+typedef enum {sync_and,sync_or} synctype;
void synchronize_bool(bool& stop, synctype s)
{
int my_stop;
- int const my_stop_temp = stop?1:0;
+ int my_stop_temp = stop?1:0;
if (s==sync_and)
MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MIN,MPI_COMM_WORLD);
else // if (s==sync_or)
void synchronize_dt(double& dt)
{
- double const dttemp=dt;
+ double dttemp=dt;
MPI_Allreduce(&dttemp,&dt,1,MPI_DOUBLE,MPI_MIN,MPI_COMM_WORLD);
}
InterpKernelDEC dec_emetteur(emetteur_group,recepteur_group);
dec_emetteur.setOrientation(2);
- MEDCoupling::ParaFIELD *champ_emetteur(nullptr),*champ_recepteur(nullptr);
- MEDCoupling::ParaMESH *paramesh(nullptr);
+ MEDCoupling::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
+ MEDCoupling::ParaMESH *paramesh(0);
if (cas=="emetteur")
{
MCAuto<MEDCoupling::MEDCouplingUMesh> mesh_emetteur(init_triangle());
paramesh=new MEDCoupling::ParaMESH(mesh_emetteur,emetteur_group,"emetteur mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
champ_emetteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
champ_emetteur->getField()->setNature(IntensiveMaximum);
champ_emetteur->setOwnSupport(true);
{
MCAuto<MEDCoupling::MEDCouplingUMesh> mesh_recepteur(init_quad());
paramesh=new MEDCoupling::ParaMESH(mesh_recepteur,recepteur_group,"recepteur mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
champ_recepteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
champ_recepteur->getField()->setNature(IntensiveMaximum);
champ_recepteur->setOwnSupport(true);
MPI_Barrier(MPI_COMM_WORLD);
- clock_t const clock0(clock());
+ clock_t clock0(clock());
int compti=0;
bool init(true),stop(false);
while(!stop)
{
compti++;
- clock_t const clocki= clock ();
+ clock_t clocki= clock ();
cout << compti << " CLOCK " << (clocki-clock0)*1.e-6 << endl;
for (int non_unif=0;non_unif<2;non_unif++)
{
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MCIdType.hxx"
-#include "NormalizedGeometricTypes"
-#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingNatureOfFieldEnum"
-#include "MCAuto.hxx"
-#include "MCType.hxx"
-#include "DECOptions.hxx"
#include "ParaMEDMEMTest.hxx"
#include <cppunit/TestAssert.h>
#include "TestInterpKernelUtils.hxx"
-#include <sstream>
-#include <iostream>
-#include <cstdlib>
#include <string>
+#include <iterator>
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
//
if(size!=5)
return ;
- int const nproc_source = 3;
+ int nproc_source = 3;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
procs_target.insert(i);
self_procs.insert(rank);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafieldP0=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
MEDCoupling::CommInterface interface;
//
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
parafieldP0->getField()->setNature(IntensiveMaximum);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP0->getField()->setNature(IntensiveMaximum);
}
//
if(size!=5)
return ;
- int const nproc_source = 3;
+ int nproc_source = 3;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
procs_target.insert(i);
self_procs.insert(rank);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafieldP0=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
MEDCoupling::CommInterface interface;
//
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
parafieldP0->getField()->setNature(IntensiveMaximum);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP0->getField()->setNature(IntensiveMaximum);
}
void ParaMEDMEMTest::testInterpKernelDEC_2D_(const char *srcMeth, const char *targetMeth)
{
- std::string const srcM(srcMeth);
- std::string const targetM(targetMeth);
+ std::string srcM(srcMeth);
+ std::string targetM(targetMeth);
int size;
int rank;
MPI_Comm_size(MPI_COMM_WORLD,&size);
//the test is meant to run on five processors
if (size !=5) return ;
- int const nproc_source = 3;
+ int nproc_source = 3;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
MEDCoupling::ParaFIELD* parafield = nullptr;
ICoCo::MEDDoubleField* icocofield = nullptr;
- string const filename_xml1 = "square1_split";
- string const filename_xml2 = "square2_split";
+ string filename_xml1 = "square1_split";
+ string filename_xml2 = "square2_split";
//string filename_seq_wr = makeTmpFile("");
//string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med");
MPI_Barrier(MPI_COMM_WORLD);
if (source_group->containsMyRank())
{
- string const master = filename_xml1;
+ string master = filename_xml1;
ostringstream strstream;
strstream <<master<<rank+1<<".med";
- string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
// MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
//loading the geometry for the target group
if (target_group->containsMyRank())
{
- string const master= filename_xml2;
+ string master= filename_xml2;
ostringstream strstream;
strstream << master<<(rank-nproc_source+1)<<".med";
- string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
// MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
void ParaMEDMEMTest::testInterpKernelDEC2_2D_(const char *srcMeth, const char *targetMeth)
{
- std::string const srcM(srcMeth);
- std::string const targetM(targetMeth);
+ std::string srcM(srcMeth);
+ std::string targetM(targetMeth);
int size;
int rank;
MPI_Comm_size(MPI_COMM_WORLD,&size);
//the test is meant to run on five processors
if (size !=5) return ;
- int const nproc_source = 3;
+ int nproc_source = 3;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
MEDCoupling::MEDCouplingUMesh* mesh = nullptr;
MEDCoupling::MEDCouplingFieldDouble* mcfield = nullptr;
- string const filename_xml1 = "square1_split";
- string const filename_xml2 = "square2_split";
+ string filename_xml1 = "square1_split";
+ string filename_xml2 = "square2_split";
// To remove tmp files from disk
- ParaMEDMEMTest_TmpFilesRemover const aRemover;
+ ParaMEDMEMTest_TmpFilesRemover aRemover;
MPI_Barrier(MPI_COMM_WORLD);
if (source_group->containsMyRank())
{
- string const master = filename_xml1;
+ string master = filename_xml1;
ostringstream strstream;
strstream <<master<<rank+1<<".med";
- string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
mcfield = MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
//loading the geometry for the target group
if (target_group->containsMyRank())
{
- string const master= filename_xml2;
+ string master= filename_xml2;
ostringstream strstream;
strstream << master<<(rank-nproc_source+1)<<".med";
- string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
mcfield = MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
void ParaMEDMEMTest::testInterpKernelDEC_3D_(const char *srcMeth, const char *targetMeth)
{
- std::string const srcM(srcMeth);
- std::string const targetM(targetMeth);
+ std::string srcM(srcMeth);
+ std::string targetM(targetMeth);
int size;
int rank;
MPI_Comm_size(MPI_COMM_WORLD,&size);
//the test is meant to run on five processors
if (size !=3) return ;
- int const nproc_source = 2;
+ int nproc_source = 2;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
char * tmp_dir_c = getenv("TMP");
string tmp_dir;
- if (tmp_dir_c != nullptr)
+ if (tmp_dir_c != NULL)
tmp_dir = string(tmp_dir_c);
else
tmp_dir = "/tmp";
- string const filename_xml1 = "Mesh3D_10_2d";
- string const filename_xml2 = "Mesh3D_11";
+ string filename_xml1 = "Mesh3D_10_2d";
+ string filename_xml2 = "Mesh3D_11";
//string filename_seq_wr = makeTmpFile("");
//string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med");
MPI_Barrier(MPI_COMM_WORLD);
if (source_group->containsMyRank())
{
- string const master = filename_xml1;
+ string master = filename_xml1;
ostringstream strstream;
strstream <<master<<rank+1<<".med";
- std::string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ std::string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<< rank+1;
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
// MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
//loading the geometry for the target group
if (target_group->containsMyRank())
{
- string const master= filename_xml2;
+ string master= filename_xml2;
ostringstream strstream;
strstream << master << ".med";
- std::string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ std::string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_6";
mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
// MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
//
if(size!=5)
return ;
- int const nproc_source = 2;
+ int nproc_source = 2;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
procs_target.insert(i);
self_procs.insert(rank);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD* parafield=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD* parafield=0;
//
MEDCoupling::CommInterface interface;
//
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *value=parafield->getField()->getArray()->getPointer();
value[0]=34+13*((double)rank);
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
}
//test 1 - Conservative volumic
//
if(size!=5)
return ;
- int const nproc_source = 2;
+ int nproc_source = 2;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
procs_target.insert(i);
self_procs.insert(rank);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafieldP0=nullptr,*parafieldP1=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0,*parafieldP1=0;
//
MEDCoupling::CommInterface interface;
//
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP1 = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
std::copy(globalNumberingP4.begin(), globalNumberingP4.end(), da->rwBegin());
paramesh->setNodeGlobal(da);
}
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP1 = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
parafieldP0->getField()->setNature(IntensiveMaximum);
//
if(size!=3)
return ;
- int const nproc_source=2;
+ int nproc_source=2;
set<int> procs_source;
set<int> procs_target;
//
for (int i=nproc_source;i<size; i++)
procs_target.insert(i);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafield=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
MEDCoupling::CommInterface interface;
//
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn+7);
mesh->finishInsertingCells();
}
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
else
{
mesh=MEDCouplingUMesh::New("an example of -1 D mesh",-1);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*target_group,"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
procs_source.insert(0);
procs_target.insert(1);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafield=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
MEDCoupling::CommInterface interface;
//
MPI_Barrier(MPI_COMM_WORLD);
double targetCoords[8]={ 0.,0., 1., 0., 0., 1., 1., 1. };
- CommInterface const comm;
+ CommInterface comm;
int grpIds[2]={0,1};
MPI_Group grp,group_world;
comm.commGroup(MPI_COMM_WORLD,&group_world);
MPI_Comm partialComm;
comm.commCreate(MPI_COMM_WORLD,grp,&partialComm);
//
- ProcessorGroup* target_group=nullptr;
- ProcessorGroup* source_group=nullptr;
+ ProcessorGroup* target_group=0;
+ ProcessorGroup* source_group=0;
//
- MEDCoupling::InterpKernelDEC *dec=nullptr;
+ MEDCoupling::InterpKernelDEC *dec=0;
if(rank==0 || rank==1)
{
target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target,partialComm);
mesh->allocateCells(1);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
mesh->finishInsertingCells();
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+3);
mesh->finishInsertingCells();
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*target_group,"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafield->getField()->setNature(IntensiveMaximum);
//
if(size!=3)
return ;
- int const nproc_source = 1;
+ int nproc_source = 1;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
procs_target.insert(i);
self_procs.insert(rank);
//
- MEDCoupling::MEDCouplingUMesh *mesh=nullptr;
- MEDCoupling::ParaMESH *paramesh=nullptr;
- MEDCoupling::ParaFIELD *parafieldP0=nullptr;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
MEDCoupling::CommInterface interface;
//
myCoords->decrRef();
//
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
parafieldP0->getField()->setNature(IntensiveMaximum);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP0->getField()->setNature(IntensiveMaximum);
}
double dtB, double tmaxB, bool WithPointToPoint, bool Asynchronous,
bool WithInterp, const char *srcMeth, const char *targetMeth)
{
- std::string const srcM(srcMeth);
- std::string const targetM(targetMeth);
+ std::string srcM(srcMeth);
+ std::string targetM(targetMeth);
int size;
int rank;
MPI_Comm_size(MPI_COMM_WORLD,&size);
//the test is meant to run on five processors
if (size !=5) return ;
- int const nproc_source = 3;
+ int nproc_source = 3;
set<int> self_procs;
set<int> procs_source;
set<int> procs_target;
char * tmp_dir_c = getenv("TMP");
string tmp_dir;
- if (tmp_dir_c != nullptr)
+ if (tmp_dir_c != NULL)
tmp_dir = string(tmp_dir_c);
else
tmp_dir = "/tmp";
- string const filename_xml1 = "square1_split";
- string const filename_xml2 = "square2_split";
+ string filename_xml1 = "square1_split";
+ string filename_xml2 = "square2_split";
//string filename_seq_wr = makeTmpFile("");
//string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med");
// To remove tmp files from disk
- ParaMEDMEMTest_TmpFilesRemover const aRemover;
+ ParaMEDMEMTest_TmpFilesRemover aRemover;
MPI_Barrier(MPI_COMM_WORLD);
if (source_group->containsMyRank())
{
- string const master = filename_xml1;
+ string master = filename_xml1;
ostringstream strstream;
strstream <<master<<rank+1<<".med";
- string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
// MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
//loading the geometry for the target group
if (target_group->containsMyRank())
{
- string const master= filename_xml2;
+ string master= filename_xml2;
ostringstream strstream;
strstream << master<<(rank-nproc_source+1)<<".med";
- string const fName = INTERP_TEST::getResourceFile(strstream.str());
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
// MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
cout << "testAsynchronousInterpKernelDEC_2D" << rank << " time " << time
<< " dtB " << dtB << " tmaxB " << tmaxB << endl ;
dec.recvData( time );
- double const vi = parafield->getVolumeIntegral(0,true);
+ double vi = parafield->getVolumeIntegral(0,true);
cout << "testAsynchronousInterpKernelDEC_2D" << rank << " time " << time
<< " VolumeIntegral " << vi
<< " time*10000 " << time*10000 << endl ;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MCAuto.hxx"
-#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingMemArray.hxx"
-#include "MCIdType.hxx"
-#include "NormalizedGeometricTypes"
#include "ParaMEDMEMTest.hxx"
#include "MEDLoader.hxx"
#include <cppunit/TestAssert.h>
#include <algorithm>
-#include <string>
+#include <numeric>
+#include <iostream>
+#include <iterator>
using namespace MEDCoupling;
else
distrib = { {INTERP_KERNEL::NORM_QUAD4,{2,3,6,7}} };
- std::string const filename=INTERP_TEST::getResourceFile("SimpleTest2D.med");
+ std::string filename=INTERP_TEST::getResourceFile("SimpleTest2D.med");
MCAuto<MEDFileUMesh> mu = ParaMEDFileUMesh::ParaNew(distrib, MPI_COMM_WORLD, MPI_INFO_NULL, filename, "mesh");
MCAuto<MEDCouplingUMesh> mesh = mu->getMeshAtLevel(0);
MCAuto<MEDCouplingUMesh> meshRef = genLocMesh2D(rank);
else
distrib= { {INTERP_KERNEL::NORM_TRI3,{0,1}} , {INTERP_KERNEL::NORM_QUAD4,{1,3}} };
- std::string const filename=INTERP_TEST::getResourceFile("Test2DMultiGeoType.med");
+ std::string filename=INTERP_TEST::getResourceFile("Test2DMultiGeoType.med");
MCAuto<MEDFileUMesh> mu = ParaMEDFileUMesh::ParaNew(distrib, MPI_COMM_WORLD, MPI_INFO_NULL, filename, "mesh");
MCAuto<MEDCouplingUMesh> mesh = mu->getMeshAtLevel(0);
MEDCouplingUMesh *meshRef;
distrib = { {INTERP_KERNEL::NORM_TETRA4,distribCells} };
}
- std::string const filename=INTERP_TEST::getResourceFile("SimpleTest3D.med");
+ std::string filename=INTERP_TEST::getResourceFile("SimpleTest3D.med");
MCAuto<MEDFileUMesh> mu = ParaMEDFileUMesh::ParaNew(distrib, MPI_COMM_WORLD, MPI_INFO_NULL, filename, "mesh");
MCAuto<MEDCouplingUMesh> mesh = mu->getMeshAtLevel(0);
CPPUNIT_ASSERT_EQUAL(96,(int)mesh->getNumberOfCells());
else
distrib = {2,3,6,7};
- std::string const filename=INTERP_TEST::getResourceFile("SimpleTest2D.med");
+ std::string filename=INTERP_TEST::getResourceFile("SimpleTest2D.med");
MCAuto<MEDFileField1TS> f1TS = ParaMEDFileField1TS::ParaNew(MPI_COMM_WORLD, MPI_INFO_NULL,filename,"fieldOnCells","mesh",distrib,ON_CELLS,INTERP_KERNEL::NORM_QUAD4);
MCAuto<MEDCouplingFieldDouble> fieldRef = genLocFieldCells(rank);
CPPUNIT_ASSERT(f1TS->getUndergroundDataArray()->isEqual(*fieldRef->getArray(),1e-12));
else
distrib = {2,3,4,7,8,9,12,13,14};
- std::string const filename=INTERP_TEST::getResourceFile("SimpleTest2D.med");
+ std::string filename=INTERP_TEST::getResourceFile("SimpleTest2D.med");
// for fields on nodes, geometrical type is not needed
MCAuto<MEDFileField1TS> f1TS = ParaMEDFileField1TS::ParaNew(MPI_COMM_WORLD, MPI_INFO_NULL,filename,"fieldOnNodes","mesh",distrib,ON_NODES,INTERP_KERNEL::NORM_ERROR);
MCAuto<MEDCouplingFieldDouble> fieldRef = genLocFieldNodes(rank);
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "InterpKernelException.hxx"
#include "ParaMEDMEMTest.hxx"
#include <cppunit/TestAssert.h>
#include "CommInterface.hxx"
#include "ProcessorGroup.hxx"
#include "MPIProcessorGroup.hxx"
+#include "InterpolationUtils.hxx"
+#include <string>
// use this define to enable lines, execution of which leads to Segmentation Fault
#define ENABLE_FAULTS
void ParaMEDMEMTest::testMPIProcessorGroup_constructor()
{
CommInterface comm_interface;
- auto* group = new MPIProcessorGroup(comm_interface);;
+ MPIProcessorGroup* group = new MPIProcessorGroup(comm_interface);;
int size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
CPPUNIT_ASSERT_EQUAL(size,group->size());
int size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
- CommInterface const comm_interface;
+ CommInterface comm_interface;
MPIProcessorGroup group(comm_interface,0,0);
MPIProcessorGroup group2(comm_interface,size-1,size-1);
ProcessorGroup* group_fuse=group.fuse(group2);
- int const group_fuse_size=(size==1)?1:2;
+ int group_fuse_size=(size==1)?1:2;
CPPUNIT_ASSERT_EQUAL(group_fuse_size,group_fuse->size());
ProcessorGroup* group_complement=((MPIProcessorGroup*)group_fuse)->createComplementProcGroup();
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- CommInterface const comm_interface;
+ CommInterface comm_interface;
MPIProcessorGroup group(comm_interface,0,0);
MPIProcessorGroup group2(comm_interface,size-1,size-1);
ProcessorGroup* group_fuse=group2.fuse(group);
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MEDCouplingNatureOfFieldEnum"
-#include "MCIdType.hxx"
-#include "NormalizedGeometricTypes"
-#include "MEDCouplingRefCountObject.hxx"
#include "ParaMEDMEMTest.hxx"
#include <cppunit/TestAssert.h>
#include "MEDCouplingUMesh.hxx"
+#include <set>
using namespace std;
#include "MCAuto.hxx"
#include "MEDLoader.hxx"
+#include "MEDLoaderBase.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingRemapper.hxx"
using namespace MEDCoupling;
-using MUMesh = MCAuto<MEDCouplingUMesh>;
-using MFDouble = MCAuto<MEDCouplingFieldDouble>;
-using DADouble = MCAuto<DataArrayDouble>;
+typedef MCAuto<MEDCouplingUMesh> MUMesh;
+typedef MCAuto<MEDCouplingFieldDouble> MFDouble;
+typedef MCAuto<DataArrayDouble> DADouble;
//void ParaMEDMEMTest::testOverlapDEC_LMEC_seq()
//{
bool stripPartOfSource=false,
int fieldCompoNum=1)
{
- MEDCouplingUMesh *meshS_0 = nullptr, *meshT_0 = nullptr;
+ MEDCouplingUMesh *meshS_0 = 0, *meshT_0 = 0;
prepareData2_buildOneSquare(meshS_0, meshT_0);
if(rank==0)
{
const double tr1[] = {1.5, 0.0};
- auto *meshS_1 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
+ MEDCouplingUMesh *meshS_1 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_1->translate(tr1);
const double tr2[] = {3.0, 0.0};
- auto *meshS_2 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
+ MEDCouplingUMesh *meshS_2 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_2->translate(tr2);
std::vector<const MEDCouplingUMesh*> vec;
meshS = MEDCouplingUMesh::MergeUMeshes(vec);
meshS_1->decrRef(); meshS_2->decrRef();
- ComponentTopology const comptopo(fieldCompoNum);
+ ComponentTopology comptopo(fieldCompoNum);
parameshS=new ParaMESH(meshS, *grp,"source mesh");
parafieldS=new ParaFIELD(ON_CELLS,ONE_TIME,parameshS,comptopo);
parafieldS->getField()->setNature(nature);
//
const double tr3[] = {0.0, -1.5};
- auto *meshT_3 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
+ MEDCouplingUMesh *meshT_3 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_3->translate(tr3);
vec.clear();
vec.push_back(meshT_0);vec.push_back(meshT_3);
if(rank==1)
{
const double tr3[] = {0.0, -1.5};
- auto *meshS_3 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
+ MEDCouplingUMesh *meshS_3 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_3->translate(tr3);
const double tr4[] = {1.5, -1.5};
- auto *meshS_4 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
+ MEDCouplingUMesh *meshS_4 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_4->translate(tr4);
std::vector<const MEDCouplingUMesh*> vec;
meshS = MEDCouplingUMesh::MergeUMeshes(vec);
meshS_3->decrRef(); meshS_4->decrRef();
- ComponentTopology const comptopo(fieldCompoNum);
+ ComponentTopology comptopo(fieldCompoNum);
parameshS=new ParaMESH(meshS, *grp,"source mesh");
parafieldS=new ParaFIELD(ON_CELLS,ONE_TIME,parameshS,comptopo);
parafieldS->getField()->setNature(nature);
//
const double tr5[] = {1.5, 0.0};
- auto *meshT_1 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
+ MEDCouplingUMesh *meshT_1 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_1->translate(tr5);
const double tr6[] = {3.0, 0.0};
- auto *meshT_2 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
+ MEDCouplingUMesh *meshT_2 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_2->translate(tr6);
const double tr7[] = {1.5, -1.5};
- auto *meshT_4 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
+ MEDCouplingUMesh *meshT_4 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_4->translate(tr7);
vec.clear();
// }
if (size != 3) return ;
- int const nproc = 3;
+ int nproc = 3;
std::set<int> procs;
for (int i=0; i<nproc; i++)
procs.insert(i);
- CommInterface const interface;
+ CommInterface interface;
OverlapDEC dec(procs);
- MEDCouplingFieldDouble * mcfieldS=nullptr, *mcfieldT=nullptr;
+ MEDCouplingFieldDouble * mcfieldS=0, *mcfieldT=0;
prepareData1(rank, IntensiveMaximum, mcfieldS, mcfieldT);
MPI_Comm_size(MPI_COMM_WORLD,&size);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
- int const nproc = 2;
+ int nproc = 2;
if (size != nproc) return ;
std::set<int> procs;
for (int i=0; i<nproc; i++)
procs.insert(i);
- CommInterface const interface;
+ CommInterface interface;
OverlapDEC dec(procs);
ProcessorGroup * grp = dec.getGroup();
- MEDCouplingUMesh* meshS=nullptr, *meshT=nullptr;
- ParaMESH* parameshS=nullptr, *parameshT=nullptr;
- ParaFIELD* parafieldS=nullptr, *parafieldT=nullptr;
+ MEDCouplingUMesh* meshS=0, *meshT=0;
+ ParaMESH* parameshS=0, *parameshT=0;
+ ParaFIELD* parafieldS=0, *parafieldT=0;
prepareData2(rank, grp, IntensiveMaximum, meshS, meshT, parameshS, parameshT, parafieldS, parafieldT);
MPI_Comm_size(MPI_COMM_WORLD,&size);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
- int const nproc = 2;
+ int nproc = 2;
if (size != nproc) return ;
std::set<int> procs;
for (int i=0; i<nproc; i++)
procs.insert(i);
- CommInterface const interface;
+ CommInterface interface;
OverlapDEC dec(procs);
ProcessorGroup * grp = dec.getGroup();
- MEDCouplingUMesh* meshS=nullptr, *meshT=nullptr;
- ParaMESH* parameshS=nullptr, *parameshT=nullptr;
- ParaFIELD* parafieldS=nullptr, *parafieldT=nullptr;
+ MEDCouplingUMesh* meshS=0, *meshT=0;
+ ParaMESH* parameshS=0, *parameshT=0;
+ ParaFIELD* parafieldS=0, *parafieldT=0;
// As before, except than one of the source cell is removed, and that the field now has 2 components
prepareData2(rank, grp, IntensiveMaximum, meshS, meshT, parameshS, parameshT, parafieldS, parafieldT,
dec.attachSourceLocalField(parafieldS);
dec.attachTargetLocalField(parafieldT);
- double const defVal = -300.0;
+ double defVal = -300.0;
dec.setDefaultValue(defVal);
dec.synchronize();
dec.sendRecvData(true);
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MEDCouplingRefCountObject.hxx"
-#include "MCIdType.hxx"
#include "ParaMEDMEMTest.hxx"
#include <cppunit/TestAssert.h>
#include "CommInterface.hxx"
+#include "ProcessorGroup.hxx"
#include "MPIProcessorGroup.hxx"
+#include "Topology.hxx"
#include "DEC.hxx"
#include "StructuredCoincidentDEC.hxx"
#include "ParaMESH.hxx"
#include "ParaFIELD.hxx"
#include "ComponentTopology.hxx"
+#include "ICoCoMEDDoubleField.hxx"
#include "MEDLoader.hxx"
#include "MEDCouplingUMesh.hxx"
#include "TestInterpKernelUtils.hxx"
-#include <sstream>
#include <string>
// use this define to enable lines, execution of which leads to Segmentation Fault
*/
void ParaMEDMEMTest::testStructuredCoincidentDEC() {
- string const testname="ParaMEDMEM - testStructured CoincidentDEC";
+ string testname="ParaMEDMEM - testStructured CoincidentDEC";
// MPI_Init(&argc, &argv);
int size;
int rank;
return;
}
- MEDCoupling::CommInterface const interface;
+ MEDCoupling::CommInterface interface;
MEDCoupling::MPIProcessorGroup self_group (interface,rank,rank);
MEDCoupling::MPIProcessorGroup target_group(interface,3,size-1);
MEDCoupling::ParaMESH* paramesh = nullptr;
MEDCoupling::ParaFIELD* parafield = nullptr;
- string const filename_xml1 = INTERP_TEST::getResourceFile("square1_split");
- string const filename_2 = INTERP_TEST::getResourceFile("square1.med");
+ string filename_xml1 = INTERP_TEST::getResourceFile("square1_split");
+ string filename_2 = INTERP_TEST::getResourceFile("square1.med");
//string filename_seq_wr = makeTmpFile("");
//string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med");
// To remove tmp files from disk
- ParaMEDMEMTest_TmpFilesRemover const aRemover;
+ ParaMEDMEMTest_TmpFilesRemover aRemover;
//loading the geometry for the source group
MPI_Barrier(MPI_COMM_WORLD);
if (source_group.containsMyRank()) {
- string const master = filename_xml1;
+ string master = filename_xml1;
ostringstream strstream;
strstream <<master<<rank+1<<".med";
paramesh=new ParaMESH (mesh,source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo(6);
+ MEDCoupling::ComponentTopology comptopo(6);
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- int const nb_local=mesh->getNumberOfCells();
+ int nb_local=mesh->getNumberOfCells();
const mcIdType* global_numbering = paramesh->getGlobalNumberingCell();
double *value=parafield->getField()->getArray()->getPointer();
//loading the geometry for the target group
if (target_group.containsMyRank()) {
- string const meshname2("Mesh_2");
+ string meshname2("Mesh_2");
mesh = ReadUMeshFromFile(filename_2.c_str(),meshname2.c_str(),0);
paramesh=new ParaMESH (mesh,self_group,"target mesh");
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- int const nb_local=mesh->getNumberOfCells();
+ int nb_local=mesh->getNumberOfCells();
double *value=parafield->getField()->getArray()->getPointer();
for (int ielem=0; ielem<nb_local; ielem++)
for (int icomp=0; icomp<comptopo.nbLocalComponents(); icomp++)
//checking validity of field
const double* recv_value = parafield->getField()->getArray()->getPointer();
for (int i=0; i< nb_local; i++) {
- int const first = comptopo.firstLocalComponent();
+ int first = comptopo.firstLocalComponent();
for (int icomp = 0; icomp < comptopo.nbLocalComponents(); icomp++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(recv_value[i*comptopo.nbLocalComponents()+icomp],(double)(i*6+icomp+first),1e-12);
}
// --- include all MEDMEM Test
//
#include "ParaMEDMEMTest.hxx"
-#include <cppunit/extensions/HelperMacros.h>
// --- Registers the fixture into the 'registry'
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <cstdlib>
-#include <iostream>
-#include <sstream>
-#include <bits/types/struct_timeval.h>
#include <time.h>
#include <sys/times.h>
#include <sys/time.h>
-#include "InterpolationOptions.hxx"
-#include "MEDCouplingRefCountObject.hxx"
-#include "DECOptions.hxx"
#include "ParaMEDMEMTest.hxx"
+#include <cppunit/TestAssert.h>
#include "CommInterface.hxx"
#include "ProcessorGroup.hxx"
void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1,
const string& filename_xml2, const string& meshname2,
- int nproc_source, double /*epsilon*/, bool tri, bool all)
+ int nproc_source, double epsilon, bool tri, bool all)
{
float tcpu, tcpu_u, tcpu_s, telps;
int size;
ICoCo::MEDDoubleField* icocofield = nullptr;
// To remove tmp files from disk
- ParaMEDMEMTest_TmpFilesRemover const aRemover;
+ ParaMEDMEMTest_TmpFilesRemover aRemover;
MPI_Barrier(MPI_COMM_WORLD);
if (source_group->containsMyRank()){
- string const master = filename_xml1;
+ string master = filename_xml1;
- ostringstream const strstream;
+ ostringstream strstream;
if( nproc_source == 1 )
strstream <<master<<".med";
else
strstream <<master<<rank+1<<".med";
- ostringstream const meshname ;
+ ostringstream meshname ;
if( nproc_source == 1 )
meshname<< meshname1;
else
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS, NO_TIME, paramesh, comptopo);
- int const nb_local=mesh->getNumberOfCells();
+ int nb_local=mesh->getNumberOfCells();
double *value=parafield->getField()->getArray()->getPointer();
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=1.0;
//loading the geometry for the target group
if (target_group->containsMyRank()){
- string const master= filename_xml2;
- ostringstream const strstream;
+ string master= filename_xml2;
+ ostringstream strstream;
if( (size-nproc_source) == 1 )
strstream << master<<".med";
else
strstream << master<<(rank-nproc_source+1)<<".med";
- ostringstream const meshname ;
+ ostringstream meshname ;
if( (size-nproc_source) == 1 )
meshname<< meshname2;
else
mesh->incrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- MEDCoupling::ComponentTopology const comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- int const nb_local=mesh->getNumberOfCells();
+ int nb_local=mesh->getNumberOfCells();
double *value=parafield->getField()->getArray()->getPointer();
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=0.0;