Skip to content

Conversation

@vkarak
Copy link
Contributor

@vkarak vkarak commented Sep 9, 2019

  1. Algorithm's complexity is now O(V+E). The algorithm is doing a DFS traversal of the nodes and assigns each node a level (i.e., in which step it has been discovered). Then the nodes are arranged by increasing level and the test cases of each node (test) are expanded inline. Tests that are in the same level can be executed in any order (or in parallel).
    The algorithm is simply doing a DFS traversal of the test graph (the original one, not the reversed) and marks a node as visited after all of its outcoming edges are explored. The visited nodes are kept in an ordered set, essentially providing at the end the topologically sorted tests.

  2. Additional information that will help execution policies in executing the test cases is now returned. More specifically, a dictionary that arranges the tests per level is returned, as well as a dictionary arranging the nodes by the level that their resources can be safely cleaned up. A test's resources can be safely deleted when the maximum level of its immediate children has been processed.

  3. Another fixed needed for correct support of pre Python 3.6 dictionaries was to use and ordered dictionary for storing the test case graph. This was needed because we want to keep the order of partitions and environments, in order to keep the final output properly organised.

- Algorithm's complexity is now O(V+E)
- Return additional information that will help execution policies in executing
  the test cases. The nodes per level are returned as well as the nodes arranged
  per level that can be safely cleaned up.
@vkarak vkarak added this to the ReFrame sprint 2019w35 milestone Sep 9, 2019
@vkarak vkarak requested review from teojgo and victorusu September 9, 2019 20:44
@vkarak vkarak self-assigned this Sep 9, 2019
@vkarak vkarak changed the title [feat] Improve and extend topological sort of test cases [wip] [feat] Improve and extend topological sort of test cases Sep 10, 2019
@vkarak
Copy link
Contributor Author

vkarak commented Sep 10, 2019

There is a small bug in my algorithm and I want also to change a bit the logic with the levels. I don't think they're needed. Classical topological sorting will do the job and for the cleaning up of resources a reference counting based on the dependencies would solve the issue. I'll come back to that later.

- The algorithm is just a DFS visit of the nodes. The trick is to mark a node as
  visited after all of its outcoming edges have been explored.
- The algorithm operates directly on the test dependencies and does not
  construct the reverse dependency graph.
@vkarak vkarak removed this from the ReFrame sprint 2019w35 milestone Sep 10, 2019
@vkarak vkarak changed the title [wip] [feat] Improve and extend topological sort of test cases [feat] Improve and simplify the topological sorting of the test cases Sep 10, 2019
@vkarak vkarak changed the title [feat] Improve and simplify the topological sorting of the test cases [enhancement] Improve and simplify the topological sorting of the test cases Sep 10, 2019
@vkarak vkarak changed the title [enhancement] Improve and simplify the topological sorting of the test cases [feat] Improve and simplify the topological sorting of the test cases Sep 10, 2019
Passing cyclic graphs is a bug, so we just raise and AssertionError
@codecov-io
Copy link

codecov-io commented Sep 14, 2019

Codecov Report

Merging #934 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #934      +/-   ##
==========================================
+ Coverage    91.7%   91.71%   +0.01%     
==========================================
  Files          79       79              
  Lines       10486    10465      -21     
==========================================
- Hits         9616     9598      -18     
+ Misses        870      867       -3
Impacted Files Coverage Δ
reframe/frontend/dependency.py 96.93% <100%> (-0.55%) ⬇️
reframe/utility/__init__.py 90% <0%> (+0.33%) ⬆️
reframe/core/config.py 85.71% <0%> (+1.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66517f4...56f517d. Read the comment docs.

@vkarak vkarak added this to the ReFrame sprint 2019w38 milestone Sep 16, 2019
@vkarak vkarak merged commit 0cf0b89 into reframe-hpc:master Sep 18, 2019
@vkarak vkarak deleted the enhancement/improve-toposort branch September 18, 2019 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants