Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Code Block
<source_library title="Library">
  <source flux="0.667283950775" name="bn131231198">
    <spectrum escale="MeV">
    <particle name="gamma">
      <power_law emax="200000.0" emin="15.0" gamma="2.0" />
    </particle>
    <celestial_dir dec="-2.42" ra="10.11" />
    </spectrum>
  </source>
</source_library>

This is the command line I am using:

Code Block
gtobssim infile=sim_model.xml srclist=source_list.txt scfile=/home/giacomov/FermiData/bn131231198/gll_ft2_tr_bn131231198_v00.fit evroot=boost simtime=100000 ltfrac=1 tstart=410157919.083 nevents=no maxtime=3.155e8 use_ac=no emin=30 emax=100000 edisp=no irfs=P8_SOURCE_V4 maxrows=100000 seed=653786

These are the execution times with the flux as reported above, and then N "boost" times that value:

BoostExecution time (s)
14.438
26.176
1020.802
5092.315
100197.873

This shows that the algorithm is essentially linearly dependent on the number of events (apart from a short initialization timethe inflection between 50 and 100 might be due to memory management, or just noise):

Profiling

I used this command to profile the execution:

...

This is essentially only checking if the name contains "TimeTick", because in that case it has to generate a new piece of simulated FT2 file. In my case I am using a real FT2 file, so the check is false. Now, as a quick-and-dirty fix, just by substituting that line with:

...

I reduce the execution time to ~1/3 of what they it used to be:

BoostExecution time (s)Old execution time (s)
107.63620.802
5028.37592.315
10053.868197.87353.868

An easy fix would be to cache the name of the source in the FluxSource class, so that it is only computed once.