{
if (comm == MPI_COMM_NULL) {
return MPI_ERR_COMM;
- } if (buf == nullptr) {
+ } if (buf == nullptr && count > 0) {
return MPI_ERR_BUFFER;
} else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()) {
return MPI_ERR_TYPE;
return MPI_ERR_COMM;
} else if ((sendbuf == nullptr) || ((comm->rank() == root) && recvbuf == nullptr)) {
return MPI_ERR_BUFFER;
- } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
+ } else if (((sendbuf != MPI_IN_PLACE && sendcount > 0) && (sendtype == MPI_DATATYPE_NULL)) ||
((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL))){
return MPI_ERR_TYPE;
} else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) || ((comm->rank() == root) && (recvcount <0))){
{
if (comm == MPI_COMM_NULL) {
return MPI_ERR_COMM;
- } else if ((sendbuf == nullptr) || ((comm->rank() == root) && recvbuf == nullptr)) {
+ } else if ((sendbuf == nullptr && sendcount > 0) || ((comm->rank() == root) && recvbuf == nullptr)) {
return MPI_ERR_BUFFER;
} else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL))){
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if ((sendbuf == nullptr) || (recvbuf == nullptr)){
+ } else if ((sendbuf == nullptr && sendcount > 0) || (recvbuf == nullptr)){
retval = MPI_ERR_BUFFER;
} else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
(recvtype == MPI_DATATYPE_NULL)){
{
if (comm == MPI_COMM_NULL) {
return MPI_ERR_COMM;
- } else if ((sendbuf == nullptr) || (recvbuf == nullptr)){
+ } else if ((sendbuf == nullptr && sendcount > 0) || (recvbuf == nullptr)){
return MPI_ERR_BUFFER;
} else if (((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) || (recvtype == MPI_DATATYPE_NULL)) {
return MPI_ERR_TYPE;
((recvbuf != MPI_IN_PLACE) && (recvcount < 0))) {
return MPI_ERR_COUNT;
} else if ((sendbuf == recvbuf) ||
- ((comm->rank()==root) && sendcount>0 && (sendbuf == nullptr)) || (recvbuf == nullptr)){
+ ((comm->rank()==root) && sendcount>0 && (sendbuf == nullptr)) ||
+ (recvcount > 0 && recvbuf == nullptr)){
return MPI_ERR_BUFFER;
} else if (root < 0 || root >= comm->size()){
return MPI_ERR_ROOT;
{
if (comm == MPI_COMM_NULL) {
return MPI_ERR_COMM;
- } if ((sendbuf == nullptr) || ((comm->rank() == root) && recvbuf == nullptr)) {
+ } if ((sendbuf == nullptr && count > 0) || ((comm->rank() == root) && recvbuf == nullptr)) {
return MPI_ERR_BUFFER;
} else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()){
return MPI_ERR_TYPE;
{
if (comm == MPI_COMM_NULL) {
return MPI_ERR_COMM;
- } if ((sendbuf == nullptr) || (recvbuf == nullptr)) {
+ } if ((sendbuf == nullptr && count > 0) || (recvbuf == nullptr)) {
return MPI_ERR_BUFFER;
} else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()) {
return MPI_ERR_TYPE;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (sendbuf == nullptr || recvbuf == nullptr) {
+ } else if ((sendbuf == nullptr && sendcount > 0) || (recvbuf == nullptr && recvcount > 0)) {
retval = MPI_ERR_BUFFER;
} else if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;