Log a group of timers.
(self, names, normalizer=1.0, reset=True, memory_breakdown=False, ranks=None)
| 139 | return " | {} | {} | {} | {}".format(alloc, max_alloc, cache, max_cache) |
| 140 | |
| 141 | def log(self, names, normalizer=1.0, reset=True, memory_breakdown=False, ranks=None): |
| 142 | """Log a group of timers.""" |
| 143 | assert normalizer > 0.0 |
| 144 | string = "time (ms)" |
| 145 | for name in names: |
| 146 | if name in self.timers: |
| 147 | elapsed_time = (self.timers[name].elapsed(reset=reset) / normalizer) |
| 148 | string += " | {}: {:.2f}".format(name, elapsed_time) |
| 149 | |
| 150 | # timers logging should be independent of the global log level it's already conditional on wall_clock_breakdown being True, so using use_logger=False will always print the stats |
| 151 | print_dist(string, ranks=ranks or [0]) |
| 152 | |
| 153 | def get_mean(self, names, normalizer=1.0, reset=True): |
| 154 | """Get the mean of a group of timers.""" |
nothing calls this directly
no test coverage detected