Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/dvsim/job/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
capture the results of the job run.
"""

import math
from collections.abc import Callable, Mapping, Sequence
from pathlib import Path

Expand Down Expand Up @@ -80,7 +81,7 @@ class JobSpec(BaseModel):
"""Wait for dependent jobs to pass before scheduling."""
weight: int
"""Weight to apply to the scheduling priority."""
timeout_mins: int | None
timeout_mins: float | None
"""Timeout to apply to the launched job."""

cmd: str
Expand Down Expand Up @@ -126,7 +127,7 @@ def id(self) -> str:
@property
def timeout_secs(self) -> int | None:
"""Returns the timeout applied to the launched job, in seconds."""
return None if self.timeout_mins is None else self.timeout_mins * 60
return None if self.timeout_mins is None else math.floor(self.timeout_mins * 60)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This timeout_secs is just used by timeout and sleep interfaces inside the launchers - no reason not to make it return a float as well instead of math.flooring the output.



class JobStatusInfo(BaseModel):
Expand Down
Loading