myfitter is hosted by Hepforge, IPPP Durham

4.3 Parallel Computation

If you installed the Dvegas library with parallelisation features enabled, you can use the last two arguments of calc_lrt_pvalue to parallelise your p-value computation. Details on the parallelisation Monte Carlo integrations can be found in the Dvegas documentation. Here we just discuss the simplest case.

The arguments argc and argv are the ones you would pass to the HepSource::OmniComp constructor if you were using Dvegas directly. They should (usually) contain the command line arguments passed to your program and thus be identical to the ones system passes to your main function. Let's say you have written some program myprog which calculates the p-value (but too slowly) and several computers with access to a network directory workdir. On each extra computer available to you, you start a worker processes with

     cd workdir
     myprog -w

These processes will dump some information about themselves in a common file myprog.workers in workdir and then wait for the “master” process to show up. Start that one on the last computer with

     cd workdir
     myprog

The master process should then connect to the workers and distribute the numerical integration among the workers. It will also do some work itself. Needless to say, if your computers have more than one core, it makes sense to start more than one worker process on each computer.