Commit 94a0437b authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas

Add define to use file or not in testBlockedMpiChebyshev.cpp...

Add define to use file or not in testBlockedMpiChebyshev.cpp testBlockedMpiUniform.cpp and testFmmAlgorithmThreadProc.cpp
parent b02ee6d0
......@@ -107,6 +107,8 @@ int main(int argc, char* argv[]){
}
};
#define LOAD_FILE
#ifndef LOAD_FILE
// open particle file
FRandomLoader<FReal> loader(NbParticles, 1.0, FPoint<FReal>(0,0,0), mpiComm.global().processId());
FAssertLF(loader.isOpen());
......@@ -118,6 +120,18 @@ int main(int argc, char* argv[]){
allParticles[idxPart].physicalValue = 0.1;
}
#else
const char* const filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "../Data/test20k.fma");
FMpiFmaGenericLoader<FReal> loader(filename,mpiComm.global());
FAssertLF(loader.isOpen());
TestParticle* allParticles = new TestParticle[loader.getMyNumberOfParticles()];
memset(allParticles,0,(unsigned int) (sizeof(TestParticle)* loader.getMyNumberOfParticles()));
for(FSize idxPart = 0 ; idxPart < loader.getMyNumberOfParticles() ; ++idxPart){
loader.fillParticle(&allParticles[idxPart].position,&allParticles[idxPart].physicalValue);
}
#endif
FVector<TestParticle> myParticles;
FLeafBalance balancer;
FMpiTreeBuilder< FReal,TestParticle >::DistributeArrayToContainer(mpiComm.global(),allParticles,
......
......@@ -107,6 +107,8 @@ int main(int argc, char* argv[]){
}
};
#define LOAD_FILE
#ifndef LOAD_FILE
// open particle file
FRandomLoader<FReal> loader(NbParticles, 1.0, FPoint<FReal>(0,0,0), mpiComm.global().processId());
FAssertLF(loader.isOpen());
......@@ -118,6 +120,18 @@ int main(int argc, char* argv[]){
allParticles[idxPart].physicalValue = 0.1;
}
#else
const char* const filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "../Data/test20k.fma");
FMpiFmaGenericLoader<FReal> loader(filename,mpiComm.global());
FAssertLF(loader.isOpen());
TestParticle* allParticles = new TestParticle[loader.getMyNumberOfParticles()];
memset(allParticles,0,(unsigned int) (sizeof(TestParticle)* loader.getMyNumberOfParticles()));
for(FSize idxPart = 0 ; idxPart < loader.getMyNumberOfParticles() ; ++idxPart){
loader.fillParticle(&allParticles[idxPart].position,&allParticles[idxPart].physicalValue);
}
#endif
FVector<TestParticle> myParticles;
FLeafBalance balancer;
FMpiTreeBuilder< FReal,TestParticle >::DistributeArrayToContainer(mpiComm.global(),allParticles,
......
......@@ -83,6 +83,8 @@ int main(int argc, char* argv[]){
}
};
#define LOAD_FILE
#ifndef LOAD_FILE
// open particle file
FRandomLoader<FReal> loader(NbParticles, 1.0, FPoint<FReal>(0,0,0), mpiComm.global().processId());
FAssertLF(loader.isOpen());
......@@ -94,6 +96,18 @@ int main(int argc, char* argv[]){
allParticles[idxPart].physicalValue = 0.1;
}
#else
const char* const filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "../Data/test20k.fma");
FMpiFmaGenericLoader<FReal> loader(filename,mpiComm.global());
FAssertLF(loader.isOpen());
TestParticle* allParticles = new TestParticle[loader.getMyNumberOfParticles()];
memset(allParticles,0,(unsigned int) (sizeof(TestParticle)* loader.getMyNumberOfParticles()));
for(FSize idxPart = 0 ; idxPart < loader.getMyNumberOfParticles() ; ++idxPart){
loader.fillParticle(&allParticles[idxPart].position,&allParticles[idxPart].physicalValue);
}
#endif
FVector<TestParticle> myParticles;
FLeafBalance balancer;
FMpiTreeBuilder< FReal,TestParticle >::DistributeArrayToContainer(mpiComm.global(),allParticles,
......
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