From d641072a127ce487698c388027db8f9d1a622cb3 Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Tue, 17 Oct 2017 14:04:23 -0700 Subject: [PATCH] broker: Move boot_pmi() timing to the caller Move the timing of the boot_pmi() to the caller of the function rather than internal to the function. We will be breaking up boot_pmi() next, so getting that out of the way will make things slightly easier. --- src/broker/broker.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/broker/broker.c b/src/broker/broker.c index 9de1bf4207d4..10d58a152ab1 100644 --- a/src/broker/broker.c +++ b/src/broker/broker.c @@ -420,8 +420,11 @@ int main (int argc, char *argv[]) /* Boot with PMI. */ double pmi_elapsed_sec; + struct timespec pmi_start_time; + monotime (&pmi_start_time); if (boot_pmi (ctx.overlay, ctx.attrs, ctx.tbon_k, &pmi_elapsed_sec) < 0) log_msg_exit ("bootstrap failed"); + pmi_elapsed_sec = monotime_since (pmi_start_time) / 1000; uint32_t rank = overlay_get_rank(ctx.overlay); uint32_t size = overlay_get_size(ctx.overlay); @@ -1084,14 +1087,11 @@ static int boot_pmi (overlay_t *overlay, attr_t *attrs, int tbon_k, char *val = NULL; int e; int rc = -1; - struct timespec start_time; const char *attrtbonendpoint; char *tbonendpoint = NULL; const char *attrmcastendpoint; char *mcastendpoint = NULL; - monotime (&start_time); - if ((e = PMI_Init (&spawned)) != PMI_SUCCESS) { log_msg ("PMI_Init: %s", pmi_strerror (e)); goto done; @@ -1332,7 +1332,6 @@ static int boot_pmi (overlay_t *overlay, attr_t *attrs, int tbon_k, PMI_Finalize (); rc = 0; done: - *elapsed_sec = monotime_since (start_time) / 1000; if (clique_ranks) free (clique_ranks); if (kvsname)