Commit a6abe63
committed
python: fix performance of ResourceStatus.get_drain_info()
Problem: The ResourceStatus get_drain_info() method is very slow
when there are many drained ranks because it uses a linear search.
Since it will be called at least once per rank, it causes an
exponential performance hit based on the number of drained ranks.
Add a mapping from rank to DrainInfo object in the ResourceStatus
class and use this instead of a search in get_drain_info().
Fixes #58591 parent b0ecae0 commit a6abe63
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
| |||
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
149 | | - | |
| 152 | + | |
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
| |||
0 commit comments