save works

This commit is contained in:
Rongsong Shen 2025-12-22 17:32:52 +08:00
parent ef95cea41f
commit c1e42b1ee2
6 changed files with 202 additions and 108 deletions

View file

@ -21,8 +21,11 @@ typedef int (*plugin_init_fn_t)(void*);
typedef void (*plugin_fini_fn_t)(void*);
/* plugin function to elect job to be scheduler */
typedef int64_t (*plugin_job_election_fn_t)(void*);
typedef void* (*plugin_job_election_fn_t)(void*);
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*);
@ -34,14 +37,16 @@ typedef struct {
} plugin_hooks_t;
typedef struct {
char* name;
void* sched;
plugin_init_fn_t init_fn;
plugin_fini_fn_t fini_fn;
plugin_job_election_fn_t job_elect_fn;
plugin_job_allocate_fn_t job_alloc_fn;
plugin_hooks_t hooks;
plugin_data_t data;
char* name;
void* sched;
plugin_init_fn_t init_fn;
plugin_fini_fn_t fini_fn;
plugin_begin_session_fn_t begin_session_fn;
plugin_end_session_fn_t end_session_fn;
plugin_job_election_fn_t job_elect_fn;
plugin_job_allocate_fn_t job_alloc_fn;
plugin_hooks_t hooks;
plugin_data_t data;
} xce_sched_plugin_t;
extern int plugin_register(void*, void*);
@ -50,6 +55,8 @@ extern int plugin_config_update(void*, xce_conf4sched_t*);
extern int plugin_queue_update(void*, xce_sched_queue_t*);
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 register_fcfs(void*);

View file

@ -66,6 +66,8 @@ extern int sched_init(xce_scheduler_t*, xce_client_config_t*,
extern void sched_fini(xce_scheduler_t*);
extern int sched_update(xce_scheduler_t*);
extern void sched_go(xce_scheduler_t*);
extern void sched_begin_session(xce_scheduler_t*);
extern void sched_end_session(xce_scheduler_t*);
extern xce_sched_job_t* sched_get_job(xce_scheduler_t*, uint64_t);
extern xce_sched_queue_t* sched_get_queue(xce_scheduler_t*, char*);
extern xce_sched_worker_t* sched_get_worker(xce_scheduler_t*, char*);
@ -77,5 +79,6 @@ extern int sched_add_user(xce_scheduler_t*, xce_sched_user_t*);
extern int sched_add_worker(xce_scheduler_t*, xce_sched_worker_t*);
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*);
#endif