From 8623b01b1a31c2f76dddc33d5fa8370329e737ce Mon Sep 17 00:00:00 2001 From: Daniel Milroy Date: Wed, 16 Oct 2024 21:54:49 -0700 Subject: [PATCH] resource: add partial cancel state tracking --- resource/jobinfo/jobinfo.cpp | 10 ++++++++++ resource/jobinfo/jobinfo.hpp | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/resource/jobinfo/jobinfo.cpp b/resource/jobinfo/jobinfo.cpp index 577610aa2..2abb3dd7d 100644 --- a/resource/jobinfo/jobinfo.cpp +++ b/resource/jobinfo/jobinfo.cpp @@ -47,6 +47,16 @@ job_info_t::job_info_t (uint64_t j, { } +bool job_info_t::get_pcancel_state () +{ + return partial_canceled; +} + +void job_info_t::set_pcanceled () +{ + partial_canceled = true; +} + void get_jobstate_str (job_lifecycle_t state, std::string &status) { switch (state) { diff --git a/resource/jobinfo/jobinfo.hpp b/resource/jobinfo/jobinfo.hpp index 3d268fc3b..6a18b5f3b 100644 --- a/resource/jobinfo/jobinfo.hpp +++ b/resource/jobinfo/jobinfo.hpp @@ -35,6 +35,9 @@ struct job_info_t { const std::string &jstr, double o); + bool get_pcancel_state (); + void set_pcanceled (); + uint64_t jobid = UINT64_MAX; job_lifecycle_t state = job_lifecycle_t::INIT; int64_t scheduled_at = -1; @@ -42,6 +45,7 @@ struct job_info_t { std::string jobspec_str = ""; std::string R = ""; double overhead = 0.0f; + bool partial_canceled = false; }; void get_jobstate_str (job_lifecycle_t state, std::string &status);