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

validation: Reduce O(N**2) edge comparison to O(N) #1777

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

arjclark
Copy link
Contributor

@arjclark arjclark commented Apr 6, 2016

The current edge comparison routine under validation used to check for cyclic dependencies is inefficient. For suites with very large numbers of inter task dependencies e.g. LARGE_FAM1:succeed-all => LARGE_FAM2 the current calculation means the suite is effectively un-validatable. Solves point 2 of #1776

This dramatically speeds up the comparison by reducing it to (effectively) order N from order ~N**2

In the case of the real user suite it gets the calculation down from 2.5+ hours (estimate based on the chunk I ran before giving up and assuming it can be read into memory) to 1 second.

@matthewrmshin - please review1
@hjoliver - please review2

@matthewrmshin
Copy link
Contributor

Looks OK. Test OK.

@hjoliver
Copy link
Member

hjoliver commented Apr 7, 2016

Nice. For a simple suite with FAM1:succeed-any => FAM2:succeed-all and 100-member families, on my desktop box, I get a speed up from 90s to 15s, which isn't as dramatic as for your user suite, but still v good.

Review 2 - good, tests as working.

@hjoliver hjoliver merged commit 61803f5 into cylc:master Apr 7, 2016
@arjclark arjclark deleted the validation.reduce_order_calculation branch April 7, 2016 07:34
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.

3 participants