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

Improved delocalization checksum #150

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dpmerrell
Copy link

The previous checksum method in canine/localization/delocalization.py had some problematic worst-case behaviors.

Specifically: imagine a task that outputs a directory containing hundreds of large files (~900MB). In this case, the checksum method would fully hash every one of these files; and it would do so serially. This output hashing could take several hours, dwarfing the expense of the actual compute task.

(It turns out this scenario is all too real when working with single cell data!)

This PR contains a new checksum method that allocates at most max(number_of_files, 1024) checksum updates to a task output. If an output is a single file, then it works much the same as before. If an output is a directory, then the checksum updates are allocated to files such that (A) each file is given at least one checksum update and (B) files are given checksum updates in rough proportion to their sizes.

This circumvents problematic worst-case expense -- hashing never takes more than a few seconds now.

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.

1 participant