4.1.8.1.2 : La définition des arguments du programme


Nous devons maintenant definir quelles options sont attendues par notre programme :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
///Create the OptionParser of this program
/**	@return OptionParser of this program
*/
OptionParser createOptionParser(){
	OptionParser parser(true, __PROGRAM_VERSION__);
	parser.setExampleLongOption("gray_scott_gpu_cuda --killrate=0.062 --feedrate=0.03 --nbimage=100 --nbrow=1080 --nbcol=1920 --output=outputFile.hdf5");
	parser.setExampleShortOption("gray_scott_gpu_cuda -k 0.062 -f 0.03 -n 100 -r 1080 -c 1920 -o outputFile.hdf5");
	
	float killRate(0.054f), feedRate(0.014f);
	size_t nbImage(100lu), nbRow(100lu), nbCol(200lu);
	parser.addOption("killrate", "k", killRate, "rate of the process which converts V into P");
	parser.addOption("feedrate", "f", feedRate, "rate of the process which feeds U and drains U, V and P");
	parser.addOption("nbimage", "n", nbImage, "number of images to be created");
	size_t nbExtraStep(1lu);
	parser.addOption("nbextrastep", "e", nbExtraStep, "number of extra steps to be computed between images");
	
	parser.addOption("nbrow", "r", nbRow, "number of rows of the images to be created");
	parser.addOption("nbcol", "c", nbCol, "number of columns of the images to be created");
	float dt(1.0f);
	parser.addOption("deltat", "t", dt, "time interval between two computation");
	
	std::string defaultOutputFile("output.h5");
	parser.addOption("output", "o", defaultOutputFile, "Output file to be created with results");
	return parser;
}