Commit a0d03ae6 authored by berenger-bramas's avatar berenger-bramas

Change the allocation of the particles and the way there are stored in the tree.

Now the leafs contains a list of real particles (and not pointers).
It make the P2P running faster (excepted with openmp, I'm going to fix it now).

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@97 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 208afb6a
......@@ -11,7 +11,7 @@ OPTION( SCALFMM_USE_CBLAS "Set to ON to build ScaFMM with BLAS" ON )
OPTION( SCALFMM_USE_MPI "Set to ON to build ScaFMM with MPI" ON )
OPTION( SCALFMM_BUILD_TESTS "Set to ON to build fonctionnalities Tests" ON )
OPTION( SCALFMM_BUILD_UTESTS "Set to ON to build UTests" ON )
OPTION( SCALFMM_BUILD_DEBUG "Set to ON to build in Debug" ON )
OPTION( SCALFMM_BUILD_DEBUG "Set to ON to build in Debug" OFF )
# MPI option has to be set before project
if( SCALFMM_USE_MPI )
......
......@@ -25,7 +25,7 @@ public:
* @param pole the multipole to fill using the particles
* @param particles the particles from the same spacial boxe
*/
virtual void P2M(CellClass* const pole, const FList<ParticleClass*>* const particles) = 0;
virtual void P2M(CellClass* const pole, const FList<ParticleClass>* const particles) = 0;
/**
* M2M
......@@ -65,7 +65,7 @@ public:
* @param local the leaf element (smaller boxe local element)
* @param particles the list of particles inside this boxe
*/
virtual void L2P(const CellClass* const local, FList<ParticleClass*>* const particles) = 0;
virtual void L2P(const CellClass* const local, FList<ParticleClass>* const particles) = 0;
/**
* P2P
......@@ -75,8 +75,8 @@ public:
* @param directNeighborsParticles the particles from direct neighbors (this is an array of list)
* @param size the number of direct neighbors (the size of the array directNeighborsParticles)
*/
virtual void P2P(FList<ParticleClass*>* const FRestrict targets, const FList<ParticleClass*>* const FRestrict sources,
const FList<ParticleClass*>* const directNeighborsParticles[26], const int size) = 0;
virtual void P2P(FList<ParticleClass>* const FRestrict targets, const FList<ParticleClass>* const FRestrict sources,
const FList<ParticleClass>* const directNeighborsParticles[26], const int size) = 0;
/**
* P2P
......@@ -89,8 +89,8 @@ public:
* @param size the number of direct neighbors (the size of the array directNeighborsParticles)
*/
virtual void P2P(const MortonIndex inCurrentLeafIndex,
FList<ParticleClass*>* const FRestrict targets, const FList<ParticleClass*>* const FRestrict sources,
FList<ParticleClass*>* const directNeighborsParticles[26], const MortonIndex inNeighborsIndex[26], const int size) = 0;
FList<ParticleClass>* const FRestrict targets, const FList<ParticleClass>* const FRestrict sources,
FList<ParticleClass>* const directNeighborsParticles[26], const MortonIndex inNeighborsIndex[26], const int size) = 0;
};
......
......@@ -24,7 +24,7 @@ public:
* Depending on the system to use the class that inherit
* this interface can sort the particle as they like.
*/
virtual void push(ParticleClass* const particle) = 0;
virtual void push(const ParticleClass& particle) = 0;
/**
* To get all the sources in a leaf
......@@ -32,7 +32,7 @@ public:
* Depending on the system to use the class that inherit
* this interface can sort the particle as they like.
*/
virtual FList<ParticleClass*>* getSrc() = 0;
virtual FList<ParticleClass>* getSrc() = 0;
/**
* To get all the target in a leaf
......@@ -40,7 +40,7 @@ public:
* Depending on the system to use the class that inherit
* this interface can sort the particle as they like.
*/
virtual FList<ParticleClass*>* getTargets() = 0;
virtual FList<ParticleClass>* getTargets() = 0;
};
......
......@@ -23,7 +23,7 @@ public:
}
/** Print the number of particles */
virtual void P2M(CellClass* const , const FList<ParticleClass*>* const ) {
virtual void P2M(CellClass* const , const FList<ParticleClass>* const ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
......@@ -47,21 +47,21 @@ public:
}
/** Print the number of particles */
virtual void L2P(const CellClass* const , FList<ParticleClass*>* const ){
virtual void L2P(const CellClass* const , FList<ParticleClass>* const ){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the number of particles */
virtual void P2P(FList<ParticleClass*>* const FRestrict , const FList<ParticleClass*>* const FRestrict ,
const FList<ParticleClass*>* const [26], const int ) {
virtual void P2P(FList<ParticleClass>* const FRestrict , const FList<ParticleClass>* const FRestrict ,
const FList<ParticleClass>* const [26], const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
virtual void P2P(const MortonIndex ,
FList<ParticleClass*>* const FRestrict , const FList<ParticleClass*>* const FRestrict ,
FList<ParticleClass*>* const [26], const MortonIndex [26], const int ){
FList<ParticleClass>* const FRestrict , const FList<ParticleClass>* const FRestrict ,
FList<ParticleClass>* const [26], const MortonIndex [26], const int ){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
......
......@@ -15,7 +15,7 @@
*/
template< class ParticleClass >
class FSimpleLeaf : public FAbstractLeaf<ParticleClass> {
FList<ParticleClass*> particles;
FList<ParticleClass> particles;
public:
/** Default destructor */
......@@ -26,7 +26,7 @@ public:
* To add a new particle in the leaf
* @param particle the new particle
*/
void push(ParticleClass* const particle){
void push(const ParticleClass& particle){
this->particles.pushFront(particle);
}
......@@ -34,7 +34,7 @@ public:
* To get all the sources in a leaf
* @return a pointer to the list of particles that are sources
*/
FList<ParticleClass*>* getSrc() {
FList<ParticleClass>* getSrc() {
return &this->particles;
}
......@@ -42,7 +42,7 @@ public:
* To get all the target in a leaf
* @return a pointer to the list of particles that are targets
*/
FList<ParticleClass*>* getTargets() {
FList<ParticleClass>* getTargets() {
return &this->particles;
}
......
......@@ -28,7 +28,7 @@ public:
}
// Before upward
void P2M(CellClass* const pole, const FList<ParticleClass*>* const particles) {
void P2M(CellClass* const pole, const FList<ParticleClass>* const particles) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// the pole represents all particles under
pole->setDataUp(particles->getSize());
......@@ -70,20 +70,20 @@ public:
}
// After Downward
void L2P(const CellClass* const local, FList<ParticleClass*>*const particles){
void L2P(const CellClass* const local, FList<ParticleClass>*const particles){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// The particles is impacted by the parent cell
typename FList<ParticleClass*>::BasicIterator iter(*particles);
typename FList<ParticleClass>::BasicIterator iter(*particles);
while( iter.isValide() ){
iter.value()->setDataDown(iter.value()->getDataDown() + local->getDataDown());
iter.value().setDataDown(iter.value().getDataDown() + local->getDataDown());
iter.progress();
}
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// After Downward
void P2P(FList<ParticleClass*>* const FRestrict targets, const FList<ParticleClass*>* const FRestrict sources,
const FList<ParticleClass*>* const directNeighborsParticles[26], const int size) {
void P2P(FList<ParticleClass>* const FRestrict targets, const FList<ParticleClass>* const FRestrict sources,
const FList<ParticleClass>* const directNeighborsParticles[26], const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// Each particles targeted is impacted by the particles sources
long inc = sources->getSize();
......@@ -94,9 +94,9 @@ public:
inc += directNeighborsParticles[idx]->getSize();
}
typename FList<ParticleClass*>::BasicIterator iter(*targets);
typename FList<ParticleClass>::BasicIterator iter(*targets);
while( iter.isValide() ){
iter.value()->setDataDown(iter.value()->getDataDown() + inc);
iter.value().setDataDown(iter.value().getDataDown() + inc);
iter.progress();
}
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
......@@ -105,8 +105,8 @@ public:
// After Downward
void P2P(const MortonIndex ,
FList<ParticleClass*>* const FRestrict targets, const FList<ParticleClass*>* const FRestrict sources,
FList<ParticleClass*>* const directNeighborsParticles[26], const MortonIndex [26], const int size) {
FList<ParticleClass>* const FRestrict targets, const FList<ParticleClass>* const FRestrict sources,
FList<ParticleClass>* const directNeighborsParticles[26], const MortonIndex [26], const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// Each particles targeted is impacted by the particles sources
long inc = sources->getSize();
......@@ -117,9 +117,9 @@ public:
inc += directNeighborsParticles[idx]->getSize();
}
typename FList<ParticleClass*>::BasicIterator iter(*targets);
typename FList<ParticleClass>::BasicIterator iter(*targets);
while( iter.isValide() ){
iter.value()->setDataDown(iter.value()->getDataDown() + inc);
iter.value().setDataDown(iter.value().getDataDown() + inc);
iter.progress();
}
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
......@@ -174,16 +174,16 @@ void ValidateFMMAlgo(FOctree<ParticleClass, CellClass, LeafClass, TreeHeight , S
typename FOctree<ParticleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
do{
typename FList<ParticleClass*>::BasicIterator iter(*octreeIterator.getCurrentListTargets());
typename FList<ParticleClass>::BasicIterator iter(*octreeIterator.getCurrentListTargets());
const bool isUsingTsm = (octreeIterator.getCurrentListTargets() != octreeIterator.getCurrentListSrc());
while( iter.isValide() ){
// If a particles has been impacted by less than NbPart - 1 (the current particle)
// there is a problem
if( (!isUsingTsm && iter.value()->getDataDown() != NbPart - 1) ||
(isUsingTsm && iter.value()->getDataDown() != NbPart) ){
std::cout << "Problem L2P + P2P : " << iter.value()->getDataDown() << "\n";
if( (!isUsingTsm && iter.value().getDataDown() != NbPart - 1) ||
(isUsingTsm && iter.value().getDataDown() != NbPart) ){
std::cout << "Problem L2P + P2P : " << iter.value().getDataDown() << "\n";
}
iter.progress();
}
......
......@@ -16,8 +16,8 @@
*/
template< class ParticleClass >
class FTypedLeaf : public FAbstractLeaf<ParticleClass>, public FAssertable {
FList<ParticleClass*> sources;
FList<ParticleClass*> targets;
FList<ParticleClass> sources;
FList<ParticleClass> targets;
public:
/** Default destructor */
......@@ -28,9 +28,9 @@ public:
* To add a new particle in the leaf
* @param particle the new particle
*/
void push(ParticleClass* const particle){
if(particle->isTarget()) this->targets.pushFront(particle);
else if(particle->isSource()) this->sources.pushFront(particle);
void push(const ParticleClass& particle){
if(particle.isTarget()) this->targets.pushFront(particle);
else if(particle.isSource()) this->sources.pushFront(particle);
else assert(false, "Error particle has undefined type.", __LINE__, __FILE__);
}
......@@ -38,7 +38,7 @@ public:
* To get all the sources in a leaf
* @return a pointer to the list of particles that are sources
*/
FList<ParticleClass*>* getSrc() {
FList<ParticleClass>* getSrc() {
return &this->sources;
}
......@@ -46,7 +46,7 @@ public:
* To get all the target in a leaf
* @return a pointer to the list of particles that are targets
*/
FList<ParticleClass*>* getTargets() {
FList<ParticleClass>* getTargets() {
return &this->targets;
}
......
......@@ -92,7 +92,7 @@ public:
* Push an element in the front of the list
* @param inObject the object to insert
*/
void pushFront(Object& inObject){
void pushFront(const Object& inObject){
Node* newNode = new Node;
newNode->target = inObject;
newNode->next = this->root;
......@@ -106,14 +106,14 @@ public:
* used when type is pointer and like [TYPE* const] object
* @param inObject the object to insert
*/
void pushFront(Object const inObject){
/*void pushFront(Object const inObject){
Node* newNode = new Node;
newNode->target = inObject;
newNode->next = this->root;
this->root = newNode;
++this->size;
}
}*/
/**
* To get front value (last pushed value)
......
......@@ -108,8 +108,8 @@ public:
* ask node to insert this particle
* @param inParticle the particle to insert (must inherite from FAbstractParticle)
*/
void insert(ParticleClass* const inParticle){
const MortonIndex particleIndex = getLeafMortonFromPosition( inParticle->getPosition() );
void insert(const ParticleClass& inParticle){
const MortonIndex particleIndex = getLeafMortonFromPosition( inParticle.getPosition() );
root.insert( particleIndex, inParticle, this->height, this->boxWidthAtLevel);
}
......@@ -489,7 +489,7 @@ public:
* You have to be at the leaf level to call this function!
* @return current element list
*/
FList<ParticleClass*>* getCurrentListSrc() {
FList<ParticleClass>* getCurrentListSrc() {
return this->current.leafTree->getLeafSrc(this->currentLocalIndex);
}
......@@ -497,7 +497,7 @@ public:
* You have to be at the leaf level to call this function!
* @return current element list
*/
FList<ParticleClass*>* getCurrentListTargets() {
FList<ParticleClass>* getCurrentListTargets() {
return this->current.leafTree->getLeafTargets(this->currentLocalIndex);
}
......@@ -736,7 +736,7 @@ public:
* @return the cell if it exist or null (0)
*
*/
FList<ParticleClass*>* getLeafSrc(const MortonIndex inIndex){
FList<ParticleClass>* getLeafSrc(const MortonIndex inIndex){
SubOctreeTypes workingTree;
workingTree.tree = &this->root;
const MortonIndex treeSubLeafMask = ~(~0x00LL << (3 * workingTree.tree->getSubOctreeHeight() ));
......@@ -761,7 +761,7 @@ public:
* @param inLevel the level of the element
* @return the number of neighbors
*/
int getLeafsNeighbors(FList<ParticleClass*>* inNeighbors[26], const MortonIndex inIndex, const int inLevel){
int getLeafsNeighbors(FList<ParticleClass>* inNeighbors[26], const MortonIndex inIndex, const int inLevel){
MortonIndex inNeighborsIndex[26];
return getLeafsNeighborsWithIndex(inNeighbors, inNeighborsIndex, inIndex, inLevel);
}
......@@ -772,7 +772,7 @@ public:
* @param inLevel the level of the element
* @return the number of neighbors
*/
int getLeafsNeighborsWithIndex(FList<ParticleClass*>* inNeighbors[26], MortonIndex inNeighborsIndex[26], const MortonIndex inIndex, const int inLevel){
int getLeafsNeighborsWithIndex(FList<ParticleClass>* inNeighbors[26], MortonIndex inNeighborsIndex[26], const MortonIndex inIndex, const int inLevel){
FTreeCoordinate center;
center.setPositionFromMorton(inIndex, inLevel);
......@@ -795,7 +795,7 @@ public:
const FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
// get cell
FList<ParticleClass*>* const leaf = getLeafSrc(mortonOther);
FList<ParticleClass>* const leaf = getLeafSrc(mortonOther);
// add to list if not null
if(leaf){
inNeighborsIndex[idxNeighbors] = mortonOther;
......
......@@ -164,7 +164,7 @@ public:
* @param inParticle the particle to insert (must inherite from FAbstractParticle)
* @param inParticle the inTreeHeight the height of the tree
*/
virtual void insert(const MortonIndex index, ParticleClass* const inParticle, const int inTreeHeight, const FReal* const inBoxWidthAtLevel) = 0;
virtual void insert(const MortonIndex index, const ParticleClass& inParticle, const int inTreeHeight, const FReal* const inBoxWidthAtLevel) = 0;
///////////////////////////////////////
// This is the FOctree::Iterator Part
......@@ -297,7 +297,7 @@ public:
/**
* Refer to FAbstractSubOctree::insert
*/
void insert(const MortonIndex index, ParticleClass* const inParticle, const int inTreeHeight, const FReal* const inBoxWidthAtLevel){
void insert(const MortonIndex index, const ParticleClass& inParticle, const int inTreeHeight, const FReal* const inBoxWidthAtLevel){
// Get the morton index for the leaf level
const MortonIndex arrayIndex = FAbstractSubOctree<ParticleClass,CellClass,LeafClass>::getLeafIndex(index,inTreeHeight);
// is there already a leaf?
......@@ -312,7 +312,7 @@ public:
/** To get access to leafs elements
* @param index the position of the leaf
* @return the list of particles at this index */
FList<ParticleClass*>* getLeafSrc(const int index){
FList<ParticleClass>* getLeafSrc(const int index){
LeafClass<ParticleClass>* const leaf = this->leafs[index];
return (leaf ? leaf->getSrc(): 0);
}
......@@ -320,7 +320,7 @@ public:
/** To get access to leafs elements
* @param index the position of the leaf
* @return the list of particles at this index */
FList<ParticleClass*>* getLeafTargets(const int index){
FList<ParticleClass>* getLeafTargets(const int index){
LeafClass<ParticleClass>* const leaf = this->leafs[index];
return (leaf ? leaf->getTargets(): 0);
}
......@@ -328,7 +328,7 @@ public:
/** To get access to leafs elements
* @param index the position of the leaf
* @return the list of particles at this index */
const FList<ParticleClass*>* getLeafSrc(const int index) const {
const FList<ParticleClass>* getLeafSrc(const int index) const {
LeafClass<ParticleClass>* const leaf = this->leafs[index];
return (leaf ? leaf->getSrc(): 0);
}
......@@ -336,7 +336,7 @@ public:
/** To get access to leafs elements
* @param index the position of the leaf
* @return the list of particles at this index */
const FList<ParticleClass*>* getLeafTargets(const int index) const {
const FList<ParticleClass>* getLeafTargets(const int index) const {
LeafClass<ParticleClass>* const leaf = this->leafs[index];
return (leaf ? leaf->getTargets() : 0);
}
......@@ -406,7 +406,7 @@ public:
/**
* Refer to FAbstractSubOctree::insert
*/
void insert(const MortonIndex index, ParticleClass* const inParticle, const int inTreeHeight, const FReal* const inBoxWidthAtLevel){
void insert(const MortonIndex index, const ParticleClass& inParticle, const int inTreeHeight, const FReal* const inBoxWidthAtLevel){
// We need the morton index at the bottom level of this sub octree
// so we remove the right side
const MortonIndex arrayIndex = FAbstractSubOctree<ParticleClass,CellClass,LeafClass>::getLeafIndex(index,inTreeHeight);
......
......@@ -212,30 +212,32 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); );
FDEBUG(FTic counterTime);
FDEBUG(FTic computationCounter);
FDEBUG(FTic computationCounterL2P);
FDEBUG(FTic computationCounterP2P);
const int heightMinusOne = OctreeHeight - 1;
FOctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
// There is a maximum of 26 neighbors
FList<ParticleClass*>* neighbors[26];
FList<ParticleClass>* neighbors[26];
MortonIndex neighborsIndex[26];
// for each leafs
do{
FDEBUG(computationCounter.tic());
FDEBUG(computationCounterL2P.tic());
kernels->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentListTargets());
FDEBUG(computationCounter.tac());
FDEBUG(computationCounterL2P.tac());
// need the current particles and neighbors particles
const int counter = tree->getLeafsNeighborsWithIndex(neighbors,neighborsIndex, octreeIterator.getCurrentGlobalIndex(),heightMinusOne);
FDEBUG(computationCounter.tic());
FDEBUG(computationCounterP2P.tic());
kernels->P2P(octreeIterator.getCurrentGlobalIndex(),octreeIterator.getCurrentListTargets(), octreeIterator.getCurrentListSrc() , neighbors, neighborsIndex,counter);
FDEBUG(computationCounter.tac());
FDEBUG(computationCounterP2P.tac());
} while(octreeIterator.moveRight());
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" );
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" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
......
......@@ -330,7 +330,7 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
// There is a maximum of 26 neighbors
FList<ParticleClass*>* neighbors[26];
FList<ParticleClass>* neighbors[26];
MortonIndex neighborsIndex[26];
for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
......@@ -352,8 +352,8 @@ public:
delete [] shapeArray[idxShape];
}
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.cumulated() << " s\n" );
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.cumulated() << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
......
......@@ -863,7 +863,7 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
// There is a maximum of 26 neighbors
FList<ParticleClass*>* neighbors[26];
FList<ParticleClass>* neighbors[26];
MortonIndex neighborsIndex[26];
for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
......@@ -881,8 +881,8 @@ public:
}
FDEBUG(computationCounter.tac());
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" );
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
......
......@@ -126,7 +126,7 @@ public:
for(int idxLeafs = 0 ; idxLeafs < numberOfLeafs ; ++idxLeafs){
// We need the current cell that represent the leaf
// and the list of particles
FList<ParticleClass*>* const sources = iterArray[idxLeafs].getCurrentListSrc();
FList<ParticleClass>* const sources = iterArray[idxLeafs].getCurrentListSrc();
if(sources->getSize()){
iterArray[idxLeafs].getCurrentCell()->setSrcChildTrue();
myThreadkernels->P2M( iterArray[idxLeafs].getCurrentCell() , sources);
......@@ -334,7 +334,7 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
// There is a maximum of 26 neighbors
FList<ParticleClass*>* neighbors[26];
FList<ParticleClass>* neighbors[26];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < numberOfLeafs ; ++idxLeafs){
......@@ -347,8 +347,8 @@ public:
FDEBUG(computationCounter.tac());
FDEBUG( counterTime.tac() );
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" );
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
......
......@@ -287,7 +287,7 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
// There is a maximum of 26 neighbors
FList<ParticleClass*>* neighbors[26];
FList<ParticleClass>* neighbors[26];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < numberOfLeafs ; ++idxLeafs){
......@@ -299,8 +299,8 @@ public:
}
FDEBUG(computationCounter.tac());
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << computationCounter.elapsed() << " s\n" );
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.tacAndElapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << computationCounter.elapsed() << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
......
......@@ -88,7 +88,7 @@ public:
// We need the current cell that represent the leaf
// and the list of particles
FDEBUG(computationCounter.tic());
FList<ParticleClass*>* const sources = octreeIterator.getCurrentListSrc();
FList<ParticleClass>* const sources = octreeIterator.getCurrentListSrc();
if(sources->getSize()){
octreeIterator.getCurrentCell()->setSrcChildTrue();
kernels->P2M( octreeIterator.getCurrentCell() , sources);
......@@ -262,7 +262,7 @@ public:
FOctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
// There is a maximum of 26 neighbors
FList<ParticleClass*>* neighbors[26];
FList<ParticleClass>* neighbors[26];
// for each leafs
do{
FDEBUG(computationCounter.tic());
......@@ -275,8 +275,8 @@ public:
} while(octreeIterator.moveRight());
FDEBUG( counterTime.tac() );
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (P2P) = " << counterTime.elapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation : " << totalComputation << " s\n" );
FDEBUG( FDebug::Controller << "\tFinished (@Direct Pass (L2P + P2P) = " << counterTime.elapsed() << "s)\n" );
FDEBUG( FDebug::Controller << "\t\t Computation L2P + P2P : " << totalComputation << " s\n" );
FTRACE( FTrace::Controller.leaveFunction(FTrace::FMM) );
}
......
......@@ -55,7 +55,7 @@ public:
* Fill the next particle
* @param inParticle the particle to fill
*/
virtual void fillParticle(ParticleClass* const inParticle) = 0;
virtual void fillParticle(ParticleClass& inParticle) = 0;
};
......
......@@ -105,10 +105,10 @@ public:
* @warning to work with the loader, particles has to expose a setPosition method
* @param the particle to fill
*/
void fillParticle(ParticleClass* const inParticle){
void fillParticle(ParticleClass& inParticle){
FReal x,y,z;
this->file >> x >> y >> z;
inParticle->setPosition(F3DPosition(x,y,z));
inParticle.setPosition(F3DPosition(x,y,z));
}
};
......