Commit 9ac079da authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

All test files have been modified in order to follow the new way to choose the balancing algorithm

parent 86db170e
......@@ -47,6 +47,7 @@
#include "../../Src/Core/FFmmAlgorithmThread.hpp"
#include "../../Src/Core/FFmmAlgorithmThreadProc.hpp"
#include "../../Src/BalanceTree/FLeafBalance.hpp"
/**
* This program runs the FMM Algorithm Distributed with the Chebyshev kernel
*/
......@@ -110,10 +111,11 @@ int main(int argc, char* argv[])
loader.fillParticle(&particles[idxPart].position,&particles[idxPart].physicalValue);
}
FVector<TestParticle> finalParticles;
FLeafBalance balancer;
FMpiTreeBuilder< TestParticle >::ArrayToTree(app.global(), particles, loader.getNumberOfParticles(),
tree.getBoxCenter(),
tree.getBoxWidth(),
tree.getHeight(), &finalParticles);
tree.getHeight(), &finalParticles,&balancer);
{ // -----------------------------------------------------
std::cout << "Creating & Inserting " << loader.getNumberOfParticles()
......
......@@ -42,6 +42,8 @@
#include "../../Src/Files/FMpiTreeBuilder.hpp"
#include "../../Src/Files/FFmaBinLoader.hpp"
#include "../../Src/BalanceTree/FLeafBalance.hpp"
#include <iostream>
#include <cstdio>
......@@ -281,10 +283,11 @@ int main(int argc, char ** argv){
}
FVector<TestParticle> finalParticles;
FLeafBalance balancer;
FMpiTreeBuilder< TestParticle >::ArrayToTree(app.global(), particles, loader.getNumberOfParticles(),
tree.getBoxCenter(),
tree.getBoxWidth(),
tree.getHeight(), &finalParticles);
tree.getHeight(), &finalParticles,&balancer);
for(int idx = 0 ; idx < finalParticles.getSize(); ++idx){
tree.insert(finalParticles[idx].position,finalParticles[idx].physicalValue);
......
......@@ -47,6 +47,7 @@
#include "../../Src/Core/FFmmAlgorithmThread.hpp"
#include "../../Src/Core/FFmmAlgorithmThreadProc.hpp"
#include "../../Src/BalanceTree/FLeafBalance.hpp"
/**
* This program runs the FMM Algorithm Distributed with the Uniform kernel
*/
......@@ -110,10 +111,11 @@ int main(int argc, char* argv[])
loader.fillParticle(&particles[idxPart].position,&particles[idxPart].physicalValue);
}
FVector<TestParticle> finalParticles;
FLeafBalance balancer;
FMpiTreeBuilder< TestParticle >::ArrayToTree(app.global(), particles, loader.getNumberOfParticles(),
tree.getBoxCenter(),
tree.getBoxWidth(),
tree.getHeight(), &finalParticles);
tree.getHeight(), &finalParticles, &balancer);
{ // -----------------------------------------------------
std::cout << "Creating & Inserting " << loader.getNumberOfParticles()
......
......@@ -44,6 +44,8 @@
#include "../../Src/Components/FBasicKernels.hpp"
#include "../../Src/BalanceTree/FLeafBalance.hpp"
#include <iostream>
#include <cstdio>
#include <cstdlib>
......@@ -357,10 +359,11 @@ int main(int argc, char ** argv){
}
FVector<TestParticle> finalParticles;
FLeafBalance balancer;
FMpiTreeBuilder< TestParticle >::ArrayToTree(app.global(), particles, loader.getNumberOfParticles(),
realTree.getBoxCenter(),
realTree.getBoxWidth(),
realTree.getHeight(), &finalParticles);
realTree.getHeight(), &finalParticles,&balancer);
for(int idx = 0 ; idx < finalParticles.getSize(); ++idx){
realTree.insert(finalParticles[idx].position);
......
......@@ -43,6 +43,7 @@
#include "../../Src/Files/FMpiTreeBuilder.hpp"
#include "../../Src/BalanceTree/FLeafBalance.hpp"
/** This program show an example of use of
* the fmm basic algo
......@@ -100,8 +101,9 @@ int main(int argc, char ** argv){
}
FVector<TestParticle> finalParticles;
FLeafBalance balancer;
FMpiTreeBuilder<TestParticle>::ArrayToTree(app.global(), particles, NbParticles, loader.getCenterOfBox(),
loader.getBoxWidth(), tree.getHeight(), &finalParticles);
loader.getBoxWidth(), tree.getHeight(), &finalParticles, &balancer);
for(int idx = 0 ; idx < finalParticles.getSize(); ++idx){
tree.insert(finalParticles[idx].position);
......
......@@ -42,13 +42,15 @@
#include "../../Src/Files/FMpiTreeBuilder.hpp"
#include "../../Src/Files/FFmaBinLoader.hpp"
#include "../../Src/BalanceTree/FLeafBalance.hpp"
#include <iostream>
#include <cstdio>
#include <cstdlib>
// Uncoment to validate the FMM
#define VALIDATE_FMM
//#define VALIDATE_FMM
/** This program show an example of use of
* the fmm basic algo it also check that eachh particles is little or longer
......@@ -282,10 +284,11 @@ int main(int argc, char ** argv){
}
FVector<TestParticle> finalParticles;
FleafBalance balancer;
FMpiTreeBuilder< TestParticle >::ArrayToTree(app.global(), particles, loader.getNumberOfParticles(),
tree.getBoxCenter(),
tree.getBoxWidth(),
tree.getHeight(), &finalParticles);
tree.getHeight(), &finalParticles,&balancer);
for(int idx = 0 ; idx < finalParticles.getSize(); ++idx){
tree.insert(finalParticles[idx].position,finalParticles[idx].physicalValue);
......@@ -312,7 +315,7 @@ int main(int argc, char ** argv){
// -----------------------------------------------------
std::cout << "Create kernel..." << std::endl;
{
KernelClass kernels( NbLevels,loader.getBoxWidth(), loader.getCenterOfBox());
std::cout << "Done " << " in " << counter.elapsed() << "s)." << std::endl;
......@@ -320,11 +323,11 @@ int main(int argc, char ** argv){
// -----------------------------------------------------
std::cout << "Working on particles ..." << std::endl;
{
FmmClass algo(app.global(),&tree,&kernels);
counter.tic();
algo.execute();
algo.execute(FFmmM2M);
counter.tac();
std::cout << "Done " << "(@Algorithm = " << counter.elapsed() << "s)." << std::endl;
......@@ -408,7 +411,8 @@ int main(int argc, char ** argv){
ValidateFMMAlgoProc<OctreeClass,ContainerClass>(&tree,&treeValide,&app);
}
#endif
}
}
// -----------------------------------------------------
......
......@@ -40,6 +40,7 @@
#include "../../Src/Components/FBasicParticleContainer.hpp"
#include "../../Src/BalanceTree/FLeafBalance.hpp"
struct TestParticle{
FPoint position;
......@@ -117,9 +118,10 @@ int main(int argc, char ** argv){
}
FVector<TestParticle> finalParticles;
FLeafBalance balancer;
FMpiTreeBuilder< TestParticle >::ArrayToTree(app.global(), particles, NbPart,
FPoint(BoxCenter,BoxCenter,BoxCenter),
BoxWidth, tree.getHeight(), &finalParticles);
FPoint(BoxCenter,BoxCenter,BoxCenter),
BoxWidth, tree.getHeight(), &finalParticles,&balancer);
for(int idx = 0 ; idx < finalParticles.getSize(); ++idx){
tree.insert(finalParticles[idx].position);
......
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