save works

This commit is contained in:
Rongsong Shen 2026-03-05 16:03:37 +08:00
parent 3f74f14687
commit 47fc32b02c
6 changed files with 155 additions and 25 deletions

View file

@ -11,6 +11,7 @@
#include "utils.h"
#include "xce/types.h"
#include "xstring.h"
#include "preason.h"
static struct {
mylock_t lock;
@ -569,18 +570,43 @@ static void job_destroy(meta_obj_t* obj)
dereference(j->job.submit);
dereference(j->job.ckptinfo);
/* FIXME: */
if (j->job.pidinfo != NULL) { }
if (j->job.pidinfo != NULL) {
FREEUP(j->job.pidinfo->pids);
FREEUP(j->job.pidinfo->pgids);
FREEUP(j->job.pidinfo->exdata);
FREEUP(j->job.pidinfo);
}
if (j->job.allocs != NULL) { }
if (j->job.allocs != NULL) {
free_JobAlloc_ptr(&(j->job.allocs));
}
if (j->job.accounts != NULL) { }
if (j->job.accounts != NULL) {
/* FIXME??? */
}
if (j->job.run_usage != NULL) { }
if (j->job.run_usage != NULL) {
int i;
if (j->job.exit_info != NULL) { }
for(i = 0; i < j->job.run_usage->num_hosts; i ++) {
if (j->job.run_usage->host_runusage[i] != NULL) {
FREEUP(j->job.run_usage->host_runusage[i]->host_name);
}
FREEUP(j->job.run_usage->host_runusage[i]);
}
if (j->job.pend_reasons != NULL) { }
FREEUP(j->job.run_usage->host_runusage);
FREEUP(j->job.run_usage);
}
if (j->job.exit_info != NULL) {
FREEUP(j->job.exit_info);
}
if (j->job.pend_reasons != NULL) {
erase_job_preason(j->job.pend_reasons);
}
my_rwlock_fini(&(priv->lock));
memset(priv, 0x0, sizeof(*priv));

View file

@ -68,20 +68,33 @@ static void queue_destroy(meta_obj_t* obj)
dereference(q->queue.queue);
dereference(q->queue.resreq);
/* FIXME: */
if (q->queue.users != NULL) { }
if (q->queue.users != NULL) {
free_GroupConfig_ptr(&(q->queue.users));
}
if (q->queue.hosts != NULL) { }
if (q->queue.hosts != NULL) {
free_GroupConfig_ptr(&(q->queue.hosts));
}
if (q->queue.thresholds != NULL) { }
if (q->queue.thresholds != NULL) {
free_Threshold_list(q->queue.nthresholds, q->queue.thresholds);
}
if (q->queue.runwindow != NULL) { }
if (q->queue.runwindow != NULL) {
/* FIXME: */
}
if (q->queue.dispatchwindow != NULL) { }
if (q->queue.dispatchwindow != NULL) {
/* FIXME: */
}
if (q->queue.runwindow_config != NULL) { }
if (q->queue.runwindow_config != NULL) {
free_TimeWindow_ptr(&(q->queue.runwindow_config));
}
if (q->queue.dispatchwindow_config != NULL) { }
if (q->queue.dispatchwindow_config != NULL) {
free_TimeWindow_ptr(&(q->queue.dispatchwindow_config));
}
dereference(q->queue.pre_exec);
dereference(q->queue.post_exec);

View file

@ -74,11 +74,16 @@ static void worker_destroy(meta_obj_t* obj)
FREEUP(w->host.attrs);
}
if (w->host.dispatch_window_config != NULL) { }
if (w->host.dispatch_window_config != NULL) {
free_timewindow_config(w->host.dispatch_window_config);
w->host.dispatch_window_config = NULL;
}
if (w->host.thresholds != NULL) { }
if (w->host.resvals_to_sched != NULL) { }
if (w->host.thresholds != NULL) {
free_resource_thresholds(w->host.thresholds, w->host.nthresholds);
w->host.thresholds = NULL;
w->host.nthresholds = 0;
}
zarray_fini(&(w->host.resvals));