Skip to content

Commit f36d0b6

Browse files
committed
mpid/sched: match communicator when checking tag space
In MPIDU_Sched_next_tag when checking for tag space in use, make sure to only check items with matching communicator. Q: This code assumes every sched item contains valid request with comm set. Is this guarantteed? A: yes, it is. Check MPIDU_Sched_start. All entries in `all_schedules` have ->req and ->req->comm set.
1 parent 39a60e1 commit f36d0b6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mpid/common/sched/mpidu_sched.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ int MPIDU_Sched_next_tag(MPIR_Comm * comm_ptr, int *tag)
178178
if (start != MPI_UNDEFINED) {
179179
MPID_THREAD_CS_ENTER(VCI, MPIDIU_THREAD_SCHED_LIST_MUTEX);
180180
DL_FOREACH(all_schedules.head, elt) {
181-
if (elt->tag >= start && elt->tag < end) {
182-
MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**toomanynbc");
181+
if (comm_ptr == elt->req->comm) {
182+
if (elt->tag >= start && elt->tag < end) {
183+
MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**toomanynbc");
184+
}
183185
}
184186
}
185187
MPID_THREAD_CS_EXIT(VCI, MPIDIU_THREAD_SCHED_LIST_MUTEX);

0 commit comments

Comments
 (0)