GaudiDiff, for intelligent auto-diffing of two gaudi jobs

(the result of task #50644 )

....... Difference engine


A common annoyance with LHCb jobs is the huge amount of stdout they throw at you whenever you run. It is quite difficult to pick out of the large number of changes small differences which really matter. The large amount of printout often requires piping to a file, and then when you are looking for the changes of your latest modification often they are buried.

Another issue arises when we consider our automated testing framework. Due to small variations in printout and modifications made by others each day much lower down the stack, our tests can be quite volatile. Although we ask our developers to check the nightlies, it is difficult for a them to really know if it is they who caused a certain set of test failures.

The parsing and diffing of stdout, to understand if certain modifications were due to you, and whether they are important, is a complicated task for which every devoloper has been used to needing to set up their own little test bench, when we're all doing the same things really, so a common script would be better. is a wrapper around which creates local reference files as a baseline against which to test your future or existing changes, and compares them for you, intelligently and automatically.

User guide


  • you will have a Gaudi job which you want to use as your baseline for comparison.
  • you will have write access somewhere to store the various reference files
  • ideally you will be running within a significantly up-to-date software stack, LHCb >= 37r1 is preferred so that you get the newest Timing Table features (to see what stack you depend on, try svnProjectDeps -P SomeProject vXrYpZ


  • with no options will print a load of help information and exit.

#setup some project and check your options to gaudirun result in what you expect. For example:
$ SetupProject Moore
$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt
#run the same thing with gaudidiff to store the reference files
$ $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

#make whatever changes you wer thinking of, in this example we will compare two different options files:

#run a second time and the results of this second run will be automatically compared with the first
$ $MOOREROOT/tests/qmtest/moore.qms/database.qms/2011.qms/default.qmt

What other options are there.

There are a lot of options:

  • rename the reference files (before or after)
  • re-run the checks without changing the reference files
  • reset force recreation of the reference files

... and even more options!!

Best way to see this all the options is to add --help, or run with no options or arguments.

Examples of use

Comparing your local build with the release build

#setup the release build with no local changes at all
$ SetupProject Moore --no-user-area
$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

#setup with your local area
$ SetupProject Moore
$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

Compare your local changes with the head from yesterday

#setup the release build with no local changes at all
$ SetupProject Moore --no-user-area HEAD --nightly lhcb-head
$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

#setup with your local area
$ SetupProject Moore HEAD --nightly lhcb-head
$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

Compare your changes in the morning with your changes in the afternoon

$ SetupProject Moore 
$  --reset --initial-run morning $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt
$ make
$  --test-run afternoon $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

Compare results on two different platforms

$ LbLogin -c x86_64-slc6-gcc46
$ SetupProject Moore
$  --initial-run x86_64-slc5-gcc46 $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

$ bash -l
$ LbLogin -c x86_64-slc6-gcc48
$ SetupProject Moore
$  --initial-run x86_64-slc6-gcc46  --test-run x86_64-slc6-gcc48 $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

Compare the same options between two different people

#setup the release build with no local changes at all
#person 1
$ cd ~/public/forPerson2
$ SetupProject Moore 
$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

#person 2
$ SetupProject Moore
$  --initial-run ~person1/public/forPerson2/before $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt

Compare two slightly different sets of options

$ SetupProject Moore 
$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt --option="from Configurables import Moore; Moore().EvtMax=11;"

$  $MOOREROOT/tests/qmtest/moore.qms/database.qms/2010.qms/default.qmt --option="from Configurables import Moore; Moore().EvtMax=12;"

I would like to do the diffing myself, can I do that?

  • YES: the script will tell you what files it has produced, running the script with no options will tell you what is in those files, and then you can diff them however you want to.

Can I use this in my qmtest?

  • YES: once it is integrated into Lbscripts this will be easy.
  • you can store the reference files in the usual .ref directory and then use --initial-run ../refs to make the comparison.

-- RobLambert - 26 Mar 2014

Topic attachments
I Attachment History Action Size Date Who Comment
GIFgif diff.gif r1 manage 8.7 K 2014-03-26 - 17:43 RobLambert cat in the hat
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2014-03-26 - RobLambert
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback