Manak
2.0.0
|
Manak can be used both with static linkage and dynamic linkage. The default is static linkage. To use Manak with dynamic linkage -
With this you need to provide the shared object generated in build to the linker. If you have installed Manak to one of the default directories, passing option '-lmanak' should work.
By defining 'MANAK_AUTO_MAIN', manak will create a main function for you. This main function will initialize all the cases and run them.
You can create your own main function and still run all the benchmarks by calling function manak::manak_main. You can pass command line arguments to this function.
NOTE: 'MANAK_AUTO_MAIN' or 'MANAK_INIT' has to be defined only once in case of multi file project. Check out Using Manak Effectively in Multi File Project for more information.
The deafult initialization function is manak::manak_init_module. This initialization function set all the primary environment variables. To register benchmarking cases manually you need to create and register your own benchmark initialization function. This can be done by setting MANAK_MANUAL_INIT_FUNCTION to the desired name. The initialization function should return bool, the success state. This function should be available in the namespace at the time 'manak_init_function' is defined. This manual init function will be called default init function.
NOTE: 'MANAK_AUTO_MAIN' or 'MANAK_INIT' has to be defined only once in case of multi file project. Check out Using Manak Effectively in Multi File Project for more information.
For guide on manual case registration check out Manual Registration
All the output to the standard output is redirected to predefined redirection stream while running any case. By default this redirection is done to file 'benchmark_log.txt'. To chnage the filename of of this default redirection file set 'MANAK_REDIRECTION_FILENAME' to desired value.
Redirection can also be done to the already existing stream. Set 'MANAK_REDIRECTION_BUFFER' to stream's buffer.
By default the results of the benchmarks are saved to file 'benchmark_stat.html'. This default filename can be changed by setting 'MANAK_DEFAULT_OUT_FILENAME' to desired value.
Here depending on the format the output will be either written to out.html or out.txt. The default format is HTML. The format can be changed with '-f' command line option. '-f TXT' will store the output i TXT format.
The output filname can also be given at runtime with command line argument '-o <filename>'. This run time filename will override the default filename. For more command line arguments
Set MANAK_BASE_LIBRARY_NAME to desired name to change the name of singleton library in 'MANAK_SIMPLE_MODULE'.
If number of iterations is not specified for any benchmark case the default number of iterations are used(which is 10). The default can be chnaged by setting 'MANAK_DEFAULT_ITERATIONS' to the desired value. The scope of this macro is limited by file, hence you can set different defaults for each file in your multi file project. Check out Using Manak Effectively in Multi File Project for tutorial on using Manak in multi file environment.
If tolerance is not specified for any benchmark case the default is used(which is 10ms). The default can be chnaged by setting 'MANAK_DEFAULT_TOLERANCE' to desired value. The measure of tolerance is microseconds. To understand the use of tolerance see Comparison Framework. The scope of this macro is limited by file, hence you can set different defaults for each file in your multi file project. Check out Using Manak Effectively in Multi File Project for tutorial on using Manak in multi file environment.
If success percentage is not specified for any benchmark case the default is used(which is 100). The default can be chnaged by setting 'MANAK_DEFAULT_SP' to desired value. The scope of this macro is limited by file, hence you can set different defaults for each file in your multi file project. Check out Using Manak Effectively in Multi File Project for tutorial on using Manak in multi file environment.