MCPcopy
hub / github.com/dask/dask / use_longest_path

Function use_longest_path

dask/order.py:446–461  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

444 return leaf_nodes_sorted.pop()
445
446 def use_longest_path() -> bool:
447 size = 0
448 # Heavy reducer / splitter topologies often benefit from a very
449 # traditional critical path that expresses the longest chain of
450 # tasks.
451 if abs(len(root_nodes) - len(leaf_nodes)) / len(root_nodes) < 0.8:
452 # If the graph stays about the same, we are checking for symmetry
453 # and choose a "quickest path first" approach if the graph appears
454 # to be asymmetrical
455 for r in root_nodes:
456 if not size:
457 size = len(leafs_connected[r])
458 elif size != len(leafs_connected[r]):
459 return False
460
461 return True
462
463 # Some topologies benefit if the node with the most dependencies
464 # is used as first choice, others benefit from the opposite.

Callers 1

orderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…