Commit 02ae1276 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Add a system to manage the execs parameters more cleanly

parent c3a64fa8
......@@ -45,6 +45,8 @@
#include "Core/FFmmAlgorithm.hpp"
#endif
#include "../Src/Utils/FParameterNames.hpp"
/**
* This program runs the FMM Algorithm with the Chebyshev kernel and compares the results with a direct computation.
*/
......@@ -54,40 +56,25 @@
//! \authors B. Bramas, O. Coulaud
//!
//! This code is a short example to use the Chebyshev Interpolation approach for the 1/r kernel
//!
//!@Algorithm
//! <b> General arguments:</b>
//! \param -help(-h) to see the parameters available in this driver
//! \param -depth The depth of the octree
//! \param -subdepth Specifies the size of the sub octree
//! \param -t The number of threads
//!
//! \param -f name Name of the particles file with extension (.fma or .bfma). The data in file have to be in our FMA format
//!
//
void usage() {
std::cout << "Driver for Chebyshev interpolation kernel (1/r kernel)" << std::endl;
std::cout << "Options "<< std::endl
<< " -help to see the parameters " << std::endl
<< " -depth the depth of the octree "<< std::endl
<< " -subdepth specifies the size of the sub octree " << std::endl
<< " -f name name specifies the name of the particle distribution" << std::endl
<< " -t n specifies the number of threads used in the computations" << std::endl;
}
// Simply create particles and try the kernels
int main(int argc, char* argv[])
{
FHelpDescribeAndExit(argc, argv,
"Driver for Chebyshev interpolation kernel (1/r kernel).",
FParameterDefinitions::InputFile, FParameterDefinitions::OctreeHeight,
FParameterDefinitions::OctreeSubHeight, FParameterDefinitions::InputFile,
FParameterDefinitions::NbThreads);
const std::string defaultFile(/*SCALFMMDataPath+*/"../Data/test20k.fma" );
const std::string filename = FParameters::getStr(argc,argv,"-f", defaultFile.c_str());
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", 1);
if(FParameters::existParameter(argc, argv, "-h")||FParameters::existParameter(argc, argv, "-help")){
usage() ;
exit(EXIT_SUCCESS);
}
const std::string filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str());
const unsigned int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
#ifdef _OPENMP
omp_set_num_threads(NbThreads);
std::cout << "\n>> Using " << omp_get_max_threads() << " threads.\n" << std::endl;
......
......@@ -44,6 +44,7 @@
#include "../Src/Kernels/P2P/FP2PParticleContainerIndexed.hpp"
#include "../Src/Utils/FParameters.hpp"
#include "../Src/Utils/FParameterNames.hpp"
/// \file ChebyshevInterpolationMPIFMM
......@@ -52,41 +53,25 @@
//! \authors B. Bramas, O. Coulaud
//!
//! This code is a short example to use the FMM Algorithm Proc with Chebyshev Interpolation for the 1/r kernel
//!
//!
//! <b> General arguments:</b>
//! \param -help(-h) to see the parameters available in this driver
//! \param -depth The depth of the octree
//! \param -subdepth Specifies the size of the sub octree
//! \param -t The number of threads
//!
//! \param -f name Name of the particles file with extension (.fma or .bfma). The data in file have to be in our FMA format
//!
//
void usage() {
std::cout << "Driver for Chebyshev Interpolation kernel using MPI (1/r kernel)" << std::endl;
std::cout << "Options "<< std::endl
<< " -help to see the parameters " << std::endl
<< " -depth the depth of the octree "<< std::endl
<< " -subdepth specifies the size of the sub octree " << std::endl
<< " -f name name specifies the name of the particle distribution" << std::endl
<< " -t n specifies the number of threads used in the computations" << std::endl
<< " CMD >> mpirun -np nb_proc_needed ./ChebyshevInterpolationAlgorithm ....." << std::endl;
}
// Simply create particles and try the kernels
int main(int argc, char* argv[])
{
FHelpDescribeAndExit(argc, argv,
"Driver for Chebyshev Interpolation kernel using MPI (1/r kernel). "
"Usully run using : mpirun -np nb_proc_needed ./ChebyshevInterpolationAlgorithm [params].",
FParameterDefinitions::InputFile, FParameterDefinitions::OctreeHeight,
FParameterDefinitions::OctreeSubHeight, FParameterDefinitions::InputFile,
FParameterDefinitions::NbThreads);
const std::string defaultFile(/*SCALFMMDataPath+*/"../Data/test20k.fma");
const std::string filename = FParameters::getStr(argc,argv,"-f", defaultFile.c_str());
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", 1);
if(FParameters::existParameter(argc, argv, "-h")||FParameters::existParameter(argc, argv, "-help")){
usage() ;
exit(-1);
}
const std::string filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str());
const unsigned int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
#ifdef _OPENMP
omp_set_num_threads(NbThreads);
std::cout << "\n>> Using " << omp_get_max_threads() << " threads.\n" << std::endl;
......
......@@ -31,7 +31,7 @@
#include "Kernels/P2P/FP2P.hpp"
#include "Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "../Src/Utils/FParameterNames.hpp"
//
/// \file DirectComputation.cpp
//!
......@@ -49,26 +49,20 @@
// Simply create particles and try the kernels
int main(int argc, char ** argv){
//
///////////////////////What we do/////////////////////////////
if( FParameters::existParameter(argc, argv, "-help" ) || argc < 4){
std::cout << ">> This executable has to be used to compute interaction either for periodic or non periodic system.\n";
std::cout << ">> Example -fin filenameIN.{fma or bfma) -fout filenameOUT{fma or bfma) \n";
std::cout << ">> Default input file : ../Data/unitCubeXYZQ20k.fma\n";
std::cout << " Options " << std::endl;
std::cout << " -verbose : print index x y z Q V fx fy fz " << std::endl;
std::cout << " -fin filename. Extension specifies if the file is binary or not. " << std::endl;
std::cout << " Only our FMA (.bma, .bfma) is allowed " << std::endl;
std::cout << " -fout filenameOUT output file with extension (default output.bfma)" << std::endl;
exit(-1);
}
FHelpDescribeAndExit(argc, argv,
">> This executable has to be used to compute interaction either for periodic or non periodic system.\n"
">> Example -fin filenameIN.{fma or bfma) -fout filenameOUT{fma or bfma) \n"
">> Default input file : ../Data/unitCubeXYZQ20k.fma\n"
">> Only our FMA (.bma, .bfma) is allowed as input.\n"
">> Output file with extension (default output.bfma).",
FParameterDefinitions::InputFile, FParameterDefinitions::OutputFile,
FParameterDefinitions::EnabledVerbose);
//////////////////////////////////////////////////////////////
const std::string defaultFile(/*SCALFMMDataPath+*/"../Data/unitCubeXYZQ20k.fma");
const std::string filenameIn(FParameters::getStr(argc,argv,"-fin", defaultFile.c_str()));
const std::string filenameOut(FParameters::getStr(argc,argv,"-fout", "output.bfma"));
const std::string filenameIn(FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str()));
const std::string filenameOut(FParameters::getStr(argc,argv,FParameterDefinitions::OutputFile.options, "output.bfma"));
//
FTic counter;
......@@ -187,7 +181,7 @@ int main(int argc, char ** argv){
// end generate
// -----------------------------------------------------
//
if(FParameters::existParameter(argc, argv, "-verbose")){
if(FParameters::existParameter(argc, argv, FParameterDefinitions::EnabledVerbose.options)){
denergy = 0 ;
for(int idx = 0 ; idx < nbParticles ; ++idx){
std::cout << ">> index " << idx << std::endl;
......
......@@ -43,6 +43,8 @@
#include "Core/FFmmAlgorithm.hpp"
#endif
#include "../Src/Utils/FParameterNames.hpp"
/// \file RotationFMM.cpp
//!
//! \brief This program runs the FMM Algorithm with harmonic spherical approximation of 1/r kernel
......@@ -61,28 +63,22 @@
//!
//
void usage() {
std::cout << "Driver for HArmonic Spherical + Rotation -- kernel (1/r kernel)" << std::endl;
std::cout << "Options "<< std::endl
<< " -help to see the parameters " << std::endl
<< " -depth the depth of the octree "<< std::endl
<< " -subdepth specifies the size of the sub octree " << std::endl
<< " -f name name specifies the name of the particle distribution. If extension is . bfma th file is -in binary mode" << std::endl
<< " -t n specifies the number of threads used in the computations" << std::endl;
}
// Simply create particles and try the kernels
int main(int argc, char* argv[])
{
FHelpDescribeAndExit(argc, argv,
"Driver for HArmonic Spherical + Rotation -- kernel (1/r kernel).",
FParameterDefinitions::InputFile, FParameterDefinitions::OctreeHeight,
FParameterDefinitions::OctreeSubHeight, FParameterDefinitions::InputFile,
FParameterDefinitions::NbThreads);
const std::string defaultFile(/*SCALFMMDataPath+*/"../Data/test20k.fma");
const std::string filename(FParameters::getStr(argc,argv,"-f", defaultFile.c_str()));
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", 1);
if(FParameters::existParameter(argc, argv, "-h")||FParameters::existParameter(argc, argv, "-help")){
usage() ;
exit(-1);
}
const std::string filename(FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str()));
const unsigned int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
#ifdef _OPENMP
omp_set_num_threads(NbThreads) ;
std::cout << "\n>> Using " << omp_get_max_threads() << " threads.\n" << std::endl;
......
This diff is collapsed.
This diff is collapsed.
......@@ -75,6 +75,7 @@
#include "Kernels/Uniform/FUnifKernel.hpp"
#endif
#include "../Src/Utils/FParameterNames.hpp"
/**
* This program compares two different kernels, eg., the Chebyshev kernel with
......@@ -94,46 +95,24 @@
//! - Chebychev and symetric Chebychev interpolation
//! - if FFT is activated: interpolation on uniform grid
//!<br>
//! <b> General arguments:</b>
//! \param -depth The depth of the octree
//! \param -subdepth Specifies the size of the sub octree
//! \param -t The number of threads
//!
//! \param -f name Name of the particles file with extension (.fma or .bfma). The data in file have to be in our FMA format
//!
//!
//! \b examples
//!
//! Transform an ascii file in a binary file
//!
//! changeFormat -fin unitCubeXYZQ100.fma -fout unitCubeXYZQ100 -bin
void usage() {
std::cout << "Driver for testing different approximations for the 1/r kernel" << std::endl;
std::cout << "Options "<< std::endl
<< " -help to see the parameters " << std::endl
<< " -depth the depth of the octree "<< std::endl
<< " -subdepth specifies the size of the sub octree " << std::endl
<< " -f name name specifies the name of the particle distribution" << std::endl
<< " -t n specifies the number of threads used in the computations" << std::endl;
}
// Simply create particles and try the kernels
int main(int argc, char* argv[])
{
if(FParameters::existParameter(argc, argv, "-h")||FParameters::existParameter(argc, argv, "-help")){
usage() ;
std::cout << "Driver for testing different approximations for the 1/r kernel" << std::endl;
FHelpDescribeAndExit(argc, argv,
"Driver for testing different approximations for the 1/r kernel.",
FParameterDefinitions::InputFile, FParameterDefinitions::OctreeHeight,
FParameterDefinitions::OctreeSubHeight, FParameterDefinitions::InputFile,
FParameterDefinitions::NbThreads, FParameterDefinitions::SHDevelopment);
exit(EXIT_SUCCESS);
}
// get info from commande line
const std::string filename(FParameters::getStr(argc,argv,"-f", "../Data/UTest/unitCubeRef20kDouble.bfma"));
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-depth", 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-subdepth", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", omp_get_max_threads());
const int DevP = FParameters::getValue(argc, argv, "-p", 11);
const std::string filename(FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "../Data/UTest/unitCubeRef20kDouble.bfma"));
const unsigned int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, omp_get_max_threads());
const int DevP = FParameters::getValue(argc, argv, FParameterDefinitions::SHDevelopment.options, 11);
//
#ifdef _OPENMP
......
......@@ -17,6 +17,8 @@
#include "Utils/FGenerateDistribution.hpp"
#include "Files/FFmaGenericLoader.hpp"
#include "../Src/Utils/FParameterNames.hpp"
//
/// \file generateDistributions.cpp
//!
......@@ -68,52 +70,45 @@
//!
//! generateDistributions -cuboid 2:2:4 -filename cuboid -visufmt vtp -charge -zeromean
//!
//
//
//
void genDistusage() {
std::cout << "Driver to generate N points (non)uniformly distributed on a given geometry"
<< std::endl;
std::cout << "Options "<< std::endl
<< " -help to see the parameters " << std::endl
<< " -N The number of points in the distribution " << std::endl
<< " -extraLength value extra length to add to the boxWidth"<< std::endl
<< std::endl
<< " Distributions " << std::endl
<< " Uniform on " << std::endl
<< " -unitCube uniform distribution on unit cube" <<std::endl
<< " -cuboid uniform distribution on rectangular cuboid of size a:b:c" <<std::endl
<< " -lengths a:b:c - default values are 1.0:1.0:2.0" <<std::endl
<< " -unitSphere uniform distribution on unit sphere" <<std::endl
<< " -sphere uniform distribution on sphere of radius given by" <<std::endl
<< " -radius R - default value for R is 2.0" <<std::endl
<< " -prolate ellipsoid with aspect ratio a:a:c" <<std::endl
<< " -ar a:a:c with c > a > 0" <<std::endl<<std::endl
<< " Non Uniform on " << std::endl
<< " -ellipsoid non uniform distribution on an ellipsoid of aspect ratio given by" <<std::endl
<< " -ar a:b:c with a, b and c > 0" <<std::endl
<< " -plummer (Highly non unuiform) plummer distrinution (astrophysics)"<<std::endl
<< " -radius R - default value 10.0" <<std::endl
<< " Physical values" <<std::endl
<< " -charge generate physical values between -1 and 1 otherwise generate between 0 and 1 " <<std::endl<<std::endl
<< " -zeromean the average of the physical values is zero " <<std::endl<<std::endl
<< " Output " << std::endl
<< " -filename name: generic name for files (without extension) and save data" <<std::endl
<< " with following format in name.fma or name.bfma in -bin is set" <<std::endl
<< " -visufmt vtk, vtp, cosmo or cvs format " <<std::endl;
}
int main(int argc, char ** argv){
//
if(FParameters::existParameter(argc, argv, "-h")||FParameters::existParameter(argc, argv, "-help")|| (argc < 3 )){
genDistusage() ;
exit(-1);
}
FHelpDescribeAndExit(argc, argv,
">> Driver to generate N points (non)uniformly distributed on a given geometry.\n"
"Options \n"
" -help to see the parameters \n"
" -N The number of points in the distribution \n"
" -extraLength value extra length to add to the boxWidth\n"
" Distributions \n"
" Uniform on \n"
" -unitCube uniform distribution on unit cube\n"
" -cuboid uniform distribution on rectangular cuboid of size a:b:c\n"
" -lengths a:b:c - default values are 1.0:1.0:2.0\n"
" -unitSphere uniform distribution on unit sphere\n"
" -sphere uniform distribution on sphere of radius given by\n"
" -radius R - default value for R is 2.0\n"
" -prolate ellipsoid with aspect ratio a:a:c\n"
" -ar a:a:c with c > a > 0\n"
" Non Uniform on \n"
" -ellipsoid non uniform distribution on an ellipsoid of aspect ratio given by\n"
" -ar a:b:c with a, b and c > 0\n"
" -plummer (Highly non unuiform) plummer distrinution (astrophysics)\n"
" -radius R - default value 10.0\n"
" Physical values\n"
" -charge generate physical values between -1 and 1 otherwise generate between 0 and 1 \n"
" -zeromean the average of the physical values is zero \n"
" Output \n"
" -filename name: generic name for files (without extension) and save data\n"
" with following format in name.fma or name.bfma in -bin is set\n"
" -visufmt vtk, vtp, cosmo or cvs format.",
FParameterDefinitions::InputFile, FParameterDefinitions::NbParticles);
FReal extraRadius = 0.000 ;
const int NbPoints = FParameters::getValue(argc,argv,"-N", 20000);
const std::string genericFileName(FParameters::getStr(argc,argv,"-filename", "unifPointDist"));
const int NbPoints = FParameters::getValue(argc,argv,FParameterDefinitions::NbParticles.options, 20000);
const std::string genericFileName(FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "unifPointDist"));
FReal BoxWith = 0.0;
FPoint Centre(0.0, 0.0,0.0);
//
......@@ -224,7 +219,7 @@ int main(int argc, char ** argv){
}
std::string name(genericFileName);
if( FParameters::existParameter(argc, argv, "-bin")){
if( FParameters::existParameter(argc, argv, FParameterDefinitions::OutputBinFormat.options)){
name += ".bfma";
}
else {
......@@ -237,8 +232,8 @@ int main(int argc, char ** argv){
//
// Generate file for visualization
//
if(FParameters::existParameter(argc, argv, "-visufmt")){
std::string visufile(""), fmt(FParameters::getStr(argc,argv,"-visufmt", "vtp"));
if(FParameters::existParameter(argc, argv, FParameterDefinitions::OutputVisuFile.options)){
std::string visufile(""), fmt(FParameters::getStr(argc,argv,FParameterDefinitions::OutputVisuFile.options, "vtp"));
if( fmt == "vtp" ){
visufile = genericFileName + ".vtp" ;
}
......
......@@ -29,6 +29,7 @@
#include "../../Src/Utils/FMath.hpp"
#include "../../Src/Files/FFmaGenericLoader.hpp"
#include "../Src/Utils/FParameterNames.hpp"
/// \file statisticsOnOctree.cpp
//!
......@@ -46,52 +47,40 @@
//!
//! \arg The number of cells, of adaptive cells (cell with more one child)
//! \arg The average, min and max numbers of M2L operators and also its variance.
//!
//! <b> General arguments:</b>
//! \param -help(-h) to see the parameters available in this driver
//! \param -depth The depth of the octree
//! \param -subdepth Specifies the size of the sub octree
//!
//! \param -infile name Name of the particles file. The file have to be in our FMA format
//! \param -bin if the input file in binary mode
//! \param -outfile name Generic name for output file (without extension)
//!
//! <b> Statistics options:</b>
//! \param -histP build a file to generate histogram of particles per leaf. The data are store in file given by -outfile arguments and .txt extension
// Simply create particles and try the kernels
//
void usage() {
std::cout << "Driver to obtain statistics on the octree" << std::endl;
std::cout << "Options "<< std::endl
<< " -help to see the parameters " << std::endl
<< " -depth the depth of the octree "<< std::endl
<< " -subdepth specifies the size of the sub octree " << std::endl
<< " -infile name specifies the name of the particle distribution" << std::endl
<< " -bin if the input file in binary mode"<< std::endl
<< " -outfile name specifies the file for the diagnostics" << std::endl
<< " -histP build the histogram of the particle number per leaf"<<std::endl;
}
static const FParameterNames LocalOptitionHist = {
{"-histP", "--histogram-stat"} ,
"Build the histogram of the particle number per leaf."
};
int main(int argc, char ** argv){
typedef FBasicParticleContainer<0> ContainerClass;
typedef FSimpleLeaf< ContainerClass > LeafClass;
FHelpDescribeAndExit(argc, argv,
"Driver to obtain statistics on the octree.",
FParameterDefinitions::InputFile, FParameterDefinitions::OctreeHeight,
FParameterDefinitions::OctreeSubHeight,
FParameterDefinitions::OutputFile, LocalOptitionHist);
typedef FBasicParticleContainer<0> ContainerClass;
typedef FSimpleLeaf< ContainerClass > LeafClass;
typedef FOctree< FBasicCell, ContainerClass , LeafClass > OctreeClass;
if(FParameters::existParameter(argc, argv, "-h")||FParameters::existParameter(argc, argv, "-help")|| (argc < 3 )){
usage() ;
exit(-1);
}
//
// Octree parameters
//
const int TreeHeight = FParameters::getValue(argc,argv,"-depth", 5);
const int SubTreeHeight = FParameters::getValue(argc,argv,"-subdepth", 3);
const int TreeHeight = FParameters::getValue(argc,argv,FParameterDefinitions::OctreeHeight.options, 5);
const int SubTreeHeight = FParameters::getValue(argc,argv,FParameterDefinitions::OctreeSubHeight.options, 3);
//
// input and output Files parameters
//
const char* const filename = FParameters::getStr(argc,argv,"-infile", "../Data/test20k.fma");
const std::string genericFileName(FParameters::getStr(argc,argv,"-outfile", "output"));
const char* const filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "../Data/test20k.fma");
const std::string genericFileName(FParameters::getStr(argc,argv,FParameterDefinitions::OutputFile.options, "output"));
//
std::cout << "Parameters "<< std::endl
<< " Octree Depth "<< TreeHeight <<std::endl
......@@ -171,7 +160,7 @@ int main(int argc, char ** argv){
// Histogram of particles per leaf
//
if(FParameters::existParameter(argc, argv, "-histP")){
if(FParameters::existParameter(argc, argv, LocalOptitionHist.options)){
int size = maxParticles+1;
int * hist = new int [size] ;
memset(hist,0,(size)*sizeof(int));
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifdef FPARAMETERNAMES_HPP
#error FParameterNames must be included only once by each main file!
#else
#define FPARAMETERNAMES_HPP
#include "../Src/Utils/FGlobal.hpp"
#include "../Src/Utils/FParameters.hpp"
#include <iostream>
#include <vector>
/**
* This file contains some useful classes/functions to manage the parameters,
* but it also contains all the parameters definitions!
* A Scalfmm executable must define a static object to propose a parameter to the user.
*/
/** A parameter descriptor */
struct FParameterNames {
std::vector<const char*> options;
const char* description;
};
/** The namespace where we put all the definitions */
namespace FParameterDefinitions {
static const FParameterNames Help = {
{"-help", "--help"} ,
"To have print the options used by the application."
};
static const FParameterNames NbParticles = {
{"-nb", "--number-of-particles", "-N"} ,
"The number of particles if they are generated by the executable."
};
static const FParameterNames OctreeHeight = {
{"-h", "--height", "-depth"} ,
"The number of levels in the octree (at least 2 for the root and the leaves)."
};
static const FParameterNames OctreeSubHeight = {
{"-sh", "--sub-height", "-subdepth"} ,
"The number of allocated levels in the sub octree."
};
static const FParameterNames InputFile = {
{"-f", "-fin", "--input-filename", "-filename"} ,
"To give an input file."
};
static const FParameterNames InputFileOne = {
{"-f1", "-fin1", "--file-one"} ,
"To give the first input file."
};
static const FParameterNames InputFileTwow = {
{"-f2", "-fin2", "--file-two"} ,
"To give the second input file."
};
static const FParameterNames InputBinFormat = {
{"-binin", "-bininput", "--binary-input"} ,
"To input is in binary format."
};
static const FParameterNames OutputFile = {
{"-fout", "--output-filename"} ,
"To give the output filename."
};
static const FParameterNames OutputVisuFile = {
{"-fvisuout", "-visufmt"} ,
"To give the output filename in visu format."
};
static const FParameterNames OutputBinFormat = {
{"-binout", "-binoutput"} ,
"To output in binary format."
};
static const FParameterNames NbThreads = {
{"-t", "-nbthreads"} ,
"To choose the number of threads."
};
static const FParameterNames SequentialFmm = {
{"-sequential", "--sequential-fmm"} ,
"No parallelization in the FMM algorithm."
};
static const FParameterNames TaskFmm = {
{"-task", "--task-fmm"} ,
"Task parallelization in the FMM algorithm."
};
static const FParameterNames SHDevelopment = {
{"-devp", "-sh-p"} ,
"The degree of development for the spherical harmonic kernel (P)."
};
static const FParameterNames EnabledVerbose = {
{"-verbose", "--verbose"} ,
"To have a high degree of verbosity."
};
static const FParameterNames PeriodicityNbLevels = {
{"-per", "--periodic-degree"} ,
"The number of level upper to the root to proceed."
};
static const FParameterNames PeriodicityDisabled = {
{"-noper", "--no-periodicity"} ,
"To disable the periodicity."
};
static const FParameterNames DeltaT = {
{"-dt", "--delta-time"} ,
"The time step between iterations."
};
static const FParameterNames RotationKernel = {
{"-rotation", "--rotation-kernel"} ,
"To use the rotation kernel (based on spherical harmonics)."
};
static const FParameterNames SphericalKernel = {
{"-spherical", "--spherical-kernel"} ,
"To use the spherical harmonics old kernel."
};
static const FParameterNames ChebyshevKernel = {
{"-chebyshev", "--chebyshev-kernel"} ,
"To use the Chebyshev kernel."
};
static const FParameterNames Epsilon = {
{"-epsilon", "--epsilon"} ,
"The epsilon needed for the application."
};
static const FParameterNames PhysicalValue = {
{"-pv", "--physical-value"} ,
"The physical value of the particles."