DikeBenchmarker package

Subpackages

Submodules

DikeBenchmarker.benchmarkatoms module

Basic benchmarking job and result representation

class DikeBenchmarker.benchmarkatoms.Job(job_producer: AbstractBenchmarker, benchmark_id: str, solver_id: str, checker_id: str, logroot: str, retries: int = 3)[source]

Bases: object

Benchmarking Job that behaves like a future.

Identity: benchmark_id, solver_id, created_at (ctor time).

Lifecycle:

CREATED (initial)

–[put into JobLog]–> SUBMITTED –[start working on]–> RUNNING –[finish working on]–> FINISHED | FAILED

CREATED/SUBMITTED -> CANCELLED

cancel_local() bool[source]

Mark the job as cancelled. Called by the benchmarker to prevent the job from being submitted to the external system.

clone_retry(decrement: int = 1) Job[source]

Create a clone of this job with identical benchmark_id, solver_id, checker_id, and logroot. The cloned job will have a new created_at timestamp and will be in the CREATED state. The retries count will be decremented by the specified amount.

get_log_prefix() str[source]

Get the logfile prefix for this job.

mark_running() None[source]

Mark the job as running. Called by the infrastructure adaptor once the job started to run.

mark_submitted() None[source]

Mark the job as submitted. Called by the infrastructure adaptor upon receiving the job.

set_failed(error: str) None[source]

Mark the job as failed. Called by the infrastructure adaptor when the job has completed unsuccessfully.

set_finished() None[source]

Mark the job as finished. Called by the infrastructure adaptor when the job has completed successfully.

class DikeBenchmarker.benchmarkatoms.JobState(value)[source]

Bases: Enum

Possible states of a Job.

CANCELLED = 6
CREATED = 1
FAILED = 5
FINISHED = 4
RUNNING = 3
SUBMITTED = 2
exception DikeBenchmarker.benchmarkatoms.JobStateError[source]

Bases: Exception

Raised when an invalid state transition is attempted on a Job.

class DikeBenchmarker.benchmarkatoms.Result(job: Job, runtime=None, memory=None, failed: bool = False)[source]

Bases: object

Represents the result of a benchmark job. Contains a reference to the job and its resource usage.

get_job() Job[source]
has_failed() bool[source]

Module contents