Skip to content

Commit

Permalink
broker: Move boot_pmi() timing to the caller
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
morrone committed Oct 17, 2017
1 parent 150898e commit d641072
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/broker/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d641072

Please sign in to comment.