From 7e0350c2e150a64711a7133a98a312674adb455c Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Wed, 8 Jan 2025 12:04:28 -0800 Subject: [PATCH] rank debug --- src/cmd/flux-exec.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/cmd/flux-exec.c b/src/cmd/flux-exec.c index 0507b1e1f5fb..906c38aed215 100644 --- a/src/cmd/flux-exec.c +++ b/src/cmd/flux-exec.c @@ -310,8 +310,10 @@ static void stdin_cb (flux_reactor_t *r, while (p) { if (flux_subprocess_state (p) == FLUX_SUBPROCESS_INIT || flux_subprocess_state (p) == FLUX_SUBPROCESS_RUNNING) { - if ((len = flux_subprocess_write (p, "stdin", ptr, lenp)) < 0) - log_err_exit ("flux_subprocess_write"); + if ((len = flux_subprocess_write (p, "stdin", ptr, lenp)) < 0) { + char *rankstr = flux_subprocess_aux_get (p, "rank"); + log_err_exit ("flux_subprocess_write rank=%s", rankstr); + } if (stdin_enable_flow_control) { /* N.B. since we are subtracting the same number * of credits from all subprocesses, the sorted @@ -814,6 +816,16 @@ int main (int argc, char *argv[]) spcred, (flux_free_f) free) < 0) log_err_exit ("flux_subprocess_aux_set"); + { + char *rankstr; + if (asprintf (&rankstr, "%d", rank) < 0) + log_err_exit ("asprintf"); + if (flux_subprocess_aux_set (p, + "rank", + rankstr, + (flux_free_f) free) < 0) + log_err_exit ("flux_subprocess_aux_set"); + } rank = idset_next (targets, rank); }