reformat code and job array

This commit is contained in:
Rongsong Shen 2025-11-07 16:14:27 +08:00
parent a665ccd4fe
commit 9ff857db9f
64 changed files with 1497 additions and 2476 deletions

View file

@ -16,36 +16,22 @@ static int mark_job_update(cluster_t*, job_t*, int);
uint64_t jobid = 100;
static job_t* create_job(cluster_t* c,
uint64_t jobid,
char* queue,
char* user,
char* exechome,
char* execcwd,
char* execuser,
char* cmdline,
char* exdata,
uint32_t mintasks,
uint32_t maxtasks)
static job_t* create_job(cluster_t* c, uint64_t jobid, char* queue, char* user,
char* exechome, char* execcwd, char* execuser,
char* cmdline, char* exdata, uint32_t mintasks,
uint32_t maxtasks)
{
job_t* job = NULL;
return job;
}
uint64_t job_submit(void* c,
char* user,
char* queue,
char* resreq,
char* cmdline,
char* exdata,
uint32_t mintasks,
uint64_t job_submit(void* c, char* user, char* queue, char* resreq,
char* cmdline, char* exdata, uint32_t mintasks,
uint32_t maxtasks)
{
job_t* job = NULL;
job = create_job(c, jobid++, queue,
user, "/tmp",
"/tmp", user, cmdline,
job = create_job(c, jobid++, queue, user, "/tmp", "/tmp", user, cmdline,
exdata, mintasks, maxtasks);
if (job == NULL) {
return -errno;
@ -62,20 +48,16 @@ int load_jobs(void* c)
for (i = 1; i < NJOBS; i++) {
sprintf(cmdline, "echo normal; sleep %d", i);
job = create_job(c, jobid++, "normal",
"rshen", "/home/rshen",
"/tmp", "rshen", (char*)cmdline,
NULL, 1, 1);
job = create_job(c, jobid++, "normal", "rshen", "/home/rshen", "/tmp",
"rshen", (char*)cmdline, NULL, 1, 1);
if (job == NULL) {
return -errno;
}
}
for (i = 1; i < NJOBS; i++) {
job = create_job(c, jobid++, "xce",
"rshen", "/home/rshen",
"/tmp", "rshen", "echo xce; sleep 30",
NULL, 1, 1);
job = create_job(c, jobid++, "xce", "rshen", "/home/rshen", "/tmp",
"rshen", "echo xce; sleep 30", NULL, 1, 1);
if (job == NULL) {
return -errno;
}
@ -108,8 +90,7 @@ static void free_launchinfo(xce_launch_t* launch)
FREEUP(launch->hosts);
}
static int mk_launchinfo(xce_launch_t* launch,
xce_job_alloc_t* alloc)
static int mk_launchinfo(xce_launch_t* launch, xce_job_alloc_t* alloc)
{
int i;
int rc = 0;
@ -124,7 +105,8 @@ static int mk_launchinfo(xce_launch_t* launch,
launch->nhosts = alloc->nhosts;
for (i = 0; i < alloc->nhosts; i++) {
launch->hosts[i] = (xce_host_launch_t*)calloc(1, sizeof(xce_host_launch_t));
launch->hosts[i]
= (xce_host_launch_t*)calloc(1, sizeof(xce_host_launch_t));
if (launch->hosts[i] == NULL) {
rc = -ENOMEM;
break;
@ -141,9 +123,7 @@ static int mk_launchinfo(xce_launch_t* launch,
return rc;
}
static int dispatch_a_job_(cluster_t* c,
endpoint_t* ep,
xce_job_alloc_t* alloc)
static int dispatch_a_job_(cluster_t* c, endpoint_t* ep, xce_job_alloc_t* alloc)
{
int rc = 0;
job_t* j;
@ -177,9 +157,7 @@ static int dispatch_a_job_(cluster_t* c,
allocs = (xce_host_alloc_t**)alloc->allocs;
/* using head node of job */
w = workermgr_lock(&(c->workermgr),
allocs[0]->host,
OBJREF_READ);
w = workermgr_lock(&(c->workermgr), allocs[0]->host, OBJREF_READ);
if (w == NULL) {
PERROR("workermgr_lock");
free_launchinfo(&launchinfo);
@ -189,9 +167,7 @@ static int dispatch_a_job_(cluster_t* c,
if ((w->ep == NULL) || (w->host.status != 0)) {
ERROR("worker %s is not in correct state, status %x ep %p",
w->host.name,
w->host.status,
w->ep);
w->host.name, w->host.status, w->ep);
free_launchinfo(&launchinfo);
obj_deref(w);
@ -206,8 +182,7 @@ static int dispatch_a_job_(cluster_t* c,
char* q_pre_exec;
char* q_post_exec;
rc = get_queue_exec(c, j->job.queue,
&q_pre_exec, &q_post_exec);
rc = get_queue_exec(c, j->job.queue, &q_pre_exec, &q_post_exec);
if (rc < 0) {
obj_deref(j);
obj_deref(w);
@ -247,8 +222,8 @@ static int dispatch_a_job_(cluster_t* c,
if (j->job.allocs != NULL) {
free_JobAlloc_ptr(&(j->job.allocs));
}
j->job.allocs = (xce_job_alloc_t*)calloc(1, sizeof(xce_job_alloc_t));
j->job.allocs->jobid = alloc->jobid;
j->job.allocs = (xce_job_alloc_t*)calloc(1, sizeof(xce_job_alloc_t));
j->job.allocs->jobid = alloc->jobid;
j->job.allocs->nhosts = nc;
MOVE_PTR(j->job.allocs->allocs, allocs);
alloc->allocs = NULL;
@ -265,8 +240,7 @@ static int dispatch_a_job_(cluster_t* c,
return rc;
}
int job_ctrl(cluster_t* c,
xce_jobctrl_t* ctrinfo)
int job_ctrl(cluster_t* c, xce_jobctrl_t* ctrinfo)
{
uint64_t jobid = ctrinfo->jobid;
job_t* j;
@ -287,9 +261,7 @@ int job_ctrl(cluster_t* c,
/* job control command will be sent to first node
* for parallel jobs
*/
w = workermgr_lock(&(c->workermgr),
allocs[0]->host,
OBJREF_READ);
w = workermgr_lock(&(c->workermgr), allocs[0]->host, OBJREF_READ);
if (w != NULL) {
/* FIXME: better method to check host status */
if ((w->ep != NULL) && (w->host.status == 0)) {
@ -297,8 +269,8 @@ int job_ctrl(cluster_t* c,
if (ioctx != NULL) {
rc = xce_jobctrl_req(ioctx, ctrinfo);
if (rc < 0) {
ERROR("job ctrl %ld on host %s returns %d",
jobid, w->host.name, rc);
ERROR("job ctrl %ld on host %s returns %d", jobid,
w->host.name, rc);
}
} else {
ERROR("memory allocate failed");
@ -306,9 +278,7 @@ int job_ctrl(cluster_t* c,
}
} else {
ERROR("worker %s is not in correct state, status %x ep %p",
w->host.name,
w->host.status,
w->ep);
w->host.name, w->host.status, w->ep);
rc = -errno;
}
obj_deref(w);
@ -328,7 +298,8 @@ int job_ctrl(cluster_t* c,
case JobControl_u_siginfo:
switch (ctrinfo->u.siginfo->signo) {
case SIGCONT:
if (j->job.state & (JOB_STAT_PSUSP | JOB_STAT_USUSP | JOB_STAT_SSUSP)) {
if (j->job.state
& (JOB_STAT_PSUSP | JOB_STAT_USUSP | JOB_STAT_SSUSP)) {
int state = j->job.state;
/* resume suspend job? */
@ -338,7 +309,8 @@ int job_ctrl(cluster_t* c,
break;
case SIGSTOP:
case SIGTSTP:
if (!(j->job.state & (JOB_STAT_PSUSP | JOB_STAT_USUSP | JOB_STAT_SSUSP))) {
if (!(j->job.state
& (JOB_STAT_PSUSP | JOB_STAT_USUSP | JOB_STAT_SSUSP))) {
int state = j->job.state;
state |= JOB_STAT_PSUSP;
@ -348,7 +320,8 @@ int job_ctrl(cluster_t* c,
case SIGKILL:
case SIGTERM:
default:
if (j->job.state & (JOB_STAT_DONE | JOB_STAT_EXIT | JOB_STAT_ERR)) {
if (j->job.state
& (JOB_STAT_DONE | JOB_STAT_EXIT | JOB_STAT_ERR)) {
break;
}
/* FIXME: */
@ -379,10 +352,8 @@ int job_ctrl(cluster_t* c,
return rc;
}
static void notify_dispatch(cluster_t* c,
endpoint_t* ep,
uint64_t jobid,
int code)
static void notify_dispatch(cluster_t* c, endpoint_t* ep, uint64_t jobid,
int code)
{
/* clang-format off */
job_failinfo_t info = {
@ -400,9 +371,7 @@ static void notify_dispatch(cluster_t* c,
notify(c, ep, &data);
}
int handle_jobdispatch(cluster_t* c,
endpoint_t* ep,
xce_request_t* request)
int handle_jobdispatch(cluster_t* c, endpoint_t* ep, xce_request_t* request)
{
int rc = 0;
int i;
@ -435,9 +404,7 @@ int handle_jobdispatch(cluster_t* c,
return rc;
}
int handle_jobsubmit(cluster_t* c,
endpoint_t* ep,
xce_request_t* request)
int handle_jobsubmit(cluster_t* c, endpoint_t* ep, xce_request_t* request)
{
uint64_t jobid;
xce_job_submit_t* submit;
@ -449,22 +416,17 @@ int handle_jobsubmit(cluster_t* c,
init_reply_by_req(&reply, request);
if (NULLSTR(submit->user) || NULLSTR(submit->queue) || NULLSTR(submit->cmdline)) {
if (NULLSTR(submit->user) || NULLSTR(submit->queue)
|| NULLSTR(submit->cmdline)) {
jobid = 0;
errno = EINVAL;
} else {
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_NEW,
c, submit);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_NEW, c, submit);
jobid = job_submit(c, (char*)submit->user,
(char*)submit->queue,
(char*)submit->resreq,
(char*)submit->cmdline,
(char*)submit->exdata,
submit->mintasks,
jobid = job_submit(c, (char*)submit->user, (char*)submit->queue,
(char*)submit->resreq, (char*)submit->cmdline,
(char*)submit->exdata, submit->mintasks,
submit->maxtasks);
}
if (jobid == 0) {
@ -482,19 +444,14 @@ int handle_jobsubmit(cluster_t* c,
xce_reply(ep, c->myhost, &reply);
/* Run hooks to tell scheduler */
j = jobmgr_lockjob(&(c->jobmgr),
jobid, OBJREF_READ);
j = jobmgr_lockjob(&(c->jobmgr), jobid, OBJREF_READ);
if (j == NULL) {
ERROR("%s fail to lock job %lu",
__func__, jobid);
ERROR("%s fail to lock job %lu", __func__, jobid);
} else {
xlist_init(&jlist, 2);
if (xlist_store(&jlist, j) >= 0) {
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_NEW,
c, &jlist);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT, HOOK_DETAIL_JOB_NEW, c, &jlist);
} else {
PERROR("xlist_store");
}
@ -506,15 +463,10 @@ int handle_jobsubmit(cluster_t* c,
return 0;
}
static int mark_job_start(cluster_t* c,
job_t* job,
job_pidinfo_t* info)
static int mark_job_start(cluster_t* c, job_t* job, job_pidinfo_t* info)
{
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_START,
c, info, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_START, c, info, job);
/* update job information */
job->job.state = JOB_STAT_RUN;
job->job.start_time = time(NULL);
@ -527,23 +479,19 @@ static int mark_job_start(cluster_t* c,
job->job.pidinfo->npgids = copy_int_list((int**)&(job->job.pidinfo->pgids),
(int*)info->pgids, info->npgids);
if (info->exdata != NULL) {
job->job.pidinfo->exdata = create_obj_by_typename(&(c->objmgr), "xstring",
info->exdata);
job->job.pidinfo->exdata
= create_obj_by_typename(&(c->objmgr), "xstring", info->exdata);
} else {
job->job.pidinfo->exdata = NULL;
}
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_START,
c, info, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_START, c, info, job);
return 0;
}
int on_job_start(cluster_t* c,
job_pidinfo_t* info)
int on_job_start(cluster_t* c, job_pidinfo_t* info)
{
job_t* job = NULL;
@ -563,15 +511,10 @@ int on_job_start(cluster_t* c,
return 0;
}
static int mark_job_finish(cluster_t* c,
job_t* job,
xce_jobfinish_t* finish)
static int mark_job_finish(cluster_t* c, job_t* job, xce_jobfinish_t* finish)
{
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_EXIT,
c, finish, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_EXIT, c, finish, job);
/* update job information */
if (finish->exit_code == 0) {
job->job.state = JOB_STAT_DONE;
@ -592,22 +535,18 @@ static int mark_job_finish(cluster_t* c,
job->job.run_time = job->job.finish_time - job->job.start_time;
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_EXIT,
c, finish, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_EXIT, c, finish, job);
return 0;
}
int on_job_finish(cluster_t* c,
xce_jobfinish_t* finish)
int on_job_finish(cluster_t* c, xce_jobfinish_t* finish)
{
job_t* job = NULL;
TRACE("%s job finish jobid %ld exit code %d",
__func__, finish->jobid, finish->exit_code);
TRACE("%s job finish jobid %ld exit code %d", __func__, finish->jobid,
finish->exit_code);
job = jobmgr_lockjob(&(c->jobmgr), finish->jobid, OBJREF_UPDATE);
if (job == NULL) {
@ -623,22 +562,18 @@ int on_job_finish(cluster_t* c,
return 0;
}
static int mark_job_fail(cluster_t* c,
job_t* job,
job_failinfo_t* failinfo)
static int mark_job_fail(cluster_t* c, job_t* job, job_failinfo_t* failinfo)
{
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_FAIL,
c, failinfo, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_FAIL, c, failinfo, job);
/* update job information */
switch (failinfo->stage) {
case JOB_EXEC_STAGE_Q_POST_EXEC:
case JOB_EXEC_STAGE_POST_EXEC:
if ((job->job.state & (JOB_STAT_EXIT | JOB_STAT_DONE)) == 0) {
WARN("job %ld got post exec fail notification but job's exit status has not been set",
WARN("job %ld got post exec fail notification but job's exit "
"status has not been set",
job->job.jobid);
job->job.state |= JOB_STAT_EXIT;
}
@ -651,43 +586,31 @@ static int mark_job_fail(cluster_t* c,
job->job.finish_time = time(NULL);
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_FAIL,
c, failinfo, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_FAIL, c, failinfo, job);
return 0;
}
static int mark_job_update(cluster_t* c,
job_t* job,
int state)
static int mark_job_update(cluster_t* c, job_t* job, int state)
{
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_UPDATE,
c, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_UPDATE, c, job);
/* update job state */
job->job.state = state;
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_UPDATE,
c, job);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_UPDATE, c, job);
return 0;
}
int on_job_fail(cluster_t* c,
job_failinfo_t* failinfo)
int on_job_fail(cluster_t* c, job_failinfo_t* failinfo)
{
job_t* job = NULL;
TRACE("%s job fail jobid %ld code %d",
__func__, failinfo->jobid, failinfo->code);
TRACE("%s job fail jobid %ld code %d", __func__, failinfo->jobid,
failinfo->code);
job = jobmgr_lockjob(&(c->jobmgr), failinfo->jobid, OBJREF_UPDATE);
if (job == NULL) {
@ -703,14 +626,12 @@ int on_job_fail(cluster_t* c,
return 0;
}
int on_job_stop(cluster_t* c,
uint64_t jobid)
int on_job_stop(cluster_t* c, uint64_t jobid)
{
job_t* job = NULL;
int state;
TRACE("%s job stop jobid %ld",
__func__, jobid);
TRACE("%s job stop jobid %ld", __func__, jobid);
job = jobmgr_lockjob(&(c->jobmgr), jobid, OBJREF_UPDATE);
if (job == NULL) {
@ -729,14 +650,12 @@ int on_job_stop(cluster_t* c,
return 0;
}
int on_job_resume(cluster_t* c,
uint64_t jobid)
int on_job_resume(cluster_t* c, uint64_t jobid)
{
job_t* job = NULL;
int state;
TRACE("%s job resume jobid %ld",
__func__, jobid);
TRACE("%s job resume jobid %ld", __func__, jobid);
job = jobmgr_lockjob(&(c->jobmgr), jobid, OBJREF_UPDATE);
if (job == NULL) {
@ -754,15 +673,12 @@ int on_job_resume(cluster_t* c,
return 0;
}
int on_job_postdone(cluster_t* c,
endpoint_t* ep,
uint64_t jobid)
int on_job_postdone(cluster_t* c, endpoint_t* ep, uint64_t jobid)
{
job_t* job = NULL;
int state;
TRACE("%s job post done jobid %ld",
__func__, jobid);
TRACE("%s job post done jobid %ld", __func__, jobid);
job = jobmgr_lockjob(&(c->jobmgr), jobid, OBJREF_UPDATE);
if (job == NULL) {
@ -772,7 +688,8 @@ int on_job_postdone(cluster_t* c,
state = job->job.state;
if ((state & (JOB_STAT_EXIT | JOB_STAT_DONE)) == 0) {
WARN("job %ld got post exec fail notification but job's exit status has not been set",
WARN("job %ld got post exec fail notification but job's exit status "
"has not been set",
job->job.jobid);
state |= JOB_STAT_EXIT;
/* ensure that job finish time has been set */
@ -788,59 +705,44 @@ int on_job_postdone(cluster_t* c,
return 0;
}
int on_job_ckpt(cluster_t* c,
endpoint_t* ep,
xce_ckptinfo_t* ckptinfo)
int on_job_ckpt(cluster_t* c, endpoint_t* ep, xce_ckptinfo_t* ckptinfo)
{
uint64_t jobid;
char* info = NULL;
job_t* j;
if (ckptinfo == NULL) {
ERROR("%s ckptinfo should not be NULL",
__func__);
ERROR("%s ckptinfo should not be NULL", __func__);
return -EINVAL;
}
jobid = ckptinfo->jobid;
info = ckptinfo->ckptinfo;
TRACE("%s job %ld ckptinfo %s",
__func__, jobid, info);
TRACE("%s job %ld ckptinfo %s", __func__, jobid, info);
j = jobmgr_lockjob(&(c->jobmgr), jobid,
OBJREF_UPDATE);
j = jobmgr_lockjob(&(c->jobmgr), jobid, OBJREF_UPDATE);
if (j == NULL) {
ERROR("%s can not find job %ld",
__func__, jobid);
ERROR("%s can not find job %ld", __func__, jobid);
return -errno;
}
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_CKPT,
c, j);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_CKPT, c, j);
if (j->job.ckptinfo != NULL) {
obj_deref(j->job.ckptinfo);
}
j->job.ckptinfo = create_obj_by_typename(&(c->objmgr), "xstring",
info);
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_CKPT,
c, j);
j->job.ckptinfo = create_obj_by_typename(&(c->objmgr), "xstring", info);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_CKPT, c, j);
obj_deref(j);
return 0;
}
int do_jobcontrol_op(cluster_t* c,
endpoint_t* ep,
xce_request_t* request)
int do_jobcontrol_op(cluster_t* c, endpoint_t* ep, xce_request_t* request)
{
int rc = 0;
xce_reply_t reply;
@ -855,17 +757,14 @@ int do_jobcontrol_op(cluster_t* c,
return rc;
}
int update_job_rusages(cluster_t* c,
endpoint_t* ep,
xce_request_t* request)
int update_job_rusages(cluster_t* c, endpoint_t* ep, xce_request_t* request)
{
xce_job_rusages_t* rusages = request->body.updatemsg->data.jobrusages;
job_t* j;
worker_t* w;
char* host = NULL;
TRACE("%s trying to update job(%ld) rusage",
__func__, rusages->jobid);
TRACE("%s trying to update job(%ld) rusage", __func__, rusages->jobid);
j = jobmgr_lockjob(&(c->jobmgr), rusages->jobid, OBJREF_UPDATE);
if (j == NULL) {
@ -879,43 +778,30 @@ int update_job_rusages(cluster_t* c,
return errno;
}
host = create_obj_by_typename(&(c->objmgr), "xstring",
w->host.name);
host = create_obj_by_typename(&(c->objmgr), "xstring", w->host.name);
obj_deref(w);
if (host == NULL) {
return -ENOMEM;
}
TRACE("%s update job (%ld) rusage for host %s",
__func__, rusages->jobid, host);
TRACE("%s update job (%ld) rusage for host %s", __func__, rusages->jobid,
host);
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_UPDATE,
c, j);
update_host_runusage(&(j->job.run_usage),
host,
rusages->count,
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_BEFORE_EVENT,
HOOK_DETAIL_JOB_UPDATE, c, j);
update_host_runusage(&(j->job.run_usage), host, rusages->count,
rusages->usages);
update_pids(&(j->job.pidinfo),
rusages->npids,
rusages->pids);
update_pids(&(j->job.pidinfo), rusages->npids, rusages->pids);
update_pgids(&(j->job.pidinfo),
rusages->npgids,
rusages->pgids);
update_pgids(&(j->job.pidinfo), rusages->npgids, rusages->pgids);
/* FIXME
* update other fields of job rusage later
*/
xce_run_hooks(&(c->hooksys),
XCE_CONTROLLER_HOOK_JOB,
HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_UPDATE,
c, j);
xce_run_hooks(&(c->hooksys), XCE_CONTROLLER_HOOK_JOB, HOOK_AFTER_EVENT,
HOOK_DETAIL_JOB_UPDATE, c, j);
obj_deref(j);
return 0;