Returns True if the partition has more than one node with the same proc_id. Args: partition: the BinaryPartition node Returns: A boolean indicating if the partition contains duplicate proc_ids.
(partition: mp.BinaryPartition)
| 37 | |
| 38 | |
| 39 | def partition_has_duplicate_proc_ids(partition: mp.BinaryPartition) -> bool: |
| 40 | """Returns True if the partition has more than one node with the same proc_id. |
| 41 | |
| 42 | Args: |
| 43 | partition: the BinaryPartition node |
| 44 | |
| 45 | Returns: |
| 46 | A boolean indicating if the partition contains duplicate proc_ids. |
| 47 | """ |
| 48 | proc_ids = [node.proc_id for node in enumerate_leaf_nodes(partition)] |
| 49 | return len(set(proc_ids)) != len(proc_ids) |
| 50 | |
| 51 | |
| 52 | def get_total_weight( |
no test coverage detected