save works

This commit is contained in:
Rongsong Shen 2025-12-18 14:55:58 +08:00
parent d0174f2f30
commit 4db6b039c5
8 changed files with 140 additions and 34 deletions

View file

@ -3,10 +3,12 @@
#define _SCHEDULER_H_ 1
#include <pthread.h>
#include <stdint.h>
#include <time.h>
#include "decision.h"
#include "client.h"
#include "dataq.h"
#include "decision.h"
#include "mylock.h"
#include "xce/types.h"
#include "xlist.h"
@ -39,6 +41,45 @@ typedef struct {
- offsetof(xce_sched_update_request_t, \
link)))
typedef void* host_selection_t;
typedef struct {
host_selection_t* select;
int nres;
uint32_t* resources;
float* amount;
} rank_req_t;
typedef struct {
uint64_t jobid;
time_t sub_time;
time_t queue_time;
time_t start_time;
unsigned int state;
char* queue;
char* user;
char* project;
uint32_t mintasks;
uint32_t maxtasks;
xce_job_alloc_t* allocs;
} xce_sched_job_t;
typedef struct {
char* name;
uint32_t attrs;
uint32_t status;
int32_t priority;
int32_t accept_interval;
int32_t sched_delay;
char* resreq;
} xce_sched_queue_t;
typedef struct {
char* name;
xce_val_t* res_avail; /* resources in worker */
xce_val_t* res_in_use; /* used resources in worker */
} xce_sched_worker_t;
typedef struct {
mylock_t lock;
int stop;

View file

@ -136,6 +136,9 @@ int scheduler_req_handler(xce_request_t* request, void* args)
/* configuration arriving */
rc = sched_handle_config(
sched, request->body.configpushmsg->data.conf4sched);
if (rc >= 0) {
request->body.configpushmsg->data.conf4sched = NULL;
}
break;
case Request_body_pushmsg:
/* data arriving */

View file

@ -88,6 +88,7 @@ static void sched_pend_update_killer(data_item_t* it)
req = ITPTR_TO_UPDATE_REQ(it);
switch (req->op) {
case XCE_SCHED_OP_UPDATE_CONFIG:
free_Conf4Sched_ptr(&(req->u.config));
break;
case XCE_SCHED_OP_UPDATE_JOB:
for (i = 0; i < req->u.jobupdate.njobs; i++) {