From 5e1b7aca9dc3211a7c51d7ede4a250e5fb01e622 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 5 May 2018 13:43:47 +0000 Subject: [PATCH] wreck: drop support for rank.N dirs in wreckrun Now that all job allocation mechanisms (wreck internal, sched) use R_lite for resources, drop support for rank.N dirs in wreck job launch. Update tests accordingly. --- src/modules/wreck/job.c | 43 ----------------------------------------- t/t2000-wreck.t | 16 +-------------- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/src/modules/wreck/job.c b/src/modules/wreck/job.c index 0728b7582b6b..bbec9d44c5ea 100644 --- a/src/modules/wreck/job.c +++ b/src/modules/wreck/job.c @@ -730,45 +730,6 @@ static int spawn_exec_handler (flux_t *h, struct wreck_job *job) return (-1); } -/* Handle response to KVS look up of rank.N. - * If it exists, spawn wrexecd. - * This concludes the continuation chain started at runevent_cb(). - */ -static void runevent_fallback_continuation (flux_future_t *f, void *arg) -{ - struct wreck_job *job = arg; - flux_t *h = flux_future_get_flux (f); - const char *key = flux_kvs_lookup_get_key (f); - - if (flux_future_get (f, NULL) < 0) { - flux_log (h, LOG_DEBUG, "No dir %s: %s", key, flux_strerror (errno)); - goto done; - } - if (spawn_exec_handler (h, job) < 0) - goto done; -done: - flux_future_destroy (f); -} - -/* Send request to look up rank.N. - * This function is continued in runevent_fallback_continuation(). - */ -static int runevent_fallback (flux_t *h, struct wreck_job *job) -{ - char key[MAX_JOB_PATH]; - flux_future_t *f; - - snprintf (key, sizeof (key), "%s.rank.%lu", - job->kvs_path, (unsigned long)broker_rank); - if (!(f = flux_kvs_lookup (h, FLUX_KVS_READDIR, key))) - return -1; - if (flux_future_then (f, -1., runevent_fallback_continuation, job) < 0) { - flux_future_destroy (f); - return -1;; - } - return 0; -} - static bool Rlite_targets_this_node (flux_t *h, const char *key, const char *R_lite) { @@ -799,10 +760,6 @@ static void runevent_continuation (flux_future_t *f, void *arg) if (flux_kvs_lookup_get (f, &R_lite) < 0) { if (broker_rank == 0) flux_log (h, LOG_INFO, "No %s: %s", key, flux_strerror (errno)); - if (runevent_fallback (h, job) < 0) { - flux_log_error (h, "%s: fallback failed", __FUNCTION__); - goto done; - } goto done; } if (!Rlite_targets_this_node (h, key, R_lite)) diff --git a/t/t2000-wreck.t b/t/t2000-wreck.t index af8b7b8e1bb1..1db2f353fddf 100755 --- a/t/t2000-wreck.t +++ b/t/t2000-wreck.t @@ -223,25 +223,11 @@ test_expect_success 'wreckrun: -t2 -N${SIZE} sets correct ntasks in kvs' ' n=$(flux kvs get --json ${LWJ}.ngpus) && test "$n" = "4" ' - -test_expect_success 'wreckrun: fallback to old rank.N.cores format works' ' - flux wreckrun -N2 -n2 \ - -P "lwj[\"rank.0.cores\"] = 1; lwj[\"rank.1.cores\"] = 1; lwj.R_lite = nil" \ - /bin/echo hello >oldrankN.out && - LWJ=$(last_job_path) && - test_must_fail flux kvs get ${LWJ}.R_lite && - cat <<-EOF >oldrankN.expected && - hello - hello - EOF - test_cmp oldrankN.expected oldrankN.out -' test_expect_success 'wreckrun: job with more nodes than tasks fails' ' test_must_fail flux wreckrun -n2 \ - -P "for i=1,3 do lwj[\"rank.\"..i..\".cores\"] = 1 end; lwj.R_lite = nil" \ + -P "t={}; for i=1,3 do t[i]={rank=i-1,children={core=\"0\"}} end; lwj.R_lite = t" \ hostname && LWJ=$(last_job_path) && - test_must_fail flux kvs get ${LWJ}.R_lite && test "$(flux kvs get --json ${LWJ}.state)" = "failed" ' cpus_allowed=${SHARNESS_TEST_SRCDIR}/scripts/cpus-allowed.lua