Skip to content
Snippets Groups Projects

fix/AGIPD_CM_processing_issue_redmine_#75266

Merged Karim Ahmed requested to merge fix/det_ticket_75266_CM_bug into master
1 unresolved thread

SUMMARY:

This MR is related to a det-support Redmine ticket https://in.xfel.eu/redmine/issues/75266?jump=issues. There were some reporter errors in the Data Processing Sections in the report for sequences 13, 20, and 52.

I understood that these errors occurred for images with fewer n_imgs than its preceding processed core (while applying cm_correction()) and the same value of trainIds was stored at the end of the shared_mem array.

Error's Screenshot:

Screenshot_from_2020-11-19_08-30-36

Reviewers

@danilevc @kamile @kluyvert

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Karim Ahmed added 9 commits

    added 9 commits

    Compare with previous version

    • Here's why it LGTMs:

      Behind the scenes, sharedmem makes use of a binary file to store the data, based of numpy.memmap

      Each process in our pool accessing the data does so by seeking to a specific position in the file, and then manipulating the file within its range.
      However, there's little protection for accessing data beyond the allocated space (due to it being, well, a file).

      As such, it's up to us to make sure we don't read too far. That's why there's a bunch of self.sharedmem['whatever'][:n_img]: ensuring we stay within the allocated n_img boundaries.

  • The fix LGTM too, but I don't think memmap is actually relevant to understanding it. The issue is just that we're reusing an array which is bigger than the data we're interested in.

    If we actually read beyond the end of the allocated space, I believe we'd see segfaults rather than a Numpy exception. NumPy should do the necessary bounds checks to avoid that.

  • Thank you both for the review.

  • Karim Ahmed mentioned in commit 9244777c

    mentioned in commit 9244777c

  • merged

Please register or sign in to reply
Loading