Skip to content

Commit 6524773

Browse files
committed
sched-simple: use f58 for jobid in log messages
Problem: sched-simple logs jobids in their decimal representation, which aren't easily identifiable as jobids at first glance and take up more space in most cases. Update the sched-simple module to use f58 encoding where appropriate.
1 parent f34751b commit 6524773

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/modules/sched-simple/sched.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "src/common/libutil/errprintf.h"
2020
#include "src/common/libjob/job.h"
2121
#include "src/common/libjob/jj.h"
22+
#include "src/common/libjob/idf58.h"
2223
#include "src/common/librlist/rlist.h"
2324
#include "ccan/str/str.h"
2425

@@ -272,7 +273,7 @@ static int try_alloc (flux_t *h, struct simple_sched *ss)
272273
"jobs_ahead") < 0)
273274
flux_log_error (h, "schedutil_alloc_respond_success_pack");
274275

275-
flux_log (h, LOG_DEBUG, "alloc: %ju: %s", (uintmax_t) job->id, s);
276+
flux_log (h, LOG_DEBUG, "alloc: %s: %s", idf58 (job->id), s);
276277
rc = 0;
277278

278279
out:
@@ -402,8 +403,8 @@ static void alloc_cb (flux_t *h, const flux_msg_t *msg, void *arg)
402403
jobreq_destroy (job);
403404
return;
404405
}
405-
flux_log (h, LOG_DEBUG, "req: %ju: spec={%d,%d,%d} duration=%.1f",
406-
(uintmax_t) job->id, job->jj.nnodes,
406+
flux_log (h, LOG_DEBUG, "req: %s: spec={%d,%d,%d} duration=%.1f",
407+
idf58 (job->id), job->jj.nnodes,
407408
job->jj.nslots, job->jj.slot_size,
408409
job->jj.duration);
409410
search_dir = job->priority > FLUX_JOB_URGENCY_DEFAULT;
@@ -521,8 +522,8 @@ static int hello_cb (flux_t *h,
521522
}
522523

523524
flux_log (h, LOG_DEBUG,
524-
"hello: id=%ju priority=%u userid=%u t_submit=%0.1f",
525-
(uintmax_t)id,
525+
"hello: id=%s priority=%u userid=%u t_submit=%0.1f",
526+
idf58 (id),
526527
priority,
527528
(unsigned int)userid,
528529
t_submit);

0 commit comments

Comments
 (0)