Skip to content

Commit

Permalink
Move nested call check down the stack
Browse files Browse the repository at this point in the history
The nested calls flag is located at the single-thread level.
Move the check to the same level as the flag.

Signed-off-by: Artem Polyakov <[email protected]>
  • Loading branch information
artpol84 committed Aug 29, 2019
1 parent 3c03eca commit 188ef2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 13 additions & 0 deletions mpiP-stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ mpiPi_stats_thr_cs_upd (mpiPi_thread_stat_t *stat,

assert (dur >= 0);


/* Check for the nested calls */
if (!mpiPi_stats_thr_is_on(stat))
return;

key.op = op;
key.rank = rank;
key.cookie = MPIP_CALLSITE_STATS_COOKIE;
Expand Down Expand Up @@ -346,6 +351,10 @@ void mpiPi_stats_thr_coll_upd (mpiPi_thread_stat_t *stat,
int op, double dur, double size,
MPI_Comm * comm)
{
/* Check for the nested calls */
if (!mpiPi_stats_thr_is_on(stat))
return;

_update_msize_stat(&stat->coll, op, dur, size, comm, "collectives");
}

Expand All @@ -367,6 +376,10 @@ void mpiPi_stats_thr_pt2pt_upd (mpiPi_thread_stat_t *stat,
int op, double dur, double size,
MPI_Comm * comm)
{
/* Check for the nested calls */
if (!mpiPi_stats_thr_is_on(stat))
return;

_update_msize_stat(&stat->pt2pt, op, dur, size, comm, "point-to-point");
}

Expand Down
3 changes: 0 additions & 3 deletions mpiPi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,9 +1085,6 @@ mpiPi_update_callsite_stats (unsigned op, unsigned rank, void **pc,
callsite_stats_t *csp = NULL;
callsite_stats_t key;

if (!mpiPi_stats_mt_is_on(&mpiPi.task_stats))
return;

mpiPi_stats_mt_cs_upd(&mpiPi.task_stats, op, rank, pc, dur,
sendSize, ioSize, rmaSize);
}
Expand Down

0 comments on commit 188ef2a

Please sign in to comment.