Skip to content

Commit f290965

Browse files
committed
add OMPI_SPC_TIME_ALLTOALL for MPI_Alltoall timings
Signed-off-by: Thomas Naughton <[email protected]>
1 parent 53acf37 commit f290965

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

ompi/mpi/c/alltoall.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
5252
{
5353
int err;
5454
size_t recvtype_size;
55+
opal_timer_t timer = 0; /* SPC */
5556

5657
SPC_RECORD(OMPI_SPC_ALLTOALL, 1);
5758

@@ -116,10 +117,15 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
116117
}
117118
}
118119

120+
SPC_TIMER_START(OMPI_SPC_TIME_ALLTOALL, &timer);
121+
119122
/* Invoke the coll component to perform the back-end operation */
120123
err = comm->c_coll->coll_alltoall(sendbuf, sendcount, sendtype,
121124
recvbuf, recvcount, recvtype,
122125
comm, comm->c_coll->coll_alltoall_module);
126+
127+
SPC_TIMER_STOP(OMPI_SPC_TIME_ALLTOALL, &timer);
128+
123129
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
124130
}
125131

ompi/runtime/ompi_spc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static const ompi_spc_event_t ompi_spc_events_desc[OMPI_SPC_NUM_COUNTERS] = {
143143
SET_COUNTER_ARRAY(OMPI_SPC_TESTALL, "The number of times MPI_Testall was called.", false, false),
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),
146+
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),
146147
SET_COUNTER_ARRAY(OMPI_SPC_WAIT, "The number of times MPI_Wait was called.", false, false),
147148
SET_COUNTER_ARRAY(OMPI_SPC_WAITALL, "The number of times MPI_Waitall was called.", false, false),
148149
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
@@ -130,6 +130,7 @@ typedef enum ompi_spc_counters {
130130
OMPI_SPC_TESTALL,
131131
OMPI_SPC_TESTANY,
132132
OMPI_SPC_TESTSOME,
133+
OMPI_SPC_TIME_ALLTOALL,
133134
OMPI_SPC_WAIT,
134135
OMPI_SPC_WAITALL,
135136
OMPI_SPC_WAITANY,

0 commit comments

Comments
 (0)