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 a5f8902 commit 26e5d6f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/broker/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ static int create_dummyattrs (flux_t *h, uint32_t rank, uint32_t size);

static char *format_endpoint (attr_t *attrs, const char *endpoint);

static int boot_pmi (overlay_t *overlay, attr_t *attrs, int tbon_k,
double *elapsed_sec);
static int boot_pmi (overlay_t *overlay, attr_t *attrs, int tbon_k);

static void init_attrs (attr_t *attrs, pid_t pid);

Expand Down Expand Up @@ -420,8 +419,11 @@ int main (int argc, char *argv[])
/* Boot with PMI.
*/
double pmi_elapsed_sec;
if (boot_pmi (ctx.overlay, ctx.attrs, ctx.tbon_k, &pmi_elapsed_sec) < 0)
struct timespec pmi_start_time;
monotime (&pmi_start_time);
if (boot_pmi (ctx.overlay, ctx.attrs, ctx.tbon_k) < 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 @@ -1063,8 +1065,7 @@ static char * format_endpoint (attr_t *attrs, const char *endpoint)
return (rv);
}

static int boot_pmi (overlay_t *overlay, attr_t *attrs, int tbon_k,
double *elapsed_sec)
static int boot_pmi (overlay_t *overlay, attr_t *attrs, int tbon_k)
{
int spawned;
int size;
Expand All @@ -1084,14 +1085,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 +1330,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 26e5d6f

Please sign in to comment.