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

Update the comments.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@182 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 79b02bd4
......@@ -23,43 +23,44 @@ public:
virtual ~FBasicKernels(){
}
/** Print the number of particles */
/** Do nothing */
virtual void P2M(CellClass* const , const ContainerClass* const ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the morton index */
/** Do nothing */
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 */
/** Do nothing */
virtual void M2L(CellClass* const FRestrict , const CellClass* [], const int , const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the morton index */
/** Do nothing */
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 particles */
/** Do nothing */
virtual void L2P(const CellClass* const , ContainerClass* const ){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the number of particles */
/** Do nothing */
virtual void P2P(ContainerClass* const FRestrict , const ContainerClass* const FRestrict ,
const ContainerClass* const [26], const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Do nothing */
virtual void P2P(const MortonIndex ,
ContainerClass* const FRestrict , const ContainerClass* const FRestrict ,
ContainerClass* const [26], const MortonIndex [26], const int ){
......
......@@ -10,7 +10,9 @@
* Please read the license
*
* This class is used in the FTestKernels, please
* look at this class to know whit it is.
* look at this class to know what it is.
*
* This cell simply store the data when up/down
*/
class FTestCell : public FBasicCell {
protected:
......@@ -22,15 +24,19 @@ public:
/** Default destructor */
virtual ~FTestCell(){
}
/** When doing the upward pass */
long getDataUp() const {
return this->dataUp;
}
/** When doing the upward pass */
void setDataUp(const long inData){
this->dataUp = inData;
}
/** When doing the downard pass */
long getDataDown() const {
return this->dataDown;
}
/** When doing the downard pass */
void setDataDown(const long inData){
this->dataDown = inData;
}
......
......@@ -26,7 +26,7 @@ public:
virtual ~FTestKernels(){
}
// Before upward
/** Before upward */
void P2M(CellClass* const pole, const ContainerClass* const particles) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// the pole represents all particles under
......@@ -34,7 +34,7 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// During upward
/** During upward */
void M2M(CellClass* const FRestrict pole, const CellClass *const FRestrict *const FRestrict child, const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// A parent represents the sum of the child
......@@ -46,7 +46,7 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// Before Downward
/** Before Downward */
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208], const int size, const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// The pole is impacted by what represent other poles
......@@ -56,7 +56,7 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// During Downward
/** During Downward */
void L2L(const CellClass*const FRestrict local, CellClass* FRestrict *const FRestrict child, const int) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// Each child is impacted by the father
......@@ -68,7 +68,7 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// After Downward
/** After Downward */
void L2P(const CellClass* const local, ContainerClass*const particles){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// The particles is impacted by the parent cell
......@@ -80,7 +80,7 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// After Downward
/** After Downward */
void P2P(ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
const ContainerClass* const directNeighborsParticles[26], const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
......@@ -102,7 +102,7 @@ public:
}
// After Downward
/** After Downward */
void P2P(const MortonIndex ,
ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
ContainerClass* const directNeighborsParticles[26], const MortonIndex [26], const int size) {
......
......@@ -11,6 +11,8 @@
*
* This class is used in the FTestKernels, please
* look at this class to know whit it is.
*
* Particles just need the data down.
*/
class FTestParticle : public FBasicParticle {
protected:
......
......@@ -58,6 +58,7 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
bottomPass();
upwardPass();
downardPass();
......
......@@ -4,8 +4,17 @@
#include "../Utils/FQuickSort.hpp"
/** This class manage the loading of particles
* for the mpi version.
* It use a BinLoader and then sort the data
* with a parallel quick sort.
*/
template<class ParticleClass>
class FMpiTreeBuilder{
/** This method has been tacken from the octree
* it computes a tree coordinate (x or y or z) from real position
*/
static long getTreeCoordinate(const FReal inRelativePosition, const FReal boxWidthAtLeafLevel) {
const FReal indexFReal = inRelativePosition / boxWidthAtLeafLevel;
const long index = FMath::dfloor(indexFReal);
......@@ -29,6 +38,7 @@ class FMpiTreeBuilder{
return nb;
}
/** receive data from a tag function */
static void receiveDataFromTag(const int inSize, const int inTag, void* const inData, int* const inSource = 0, int* const inFilledSize = 0){
MPI_Status status;
MPI_Recv(inData, inSize, MPI_CHAR, MPI_ANY_SOURCE, inTag, MPI_COMM_WORLD, &status);
......@@ -58,6 +68,9 @@ class FMpiTreeBuilder{
else return res;
}
/** This struct is used to represent a particles group to
* sort them easily
*/
struct ParticlesGroup {
int number;
int positionInArray;
......@@ -68,6 +81,10 @@ class FMpiTreeBuilder{
};
/** A particle may not have a MortonIndex Method
* but they are sorted on their morton index
* so this struct store a particle and its index
*/
struct IndexedParticle{
MortonIndex index;
ParticleClass particle;
......@@ -77,22 +94,26 @@ class FMpiTreeBuilder{
}
};
IndexedParticle* intervals;
int nbLeavesInIntervals;
IndexedParticle* intervals; //< Current intervals
int nbLeavesInIntervals; //< Nb intervals
private:
// Forbid copy
FMpiTreeBuilder(const FMpiTreeBuilder&){}
FMpiTreeBuilder& operator=(const FMpiTreeBuilder&){return *this;}
public:
/** Constructor */
FMpiTreeBuilder()
: intervals(0), nbLeavesInIntervals(0) {
}
/** Destructor */
virtual ~FMpiTreeBuilder(){
delete [] intervals;
}
/** Split and sort the file */
template <class LoaderClass>
bool splitAndSortFile(LoaderClass& loader, const int NbLevels){
const int rank = MpiGetRank();
......@@ -236,6 +257,7 @@ public:
return true;
}
/** Put the interval into a tree */
template <class OctreeClass>
bool intervalsToTree(OctreeClass& realTree){
const int rank = MpiGetRank();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment