Commit 3bac8835 authored by berenger-bramas's avatar berenger-bramas
Browse files

ExtendValue is now ExtendPhysicalValue

A trace system has been added (FTrace).
Output format may change later.

__PRETTY_FUNCTION__ can be used (to replace __FONCTION__)
but it is a large name (difficult to read) because of template.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@23 2616d619-271b-44dc-8df4-d4a8f33a7222
parent f579a60e
......@@ -12,7 +12,7 @@
*
* If you want to create you own kernels you have to inherit from this class.
*/
template< class ParticuleClass, class CellClass>
template< class ParticuleClass, class CellClass, int TreeHeight>
class FAbstractKernels{
public:
/** Default destructor */
......
......@@ -4,7 +4,7 @@
#include "FAbstractKernels.hpp"
#include "../Utils/FDebug.hpp"
#include "../Utils/FTrace.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -15,8 +15,8 @@
* This kernels simply shows the details of the information
* it receives (in debug)
*/
template< class ParticuleClass, class CellClass>
class FBasicKernels : public FAbstractKernels<ParticuleClass,CellClass> {
template< class ParticuleClass, class CellClass, int TreeHeight>
class FBasicKernels : public FAbstractKernels<ParticuleClass,CellClass,TreeHeight> {
public:
/** Default destructor */
virtual ~FBasicKernels(){
......@@ -26,33 +26,39 @@ public:
virtual void init(){}
/** Print the number of particules */
virtual void P2M(CellClass* const pole, const FList<ParticuleClass*>* const particules) {
//FDEBUG( FDebug::Controller << "P2M : " << particules->getSize() << "\n" );
virtual void P2M(CellClass* const , const FList<ParticuleClass*>* const ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the morton index */
virtual void M2M(CellClass* const FRestrict pole, const CellClass*const FRestrict *const FRestrict child, const int inLevel) {
//FDEBUG( FDebug::Controller << "M2M : " << pole->getMortonIndex() << "\n" );
virtual void M2M(CellClass* const FRestrict , const CellClass*const FRestrict *const FRestrict , const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the morton index */
virtual void M2L(CellClass* const FRestrict pole, const CellClass*const FRestrict *const FRestrict distantNeighbors, const int size, const int inLevel) {
//FDEBUG( FDebug::Controller << "M2L : " << pole->getMortonIndex() << " (" << size << ")\n" );
virtual void M2L(CellClass* const FRestrict , const CellClass*const FRestrict *const FRestrict , const int , const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the morton index */
virtual void L2L(const CellClass* const FRestrict local, CellClass* FRestrict *const FRestrict child, const int inLevel) {
//FDEBUG( FDebug::Controller << "L2L : " << local->getMortonIndex() << "\n" );
virtual void L2L(const CellClass* const FRestrict , CellClass* FRestrict *const FRestrict , const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the number of particules */
virtual void L2P(const CellClass* const pole, FList<ParticuleClass*>* const particules){
//FDEBUG( FDebug::Controller << "L2P : " << particules->getSize() << "\n" );
virtual void L2P(const CellClass* const , FList<ParticuleClass*>* const ){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the number of particules */
virtual void P2P(FList<ParticuleClass*>* const FRestrict currentBox, const FList<ParticuleClass*>* FRestrict const* FRestrict directNeighbors, const int size) {
//FDEBUG( FDebug::Controller << "P2P : " << currentBox->getSize() << " (" << size << ")\n" );
virtual void P2P(FList<ParticuleClass*>* const FRestrict , const FList<ParticuleClass*>* FRestrict const* FRestrict , const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
};
......
#ifndef FEXTENDVALUE_HPP
#define FEXTENDVALUE_HPP
#ifndef FExtendPhysicalValue_HPP
#define FExtendPhysicalValue_HPP
// /!\ Please, you must read the license at the bottom of this page
#include "../Utils/FGlobal.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FExtendValue
* @class FExtendPhysicalValue
* Please read the license
* This class is an extenssion.
* It proposes a value (FReal).
* It proposes a physicalValue (FReal).
*/
class FExtendValue {
class FExtendPhysicalValue {
protected:
FReal value; //< A simple value
FReal physicalValue; //< A simple physicalValue
public:
/** Default constructor */
FExtendValue() : value(0) {
FExtendPhysicalValue() : physicalValue(0) {
}
/** Copy constructor */
FExtendValue(const FExtendValue& other) : value(other.value) {
FExtendPhysicalValue(const FExtendPhysicalValue& other) : physicalValue(other.physicalValue) {
}
/** Destructor */
virtual ~FExtendValue(){
virtual ~FExtendPhysicalValue(){
}
/** Copy Constructor */
FExtendValue& operator=(const FExtendValue& other) {
this->value = other.value;
FExtendPhysicalValue& operator=(const FExtendPhysicalValue& other) {
this->physicalValue = other.physicalValue;
return *this;
}
/** To get the value */
FReal getValue() const {
return this->value;
/** To get the physicalValue */
FReal getPhysicalValue() const {
return this->physicalValue;
}
/** To set the value */
void setValue(const FReal invalue) {
this->value = invalue;
/** To set the physicalValue */
void setPhysicalValue(const FReal inphysicalValue) {
this->physicalValue = inphysicalValue;
}
};
#endif //FEXTENDVALUE_HPP
#endif //FExtendPhysicalValue_HPP
// [--LICENSE--]
......@@ -4,6 +4,7 @@
#include "../Utils/FAssertable.hpp"
#include "../Utils/FDebug.hpp"
#include "../Utils/FTrace.hpp"
#include "../Utils/FTic.hpp"
#include "../Containers/FOctree.hpp"
......@@ -20,16 +21,17 @@
*
* Of course this class does not deallocate pointer given in arguements.
*/
template<template< class ParticuleClass, class CellClass> class KernelClass, class ParticuleClass, class CellClass, int OctreeHeight, int SubtreeHeight>
template<template< class ParticuleClass, class CellClass, int OctreeHeight> class KernelClass, class ParticuleClass, class CellClass, int OctreeHeight, int SubtreeHeight>
class FFMMAlgorithm : protected FAssertable{
// To reduce the size of variable type based on foctree in this file
typedef FOctree<ParticuleClass, CellClass, OctreeHeight, SubtreeHeight> Octree;
typedef typename FOctree<ParticuleClass, CellClass, OctreeHeight, SubtreeHeight>::Iterator FOctreeIterator;
Octree* const tree; //< The octree to work on
KernelClass<ParticuleClass, CellClass>* const kernels; //< The kernels
Octree* const tree; //< The octree to work on
KernelClass<ParticuleClass, CellClass, OctreeHeight>* const kernels; //< The kernels
FDEBUG_TIME(FTic counter); //< In case of debug: to count the time
FDEBUG(FTic counter); //< In case of debug: to count the elapsed time
FDEBUG(FTic computationCounter); //< In case of debug: to count computation time
public:
/** The constructor need the octree and the kernels used for computation
......@@ -37,14 +39,13 @@ public:
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
FFMMAlgorithm(Octree* const inTree,
KernelClass<ParticuleClass, CellClass>* const inKernels)
FFMMAlgorithm(Octree* const inTree, KernelClass<ParticuleClass,CellClass,OctreeHeight>* const inKernels)
: tree(inTree) , kernels(inKernels) {
assert(tree, "tree cannot be null", __LINE__, __FILE__);
assert(kernels, "kernels cannot be null", __LINE__, __FILE__);
FDEBUG_TRACE(FDebug::Controller << "FFMMAlgorithm\n");
FDEBUG(FDebug::Controller << "FFMMAlgorithm\n");
}
/** Default destructor */
......@@ -56,6 +57,8 @@ public:
* Call this function to run the complete algorithm
*/
void execute(){
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
kernels->init();
bottomPass();
......@@ -64,12 +67,15 @@ public:
downardPass();
directPass();
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** P2M */
void bottomPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) );
FDEBUG( counter.tic() );
FDEBUG( double totalComputation = 0 );
FOctreeIterator octreeIterator(tree);
......@@ -78,17 +84,24 @@ public:
do{
// We need the current cell that represent the leaf
// and the list of particules
FDEBUG(computationCounter.tic());
kernels->P2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentList());
FDEBUG(computationCounter.tac());
FDEBUG(totalComputation += computationCounter.elapsed());
} while(octreeIterator.moveRight());
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** M2M */
void upwardPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
FDEBUG( double totalComputation = 0 );
// Start from leal level - 1
FOctreeIterator octreeIterator(tree);
......@@ -103,21 +116,28 @@ public:
do{
// We need the current cell and the child
// child is an array (of 8 child) that may be null
FDEBUG(computationCounter.tic());
kernels->M2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), idxLevel);
FDEBUG(computationCounter.tac());
FDEBUG(totalComputation += computationCounter.elapsed());
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveUp();
octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft();
}
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** M2L L2L */
void downardPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
FDEBUG( double totalComputation = 0 );
{ // first M2L
FOctreeIterator octreeIterator(tree);
......@@ -131,18 +151,23 @@ public:
// for each cells
do{
const int counter = tree->getDistantNeighbors(neighbors, octreeIterator.getCurrentGlobalIndex(),idxLevel);
FDEBUG(computationCounter.tic());
if(counter) kernels->M2L( octreeIterator.getCurrentCell() , neighbors, counter, idxLevel);
FDEBUG(computationCounter.tac());
FDEBUG(totalComputation += computationCounter.elapsed());
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
}
}
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" );
FDEBUG_TRACE( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
FDEBUG( totalComputation = 0 );
{ // second L2L
FOctreeIterator octreeIterator(tree);
octreeIterator.moveDown();
......@@ -154,7 +179,10 @@ public:
for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){
// for each cells
do{
FDEBUG(computationCounter.tic());
kernels->L2L( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), idxLevel);
FDEBUG(computationCounter.tac());
FDEBUG(totalComputation += computationCounter.elapsed());
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
......@@ -162,15 +190,18 @@ public:
}
}
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** P2P */
void directPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
FDEBUG( double totalComputation = 0 );
const int heightMinusOne = OctreeHeight - 1;
......@@ -180,15 +211,22 @@ public:
FList<ParticuleClass*>* neighbors[26];
// for each leafs
do{
FDEBUG(computationCounter.tic());
kernels->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentList());
FDEBUG(computationCounter.tac());
FDEBUG(totalComputation += computationCounter.elapsed());
// need the current particules and neighbors particules
const int counter = tree->getLeafsNeighbors(neighbors, octreeIterator.getCurrentGlobalIndex(),heightMinusOne);
FDEBUG(computationCounter.tic());
kernels->P2P( octreeIterator.getCurrentList() , neighbors, counter);
FDEBUG(computationCounter.tac());
FDEBUG(totalComputation += computationCounter.elapsed());
} while(octreeIterator.moveRight());
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
};
......
......@@ -4,6 +4,7 @@
#include "../Utils/FAssertable.hpp"
#include "../Utils/FDebug.hpp"
#include "../Utils/FTrace.hpp"
#include "../Utils/FTic.hpp"
#include "../Utils/FOpenMPThread.hpp"
......@@ -22,18 +23,18 @@
*
* The parallel algorithm is simple, each thread is taking a value from the iterator (protected by a mutex)
*/
template<template< class ParticuleClass, class CellClass> class KernelClass, class ParticuleClass, class CellClass, int OctreeHeight, int SubtreeHeight>
template<template< class ParticuleClass, class CellClass, int OctreeHeight> class KernelClass, class ParticuleClass, class CellClass, int OctreeHeight, int SubtreeHeight>
class FFMMAlgorithmThreaded : protected FAssertable{
// To reduce the size of variable type based on foctree in this file
typedef FOctree<ParticuleClass, CellClass, OctreeHeight, SubtreeHeight> Octree;
typedef typename FOctree<ParticuleClass, CellClass, OctreeHeight, SubtreeHeight>::Iterator FOctreeIterator;
static const int NbThreads = 4; //< Number of threads (currently a static number)
static const int NbThreads = 4; //< Number of threads (currently a static number)
KernelClass<ParticuleClass, CellClass>* kernels[NbThreads]; //< The kernels (one by thread)
Octree* const tree; //< The octree to work on
KernelClass<ParticuleClass, CellClass, OctreeHeight>* kernels[NbThreads]; //< The kernels (one by thread)
Octree* const tree; //< The octree to work on
FDEBUG_TIME(FTic counter); //< In case of debug count the time
FDEBUG(FTic counter); //< In case of debug count the time
public:
/** The constructor need the octree and the kernels used for computation
......@@ -42,17 +43,17 @@ public:
* an assert is launched if one of the arguments is null
*/
FFMMAlgorithmThreaded(Octree* const inTree,
KernelClass<ParticuleClass, CellClass>* const inKernels)
KernelClass<ParticuleClass, CellClass, OctreeHeight>* const inKernels)
: tree(inTree) {
assert(tree, "tree cannot be null", __LINE__, __FILE__);
assert(kernels, "kernels cannot be null", __LINE__, __FILE__);
for(int idxThread = 0 ; idxThread < NbThreads ; ++idxThread){
this->kernels[idxThread] = new KernelClass<ParticuleClass, CellClass>(*inKernels);
this->kernels[idxThread] = new KernelClass<ParticuleClass, CellClass, OctreeHeight>(*inKernels);
}
FDEBUG_TRACE(FDebug::Controller << "FFMMAlgorithmThreaded\n" );
FDEBUG(FDebug::Controller << "FFMMAlgorithmThreaded\n" );
}
/** Default destructor */
......@@ -66,6 +67,8 @@ public:
* Call this function to run the complete algo
*/
void execute(){
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
for(int idxThread = 0 ; idxThread < NbThreads ; ++idxThread){
this->kernels[idxThread]->init();
}
......@@ -76,12 +79,14 @@ public:
downardPass();
directPass();
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** P2M */
void bottomPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Bottom Pass\n").write(FDebug::Flush) );
FDEBUG( counter.tic() );
FOctreeIterator octreeIterator(tree);
// Iterate on leafs
......@@ -110,14 +115,16 @@ public:
}
omp_destroy_lock(&mutex);
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** M2M */
void upwardPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Upward Pass\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
FOctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
......@@ -152,14 +159,16 @@ public:
}
omp_destroy_lock(&mutex);
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** M2L L2L */
void downardPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Downward Pass (M2L)\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
{ // first M2L
FOctreeIterator octreeIterator(tree);
......@@ -195,11 +204,11 @@ public:
}
omp_destroy_lock(&mutex);
}
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FDEBUG_TRACE( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FDEBUG( FDebug::Controller.write("\tStart Downward Pass (L2L)\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
{ // second L2L
FOctreeIterator octreeIterator(tree);
octreeIterator.moveDown();
......@@ -234,15 +243,16 @@ public:
omp_destroy_lock(&mutex);
}
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
/** P2P */
void directPass(){
FDEBUG_TRACE( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); );
FDEBUG_TIME( counter.tic() );
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); );
FDEBUG( counter.tic() );
FOctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
......@@ -277,9 +287,9 @@ public:
}
omp_destroy_lock(&mutex);
FDEBUG_TIME( counter.tac() );
FDEBUG_TRACE( FDebug::Controller << "\tFinished (" FDEBUG_TIME(<< counter.elapsed() <<) "s)\n" );
FDEBUG( counter.tac() );
FDEBUG( FDebug::Controller << "\tFinished (" << counter.elapsed() << "s)\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
};
......
......@@ -3,7 +3,7 @@
// /!\ Please, you must read the license at the bottom of this page
#include "FBasicParticule.hpp"
#include "FExtendValue.hpp"
#include "FExtendPhysicalValue.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -11,9 +11,9 @@
* Please read the license
*
* This class defines a particule for FMA loader.
* As defined in FFmaLoader it needs {FBasicParticule,FExtendValue}
* As defined in FFmaLoader it needs {FBasicParticule,FExtendPhysicalValue}
*/
class FFmaParticule : public FBasicParticule, public FExtendValue {
class FFmaParticule : public FBasicParticule, public FExtendPhysicalValue {
public:
/** Default destructor */
virtual ~FFmaParticule(){
......
......@@ -2,10 +2,13 @@
#define FTESTKERNELS_HPP
// /!\ Please, you must read the license at the bottom of this page
#include "FAbstractKernels.hpp"
#include <iostream>
#include "FAbstractKernels.hpp"
#include "../Containers/FList.hpp"
#include "../Containers/FOctree.hpp"
#include "../Utils/FTrace.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -17,8 +20,8 @@
* correctly done on particules.
* It used FTestCell and FTestParticule
*/
template< class ParticuleClass, class CellClass>
class FTestKernels : public FAbstractKernels<ParticuleClass,CellClass> {
template< class ParticuleClass, class CellClass, int TreeHeight>
class FTestKernels : public FAbstractKernels<ParticuleClass,CellClass,TreeHeight> {
public:
/** Default destructor */
virtual ~FTestKernels(){
......@@ -26,45 +29,56 @@ public:
// Before upward
void P2M(CellClass* const pole, const FList<ParticuleClass*>* const particules) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// the pole represents all particules under
pole->setDataUp(particules->getSize());