How to add automatic benchmarking to your example

From KratosWiki
Revision as of 16:43, 27 November 2008 by Mossaiby (Talk | contribs)
Jump to: navigation, search

Kratos contains an automatic benchmarking feature which can be used to automatically check the status of nightly build, for example. To use this feature you need to import benchmarking module from kratos_root/benchmarking. To do this add the lines marked in bold to your code:

#################################################################
##################################################################
## ATTENTION: here the order is important

#including kratos path
kratos_libs_path = '../../../../libs' ##kratos_root/libs
kratos_applications_path = '../../../../applications' ##kratos_root/applications
kratos_benchmarking_path = '../../../../benchmarking' ##kratos_root/benchmarking

import sys
sys.path.append(kratos_libs_path)
sys.path.append(kratos_applications_path)
sys.path.append(kratos_benchmarking_path)

#importing Kratos main library
from Kratos import *
kernel = Kernel()   #defining kernel

#importing applications
import applications_interface
applications_interface.Import_IncompressibleFluidApplication = True
applications_interface.Import_PFEMApplication = True
applications_interface.ImportApplications(kernel, kratos_applications_path)

import benchmarking
## from now on the order is not anymore crucial
##################################################################
##################################################################

The principle of the benchmarking module is to first marking some values in your program which need to be examined, or some part of the code which needs to be checked for amount of the time it takes to run. Then, the program is run (using the benchmarking module) in a special mode, called benchmarking mode, and the required data are collected and stored in a file. These data are called the reference data, and will be used to verify the functionality of the program later. This also is done using the benchmarking module.

Personal tools
Categories