Skip to content

Commit

Permalink
Rework count & datatype mismatch checks for reductions
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Jun 6, 2016
1 parent 0c17c29 commit fccb7fb
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions src/MPI/msgbuffer.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -704,15 +704,14 @@ cdef class _p_msg_cco:
else:
self.for_cro_send(smsg, 0)
# check counts and datatypes
if (self.sbuf != MPI_IN_PLACE and
self.scount != self.rcount):
raise ValueError(
"mismatch in send count %d and receive count %d" %
(self.scount, self.rcount))
if (self.sbuf != MPI_IN_PLACE and
self.stype != self.rtype):
raise ValueError(
"mismatch in send and receive MPI datatypes")
if self.sbuf != MPI_IN_PLACE:
if self.stype != self.rtype:
raise ValueError(
"mismatch in send and receive MPI datatypes")
if self.scount != self.rcount:
raise ValueError(
"mismatch in send count %d and receive count %d" %
(self.scount, self.rcount))
return 0

cdef int for_reduce_scatter_block(self,
Expand Down Expand Up @@ -798,15 +797,14 @@ cdef class _p_msg_cco:
else:
self.for_cro_send(smsg, 0)
# check counts and datatypes
if (self.sbuf != MPI_IN_PLACE and
self.scount != self.rcount):
raise ValueError(
"mismatch in send count %d and receive count %d" %
(self.scount, self.rcount))
if (self.sbuf != MPI_IN_PLACE and
self.stype != self.rtype):
raise ValueError(
"mismatch in send and receive MPI datatypes")
if self.sbuf != MPI_IN_PLACE:
if self.stype != self.rtype:
raise ValueError(
"mismatch in send and receive MPI datatypes")
if self.scount != self.rcount:
raise ValueError(
"mismatch in send count %d and receive count %d" %
(self.scount, self.rcount))
return 0

cdef int for_exscan(self,
Expand All @@ -822,13 +820,14 @@ cdef class _p_msg_cco:
else:
self.for_cro_send(smsg, 0)
# check counts and datatypes
if self.scount != self.rcount:
raise ValueError(
"mismatch in send count %d and receive count %d" %
(self.scount, self.rcount))
if self.stype != self.rtype:
raise ValueError(
"mismatch in send and receive MPI datatypes")
if self.sbuf != MPI_IN_PLACE:
if self.stype != self.rtype:
raise ValueError(
"mismatch in send and receive MPI datatypes")
if self.scount != self.rcount:
raise ValueError(
"mismatch in send count %d and receive count %d" %
(self.scount, self.rcount))
return 0


Expand Down

0 comments on commit fccb7fb

Please sign in to comment.