Commit 057bb8be authored by Jeff Hammond's avatar Jeff Hammond Committed by Pavan Balaji
Browse files

fix ticket 1863 - improper+missing RMA error checks for addr=NULL



MPIR_ERRTEST_ARGNULL is used in MPI_Get_accumulate and
MPI_Rget_accumulate to verify that the address of a buffer is not
NULL.  However, a NULL buffer is valid when the count is zero or when
a derived datatype of size 0 is used.
Signed-off-by: default avatarJeff Hammond <jhammond@alcf.anl.gov>
parent 4e6333e1
......@@ -102,6 +102,7 @@ int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
......@@ -98,6 +98,7 @@ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
......@@ -133,11 +133,11 @@ int MPI_Get_accumulate(const void *origin_addr, int origin_count,
if (op != MPI_NO_OP) {
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_ARGNULL(origin_addr, "origin_addr", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
}
MPIR_ERRTEST_COUNT(result_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(result_datatype, "result_datatype", mpi_errno);
MPIR_ERRTEST_ARGNULL(result_addr, "result_addr", mpi_errno);
MPIR_ERRTEST_USERBUFFER(result_addr, result_count, result_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
......@@ -98,6 +98,7 @@ int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
......@@ -115,6 +115,7 @@ int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
......@@ -110,6 +110,7 @@ int MPI_Rget(void *origin_addr, int origin_count, MPI_Datatype
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
......@@ -125,11 +125,11 @@ int MPI_Rget_accumulate(const void *origin_addr, int origin_count,
if (op != MPI_NO_OP) {
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_ARGNULL(origin_addr, "origin_addr", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
}
MPIR_ERRTEST_COUNT(result_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(result_datatype, "result_datatype", mpi_errno);
MPIR_ERRTEST_ARGNULL(result_addr, "result_addr", mpi_errno);
MPIR_ERRTEST_USERBUFFER(result_addr, result_count, result_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
......@@ -112,6 +112,7 @@ int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype
MPIR_ERRTEST_COUNT(origin_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(origin_datatype, "origin_datatype", mpi_errno);
MPIR_ERRTEST_USERBUFFER(origin_addr, origin_count, origin_datatype, mpi_errno);
MPIR_ERRTEST_COUNT(target_count, mpi_errno);
MPIR_ERRTEST_DATATYPE(target_datatype, "target_datatype", mpi_errno);
if (win_ptr->create_flavor != MPI_WIN_FLAVOR_DYNAMIC)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment