From: ageay Date: Mon, 18 Jan 2010 08:51:30 +0000 (+0000) Subject: g++ 4.4.1 porting X-Git-Tag: V5_1_main_FINAL~245 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77b7fb3b7ee3a0ff6ce6ceb43801ca5a51d6b608;p=tools%2Fmedcoupling.git g++ 4.4.1 porting --- diff --git a/src/ParaMEDMEM/Test/test_AllToAllvTimeDEC.cxx b/src/ParaMEDMEM/Test/test_AllToAllvTimeDEC.cxx index e8bbb1f4d..7bba25cda 100644 --- a/src/ParaMEDMEM/Test/test_AllToAllvTimeDEC.cxx +++ b/src/ParaMEDMEM/Test/test_AllToAllvTimeDEC.cxx @@ -150,7 +150,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat //rtimedispls[i] = i*mpi_access->TimeExtent() ; } - double time = 0 ; + double timeLoc = 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 maxtime ; double nextdeltatime = deltatime[myrank] ; @@ -161,18 +161,18 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat maxtime = maxreq ; // MyMPIAccessDEC->InitTime( time , nextdeltatime , maxtime ) ; } - time_t begintime = std::time(NULL) ; + time_t begintime = time(NULL) ; // for ( time = 0 ; time <= maxtime ; time+=deltatime[myrank] ) { - for ( time = 0 ; time <= maxtime && nextdeltatime != 0 ; time+=nextdeltatime ) { + for ( timeLoc = 0 ; timeLoc <= maxtime && nextdeltatime != 0 ; timeLoc+=nextdeltatime ) { nextdeltatime = deltatime[myrank] ; - if ( time != 0 ) { + if ( timeLoc != 0 ) { nextdeltatime = deltatime[myrank] ; - if ( time+nextdeltatime > maxtime ) { + if ( timeLoc+nextdeltatime > maxtime ) { nextdeltatime = 0 ; } // MyMPIAccessDEC->NextTime( nextdeltatime ) ; } - MyMPIAccessDEC->setTime( time , nextdeltatime ) ; + MyMPIAccessDEC->setTime( timeLoc , nextdeltatime ) ; cout << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME " << nextdeltatime << "=====MAXTIME " << maxtime << " ======" << endl ; int * sendbuf = new int[datamsglength*size] ; @@ -187,11 +187,11 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat if ( UseMPI_Alltoallv ) { const MPI_Comm* comm = MyMPIAccessDEC->getComm(); TimeMessage * aSendTimeMessage = new TimeMessage ; - aSendTimeMessage->time = time ; + aSendTimeMessage->time = timeLoc ; // aSendTimeMessage->deltatime = deltatime[myrank] ; aSendTimeMessage->deltatime = nextdeltatime ; // aSendTimeMessage->maxtime = maxtime ; - aSendTimeMessage->tag = (int ) (time/deltatime[myrank]) ; + aSendTimeMessage->tag = (int ) (timeLoc/deltatime[myrank]) ; TimeMessage * aRecvTimeMessage = new TimeMessage[size] ; interface.allToAllV(aSendTimeMessage, sendtimecounts , stimedispls , mpi_access->timeType() , @@ -323,7 +323,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat << " RecvRequests = 0 OK" << endl ; } - time_t endtime = std::time(NULL) ; + time_t endtime = time(NULL) ; cout << "test_AllToAllvTimeDEC" << myrank << " begintime " << begintime << " endtime " << endtime << " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank] << " calls to AllToAll" << endl ; @@ -348,7 +348,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat // MPI_Finalize(); - endtime = std::time(NULL) ; + endtime = time(NULL) ; cout << "test_AllToAllvTimeDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime << " elapse " << endtime-begintime << " " << maxtime/deltatime[myrank] diff --git a/src/ParaMEDMEM/Test/test_AllToAllvTimeDoubleDEC.cxx b/src/ParaMEDMEM/Test/test_AllToAllvTimeDoubleDEC.cxx index 81813e1a5..ad13bd2bc 100644 --- a/src/ParaMEDMEM/Test/test_AllToAllvTimeDoubleDEC.cxx +++ b/src/ParaMEDMEM/Test/test_AllToAllvTimeDoubleDEC.cxx @@ -141,35 +141,35 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) { rtimedispls[i] = i ; } - double time[maxproc] ; + double timeLoc[maxproc] ; 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++ ) { - time[i] = 0 ; + timeLoc[i] = 0 ; maxtime[i] = maxreq ; nextdeltatime[i] = deltatime[i] ; } - time_t begintime = std::time(NULL) ; - for ( time[myrank] = 0 ; time[myrank] <= maxtime[myrank] && nextdeltatime[myrank] != 0 ; - time[myrank]+=nextdeltatime[myrank] ) { + time_t begintime = time(NULL) ; + for ( timeLoc[myrank] = 0 ; timeLoc[myrank] <= maxtime[myrank] && nextdeltatime[myrank] != 0 ; + timeLoc[myrank]+=nextdeltatime[myrank] ) { //local and target times int target ; for ( target = 0 ; target < size ; target++ ) { nextdeltatime[target] = deltatime[target] ; - if ( time[target] != 0 ) { - if ( time[target]+nextdeltatime[target] > maxtime[target] ) { + if ( timeLoc[target] != 0 ) { + if ( timeLoc[target]+nextdeltatime[target] > maxtime[target] ) { nextdeltatime[target] = 0 ; } } if ( target != myrank ) { - while ( time[myrank] >= time[target] ) { - time[target] += deltatime[target] ; + while ( timeLoc[myrank] >= timeLoc[target] ) { + timeLoc[target] += deltatime[target] ; } } } - MyMPIAccessDEC->setTime( time[myrank] , nextdeltatime[myrank] ) ; - cout << "test" << myrank << "=====TIME " << time[myrank] << "=====DELTATIME " + MyMPIAccessDEC->setTime( timeLoc[myrank] , nextdeltatime[myrank] ) ; + cout << "test" << myrank << "=====TIME " << timeLoc[myrank] << "=====DELTATIME " << nextdeltatime[myrank] << "=====MAXTIME " << maxtime[myrank] << " ======" << endl ; double * sendbuf = new double[datamsglength*size] ; @@ -181,7 +181,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) { for ( j = 0 ; j < datamsglength ; j++ ) { //sendbuf[j] = myrank*10000 + (j/datamsglength)*100 + j ; sendbuf[target*datamsglength+j] = myrank*1000000 + target*10000 + - (time[myrank]/deltatime[myrank])*100 + j ; + (timeLoc[myrank]/deltatime[myrank])*100 + j ; //cout << " " << (int ) sendbuf[target*datamsglength+j] ; recvbuf[target*datamsglength+j] = -1 ; } @@ -222,18 +222,18 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) { int index = target*datamsglength+j ; if ( j < recvcounts[target] ) { if ( fabs(recvbuf[index] - (target*1000000 + myrank*10000 + - (time[target]/deltatime[target])*100 + j)) > 101) { + (timeLoc[target]/deltatime[target])*100 + j)) > 101) { badrecvbuf = true ; - cout << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " time[target] " - << time[target] << " recvbuf[" << index << "] " << (int ) recvbuf[index] + cout << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " timeLoc[target] " + << timeLoc[target] << " recvbuf[" << index << "] " << (int ) recvbuf[index] << " # " << (int ) (target*1000000 + - myrank*10000 + (time[target]/deltatime[target])*100 + j) + myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j) << endl ; } else if ( badrecvbuf ) { cout << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] " << recvbuf[index] << " ~= " << (int ) (target*1000000 + - myrank*10000 + (time[target]/deltatime[target])*100 + j) << endl ; + myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j) << endl ; } } else if ( recvbuf[index] != -1 ) { @@ -298,7 +298,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) { << " RecvRequests = 0 OK" << endl ; } - time_t endtime = std::time(NULL) ; + time_t endtime = time(NULL) ; cout << "test_AllToAllvTimeDoubleDEC" << myrank << " begintime " << begintime << " endtime " << endtime << " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank] << " calls to AllToAll" << endl ; @@ -322,7 +322,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) { // MPI_Finalize(); - endtime = std::time(NULL) ; + endtime = time(NULL) ; cout << "test_AllToAllvTimeDoubleDEC" << myrank << " OK begintime " << begintime << " endtime " << endtime << " elapse " << endtime-begintime << " " << maxtime[myrank]/deltatime[myrank] diff --git a/src/ParaMEDMEM/Test/test_perf.cxx b/src/ParaMEDMEM/Test/test_perf.cxx index f5872c15b..825247182 100644 --- a/src/ParaMEDMEM/Test/test_perf.cxx +++ b/src/ParaMEDMEM/Test/test_perf.cxx @@ -18,6 +18,7 @@ #include "MEDLoader.hxx" #include +#include // use this define to enable lines, execution of which leads to Segmentation Fault #define ENABLE_FAULTS