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

In the test files, in the part where we insert the particles,

I remove the temporary creation in the loop to create only
one per file.
LOOP
    PARTICLE.create
    PARTICLE <= FILL
ENDLOOP

Has been changed by
PARTICLE.create
LOOP
    PARTICLE <= FILL
ENDLOOP

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@121 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 16eb48f9
......@@ -93,10 +93,12 @@ int main(int argc, char ** argv){
std::cout << "Creating & Inserting " << loader.getNumberOfParticles() << " particles ..." << std::endl;
counter.tic();
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
{
FmbParticle particleToFill;
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
}
}
counter.tac();
......
......@@ -292,13 +292,15 @@ int main(int argc, char ** argv){
std::cout << "Creating & Inserting " << loader.getNumberOfParticles() << " particles ..." << std::endl;
counter.tic();
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
{
FmbParticle particleToFill;
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
#ifdef VALIDATE_FMM
treeValide.insert(particleToFill);
#endif
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
#ifdef VALIDATE_FMM
treeValide.insert(particleToFill);
#endif
}
}
counter.tac();
......
......@@ -94,10 +94,12 @@ int main(int argc, char ** argv){
std::cout << "Creating & Inserting " << loader.getNumberOfParticles() << " particles ..." << std::endl;
counter.tic();
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
{
FmbParticle particleToFill;
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
}
}
counter.tac();
......
......@@ -92,10 +92,12 @@ int main(int argc, char ** argv){
std::cout << "Creating & Inserting " << loader.getNumberOfParticles() << " particles ..." << std::endl;
counter.tic();
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
{
FmbParticle particleToFill;
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(particleToFill);
tree.insert(particleToFill);
}
}
counter.tac();
......
......@@ -57,10 +57,12 @@ int main(int argc, char ** argv){
std::cout << "Creating & Inserting " << NbPart << " particles ..." << std::endl;
counter.tic();
for(int idxPart = 0 ; idxPart < NbPart ; ++idxPart){
{
FTestParticle particleToFill;
particleToFill.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
tree.insert(particleToFill);
for(int idxPart = 0 ; idxPart < NbPart ; ++idxPart){
particleToFill.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
tree.insert(particleToFill);
}
}
counter.tac();
......
......@@ -259,13 +259,15 @@ int main(int argc, char ** argv){
std::cout << "Inserting particles ..." << std::endl;
counter.tic();
for(long idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
{
TestParticle particle;
for(long idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(particle);
loader.fillParticle(particle);
tree.insert(particle);
treeValide.insert(particle);
tree.insert(particle);
treeValide.insert(particle);
}
}
counter.tac();
std::cout << "Done " << "(@Creating and Inserting Particles = " << counter.elapsed() << "s)." << std::endl;
......
......@@ -61,13 +61,15 @@ int main(int argc, char ** argv){
std::cout << "Creating " << NbPart << " particles ..." << std::endl;
counter.tic();
for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){
{
FTestParticleTsm particle;
particle.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
if(rand() > RAND_MAX/2) particle.setAsTarget();
else particle.setAsSource();
for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){
particle.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
if(rand() > RAND_MAX/2) particle.setAsTarget();
else particle.setAsSource();
tree.insert(particle);
tree.insert(particle);
}
}
counter.tac();
......
......@@ -71,8 +71,9 @@ int main(int argc, char ** argv){
// -----------------------------------------------------
std::cout << "Inserting " << loader.getNumberOfParticles() << " particles ..." << std::endl;
counter.tic();
FBasicParticle part;
for(int idx = 0 ; idx < loader.getNumberOfParticles() ; ++idx){
FBasicParticle part;
loader.fillParticle(part);
tree.insert(part);
}
......
......@@ -71,8 +71,9 @@ int main(int argc, char ** argv ){
// -----------------------------------------------------
std::cout << "Inserting " << loader.getNumberOfParticles() << " particles ..." << std::endl;
counter.tic();
FFmaParticle part;
for(int idx = 0 ; idx < loader.getNumberOfParticles() ; ++idx){
FFmaParticle part;
loader.fillParticle(part);
tree.insert(part);
}
......
......@@ -70,8 +70,9 @@ int main(int argc, char ** argv ){
// -----------------------------------------------------
std::cout << "Inserting " << loader.getNumberOfParticles() << " particles ..." << std::endl;
counter.tic();
ParticleTsm part;
for(int idx = 0 ; idx < loader.getNumberOfParticles() ; ++idx){
ParticleTsm part;
loader.fillParticle(part);
tree.insert(part);
}
......
......@@ -128,15 +128,15 @@ int main(int argc, char ** argv){
std::cout << "Width of box is " << loader.getBoxWidth() << std::endl;
std::cout << "Center of box is x " << loader.getCenterOfBox().getX() << " y " << loader.getCenterOfBox().getY() << " z " << loader.getCenterOfBox().getZ()<< std::endl;
counter.tic();
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
{
Particle particle;
loader.fillParticle(particle);
particle.setGlobalIndex( idxPart+1 );
particle.setMortonIndex( -1 );
tree.insert(particle);
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(particle);
particle.setGlobalIndex( idxPart+1 );
particle.setMortonIndex( -1 );
tree.insert(particle);
}
}
counter.tac();
std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl;
......
......@@ -41,12 +41,15 @@ int main(int , char ** ){
// -----------------------------------------------------
std::cout << "Creating and inserting " << NbPart << " particles ..." << std::endl;
counter.tic();
for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){
{
FBasicParticle particle;
particle.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){
particle.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
tree.insert(particle);
tree.insert(particle);
}
}
counter.tac();
std::cout << "Done " << "(" << counter.elapsed() << ")." << std::endl;
// -----------------------------------------------------
......
......@@ -47,11 +47,12 @@ int main(int , char ** ){
// -----------------------------------------------------
std::cout << "Creating and inserting " << NbPart << " particles ..." << std::endl;
counterTime.tic();
for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){
{
FBasicParticle particle;
particle.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
tree.insert(particle);
for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){
particle.setPosition(FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX,FReal(rand())/RAND_MAX);
tree.insert(particle);
}
}
counterTime.tac();
std::cout << "Done " << "(" << counterTime.elapsed() << "s)." << std::endl;
......
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