Commit e81135cd authored by berenger-bramas's avatar berenger-bramas
Browse files

Changed some test file to accept a file in argument.

(or take a default file if nothing is given)

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@34 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 3aedcfbc
......@@ -34,7 +34,7 @@
// Simply create particules and try the kernels
int main(int , char ** ){
int main(int argc, char ** argv){
const int NbLevels = 10;//10;
const int SizeSubLevels = 3;//3
const long NbPart = 2000000;//2000000
......
......@@ -56,11 +56,22 @@ public:
// Simply create particules and try the kernels
int main(int , char ** ){
int main(int argc, char ** argv){
const int NbLevels = 9;//10;
const int SizeSubLevels = 3;//3
FTic counter;
const char* const filename = "testLoaderFMA.fma"; //../../Data/ "testLoaderFMA.fma" "testFMAlgorithm.fma" Sphere.fma
const char* const defaultFilename = "testLoaderFMA.fma"; //../../Data/ "testLoaderFMA.fma" "testFMAlgorithm.fma" Sphere.fma
const char* filename;
if(argc == 1){
std::cout << "You have to give a .fma file in argument.\n";
std::cout << "The program will try a default file : " << defaultFilename << "\n";
filename = defaultFilename;
}
else{
filename = argv[1];
std::cout << "Opening : " << filename << "\n";
}
FFMALoader<FmbParticule> loader(filename);
if(!loader.isValide()){
......
......@@ -58,11 +58,22 @@ public:
// Simply create particules and try the kernels
int main(int , char ** ){
int main(int argc, char ** argv){
const int NbLevels = 9;//10;
const int SizeSubLevels = 3;//3
FTic counter;
const char* const filename = "testLoaderFMA.tor.fma"; //../../Data/ "testLoaderFMA.fma" "testFMAlgorithm.fma" Sphere.fma
const char* const defaultFilename = "testLoaderFMA.tor.fma"; //../../Data/ "testLoaderFMA.fma" "testFMAlgorithm.fma" Sphere.fma
const char* filename;
if(argc == 1){
std::cout << "You have to give a .fma file in argument.\n";
std::cout << "The program will try a default file : " << defaultFilename << "\n";
filename = defaultFilename;
}
else{
filename = argv[1];
std::cout << "Opening : " << filename << "\n";
}
FFMAToRLoader<FmbParticule> loader(filename);
if(!loader.isValide()){
......
......@@ -33,12 +33,23 @@
* Done (0.171918).
*/
int main(int , char ** ){
int main(int argc, char ** argv){
// we store all particules to be able to dealloc
FList<FBasicParticule*> particules;
// Use testLoaderCreate.exe to create this file
const char* const filename = "../../Data/testLoader.basic.temp";
FTic counter;
const char* const defaultFilename = "../../Data/testLoader.basic.temp";
const char* filename;
if(argc == 1){
std::cout << "You have to give a .fma file in argument.\n";
std::cout << "The program will try a default file : " << defaultFilename << "\n";
filename = defaultFilename;
}
else{
filename = argv[1];
std::cout << "Opening : " << filename << "\n";
}
// open basic particules loader
FBasicLoader<FBasicParticule> loader(filename);
......
......@@ -33,12 +33,23 @@
* Done (0.171918).
*/
int main(int , char ** ){
int main(int argc, char ** argv ){
// we store all particules to be able to dealloc
FList<FFmaParticule*> particules;
// Use testLoaderCreate.exe to create this file
const char* const filename = "../../Data/testLoaderFMA.fma";
FTic counter;
const char* const defaultFilename = "../../Data/testLoaderFMA.fma";
const char* filename;
if(argc == 1){
std::cout << "You have to give a .fma file in argument.\n";
std::cout << "The program will try a default file : " << defaultFilename << "\n";
filename = defaultFilename;
}
else{
filename = argv[1];
std::cout << "Opening : " << filename << "\n";
}
// open basic particules loader
FFMALoader<FFmaParticule> loader(filename);
......
......@@ -33,12 +33,23 @@ class ParticuleToR : public FFmaParticule, public FExtendParticuleType {
* In this file we show an example of FFmaLoader use
*/
int main(int , char ** ){
int main(int argc, char ** argv ){
// we store all particules to be able to dealloc
FList<ParticuleToR*> particules;
// Use testLoaderCreate.exe to create this file
const char* const filename = "testLoaderFMA.tor.fma";
FTic counter;
const char* const defaultFilename = "testLoaderFMA.tor.fma";
const char* filename;
if(argc == 1){
std::cout << "You have to give a .tos.fma file in argument.\n";
std::cout << "The program will try a default file : " << defaultFilename << "\n";
filename = defaultFilename;
}
else{
filename = argv[1];
std::cout << "Opening : " << filename << "\n";
}
// open basic particules loader
FFMAToRLoader<ParticuleToR> loader(filename);
......
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