diff --git a/src/modules/wreck/job.c b/src/modules/wreck/job.c index a6c4d106f307..aa5786678b1a 100644 --- a/src/modules/wreck/job.c +++ b/src/modules/wreck/job.c @@ -776,22 +776,6 @@ static int runevent_fallback (flux_t *h, struct wreck_job *job) return 0; } -static bool Rlite_targets_this_node (flux_t *h, const char *key, - const char *R_lite) -{ - rcalc_t *r = NULL; - bool result; - - if (!(r = rcalc_create (R_lite))) { - if (broker_rank == 0) - flux_log (h, LOG_ERR, "Unable to parse %s", key); - return false; - } - result = rcalc_has_rank (r, broker_rank); - rcalc_destroy (r); - return result; -} - /* Handle response to lookup of R_lite. If this node is targetted, * spawn wrexecd. If R_lite doesn't exist, fallback to old method * of looking up rank.N, with one more continuation. @@ -802,6 +786,7 @@ static void runevent_continuation (flux_future_t *f, void *arg) flux_t *h = flux_future_get_flux (f); const char *key = flux_kvs_lookup_get_key (f); const char *R_lite; + rcalc_t *r = NULL; if (flux_kvs_lookup_get (f, &R_lite) < 0) { if (broker_rank == 0) @@ -812,8 +797,17 @@ static void runevent_continuation (flux_future_t *f, void *arg) } goto done; } - if (!Rlite_targets_this_node (h, key, R_lite)) + if (!(r = rcalc_create (R_lite))) { + flux_log (h, LOG_ERR, "Unable to parse %s", key); goto done_destroy; + } + if (!rcalc_has_rank (r, broker_rank)) { + rcalc_destroy (r); + goto done_destroy; + } + if (wreck_job_set (job, "rcalc", r, (flux_free_f) rcalc_destroy) < 0) + flux_log_error (h, "wreck_job_set (rcalc)"); + if (spawn_exec_handler (h, job) < 0) goto done_destroy; done_destroy: