MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / job_status

Function job_status

crates/hyperqueue/src/client/status.rs:18–39  ·  view source on GitHub ↗
(info: &JobInfo)

Source from the content-addressed store, hash-verified

16}
17
18pub fn job_status(info: &JobInfo) -> Status {
19 let has_waiting = info.counters.n_waiting_tasks(info.n_tasks) > 0;
20
21 if info.counters.n_running_tasks > 0 {
22 Status::Running
23 } else if has_waiting {
24 Status::Waiting
25 } else if info.counters.n_failed_tasks > 0 {
26 Status::Failed
27 } else if info.counters.n_aborted_tasks > 0 {
28 Status::Aborted
29 } else if info.counters.n_canceled_tasks > 0 {
30 Status::Canceled
31 } else {
32 assert_eq!(info.counters.n_finished_tasks, info.n_tasks);
33 if info.is_open() {
34 Status::Opened
35 } else {
36 Status::Finished
37 }
38 }
39}
40
41pub fn is_terminated(info: &JobInfo) -> bool {
42 info.counters.n_running_tasks == 0 && info.counters.n_waiting_tasks(info.n_tasks) == 0

Callers 6

output_job_listFunction · 0.85
group_jobs_by_statusFunction · 0.85
print_job_listMethod · 0.85
print_job_listMethod · 0.85
print_job_detailMethod · 0.85
handle_job_forgetFunction · 0.85

Calls 2

n_waiting_tasksMethod · 0.80
is_openMethod · 0.45

Tested by

no test coverage detected