Skip to content

Commit

Permalink
Pass lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywonchung committed Aug 20, 2023
1 parent 4cccc10 commit 63ca271
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions zeus/monitor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def energy(gpu_indices: Optional[list[int]] = None) -> None:

@app.command()
def power(
gpu_indices: Optional[list[int]] = None, update_period: float = 1.0,
gpu_indices: Optional[list[int]] = None,
update_period: float = 1.0,
) -> None:
"""Monitor the power consumption of GPUs during the duration of the CLI program.
Expand All @@ -68,7 +69,7 @@ def power(
end_time = time.time()
print(f"Total time: {end_time - start_time} s")
print(f"Total energy: {monitor.get_energy(start_time, end_time)} J")
raise typer.Exit()
raise typer.Exit() from None


if __name__ == "__main__":
Expand Down
6 changes: 2 additions & 4 deletions zeus/monitor/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ def __init__(
# Spawn the power polling process.
self.process = None
atexit.register(self._stop)
self.process = (
mp
.get_context("spawn")
.Process(target=self._run, args=(gpu_indices, power_csv, update_period))
self.process = mp.get_context("spawn").Process(
target=self._run, args=(gpu_indices, power_csv, update_period)
)

def _run(
Expand Down

0 comments on commit 63ca271

Please sign in to comment.