merge job rusage and pending reason support

This commit is contained in:
Rongsong Shen 2025-12-16 14:36:28 +08:00
parent 30824ae5ea
commit cb0c7fe9e7
82 changed files with 4280 additions and 2561 deletions

View file

@ -6,6 +6,7 @@
#include <pthread.h>
#include <stdint.h>
#include "delay.h"
#include "hook.h"
#include "htab.h"
#include "kvmgr.h"
@ -39,6 +40,8 @@ enum {
HOOK_DETAIL_JOB_FAIL,
HOOK_DETAIL_JOB_UPDATE,
HOOK_DETAIL_JOB_CKPT,
HOOK_DETAIL_SETPREASON,
HOOK_DETAIL_CLRPREASON,
HOOK_DETAIL_WORKER_JOIN,
HOOK_DETAIL_WORKER_DEAD,
HOOK_DETAIL_WORKER_UPDATE,
@ -50,7 +53,8 @@ enum {
HOOK_DETAIL_RESOURCE_LOC_UPDATE,
HOOK_DETAIL_QUEUE_UPDATE,
HOOK_DETAIL_USERGROUP_UPDATE,
HOOK_DETAIL_HOSTGROUP_UPDATE
HOOK_DETAIL_HOSTGROUP_UPDATE,
HOOK_DETAIL_JOB_RUSAGE_UPDATE
};
#define XCE_NS_CONFIG (0)
@ -125,6 +129,7 @@ typedef struct {
int myidx;
int master;
int ncontrollers;
delaymgr_t delaymgr;
scheduler_t sched;
jobmgr_t jobmgr;
resmgr_t resmgr;

View file

@ -230,16 +230,16 @@ typedef struct {
} xce_launch_t;
typedef struct {
char* exechome;
char* execcwd;
char* execuser;
char* cmdline;
char* exdata;
char* launch_type;
char* q_pre_exec;
char* q_post_exec;
char* job_pre_exec;
char* job_post_exec;
char* exechome;
char* execcwd;
char* execuser;
char* cmdline;
char* exdata;
char* launch_type;
char* q_pre_exec;
char* q_post_exec;
char* job_pre_exec;
char* job_post_exec;
} job_startinfo_t;
typedef struct {
@ -389,6 +389,30 @@ typedef struct {
char* ckptinfo;
} xce_ckptinfo_t;
typedef struct {
char* host;
int reason;
} xce_host_reason_t;
typedef struct {
char* resource;
char* host;
int reason;
} xce_res_reason_t;
typedef struct {
int njobs;
uint64_t* jobs;
} xce_clear_reason_t;
typedef struct {
int main_reason;
int nhost_reasons;
xce_host_reason_t** host_based_reasons;
int nres_reasons;
xce_res_reason_t** res_based_reasons;
} xce_job_preason_t;
typedef struct {
uint64_t jobid;
job_submit_data_t* submit;
@ -405,6 +429,7 @@ typedef struct {
job_exitinfo_t* exit_info;
char* ckptinfo;
int64_t pending_ctrl;
xce_job_preason_t* pend_reasons;
} xce_job_t;
typedef struct {
@ -447,6 +472,7 @@ typedef struct {
int64_t pending_ctrl;
char* pre_exec;
char* post_exec;
char* autopscaler;
} xce_queue_t;
typedef struct {
@ -615,4 +641,14 @@ typedef struct {
float value;
} xce_rusage_t;
typedef struct {
uint64_t jobid;
xce_job_preason_t* reasons;
} xce_pendreason_t;
typedef struct {
int nreasons;
xce_pendreason_t** reasons;
} xce_preason_set_t;
#endif