pass pend reason back to controller

This commit is contained in:
Rongsong Shen 2025-12-23 15:29:26 +08:00
parent cd0bca3138
commit 5560ae91da
16 changed files with 349 additions and 123 deletions

View file

@ -14,13 +14,13 @@ typedef enum {
typedef struct {
xce_decision_op_t op;
uint64_t jobid;
union {
xce_job_alloc_t* alloc;
xce_job_alloc_t* alloc;
xce_pendreason_t* reason;
} u;
} xce_decision_t;
extern xce_decision_t* make_pend_decision(uint64_t);
extern xce_decision_t* make_pend_decision(xce_pendreason_t*);
extern xce_decision_t* make_dispatch_decision(xce_job_alloc_t*);
#endif

View file

@ -29,7 +29,8 @@ typedef int (*plugin_begin_session_fn_t)(void*);
typedef int (*plugin_end_session_fn_t)(void*);
/* allocation function of job */
typedef xce_job_alloc_t* (*plugin_job_allocate_fn_t)(void*, int64_t);
typedef xce_job_alloc_t* (*plugin_job_allocate_fn_t)(void*, int64_t,
xce_pendreason_t**);
typedef struct {
plugin_update_config_hook_t config_hook;
@ -60,6 +61,7 @@ extern int plugin_job_update(void*, xce_sched_job_t*);
extern int plugin_worker_update(void*, xce_sched_worker_t*);
extern int plugin_begin_session(void*);
extern int plugin_end_session(void*);
extern int plugin_commit_decision(void*, xce_decision_t*);
extern int register_fcfs(void*);
extern int register_default_allocator(void*);

View file

@ -81,5 +81,6 @@ extern int sched_add_project(xce_scheduler_t*, xce_sched_project_t*);
extern int sched_job_is_ready(xce_sched_job_t*);
extern int sched_queue_is_ready(xce_sched_queue_t*);
extern int sched_commit_decision(xce_scheduler_t*, xce_decision_t*);
extern int sched_publish_pend_reason(xce_scheduler_t*, xce_preason_set_t*);
#endif