Reference test scripts
From Tobyfit
Contents |
Reference test scripts
Currently three reference test scripts are provided in the directory TobyfitProject/reference. Each script uses the command line interface to load in a TFT file, select some parameters and perform a fit or simulation. One of the final output files is then compared to a previous calculation using the command visdiff, which is available in more recent versions of Matlab. When the tobyfit GUI is run the test scripts are automatically added to the Matlab path so they can be invoked for testing.
All the test scripts take two arguments, the first being the name of the host to run the test on and the second is the number of processors to use, which defaults to 1 if not present. The example cases are listed below.
Simulation of demo.tft data sets
The script sim_demo_tfv1.m loads the data set from the directory demo and performs a simple simulation using all the default parameters from the tft file. For example the command sim_demo_tfv1('local',1) will run the example on the local host using one processor. The run time of this example should be very low, a few seconds.
If the simulation completes successfully the simulation output file of the first cut will be compared with a reference file. These should be identical, or at most have round-off in the last decimal place of some values.
Fitting of the demo.tft data set
The script fit_demo_mc.m loads the data set from the directory demo and performs a multi-parameter fit of the given model to the data. The Monte-Carlo integration method is used with default parameters. For example the command fit_demo_mc('local') will run the example on the local host using one processor. The run time of this example is of the order of a minute, depending on the processor used.
On a successful run the output of the first fitted cut will be compared with a reference result. Again results should be identical or very close.
Fitting of the demo.tft data set
The script cobalt_fit_mc.m loads the data set from the directory demo_new_cobalt and performs a multi-parameter fit of the given model to the data. The Monte-Carlo integration method is used with default parameters. For example the command fit_demo_mc('ral',4) will run the example on the RAL NGS host using four processors. This assumes that the user has this resource defined in their Resources.properties file, have created a valid proxy certificate and have registered to use the NGS system. The run time of this example can be of the order of several minutes, depending on how many processors are used.
On a successful run the output of the first fitted cut will be compared with a reference result. Again results should be identical or very close.
