Open
Conversation
Previously diffBragg would raise an Exception if any image failed to process for unexpected reasons. In future real data use cases we will want to log this issue but continue to process the rest of the dataset. The problems encountered for a single image in LZ08 are now moved to RuntimeErrors and caught by a try-except when looping over experiments/reflections/files. Design choices here are guided by the fact that previous Exceptions would kill a single rank and hang the slurm job. By adding the @mpi_abort_on_exception decorator to the function that loops over files, we correctly raise an Exception and kill the slurm job when anything except these RuntimeErrors triggers an Exception, and we preserve the most informative traceback (compared with decorating functions called in the loop). The problems caught as RuntimeErrors are logged at the "critical" level, with more information in the debug logs where possible. The logs also reflect the number of files that could be read, compared with all files found. Although it's not ideal that the files that couldn't be read are still included in the "work distribution" over ranks (marked as having zero reflections), there is an important sanity check taking stock of the expected images here that relies on those files being listed, and the alternative leaves us much more vulnerable to losing images and having no way to tell. A more invasive refactor could be a better choice at some future date. Finally, note that sys.exit() instances aren't safe to use in the functions decorated with @mpi_abort_on_exception. They either need to be replaced with things that aren't recognized as Exceptions or moved outside those functions.
dermen
reviewed
Mar 16, 2023
| mpi_logger.setup_logging_from_params(params) | ||
|
|
||
| df = pandas.read_pickle(args.input) | ||
| for i in range(3): |
Contributor
There was a problem hiding this comment.
what was the failure occurring here without the waiting ?
Contributor
There was a problem hiding this comment.
is there two jobs running simultaneously??
Contributor
Author
There was a problem hiding this comment.
Correct me if I'm wrong -- this is what prep_time is currently addressing? This was a first stab at making it happen by default to wait until files are available, if necessary. Am I in the wrong place?
| MAIN_LOGGER.debug("Number of skipped ROI with NAN in BGs: %d / %d" % (num_roi_nan_bg, len(rois))) | ||
| MAIN_LOGGER.info("Number of ROIS that will proceed to refinement: %d/%d" % (np.sum(selection_flags), len(rois))) | ||
| if np.sum(selection_flags) == 0: | ||
| raise RuntimeError("Can't proceed with zero ROIs") |
Contributor
There was a problem hiding this comment.
Would it make sense to catch this error in hopper_utils.py / GatherFromExperiment:
try:
roi_packet = utils.get_roi_background_and_selection_flag( ...
except RuntimeError:
return False
something like that... the return value of this method is inspected in command_line/hopper.py ...
Contributor
Author
There was a problem hiding this comment.
Yep, that makes sense.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A couple fixes here to make diffBragg usable with LZ08 at scale. Mainly, we need to be able to skip over one or two bad files without crashing the whole job. Open to discussion if these are addressable individual failures though.