From 6dc92ced7f60325942590e2234321828a867a603 Mon Sep 17 00:00:00 2001 From: bramas Date: Fri, 27 Sep 2013 11:20:43 +0200 Subject: [PATCH] use FLOG instead of FDEBUG --- Src/Components/FAbstractKernels.hpp | 2 +- Src/Components/FAbstractLeaf.hpp | 2 +- Src/Components/FAbstractParticleContainer.hpp | 2 +- Src/Containers/FOctree.hpp | 2 +- Src/Core/FFmmAlgorithm.hpp | 96 +++++----- Src/Core/FFmmAlgorithmPeriodic.hpp | 110 +++++------ Src/Core/FFmmAlgorithmSectionTask.hpp | 58 +++--- Src/Core/FFmmAlgorithmTask.hpp | 52 ++--- Src/Core/FFmmAlgorithmThread.hpp | 94 ++++----- Src/Core/FFmmAlgorithmThreadProc.hpp | 178 +++++++++--------- Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp | 178 +++++++++--------- Src/Core/FFmmAlgorithmThreadTsm.hpp | 90 ++++----- Src/Core/FFmmAlgorithmTsm.hpp | 112 +++++------ Src/Files/FFmaBinLoader.hpp | 6 +- Src/Files/FMpiFmaLoader.hpp | 18 +- Src/Utils/FDebug.hpp | 8 +- Src/Utils/FSpherical.hpp | 2 +- Tests/Utils/testDebug.cpp | 12 +- 18 files changed, 511 insertions(+), 511 deletions(-) diff --git a/Src/Components/FAbstractKernels.hpp b/Src/Components/FAbstractKernels.hpp index 23cc1914..a5ef2878 100755 --- a/Src/Components/FAbstractKernels.hpp +++ b/Src/Components/FAbstractKernels.hpp @@ -126,7 +126,7 @@ public: virtual void P2PRemote(const FTreeCoordinate& /*inLeafPosition*/, ContainerClass* const FRestrict /*targets*/, const ContainerClass* const FRestrict /*sources*/, ContainerClass* const /*directNeighborsParticles*/[27], const int /*size*/) { - FDEBUG( FDebug::Controller.write("Warning, P2P remote is used but not implemented!").write(FDebug::Flush) ); + FLOG( FDebug::Controller.write("Warning, P2P remote is used but not implemented!").write(FDebug::Flush) ); } }; diff --git a/Src/Components/FAbstractLeaf.hpp b/Src/Components/FAbstractLeaf.hpp index 6cffb0dd..ec79ec5f 100755 --- a/Src/Components/FAbstractLeaf.hpp +++ b/Src/Components/FAbstractLeaf.hpp @@ -42,7 +42,7 @@ public: */ template void push(const FPoint& /*inParticlePosition*/, Args ... /*args*/){ - FDEBUG( FDebug::Controller.write("Warning, push is not implemented!").write(FDebug::Flush) ); + FLOG( FDebug::Controller.write("Warning, push is not implemented!").write(FDebug::Flush) ); } /** diff --git a/Src/Components/FAbstractParticleContainer.hpp b/Src/Components/FAbstractParticleContainer.hpp index f2cd6306..1bafa0c7 100755 --- a/Src/Components/FAbstractParticleContainer.hpp +++ b/Src/Components/FAbstractParticleContainer.hpp @@ -45,7 +45,7 @@ public: */ template void push(const FPoint& /*inParticlePosition*/, Args ... /*args*/){ - FDEBUG( FDebug::Controller.write("Warning, push is not implemented!").write(FDebug::Flush) ); + FLOG( FDebug::Controller.write("Warning, push is not implemented!").write(FDebug::Flush) ); } }; diff --git a/Src/Containers/FOctree.hpp b/Src/Containers/FOctree.hpp index 83ba85c9..38bd9d5a 100755 --- a/Src/Containers/FOctree.hpp +++ b/Src/Containers/FOctree.hpp @@ -93,7 +93,7 @@ class FOctree : protected FAssertable, public FNoCopyable { * @return the box num at the leaf level that contains inRelativePosition */ int getTreeCoordinate(const FReal inRelativePosition) const { - FDEBUG( fassert(inRelativePosition >= 0 && inRelativePosition < this->boxWidth, "Particle out of box", __LINE__, __FILE__) ); + FLOG( fassert(inRelativePosition >= 0 && inRelativePosition < this->boxWidth, "Particle out of box", __LINE__, __FILE__) ); const FReal indexFReal = inRelativePosition / this->boxWidthAtLevel[this->leafIndex]; /*const int index = int(FMath::dfloor(indexFReal)); if( index && FMath::LookEqual(inRelativePosition, this->boxWidthAtLevel[this->leafIndex] * FReal(index) ) ){ diff --git a/Src/Core/FFmmAlgorithm.hpp b/Src/Core/FFmmAlgorithm.hpp index 55cf6a33..b38b4cc4 100755 --- a/Src/Core/FFmmAlgorithm.hpp +++ b/Src/Core/FFmmAlgorithm.hpp @@ -59,7 +59,7 @@ public: fassert(tree, "tree cannot be null", __LINE__, __FILE__); fassert(kernels, "kernels cannot be null", __LINE__, __FILE__); - FDEBUG(FDebug::Controller << "FFmmAlgorithm\n"); + FLOG(FDebug::Controller << "FFmmAlgorithm\n"); } /** Default destructor */ @@ -92,9 +92,9 @@ private: /** P2M */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); @@ -103,13 +103,13 @@ private: do{ // We need the current cell that represent the leaf // and the list of particles - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->P2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentListSrc()); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -119,9 +119,9 @@ private: /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -132,26 +132,26 @@ private: // for each levels for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ // We need the current cell and the child // child is an array (of 8 child) that may be null - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->M2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); avoidGotoLeftIterator.moveUp(); octreeIterator = avoidGotoLeftIterator; - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -162,9 +162,9 @@ private: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -175,27 +175,27 @@ private: // for each levels for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ const int counter = tree->getInteractionNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), idxLevel); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); if(counter) kernels->M2L( octreeIterator.getCurrentCell() , neighbors, counter, idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->finishedLevelM2L(idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -205,9 +205,9 @@ private: /** L2L */ void downardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter ); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter ); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -217,23 +217,23 @@ private: const int heightMinusOne = OctreeHeight - 1; // for each levels exepted leaf level for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->L2L( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } @@ -245,10 +245,10 @@ private: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounterL2P); - FDEBUG(FTic computationCounterP2P); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounterL2P); + FLOG(FTic computationCounterP2P); const int heightMinusOne = OctreeHeight - 1; @@ -258,21 +258,21 @@ private: ContainerClass* neighbors[27]; // for each leafs do{ - FDEBUG(computationCounterL2P.tic()); + FLOG(computationCounterL2P.tic()); kernels->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentListTargets()); - FDEBUG(computationCounterL2P.tac()); + FLOG(computationCounterL2P.tac()); // need the current particles and neighbors particles const int counter = tree->getLeafsNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(),heightMinusOne); - FDEBUG(computationCounterP2P.tic()); + FLOG(computationCounterP2P.tic()); kernels->P2P(octreeIterator.getCurrentGlobalCoordinate(),octreeIterator.getCurrentListTargets(), octreeIterator.getCurrentListSrc(), neighbors, counter); - FDEBUG(computationCounterP2P.tac()); + FLOG(computationCounterP2P.tac()); } while(octreeIterator.moveRight()); - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P : " << computationCounterL2P.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation P2P : " << computationCounterP2P.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P : " << computationCounterL2P.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Computation P2P : " << computationCounterP2P.cumulated() << " s\n" ); } diff --git a/Src/Core/FFmmAlgorithmPeriodic.hpp b/Src/Core/FFmmAlgorithmPeriodic.hpp index f98b4578..1f66b6e3 100755 --- a/Src/Core/FFmmAlgorithmPeriodic.hpp +++ b/Src/Core/FFmmAlgorithmPeriodic.hpp @@ -69,7 +69,7 @@ public: fassert(tree, "tree cannot be null", __LINE__, __FILE__); fassert(-1 <= inUpperLevel, "inUpperLevel cannot be < -1", __LINE__, __FILE__); - FDEBUG(FDebug::Controller << "FFmmAlgorithmPeriodic\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmPeriodic\n"); } /** Default destructor */ @@ -111,9 +111,9 @@ public: /** P2M */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); @@ -122,13 +122,13 @@ public: do{ // We need the current cell that represent the leaf // and the list of particles - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->P2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentListSrc()); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -138,9 +138,9 @@ public: /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -151,25 +151,25 @@ public: // for each levels for(int idxLevel = OctreeHeight - 2 ; idxLevel > 0 ; --idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); const int fackLevel = idxLevel + offsetRealTree; // for each cells do{ // We need the current cell and the child // child is an array (of 8 child) that may be null - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->M2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), fackLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); avoidGotoLeftIterator.moveUp(); octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft(); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << "(" << fackLevel << ") = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << "(" << fackLevel << ") = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -180,9 +180,9 @@ public: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); typename OctreeClass::Iterator avoidGotoLeftIterator(octreeIterator); @@ -191,25 +191,25 @@ public: // for each levels for(int idxLevel = 1 ; idxLevel < OctreeHeight ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); const int fackLevel = idxLevel + offsetRealTree; // for each cells do{ const int counter = tree->getPeriodicInteractionNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), idxLevel, periodicDirections); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); if(counter) kernels->M2L( octreeIterator.getCurrentCell() , neighbors, counter, fackLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->finishedLevelM2L(fackLevel); - FDEBUG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << "(" << fackLevel << ") = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG(computationCounter.tac()); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << "(" << fackLevel << ") = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -219,9 +219,9 @@ public: void downardPass(){ // second L2L FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter ); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter ); typename OctreeClass::Iterator octreeIterator(tree); typename OctreeClass::Iterator avoidGotoLeftIterator(octreeIterator); @@ -229,23 +229,23 @@ public: const int heightMinusOne = OctreeHeight - 1; // for each levels exepted leaf level for(int idxLevel = 1 ; idxLevel < heightMinusOne ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); const int fackLevel = idxLevel + offsetRealTree; // for each cells do{ - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->L2L( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), fackLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } while(octreeIterator.moveRight()); avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << "(" << fackLevel << ") = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << "(" << fackLevel << ") = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } @@ -257,10 +257,10 @@ public: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounterL2P); - FDEBUG(FTic computationCounterP2P); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounterL2P); + FLOG(FTic computationCounterP2P); const int heightMinusOne = OctreeHeight - 1; const FReal boxWidth = tree->getBoxWidth(); @@ -273,9 +273,9 @@ public: bool hasPeriodicLeaves; // for each leafs do{ - FDEBUG(computationCounterL2P.tic()); + FLOG(computationCounterL2P.tic()); kernels->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentListTargets()); - FDEBUG(computationCounterL2P.tac()); + FLOG(computationCounterL2P.tac()); // need the current particles and neighbors particles const FTreeCoordinate centerOfLeaf = octreeIterator.getCurrentGlobalCoordinate(); @@ -305,10 +305,10 @@ public: } } - FDEBUG(computationCounterP2P.tic()); + FLOG(computationCounterP2P.tic()); kernels->P2PRemote(octreeIterator.getCurrentGlobalCoordinate(),octreeIterator.getCurrentListTargets(), octreeIterator.getCurrentListSrc(), periodicNeighbors, periodicNeighborsCounter); - FDEBUG(computationCounterP2P.tac()); + FLOG(computationCounterP2P.tac()); for(int idxNeig = 0 ; idxNeig < 27 ; ++idxNeig){ if( periodicNeighbors[idxNeig] ){ @@ -325,18 +325,18 @@ public: } } - FDEBUG(computationCounterP2P.tic()); + FLOG(computationCounterP2P.tic()); kernels->P2P(octreeIterator.getCurrentGlobalCoordinate(),octreeIterator.getCurrentListTargets(), octreeIterator.getCurrentListSrc(), neighbors, counter - periodicNeighborsCounter); - FDEBUG(computationCounterP2P.tac()); + FLOG(computationCounterP2P.tac()); } while(octreeIterator.moveRight()); - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P : " << computationCounterL2P.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation P2P : " << computationCounterP2P.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P : " << computationCounterL2P.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Computation P2P : " << computationCounterP2P.cumulated() << " s\n" ); } @@ -561,12 +561,12 @@ public: */ void processPeriodicLevels(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Periodic Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Periodic Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); ///////////////////////////////////////////////////// // If nb level == -1 nothing to do if( nbLevelsAboveRoot == -1 ){ - FDEBUG( FDebug::Controller << "\tFinished (@Periodic = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Periodic = " << counterTime.tacAndElapsed() << "s)\n" ); return; } ///////////////////////////////////////////////////// @@ -599,7 +599,7 @@ public: // put result in level 1 kernels->L2L( &rootDown, octreeIterator.getCurrentBox(), 3); - FDEBUG( FDebug::Controller << "\tFinished (@Periodic = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Periodic = " << counterTime.tacAndElapsed() << "s)\n" ); return; } ///////////////////////////////////////////////////// @@ -1195,7 +1195,7 @@ public: delete[] cellsYZAxis; delete[] cellsXZAxis; - FDEBUG( FDebug::Controller << "\tFinished (@Periodic = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Periodic = " << counterTime.tacAndElapsed() << "s)\n" ); } diff --git a/Src/Core/FFmmAlgorithmSectionTask.hpp b/Src/Core/FFmmAlgorithmSectionTask.hpp index 3adf3f0e..b0d1a57d 100755 --- a/Src/Core/FFmmAlgorithmSectionTask.hpp +++ b/Src/Core/FFmmAlgorithmSectionTask.hpp @@ -68,7 +68,7 @@ public: this->kernels[idxThread] = new KernelClass(*inKernels); } - FDEBUG(FDebug::Controller << "FFmmAlgorithmSectionTask (Max Thread " << omp_get_max_threads() << ")\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmSectionTask (Max Thread " << omp_get_max_threads() << ")\n"); } /** Default destructor */ @@ -120,8 +120,8 @@ private: /** P2M */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG(FTic counterTime); typename OctreeClass::Iterator octreeIterator(tree); @@ -139,7 +139,7 @@ private: #pragma omp taskwait - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -149,8 +149,8 @@ private: /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -161,7 +161,7 @@ private: // for each levels for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ // We need the current cell and the child @@ -176,11 +176,11 @@ private: octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft(); #pragma omp taskwait - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -191,8 +191,8 @@ private: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); const CellClass* neighbors[343]; @@ -204,7 +204,7 @@ private: // for each levels for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ int counter = tree->getInteractionNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), idxLevel); @@ -230,10 +230,10 @@ private: } #pragma omp taskwait - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -242,8 +242,8 @@ private: void downardPass(){ // second L2L FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -253,7 +253,7 @@ private: const int heightMinusOne = OctreeHeight - 1; // for each levels exepted leaf level for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ #pragma omp task firstprivate(octreeIterator) shared(idxLevel) @@ -267,10 +267,10 @@ private: octreeIterator = avoidGotoLeftIterator; #pragma omp taskwait - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); } @@ -281,9 +281,9 @@ private: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); const int heightMinusOne = OctreeHeight - 1; @@ -305,7 +305,7 @@ private: } while(octreeIterator.moveRight()); - FDEBUG( computationCounter.tic() ); + FLOG( computationCounter.tic() ); for( int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){ const int nbLeaf = shapes[idxShape].getSize(); @@ -322,17 +322,17 @@ private: #pragma omp taskwait } - FDEBUG( computationCounter.tac() ); + FLOG( computationCounter.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation P2P : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation P2P : " << computationCounter.cumulated() << " s\n" ); } void L2PPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart L2P Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart L2P Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.gotoBottomLeft(); @@ -347,7 +347,7 @@ private: #pragma omp taskwait - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P) = " << counterTime.tacAndElapsed() << "s)\n" ); } }; diff --git a/Src/Core/FFmmAlgorithmTask.hpp b/Src/Core/FFmmAlgorithmTask.hpp index 7a92dab0..63b81c51 100755 --- a/Src/Core/FFmmAlgorithmTask.hpp +++ b/Src/Core/FFmmAlgorithmTask.hpp @@ -68,7 +68,7 @@ public: this->kernels[idxThread] = new KernelClass(*inKernels); } - FDEBUG(FDebug::Controller << "FFmmAlgorithmTask (Max Thread " << omp_get_max_threads() << ")\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmTask (Max Thread " << omp_get_max_threads() << ")\n"); } /** Default destructor */ @@ -105,8 +105,8 @@ private: /** P2M */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG(FTic counterTime); #pragma omp parallel { @@ -129,7 +129,7 @@ private: } } - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -139,8 +139,8 @@ private: /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); #pragma omp parallel { @@ -155,7 +155,7 @@ private: // for each levels for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ // We need the current cell and the child @@ -170,13 +170,13 @@ private: octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft(); #pragma omp taskwait - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } } } - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -187,8 +187,8 @@ private: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); #pragma omp parallel { #pragma omp single nowait @@ -203,7 +203,7 @@ private: // for each levels for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ int counter = tree->getInteractionNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), idxLevel); @@ -229,11 +229,11 @@ private: } #pragma omp taskwait - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } } } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -242,8 +242,8 @@ private: void downardPass(){ // second L2L FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); #pragma omp parallel { @@ -257,7 +257,7 @@ private: const int heightMinusOne = OctreeHeight - 1; // for each levels exepted leaf level for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ #pragma omp task firstprivate(octreeIterator) shared(idxLevel) @@ -271,12 +271,12 @@ private: octreeIterator = avoidGotoLeftIterator; #pragma omp taskwait - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } } } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); } @@ -287,9 +287,9 @@ private: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); const int heightMinusOne = OctreeHeight - 1; @@ -316,7 +316,7 @@ private: } while(octreeIterator.moveRight()); - FDEBUG( computationCounter.tic() ); + FLOG( computationCounter.tic() ); for( int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){ const int nbLeaf = shapes[idxShape].getSize(); @@ -334,13 +334,13 @@ private: #pragma omp taskwait } - FDEBUG( computationCounter.tac() ); + FLOG( computationCounter.tac() ); } } - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.cumulated() << " s\n" ); } }; diff --git a/Src/Core/FFmmAlgorithmThread.hpp b/Src/Core/FFmmAlgorithmThread.hpp index 056e70a2..226514c0 100755 --- a/Src/Core/FFmmAlgorithmThread.hpp +++ b/Src/Core/FFmmAlgorithmThread.hpp @@ -76,7 +76,7 @@ public: this->kernels[idxThread] = new KernelClass(*inKernels); } - FDEBUG(FDebug::Controller << "FFmmAlgorithmThread (Max Thread " << omp_get_max_threads() << ")\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmThread (Max Thread " << omp_get_max_threads() << ")\n"); } /** Default destructor */ @@ -133,8 +133,8 @@ private: /** P2M */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG(FTic counterTime); typename OctreeClass::Iterator octreeIterator(tree); int leafs = 0; @@ -145,7 +145,7 @@ private: ++leafs; } while(octreeIterator.moveRight()); - FDEBUG(FTic computationCounter); + FLOG(FTic computationCounter); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -156,10 +156,10 @@ private: myThreadkernels->P2M( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentListSrc()); } } - FDEBUG(computationCounter.tac() ); + FLOG(computationCounter.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); } @@ -170,9 +170,9 @@ private: /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -182,7 +182,7 @@ private: // for each levels for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); int numberOfCells = 0; // for each cells do{ @@ -192,7 +192,7 @@ private: avoidGotoLeftIterator.moveUp(); octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft(); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -204,13 +204,13 @@ private: } } - FDEBUG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG(computationCounter.tac()); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } @@ -222,9 +222,9 @@ private: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -232,7 +232,7 @@ private: // for each levels for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); int numberOfCells = 0; // for each cells do{ @@ -242,7 +242,7 @@ private: avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -254,16 +254,16 @@ private: if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, counter, idxLevel); } - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); myThreadkernels->finishedLevelM2L(idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } - FDEBUG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG(computationCounter.tac()); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } ///////////////////////////////////////////////////////////////////////////// @@ -273,9 +273,9 @@ private: void downardPass(){ // second L2L FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -285,7 +285,7 @@ private: const int heightMinusOne = OctreeHeight - 1; // for each levels exepted leaf level for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); int numberOfCells = 0; // for each cells do{ @@ -295,7 +295,7 @@ private: avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -304,12 +304,12 @@ private: myThreadkernels->L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel); } } - FDEBUG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG(computationCounter.tac()); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } @@ -321,10 +321,10 @@ private: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); - FDEBUG(FTic computationCounterP2P); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); + FLOG(FTic computationCounterP2P); omp_lock_t lockShape[SizeShape]; for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){ @@ -383,7 +383,7 @@ private: #pragma omp barrier - FDEBUG(if(!omp_get_thread_num()) computationCounter.tic()); + FLOG(if(!omp_get_thread_num()) computationCounter.tic()); KernelClass& myThreadkernels = (*kernels[omp_get_thread_num()]); // There is a maximum of 26 neighbors @@ -398,18 +398,18 @@ private: LeafData& currentIter = leafsDataArray[idxLeafs]; myThreadkernels.L2P(currentIter.cell, currentIter.targets); // need the current particles and neighbors particles - FDEBUG(if(!omp_get_thread_num()) computationCounterP2P.tic()); + FLOG(if(!omp_get_thread_num()) computationCounterP2P.tic()); const int counter = tree->getLeafsNeighbors(neighbors, currentIter.cell->getCoordinate(), LeafIndex); myThreadkernels.P2P(currentIter.cell->getCoordinate(), currentIter.targets, currentIter.sources, neighbors, counter); - FDEBUG(if(!omp_get_thread_num()) computationCounterP2P.tac()); + FLOG(if(!omp_get_thread_num()) computationCounterP2P.tac()); } previous = endAtThisShape; } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); delete [] leafsDataArray; for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){ @@ -417,9 +417,9 @@ private: } - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation P2P : " << computationCounterP2P.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Computation P2P : " << computationCounterP2P.cumulated() << " s\n" ); } diff --git a/Src/Core/FFmmAlgorithmThreadProc.hpp b/Src/Core/FFmmAlgorithmThreadProc.hpp index 1b5ef984..50c79311 100755 --- a/Src/Core/FFmmAlgorithmThreadProc.hpp +++ b/Src/Core/FFmmAlgorithmThreadProc.hpp @@ -124,8 +124,8 @@ public: this->kernels[idxThread] = new KernelClass(*inKernels); } - FDEBUG(FDebug::Controller << "FFmmAlgorithmThreadProc\n"); - FDEBUG(FDebug::Controller << "Max threads = " << MaxThreads << ", Procs = " << nbProcess << ", I am " << idProcess << ".\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmThreadProc\n"); + FLOG(FDebug::Controller << "Max threads = " << MaxThreads << ", Procs = " << nbProcess << ", I am " << idProcess << ".\n"); } /** Default destructor */ @@ -221,8 +221,8 @@ private: /** P2M Bottom Pass */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG(FTic counterTime); typename OctreeClass::Iterator octreeIterator(tree); @@ -233,7 +233,7 @@ private: iterArray[leafs++] = octreeIterator; } while(octreeIterator.moveRight()); - FDEBUG(FTic computationCounter); + FLOG(FTic computationCounter); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -242,11 +242,11 @@ private: myThreadkernels->P2M( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentListSrc()); } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); } @@ -257,11 +257,11 @@ private: /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); - FDEBUG(FTic prepareCounter); - FDEBUG(FTic waitCounter); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); + FLOG(FTic prepareCounter); + FLOG(FTic waitCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -312,7 +312,7 @@ private: FTRACE( FTrace::FRegion regionTrace( "Preprocess" , __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); if(idProcess != 0 && (getWorkingInterval((idxLevel+1), idProcess).min >>3) <= (getWorkingInterval((idxLevel+1), idProcess - 1).max >>3)){ @@ -367,12 +367,12 @@ private: } } } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); FTRACE( regionTrace.end() ); // Compute const int endIndex = (hasToReceive?numberOfCells-1:numberOfCells); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass& myThreadkernels = (*kernels[omp_get_thread_num()]); @@ -381,13 +381,13 @@ private: myThreadkernels.M2M( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel); } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); // Are we sending or waiting anything? if(iterRequests){ - FDEBUG(waitCounter.tic()); + FLOG(waitCounter.tic()); MPI_Waitall( iterRequests, requests, status); - FDEBUG(waitCounter.tac()); + FLOG(waitCounter.tac()); // we were receiving data if( hasToReceive ){ @@ -417,9 +417,9 @@ private: } // Finally compute - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); (*kernels[0]).M2M( iterArray[numberOfCells - 1].getCurrentCell() , currentChild, idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); firstProcThatSend = endProcThatSend - 1; @@ -431,10 +431,10 @@ private: } - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); } @@ -446,13 +446,13 @@ private: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); - FDEBUG(FTic sendCounter); - FDEBUG(FTic receiveCounter); - FDEBUG(FTic prepareCounter); - FDEBUG(FTic gatherCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); + FLOG(FTic sendCounter); + FLOG(FTic receiveCounter); + FLOG(FTic prepareCounter); + FLOG(FTic gatherCounter); ////////////////////////////////////////////////////////////////// // First know what to send to who @@ -469,7 +469,7 @@ private: { FTRACE( FTrace::FRegion regionTrace( "Preprocess" , __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); // To know if a leaf has been already sent to a proc bool*const alreadySent = new bool[nbProcess]; @@ -547,7 +547,7 @@ private: } } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); delete[] alreadySent; } @@ -556,20 +556,20 @@ private: // Gather this information ////////////////////////////////////////////////////////////////// - FDEBUG(gatherCounter.tic()); + FLOG(gatherCounter.tic()); // All process say to each others // what the will send to who int*const globalReceiveMap = new int[nbProcess * nbProcess * OctreeHeight]; memset(globalReceiveMap, 0, sizeof(int) * nbProcess * nbProcess * OctreeHeight); FMpi::MpiAssert( MPI_Allgather( indexToSend, nbProcess * OctreeHeight, MPI_INT, globalReceiveMap, nbProcess * OctreeHeight, MPI_INT, comm.getComm()), __LINE__ ); - FDEBUG(gatherCounter.tac()); + FLOG(gatherCounter.tac()); ////////////////////////////////////////////////////////////////// // Send and receive for real ////////////////////////////////////////////////////////////////// - FDEBUG(sendCounter.tic()); + FLOG(sendCounter.tic()); // Then they can send and receive (because they know what they will receive) // To send in asynchrone way MPI_Request*const requests = new MPI_Request[2 * nbProcess * OctreeHeight]; @@ -610,7 +610,7 @@ private: } } } - FDEBUG(sendCounter.tac()); + FLOG(sendCounter.tac()); ////////////////////////////////////////////////////////////////// // Do M2L @@ -645,7 +645,7 @@ private: avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -659,7 +659,7 @@ private: myThreadkernels->finishedLevelM2L(idxLevel); } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } } @@ -672,7 +672,7 @@ private: { FTRACE( FTrace::FRegion regionTrace("Compute Received data", __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(receiveCounter.tic()); + FLOG(receiveCounter.tic()); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); typename OctreeClass::Iterator avoidGotoLeftIterator(octreeIterator); @@ -727,7 +727,7 @@ private: leafsNeedOther[idxLevel] = 0; // Compute this cells - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -764,9 +764,9 @@ private: myThreadkernels->finishedLevelM2L(idxLevel); } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } - FDEBUG(receiveCounter.tac()); + FLOG(receiveCounter.tac()); } for(int idxComm = 0 ; idxComm < nbProcess * OctreeHeight; ++idxComm){ @@ -784,12 +784,12 @@ private: delete[] requests; delete[] status; - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Send : " << sendCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Receive : " << receiveCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Gather : " << gatherCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Send : " << sendCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Receive : " << receiveCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Gather : " << gatherCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); } ////////////////////////////////////////////////////////////////// @@ -798,11 +798,11 @@ private: void downardPass(){ // second L2L FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); - FDEBUG(FTic prepareCounter); - FDEBUG(FTic waitCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); + FLOG(FTic prepareCounter); + FLOG(FTic waitCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -845,7 +845,7 @@ private: bool needToRecv = false; int iterRequests = 0; - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); // do we need to receive one or zeros cell if(idProcess != 0 @@ -882,9 +882,9 @@ private: } } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass& myThreadkernels = (*kernels[omp_get_thread_num()]); @@ -893,23 +893,23 @@ private: myThreadkernels.L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel); } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); // are we sending or receiving? if(iterRequests){ // process - FDEBUG(waitCounter.tic()); + FLOG(waitCounter.tic()); MPI_Waitall( iterRequests, requests, status); - FDEBUG(waitCounter.tac()); + FLOG(waitCounter.tac()); if(needToRecv){ // Need to compute - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); iterArray[firstCellWork].getCurrentCell()->deserializeDown(recvBuffer); kernels[0]->L2L( iterArray[firstCellWork].getCurrentCell() , iterArray[firstCellWork].getCurrentChild(), idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } } @@ -920,10 +920,10 @@ private: delete[] requests; delete[] status; - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); } @@ -939,16 +939,16 @@ private: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG( FTic counterTime); - FDEBUG( FTic prepareCounter); - FDEBUG( FTic gatherCounter); - FDEBUG( FTic waitCounter); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG( FTic counterTime); + FLOG( FTic prepareCounter); + FLOG( FTic gatherCounter); + FLOG( FTic waitCounter); /////////////////////////////////////////////////// // Prepare data to send receive /////////////////////////////////////////////////// - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); // To send in asynchrone way MPI_Request requests[2 * nbProcess]; @@ -1037,9 +1037,9 @@ private: } } - FDEBUG(gatherCounter.tic()); + FLOG(gatherCounter.tic()); FMpi::MpiAssert( MPI_Allgather( partsToSend, nbProcess, MPI_INT, globalReceiveMap, nbProcess, MPI_INT, comm.getComm()), __LINE__ ); - FDEBUG(gatherCounter.tac()); + FLOG(gatherCounter.tac()); // Prepare receive for(int idxProc = 0 ; idxProc < nbProcess ; ++idxProc){ @@ -1076,7 +1076,7 @@ private: delete[] toSend; } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); /////////////////////////////////////////////////// // Prepare data for thread P2P @@ -1145,7 +1145,7 @@ private: ////////////////////////////////////////////////////////// FTRACE( FTrace::FRegion regionP2PTrace("Compute P2P", __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(FTic computationCounter); + FLOG(FTic computationCounter); #pragma omp parallel { @@ -1171,14 +1171,14 @@ private: previous = endAtThisShape; } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); FTRACE( regionP2PTrace.end() ); ////////////////////////////////////////////////////////// // Wait send receive ////////////////////////////////////////////////////////// - FDEBUG(FTic computation2Counter); + FLOG(FTic computation2Counter); // Create an octree with leaves from others OctreeClass otherP2Ptree( tree->getHeight(), tree->getSubHeight(), tree->getBoxWidth(), tree->getBoxCenter() ); @@ -1188,9 +1188,9 @@ private: memset(indexMessage, 0, sizeof(int) * nbProcess * 2); int countMessages = 0; // Wait data - FDEBUG(waitCounter.tic()); + FLOG(waitCounter.tic()); MPI_Waitsome(iterRequest, requests, &countMessages, indexMessage, status); - FDEBUG(waitCounter.tac()); + FLOG(waitCounter.tac()); complete += countMessages; @@ -1216,7 +1216,7 @@ private: ////////////////////////////////////////////////////////// FTRACE( FTrace::FRegion regionOtherTrace("Compute P2P Other", __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG( computation2Counter.tic() ); + FLOG( computation2Counter.tic() ); #pragma omp parallel { @@ -1263,15 +1263,15 @@ private: delete[] globalReceiveMap; delete[] leafsDataArray; - FDEBUG(computation2Counter.tac()); + FLOG(computation2Counter.tac()); - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation P2P 2 : " << computation2Counter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare P2P : " << prepareCounter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Gather P2P : " << gatherCounter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Wait : " << waitCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Computation P2P 2 : " << computation2Counter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare P2P : " << prepareCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Gather P2P : " << gatherCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Wait : " << waitCounter.elapsed() << " s\n" ); } diff --git a/Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp b/Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp index 74fbdf98..b858442e 100755 --- a/Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp +++ b/Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp @@ -135,8 +135,8 @@ public: fassert(tree, "tree cannot be null", __LINE__, __FILE__); fassert(-1 <= inUpperLevel, "inUpperLevel cannot be < -1", __LINE__, __FILE__); - FDEBUG(FDebug::Controller << "FFmmAlgorithmThreadProcPeriodic\n"); - FDEBUG(FDebug::Controller << "Max threads = " << MaxThreads << ", Procs = " << nbProcess << ", I am " << idProcess << ".\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmThreadProcPeriodic\n"); + FLOG(FDebug::Controller << "Max threads = " << MaxThreads << ", Procs = " << nbProcess << ", I am " << idProcess << ".\n"); } /** Default destructor */ @@ -232,8 +232,8 @@ private: /** P2M Bottom Pass */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG(FTic counterTime); typename OctreeClass::Iterator octreeIterator(tree); @@ -244,7 +244,7 @@ private: iterArray[leafs++] = octreeIterator; } while(octreeIterator.moveRight()); - FDEBUG(FTic computationCounter); + FLOG(FTic computationCounter); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -253,11 +253,11 @@ private: myThreadkernels->P2M( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentListSrc()); } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); } @@ -268,11 +268,11 @@ private: /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); - FDEBUG(FTic prepareCounter); - FDEBUG(FTic waitCounter); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); + FLOG(FTic prepareCounter); + FLOG(FTic waitCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -324,7 +324,7 @@ private: FTRACE( FTrace::FRegion regionTrace( "Preprocess" , __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); if(idProcess != 0 && (getWorkingInterval((idxLevel+1), idProcess).min >>3) <= (getWorkingInterval((idxLevel+1), idProcess - 1).max >>3)){ @@ -379,12 +379,12 @@ private: } } } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); FTRACE( regionTrace.end() ); // Compute const int endIndex = (hasToReceive?numberOfCells-1:numberOfCells); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass& myThreadkernels = (*kernels[omp_get_thread_num()]); @@ -393,13 +393,13 @@ private: myThreadkernels.M2M( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), fackLevel); } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); // Are we sending or waiting anything? if(iterRequests){ - FDEBUG(waitCounter.tic()); + FLOG(waitCounter.tic()); MPI_Waitall( iterRequests, requests, status); - FDEBUG(waitCounter.tac()); + FLOG(waitCounter.tac()); // we were receiving data if( hasToReceive ){ @@ -429,9 +429,9 @@ private: } // Finally compute - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); (*kernels[0]).M2M( iterArray[numberOfCells - 1].getCurrentCell() , currentChild, fackLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); firstProcThatSend = endProcThatSend - 1; @@ -443,10 +443,10 @@ private: } - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); ////////////////////////////////////////////////////////////////// //Periodicity @@ -530,13 +530,13 @@ private: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); - FDEBUG(FTic sendCounter); - FDEBUG(FTic receiveCounter); - FDEBUG(FTic prepareCounter); - FDEBUG(FTic gatherCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); + FLOG(FTic sendCounter); + FLOG(FTic receiveCounter); + FLOG(FTic prepareCounter); + FLOG(FTic gatherCounter); ////////////////////////////////////////////////////////////////// // First know what to send to who @@ -553,7 +553,7 @@ private: { FTRACE( FTrace::FRegion regionTrace( "Preprocess" , __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); // To know if a leaf has been already sent to a proc bool*const alreadySent = new bool[nbProcess]; @@ -632,7 +632,7 @@ private: } } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); delete[] alreadySent; } @@ -641,19 +641,19 @@ private: // Gather this information ////////////////////////////////////////////////////////////////// - FDEBUG(gatherCounter.tic()); + FLOG(gatherCounter.tic()); // All process say to each others // what the will send to who int*const globalReceiveMap = new int[nbProcess * nbProcess * OctreeHeight]; memset(globalReceiveMap, 0, sizeof(int) * nbProcess * nbProcess * OctreeHeight); FMpi::MpiAssert( MPI_Allgather( indexToSend, nbProcess * OctreeHeight, MPI_INT, globalReceiveMap, nbProcess * OctreeHeight, MPI_INT, comm.getComm()), __LINE__ ); - FDEBUG(gatherCounter.tac()); + FLOG(gatherCounter.tac()); ////////////////////////////////////////////////////////////////// // Send and receive for real ////////////////////////////////////////////////////////////////// - FDEBUG(sendCounter.tic()); + FLOG(sendCounter.tic()); // Then they can send and receive (because they know what they will receive) // To send in asynchrone way MPI_Request*const requests = new MPI_Request[2 * nbProcess * OctreeHeight]; @@ -695,7 +695,7 @@ private: } } } - FDEBUG(sendCounter.tac()); + FLOG(sendCounter.tac()); ////////////////////////////////////////////////////////////////// // Do M2L @@ -730,7 +730,7 @@ private: avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -744,7 +744,7 @@ private: myThreadkernels->finishedLevelM2L(fackLevel); } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } } @@ -757,7 +757,7 @@ private: { FTRACE( FTrace::FRegion regionTrace("Compute Received data", __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(receiveCounter.tic()); + FLOG(receiveCounter.tic()); typename OctreeClass::Iterator octreeIterator(tree); typename OctreeClass::Iterator avoidGotoLeftIterator(octreeIterator); // compute the second time @@ -812,7 +812,7 @@ private: leafsNeedOther[idxLevel] = 0; // Compute this cells - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -851,9 +851,9 @@ private: myThreadkernels->finishedLevelM2L(fackLevel); } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } - FDEBUG(receiveCounter.tac()); + FLOG(receiveCounter.tac()); } for(int idxComm = 0 ; idxComm < nbProcess * OctreeHeight; ++idxComm){ @@ -871,12 +871,12 @@ private: delete[] requests; delete[] status; - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Send : " << sendCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Receive : " << receiveCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Gather : " << gatherCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Send : " << sendCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Receive : " << receiveCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Gather : " << gatherCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); } ////////////////////////////////////////////////////////////////// @@ -885,11 +885,11 @@ private: void downardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); - FDEBUG(FTic prepareCounter); - FDEBUG(FTic waitCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); + FLOG(FTic prepareCounter); + FLOG(FTic waitCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -950,7 +950,7 @@ private: bool needToRecv = false; int iterRequests = 0; - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); // do we need to receive one or zeros cell if(idProcess != 0 @@ -985,9 +985,9 @@ private: } } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass& myThreadkernels = (*kernels[omp_get_thread_num()]); @@ -996,22 +996,22 @@ private: myThreadkernels.L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), fackLevel); } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); // are we sending or receiving? if(iterRequests){ // process - FDEBUG(waitCounter.tic()); + FLOG(waitCounter.tic()); MPI_Waitall( iterRequests, requests, status); - FDEBUG(waitCounter.tac()); + FLOG(waitCounter.tac()); if(needToRecv){ // Need to compute - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); iterArray[firstCellWork].getCurrentCell()->deserializeDown(recvBuffer); kernels[0]->L2L( iterArray[firstCellWork].getCurrentCell() , iterArray[firstCellWork].getCurrentChild(), fackLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } } @@ -1022,10 +1022,10 @@ private: delete[] requests; delete[] status; - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare : " << prepareCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Wait : " << waitCounter.cumulated() << " s\n" ); } @@ -1041,16 +1041,16 @@ private: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG( FTic counterTime); - FDEBUG( FTic prepareCounter); - FDEBUG( FTic gatherCounter); - FDEBUG( FTic waitCounter); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG( FTic counterTime); + FLOG( FTic prepareCounter); + FLOG( FTic gatherCounter); + FLOG( FTic waitCounter); /////////////////////////////////////////////////// // Prepare data to send receive /////////////////////////////////////////////////// - FDEBUG(prepareCounter.tic()); + FLOG(prepareCounter.tic()); // To send in asynchrone way MPI_Request requests[2 * nbProcess]; @@ -1143,9 +1143,9 @@ private: } } - FDEBUG(gatherCounter.tic()); + FLOG(gatherCounter.tic()); FMpi::MpiAssert( MPI_Allgather( partsToSend, nbProcess, MPI_INT, globalReceiveMap, nbProcess, MPI_INT, comm.getComm()), __LINE__ ); - FDEBUG(gatherCounter.tac()); + FLOG(gatherCounter.tac()); // Prepare receive @@ -1178,7 +1178,7 @@ private: delete[] toSend; } - FDEBUG(prepareCounter.tac()); + FLOG(prepareCounter.tac()); /////////////////////////////////////////////////// // Prepare data for thread P2P @@ -1247,7 +1247,7 @@ private: ////////////////////////////////////////////////////////// FTRACE( FTrace::FRegion regionP2PTrace("Compute P2P", __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG(FTic computationCounter); + FLOG(FTic computationCounter); #pragma omp parallel { @@ -1320,14 +1320,14 @@ private: previous = endAtThisShape; } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); FTRACE( regionP2PTrace.end() ); ////////////////////////////////////////////////////////// // Wait send receive ////////////////////////////////////////////////////////// - FDEBUG(FTic computation2Counter); + FLOG(FTic computation2Counter); // Create an octree with leaves from others OctreeClass otherP2Ptree( tree->getHeight(), tree->getSubHeight(), tree->getBoxWidth(), tree->getBoxCenter() ); @@ -1337,9 +1337,9 @@ private: memset(indexMessage, 0, sizeof(int) * nbProcess * 2); int countMessages = 0; // Wait data - FDEBUG(waitCounter.tic()); + FLOG(waitCounter.tic()); MPI_Waitsome(iterRequest, requests, &countMessages, indexMessage, status); - FDEBUG(waitCounter.tac()); + FLOG(waitCounter.tac()); complete += countMessages; @@ -1365,7 +1365,7 @@ private: ////////////////////////////////////////////////////////// FTRACE( FTrace::FRegion regionOtherTrace("Compute P2P Other", __FUNCTION__ , __FILE__ , __LINE__) ); - FDEBUG( computation2Counter.tic() ); + FLOG( computation2Counter.tic() ); #pragma omp parallel { @@ -1412,15 +1412,15 @@ private: delete[] globalReceiveMap; delete[] leafsDataArray; - FDEBUG(computation2Counter.tac()); + FLOG(computation2Counter.tac()); - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation P2P 2 : " << computation2Counter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Prepare P2P : " << prepareCounter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Gather P2P : " << gatherCounter.elapsed() << " s\n" ); - FDEBUG( FDebug::Controller << "\t\t Wait : " << waitCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Computation P2P 2 : " << computation2Counter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Prepare P2P : " << prepareCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Gather P2P : " << gatherCounter.elapsed() << " s\n" ); + FLOG( FDebug::Controller << "\t\t Wait : " << waitCounter.elapsed() << " s\n" ); } diff --git a/Src/Core/FFmmAlgorithmThreadTsm.hpp b/Src/Core/FFmmAlgorithmThreadTsm.hpp index cd459910..6902c4d5 100755 --- a/Src/Core/FFmmAlgorithmThreadTsm.hpp +++ b/Src/Core/FFmmAlgorithmThreadTsm.hpp @@ -72,7 +72,7 @@ public: this->kernels[idxThread] = new KernelClass(*inKernels); } - FDEBUG(FDebug::Controller << "FFmmAlgorithmThreadTsm\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmThreadTsm\n"); } /** Default destructor */ @@ -119,8 +119,8 @@ public: /** P2M */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG( FTic counterTime ); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG( FTic counterTime ); typename OctreeClass::Iterator octreeIterator(tree); int numberOfLeafs = 0; @@ -131,7 +131,7 @@ public: ++numberOfLeafs; } while(octreeIterator.moveRight()); - FDEBUG(FTic computationCounter); + FLOG(FTic computationCounter); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -149,20 +149,20 @@ public: } } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.elapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.elapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" ); } /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -172,7 +172,7 @@ public: // for each levels for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); int numberOfCells = 0; // for each cells do{ @@ -182,7 +182,7 @@ public: avoidGotoLeftIterator.moveUp(); octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft(); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -208,13 +208,13 @@ public: myThreadkernels->M2M( currentCell , potentialChild, idxLevel); } } - FDEBUG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG(computationCounter.tac()); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.elapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.elapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } @@ -222,9 +222,9 @@ public: void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -232,7 +232,7 @@ public: // for each levels for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); int numberOfCells = 0; // for each cells do{ @@ -242,7 +242,7 @@ public: avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -270,24 +270,24 @@ public: } } - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); myThreadkernels->finishedLevelM2L(idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); } - FDEBUG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG(computationCounter.tac()); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } /* L2L */ void downardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); - FDEBUG(FTic computationCounter); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); + FLOG(FTic computationCounter); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -297,7 +297,7 @@ public: const int heightMinusOne = OctreeHeight - 1; // for each levels exepted leaf level for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); int numberOfCells = 0; // for each cells do{ @@ -307,7 +307,7 @@ public: avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -327,19 +327,19 @@ public: myThreadkernels->L2L( currentCell , potentialChild, idxLevel); } } - FDEBUG(computationCounter.tac()); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG(computationCounter.tac()); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" ); } /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG(FTic counterTime); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG(FTic counterTime); int numberOfLeafs = 0; { @@ -353,7 +353,7 @@ public: } const int heightMinusOne = OctreeHeight - 1; - FDEBUG(FTic computationCounter); + FLOG(FTic computationCounter); #pragma omp parallel { KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; @@ -369,11 +369,11 @@ public: iterArray[idxLeafs].getCurrentListSrc() , neighbors, counter); } } - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" ); } diff --git a/Src/Core/FFmmAlgorithmTsm.hpp b/Src/Core/FFmmAlgorithmTsm.hpp index d67118ae..a1270f3c 100755 --- a/Src/Core/FFmmAlgorithmTsm.hpp +++ b/Src/Core/FFmmAlgorithmTsm.hpp @@ -46,8 +46,8 @@ class FFmmAlgorithmTsm : protected FAssertable{ const int OctreeHeight; - FDEBUG(FTic counterTime); //< In case of debug: to count the elapsed time - FDEBUG(FTic computationCounter); //< In case of debug: to count computation time + FLOG(FTic counterTime); //< In case of debug: to count the elapsed time + FLOG(FTic computationCounter); //< In case of debug: to count computation time public: /** The constructor need the octree and the kernels used for computation @@ -61,7 +61,7 @@ public: fassert(tree, "tree cannot be null", __LINE__, __FILE__); fassert(kernels, "kernels cannot be null", __LINE__, __FILE__); - FDEBUG(FDebug::Controller << "FFmmAlgorithmTsm\n"); + FLOG(FDebug::Controller << "FFmmAlgorithmTsm\n"); } /** Default destructor */ @@ -89,9 +89,9 @@ public: /** P2M */ void bottomPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); - FDEBUG( counterTime.tic() ); - FDEBUG( double totalComputation = 0 ); + FLOG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) ); + FLOG( counterTime.tic() ); + FLOG( double totalComputation = 0 ); typename OctreeClass::Iterator octreeIterator(tree); @@ -100,7 +100,7 @@ public: do{ // We need the current cell that represent the leaf // and the list of particles - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); ContainerClass* const sources = octreeIterator.getCurrentListSrc(); if(sources->getNbParticles()){ octreeIterator.getCurrentCell()->setSrcChildTrue(); @@ -109,22 +109,22 @@ public: if(octreeIterator.getCurrentListTargets()->getNbParticles()){ octreeIterator.getCurrentCell()->setTargetsChildTrue(); } - FDEBUG(computationCounter.tac()); - FDEBUG(totalComputation += computationCounter.elapsed()); + FLOG(computationCounter.tac()); + FLOG(totalComputation += computationCounter.elapsed()); } while(octreeIterator.moveRight()); - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.elapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Bottom Pass (P2M) = " << counterTime.elapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); } /** M2M */ void upwardPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); - FDEBUG( counterTime.tic() ); - FDEBUG( double totalComputation = 0 ); + FLOG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); ); + FLOG( counterTime.tic() ); + FLOG( double totalComputation = 0 ); // Start from leal level - 1 typename OctreeClass::Iterator octreeIterator(tree); @@ -135,12 +135,12 @@ public: // for each levels for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ // We need the current cell and the child // child is an array (of 8 child) that may be null - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); CellClass* potentialChild[8]; CellClass** const realChild = octreeIterator.getCurrentChild(); @@ -159,27 +159,27 @@ public: } kernels->M2M( currentCell , potentialChild, idxLevel); - FDEBUG(computationCounter.tac()); - FDEBUG(totalComputation += computationCounter.elapsed()); + FLOG(computationCounter.tac()); + FLOG(totalComputation += computationCounter.elapsed()); } while(octreeIterator.moveRight()); avoidGotoLeftIterator.moveUp(); octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft(); - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.elapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Upward Pass (M2M) = " << counterTime.elapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); } /** M2L */ void transferPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); - FDEBUG( counterTime.tic() ); - FDEBUG( double totalComputation = 0 ); + FLOG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); ); + FLOG( counterTime.tic() ); + FLOG( double totalComputation = 0 ); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -190,10 +190,10 @@ public: // for each levels for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); CellClass* const currentCell = octreeIterator.getCurrentCell(); if(currentCell->hasTargetsChild()){ const int counter = tree->getInteractionNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(),idxLevel); @@ -212,29 +212,29 @@ public: } } } - FDEBUG(computationCounter.tac()); - FDEBUG(totalComputation += computationCounter.elapsed()); + FLOG(computationCounter.tac()); + FLOG(totalComputation += computationCounter.elapsed()); } while(octreeIterator.moveRight()); - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->finishedLevelM2L(idxLevel); - FDEBUG(computationCounter.tac()); + FLOG(computationCounter.tac()); avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.elapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (M2L) = " << counterTime.elapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); } /** L2L */ void downardPass(){ - FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); - FDEBUG( counterTime.tic() ); - FDEBUG( double totalComputation = 0 ); + FLOG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); ); + FLOG( counterTime.tic() ); + FLOG( double totalComputation = 0 ); typename OctreeClass::Iterator octreeIterator(tree); octreeIterator.moveDown(); @@ -244,10 +244,10 @@ public: const int heightMinusOne = OctreeHeight - 1; // for each levels exepted leaf level for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ - FDEBUG(FTic counterTimeLevel); + FLOG(FTic counterTimeLevel); // for each cells do{ - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); CellClass* potentialChild[8]; CellClass** const realChild = octreeIterator.getCurrentChild(); CellClass* const currentCell = octreeIterator.getCurrentCell(); @@ -260,18 +260,18 @@ public: } } kernels->L2L( currentCell , potentialChild, idxLevel); - FDEBUG(computationCounter.tac()); - FDEBUG(totalComputation += computationCounter.elapsed()); + FLOG(computationCounter.tac()); + FLOG(totalComputation += computationCounter.elapsed()); } while(octreeIterator.moveRight()); avoidGotoLeftIterator.moveDown(); octreeIterator = avoidGotoLeftIterator; - FDEBUG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); + FLOG( FDebug::Controller << "\t\t>> Level " << idxLevel << " = " << counterTimeLevel.tacAndElapsed() << "s\n" ); } - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.elapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Downward Pass (L2L) = " << counterTime.elapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" ); } @@ -279,9 +279,9 @@ public: /** P2P */ void directPass(){ FTRACE( FTrace::FFunction functionTrace(__FUNCTION__, "Fmm" , __FILE__ , __LINE__) ); - FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); - FDEBUG( counterTime.tic() ); - FDEBUG( double totalComputation = 0 ); + FLOG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); ); + FLOG( counterTime.tic() ); + FLOG( double totalComputation = 0 ); const int heightMinusOne = OctreeHeight - 1; @@ -291,19 +291,19 @@ public: ContainerClass* neighbors[27]; // for each leafs do{ - FDEBUG(computationCounter.tic()); + FLOG(computationCounter.tic()); kernels->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentListTargets()); // need the current particles and neighbors particles const int counter = tree->getLeafsNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), heightMinusOne); kernels->P2P( octreeIterator.getCurrentGlobalCoordinate(), octreeIterator.getCurrentListTargets(), octreeIterator.getCurrentListSrc() , neighbors, counter); - FDEBUG(computationCounter.tac()); - FDEBUG(totalComputation += computationCounter.elapsed()); + FLOG(computationCounter.tac()); + FLOG(totalComputation += computationCounter.elapsed()); } while(octreeIterator.moveRight()); - FDEBUG( counterTime.tac() ); - FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.elapsed() << "s)\n" ); - FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << totalComputation << " s\n" ); + FLOG( counterTime.tac() ); + FLOG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.elapsed() << "s)\n" ); + FLOG( FDebug::Controller << "\t\t Computation L2P + P2P : " << totalComputation << " s\n" ); } diff --git a/Src/Files/FFmaBinLoader.hpp b/Src/Files/FFmaBinLoader.hpp index 964fc218..14f79efe 100755 --- a/Src/Files/FFmaBinLoader.hpp +++ b/Src/Files/FFmaBinLoader.hpp @@ -71,10 +71,10 @@ public: if(this->file != NULL) { int sizeOfElement(0); removeWarning += fread(&sizeOfElement, sizeof(int), 1, file); - FDEBUG(if(sizeOfElement != int(sizeof(FReal)) ){) - FDEBUG( FDebug::Controller.writeFromLine("Warning type size between file and FReal are differents\n", __LINE__, __FILE__); ) + FLOG(if(sizeOfElement != int(sizeof(FReal)) ){) + FLOG( FDebug::Controller.writeFromLine("Warning type size between file and FReal are differents\n", __LINE__, __FILE__); ) printf("%d sizeofelement\n",sizeOfElement); - FDEBUG(}) + FLOG(}) removeWarning += fread(&this->nbParticles, sizeof(FSize), 1, file); removeWarning += fread(&this->boxWidth, sizeof(FReal), 1, file); diff --git a/Src/Files/FMpiFmaLoader.hpp b/Src/Files/FMpiFmaLoader.hpp index 849cfa78..7e7ce768 100755 --- a/Src/Files/FMpiFmaLoader.hpp +++ b/Src/Files/FMpiFmaLoader.hpp @@ -83,9 +83,9 @@ public: && MPI_File_read(file, &this->totalNbParticles, 1, MPI_LONG_LONG, &status) == MPI_SUCCESS && MPI_File_read(file, xyzBoxWidth, 4, MPI_FLOAT, &status) == MPI_SUCCESS ){ - FDEBUG(if(sizeOfElement != sizeof(FReal)){) - FDEBUG( FDebug::Controller.writeFromLine("Warning type size between file and FReal are differents\n", __LINE__, __FILE__); ) - FDEBUG(}) + FLOG(if(sizeOfElement != sizeof(FReal)){) + FLOG( FDebug::Controller.writeFromLine("Warning type size between file and FReal are differents\n", __LINE__, __FILE__); ) + FLOG(}) this->boxWidth = xyzBoxWidth[3]; this->centerOfBox.setPosition(xyzBoxWidth[0],xyzBoxWidth[1],xyzBoxWidth[2]); @@ -121,9 +121,9 @@ public: // check if needed int count(0); MPI_Get_count(&status, MPI_INT, &count); - FDEBUG(if(count / 4 != this->nbParticles){) - FDEBUG( FDebug::Controller<< "Error read " << count << " data, nbPart is " << this->nbParticles << __LINE__ << " " << __FILE__ << "\n"; ) - FDEBUG(}) + FLOG(if(count / 4 != this->nbParticles){) + FLOG( FDebug::Controller<< "Error read " << count << " data, nbPart is " << this->nbParticles << __LINE__ << " " << __FILE__ << "\n"; ) + FLOG(}) } else{ this->totalNbParticles = 0; @@ -138,9 +138,9 @@ public: if(file != NULL) { int sizeOfElement(0); removeWarning += fread(&sizeOfElement, sizeof(int), 1, file); - FDEBUG(if(sizeOfElement != int(sizeof(FReal)) ){) - FDEBUG( FDebug::Controller.writeFromLine("Warning type size between file and FReal are differents\n", __LINE__, __FILE__); ) - FDEBUG(}) + FLOG(if(sizeOfElement != int(sizeof(FReal)) ){) + FLOG( FDebug::Controller.writeFromLine("Warning type size between file and FReal are differents\n", __LINE__, __FILE__); ) + FLOG(}) removeWarning += fread(&this->totalNbParticles, sizeof(FSize), 1, file); removeWarning += fread(&this->boxWidth, sizeof(FReal), 1, file); diff --git a/Src/Utils/FDebug.hpp b/Src/Utils/FDebug.hpp index eb488449..a66b6be9 100755 --- a/Src/Utils/FDebug.hpp +++ b/Src/Utils/FDebug.hpp @@ -23,11 +23,11 @@ #ifndef ScalFMM_USE_LOG -#define FDEBUG( X ) +#define FLOG( X ) #else -#define FDEBUG( X ) X +#define FLOG( X ) X #include #include @@ -42,8 +42,8 @@ * You have to use the DEBUG macro as shown in the example. * * -* FDEBUG( FDebug::Controller.writeFromLine("hello World", __LINE__, __FILE__); )
-* FDEBUG( FDebug::Controller << "I want to debug " << toto << "\n"; ) +* FLOG( FDebug::Controller.writeFromLine("hello World", __LINE__, __FILE__); )
+* FLOG( FDebug::Controller << "I want to debug " << toto << "\n"; ) *
*/ class FDebug : public FNoCopyable { diff --git a/Src/Utils/FSpherical.hpp b/Src/Utils/FSpherical.hpp index 5bfaf857..9fe1b1c0 100755 --- a/Src/Utils/FSpherical.hpp +++ b/Src/Utils/FSpherical.hpp @@ -59,7 +59,7 @@ public: this->sinTheta = FMath::Sqrt(x2y2) / r; this->theta = FMath::ACos(this->cosTheta); // if r == 0 we cannot divide! - FDEBUG(if( r < FMath::Epsilon ) FDebug::Controller << "!!! In FSpherical, r == 0!\n"; ) + FLOG(if( r < FMath::Epsilon ) FDebug::Controller << "!!! In FSpherical, r == 0!\n"; ) } /** Get the radius */ diff --git a/Tests/Utils/testDebug.cpp b/Tests/Utils/testDebug.cpp index 74ed4c70..8073b8cc 100755 --- a/Tests/Utils/testDebug.cpp +++ b/Tests/Utils/testDebug.cpp @@ -27,21 +27,21 @@ int main(void){ std::cout << ">> to understand the FDebug system.\n"; ////////////////////////////////////////////////////////////// // Print data simply - FDEBUG( FDebug::Controller << "Hello Wordl\n"); + FLOG( FDebug::Controller << "Hello Wordl\n"); // Print a variable (formated print) int i = 50; - FDEBUG( FDebug::Controller.writeVariableFromLine( "i", i, __LINE__, __FILE__);); + FLOG( FDebug::Controller.writeVariableFromLine( "i", i, __LINE__, __FILE__);); // Write a developer information - FDEBUG( FDebug::Controller.writeFromLine("Strange things are there!", __LINE__, __FILE__); ) + FLOG( FDebug::Controller.writeFromLine("Strange things are there!", __LINE__, __FILE__); ) // Flush - FDEBUG( FDebug::Controller << FDebug::Flush ); + FLOG( FDebug::Controller << FDebug::Flush ); // Change stream type - FDEBUG( FDebug::Controller.writeToFile("testDebug.out.temp"); ) - FDEBUG( FDebug::Controller << "Hello Wordl 2 the return\n"); + FLOG( FDebug::Controller.writeToFile("testDebug.out.temp"); ) + FLOG( FDebug::Controller << "Hello Wordl 2 the return\n"); return 0; } -- GitLab