Skip to content

Commit

Permalink
wreck: drop support for rank.N dirs in wreckrun
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
grondo committed May 8, 2018
1 parent 0160716 commit 5e1b7ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 58 deletions.
43 changes: 0 additions & 43 deletions src/modules/wreck/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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))
Expand Down
16 changes: 1 addition & 15 deletions t/t2000-wreck.t
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e1b7ac

Please sign in to comment.