Skip to content
Draft
Show file tree
Hide file tree
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
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ debug = [
test = [
"pyhamcrest>=2.1.0",
"pytest>=8.3.3",
"pytest-asyncio>=1.3.0",
"pytest-cov>=5.0.0",
"pytest-timeout>=2.4.0",
"pytest-repeat>=0.9.4",
Expand Down
2 changes: 2 additions & 0 deletions src/dvsim/instrumentation/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class MetadataJobFragment(JobFragment):
job_type: str
target: str
tool: str
backend: str | None
dependencies: list[str]
status: str

Expand Down Expand Up @@ -61,6 +62,7 @@ def build_report_fragments(self) -> InstrumentationFragments | None:
spec.job_type,
spec.target,
spec.tool.name,
spec.backend,
spec.dependencies,
status_str,
)
Expand Down
2 changes: 1 addition & 1 deletion src/dvsim/instrumentation/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def on_job_status_change(self, job: JobSpec, status: JobStatus) -> None:
with self._lock:
running = job_id in self._running_jobs
started = running or job_id in self._finished_jobs
if not started and status != JobStatus.QUEUED:
if not started and status not in (JobStatus.SCHEDULED, JobStatus.QUEUED):
self._running_jobs[job_id] = JobResourceAggregate(job)
running = True
if running and status.is_terminal:
Expand Down
2 changes: 1 addition & 1 deletion src/dvsim/instrumentation/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def on_job_status_change(self, job: JobSpec, status: JobStatus) -> None:
job_info = TimingJobFragment(job)
self._jobs[job_id] = job_info

if job_info.start_time is None and status != JobStatus.QUEUED:
if job_info.start_time is None and status not in (JobStatus.SCHEDULED, JobStatus.QUEUED):
job_info.start_time = time.perf_counter()
if status.is_terminal:
job_info.end_time = time.perf_counter()
Expand Down
5 changes: 5 additions & 0 deletions src/dvsim/job/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class JobSpec(BaseModel):
target: str
"""run phase [build, run, ...]"""

backend: str | None
"""The runtime backend to execute this job with. If not provided (None), this
indicates that whatever is configured as the 'default' backend should be used.
"""

seed: int | None
"""Seed if there is one."""

Expand Down
3 changes: 3 additions & 0 deletions src/dvsim/job/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def get_job_spec(self) -> "JobSpec":
name=self.name,
job_type=self.__class__.__name__,
target=self.target,
# TODO: for now we always use the default configured backend, but it might be good
# to allow different jobs to run on different backends in the future?
backend=None,
seed=getattr(self, "seed", None),
full_name=self.full_name,
qual_name=self.qual_name,
Expand Down
13 changes: 8 additions & 5 deletions src/dvsim/job/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
class JobStatus(Enum):
"""Status of a Job."""

QUEUED = auto()
RUNNING = auto()
PASSED = auto()
FAILED = auto()
KILLED = auto()
# SCHEDULED is currently unused in the old sync scheduler, there `SCHEDULED` and `QUEUED`
# are combined under `QUEUED`. It is used only in the new async scheduler.
SCHEDULED = auto() # Waiting for dependencies
QUEUED = auto() # Dependencies satisfied, waiting to be dispatched
RUNNING = auto() # Dispatched to a backend and actively executing
PASSED = auto() # Completed successfully
FAILED = auto() # Completed with failure
KILLED = auto() # Forcibly terminated or never executed

@property
def shorthand(self) -> str:
Expand Down
Loading
Loading