diff --git a/src/scheduler/src/handler.c b/src/scheduler/src/handler.c index be38977b..5c2afade 100644 --- a/src/scheduler/src/handler.c +++ b/src/scheduler/src/handler.c @@ -294,18 +294,26 @@ int sched_handle_notify(xce_scheduler_t* sched, xce_notify_data_t* notify) case NotifyData_data_schedUpdateJob: rc = sched_handle_sched_update_job(sched, notify->data.sched_update_job); + if (rc >= 0) + notify->data.sched_update_job = NULL; break; case NotifyData_data_schedUpdateQueue: rc = sched_handle_sched_update_queue(sched, notify->data.sched_update_queue); + if (rc >= 0) + notify->data.sched_update_queue = NULL; break; case NotifyData_data_schedUpdateResvals: rc = sched_handle_sched_update_resvals( sched, notify->data.sched_update_resvals); + if (rc >= 0) + notify->data.sched_update_resvals = NULL; break; case NotifyData_data_schedJobRusages: rc = sched_handle_sched_job_rusage(sched, notify->data.sched_job_rusages); + if (rc >= 0) + notify->data.sched_job_rusages = NULL; break; default: rc = -EINVAL; diff --git a/src/scheduler/src/resource.c b/src/scheduler/src/resource.c index aa773911..46fe0d60 100644 --- a/src/scheduler/src/resource.c +++ b/src/scheduler/src/resource.c @@ -93,9 +93,9 @@ int put_resvals(zarray_t* array, int nres, int* idxs, float* vals) return nres; } -static int unsatisfy_(int nres, int* idxs, float* total, float* inuse, - float* uncomitted, float* wanted, int* unmeet_idxs, - float* unmeet_vals) +static int unsatisfy_(xce_scheduler_t* sched, int nres, int* idxs, float* total, + float* inuse, float* uncomitted, float* wanted, + int* unmeet_idxs, float* unmeet_vals) { int i, j; int count; @@ -116,8 +116,15 @@ static int unsatisfy_(int nres, int* idxs, float* total, float* inuse, j = 0; for (i = 0; i < nres; i++) { if (total[i] < inuse[i] + uncomitted[i] + wanted[i]) { + xce_resource_t* r = NULL; + float need = inuse[i] + uncomitted[i] + wanted[i] - total[i]; + + vget(sched->resmgr, idxs[i], (void**)&r); + TRACE("%s unmet resource %d (%s) shortfall %f", __func__, idxs[i], + r ? r->name : "?", need); + unmeet_idxs[j] = idxs[i]; - unmeet_vals[j] = inuse[i] + wanted[i] + uncomitted[i] - total[i]; + unmeet_vals[j] = need; j++; } } @@ -249,7 +256,7 @@ static int sched_check_shared_satisfy_(xce_scheduler_t* sched, xvec_t* total, return rc; } - rc = unsatisfy_(nres, (int*)wanted->idxs.data, (float*)total->data, + rc = unsatisfy_(sched, nres, (int*)wanted->idxs.data, (float*)total->data, (float*)inuse->data, (float*)uncomitted->data, (float*)wanted->vals.data, (int*)unmeet->idxs.data, (float*)unmeet->vals.data); @@ -324,7 +331,7 @@ static int sched_check_host_satisfy_(xce_scheduler_t* sched, return rc; } - rc = unsatisfy_(nres, (int*)wanted->idxs.data, (float*)total->data, + rc = unsatisfy_(sched, nres, (int*)wanted->idxs.data, (float*)total->data, (float*)inuse->data, (float*)uncomitted->data, (float*)wanted->vals.data, (int*)unmeet->idxs.data, (float*)unmeet->vals.data);