Ticket #7743 (closed: fixed)
Slow down of reduction after running it through many loops
Reported by: | Martyn Gigg | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | critical | Milestone: | Release 3.0 |
Component: | Direct Inelastic | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Russell Taylor |
Description
This script demonstrates the problem (data is in systemtests). If you look at the timing of the reduction then it increases a lot between the first few runs and the last.
import mantid from mantid.simpleapi import * import dgreduce iliad_setup=dgreduce.setup iliad=dgreduce.arb_units iliad_abs=dgreduce.abs_units iliad_help=dgreduce.help inst='mar' iliad_setup(inst) ext='.raw' mapfile='mari_res' #det_cal_file must be specified if the reduction sends out put to a workpsace #cal_file='MAR17578.raw' cal_file='MAR11060.RAW' #load vanadium file for i in range(200): print '############' ,i,' ##################' run='11001' WB='MAR11060.RAW' ei = 12.5 rebin_params = "-6.25,0.03125,11.875" BkgdRange = [11705.726218019521, 19500] w1=iliad(WB,run,ei,rebin_params,mapfile,det_cal_file=cal_file,norm_method='current') DeleteWorkspace('w1')
Change History
comment:2 Changed 7 years ago by Martyn Gigg
Fix case when no log exists for parameter link.
Also, improved error message for LoadEmptyInstrument when running child algorithm. Refs #7743
Changeset: 48ed7f59d88050f2e0de14c178e86920a054b805
comment:3 Changed 7 years ago by Martyn Gigg
Add equality operator to ParameterMap...
and use it in CheckWorkspacesMatch. This avoids changes in ordering within the map affecting whether the map is actually the same as another. Refs #7743
Changeset: 4b7aee01301d57493c72b16e0dcb28de8ec18efa
comment:4 Changed 7 years ago by Martyn Gigg
- Status changed from inprogress to verify
- Resolution set to fixed
Branch: bugfix/7743_reduction_looping_slow_down
Tester: Before merging the changes confirm to yourself that the processing of each iteration takes longer as the script keeps executing (it prints the loop time after each iteration).
Merge the changes and rerun the the script above. Confirm that each loop now takes roughly the same time, with the exception of the first that has to load the instrument.
Check that the systemtests have been run (i.e there has been at least one night between the changes going to develop and the point you are testing) and are passing.
comment:5 Changed 7 years ago by Russell Taylor
- Status changed from verify to verifying
- Tester set to Russell Taylor
comment:6 Changed 7 years ago by Russell Taylor
- Status changed from verifying to closed
After the changes there is no slowdown trend when running the above script. I am relying fairly heavily on the tests to validate the changes, but they look good and have certainly cleaned things up in certain places.
Fix bug when loading duplicate instrument parameters.
The multimap was continuously growing as there was no way of checking if a given parameter for a component was already loaded. The storage is now a map with key <Component*,name> so that only unique component/named pairs will be stored. Refs #7743.
Changeset: c34a3597e9d84d01bc0619c4aa202c111e914f03