Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a helper method to enable/disable plugins during staging of Eiger detectors #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrakitin
Copy link
Member

@mrakitin mrakitin commented Jan 4, 2021

During today's CHX visit with @oksanagit, @jklynch, @AbbyGi, @MikeHart85 over zoom and Lutz in person, we tried this method to disable plugins during the staging process of the eiger1m_single detector to speed up the acquisition process:

for i in range(1, 4+1):
    getattr(eiger1m_single, f'roi{i}').stage_sigs = OrderedDict([('enable', 0),
             ('blocking_callbacks', 'No'),
             ('parent.cam.array_callbacks', 1)])

for i in range(1, 5+1):
    getattr(eiger1m_single, f'stats{i}').stage_sigs = OrderedDict([('enable', 0),
             ('blocking_callbacks', 'No'),
             ('parent.cam.array_callbacks', 1)])

eiger1m_single.proc1.stage_sigs = OrderedDict([('enable', 0),
             ('blocking_callbacks', 'No'),
             ('parent.cam.array_callbacks', 1)])

eiger1m_single.image.stage_sigs = OrderedDict([('enable', 0),
             ('blocking_callbacks', 'No'),
             ('parent.cam.array_callbacks', 1)])

We also figured out the non-blocking plugin mode was only enabled for eiger4m_single, but not for the other 2 detectors (eiger500k_single and eiger1m_single). de6e031 resolved it. We did a few tests with manipulation of the ['roi1', 'roi2', 'roi3', 'roi4', 'stats1', 'stats2', 'stats3', 'stats4', 'stats5', 'proc1', 'image'] plugins, and the results are as follows:

  • all plugins enabled/blocking mode: 2000 frames with 0.001 s/frame took ~20s;
  • all plugins enabled/non-blocking mode: 2000 frames with 0.001 s/frame took ~9s on the first run after bsui restart, and ~6.8s for the subsequent runs;
  • all plugins disabled/non-blocking mode: 2000 frames with 0.001 s/frame took ~9s on the first run after bsui restart, and ~6.8s for the subsequent runs.

The last 2 cases were comparable in terms of the speed of the scan, but when all plugins are enabled/non-blocking, the resource use is significantly higher than when the plugins are disabled. So, the current PR's update is to provide a way to disable the plugins when needed (they are enabled by default).

Usage:

eiger1m_single.enable_plugins()  # to enable the plugins
eiger1m_single.enable_plugins(enable=False)  # to disable the plugins

This needs to be tested thoroughly before going to production, preferably with the beam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants