Skip to content

Commit

Permalink
resource: add partial cancel state tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
milroy committed Oct 17, 2024
1 parent 35907cc commit 8623b01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resource/jobinfo/jobinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ job_info_t::job_info_t (uint64_t j,
{
}

bool job_info_t::get_pcancel_state ()

Check warning on line 50 in resource/jobinfo/jobinfo.cpp

View check run for this annotation

Codecov / codecov/patch

resource/jobinfo/jobinfo.cpp#L50

Added line #L50 was not covered by tests
{
return partial_canceled;

Check warning on line 52 in resource/jobinfo/jobinfo.cpp

View check run for this annotation

Codecov / codecov/patch

resource/jobinfo/jobinfo.cpp#L52

Added line #L52 was not covered by tests
}

void job_info_t::set_pcanceled ()

Check warning on line 55 in resource/jobinfo/jobinfo.cpp

View check run for this annotation

Codecov / codecov/patch

resource/jobinfo/jobinfo.cpp#L55

Added line #L55 was not covered by tests
{
partial_canceled = true;

Check warning on line 57 in resource/jobinfo/jobinfo.cpp

View check run for this annotation

Codecov / codecov/patch

resource/jobinfo/jobinfo.cpp#L57

Added line #L57 was not covered by tests
}

void get_jobstate_str (job_lifecycle_t state, std::string &status)
{
switch (state) {
Expand Down
4 changes: 4 additions & 0 deletions resource/jobinfo/jobinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ 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;
std::string jobspec_fn = "";
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);
Expand Down

0 comments on commit 8623b01

Please sign in to comment.