Skip to content

Commit d724c7d

Browse files
committed
add OMPI_SPC_TIME_ALLTOALLV for MPI_Alltoallv timings
Signed-off-by: Thomas Naughton <[email protected]>
1 parent f290965 commit d724c7d

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

ompi/mpi/c/alltoallv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ int MPI_Alltoallv(const void *sendbuf, const int sendcounts[],
5050
MPI_Datatype recvtype, MPI_Comm comm)
5151
{
5252
int i, size, err;
53+
opal_timer_t timer = 0; /* SPC */
5354

5455
SPC_RECORD(OMPI_SPC_ALLTOALLV, 1);
5556

@@ -135,10 +136,14 @@ int MPI_Alltoallv(const void *sendbuf, const int sendcounts[],
135136
}
136137
#endif
137138

139+
SPC_TIMER_START(OMPI_SPC_TIME_ALLTOALLV, &timer);
140+
138141
/* Invoke the coll component to perform the back-end operation */
139142
err = comm->c_coll->coll_alltoallv(sendbuf, sendcounts, sdispls, sendtype,
140143
recvbuf, recvcounts, rdispls, recvtype,
141144
comm, comm->c_coll->coll_alltoallv_module);
145+
SPC_TIMER_STOP(OMPI_SPC_TIME_ALLTOALLV, &timer);
146+
142147
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
143148
}
144149

ompi/runtime/ompi_spc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static const ompi_spc_event_t ompi_spc_events_desc[OMPI_SPC_NUM_COUNTERS] = {
144144
SET_COUNTER_ARRAY(OMPI_SPC_TESTANY, "The number of times MPI_Testany was called.", false, false),
145145
SET_COUNTER_ARRAY(OMPI_SPC_TESTSOME, "The number of times MPI_Testsome was called.", false, false),
146146
SET_COUNTER_ARRAY(OMPI_SPC_TIME_ALLTOALL, "The number microseconds spent performing the MPI_Alltoall operation. Note: The timer used on the back end is in cycles, which could potentially be problematic on a system where the clock frequency can change. On such a system, this counter could be inaccurate since we assume a fixed clock rate.", false, true),
147+
SET_COUNTER_ARRAY(OMPI_SPC_TIME_ALLTOALLV, "The number microseconds spent performing the MPI_Alltoallv operation. Note: The timer used on the back end is in cycles, which could potentially be problematic on a system where the clock frequency can change. On such a system, this counter could be inaccurate since we assume a fixed clock rate.", false, true),
147148
SET_COUNTER_ARRAY(OMPI_SPC_WAIT, "The number of times MPI_Wait was called.", false, false),
148149
SET_COUNTER_ARRAY(OMPI_SPC_WAITALL, "The number of times MPI_Waitall was called.", false, false),
149150
SET_COUNTER_ARRAY(OMPI_SPC_WAITANY, "The number of times MPI_Waitany was called.", false, false),

ompi/runtime/ompi_spc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ typedef enum ompi_spc_counters {
131131
OMPI_SPC_TESTANY,
132132
OMPI_SPC_TESTSOME,
133133
OMPI_SPC_TIME_ALLTOALL,
134+
OMPI_SPC_TIME_ALLTOALLV,
134135
OMPI_SPC_WAIT,
135136
OMPI_SPC_WAITALL,
136137
OMPI_SPC_WAITANY,

0 commit comments

Comments
 (0)