Re: [mpich-discuss] Checks for buffer aliasing in coll ops?
I have created a ticket for it. http://trac.mpich.org/projects/mpich/ticket/2049 Rajeev On Feb 28, 2014, at 8:13 AM, Carsten Clauss <[email protected]> wrote:
Constantly, our users step into the common trap of aliasing send and receive buffers e.g. in (All)Gather(v) instead of using MPI_IN_PLACE.
Although these cases are frequently caught by lower-level memcpy() checks within MPICH, I wonder if it would be feasible to do so already in the upper MPI layer, e.g. by using MPIR_ERRTEST_ALIAS_COLL() in a more comprehensive manner.
IMHO it would be nice to extend the check e.g. in MPI_(All)Gather() from
/* catch common aliasing cases */ if (recvbuf != MPI_IN_PLACE && sendtype == recvtype && sendcount == recvcount && sendcount != 0) MPIR_ERRTEST_ALIAS_COLL(sendbuf,recvbuf,mpi_errno);
-- that would only take effect for root=0 -- to let's say:
/* catch common aliasing cases */ MPID_Datatype_get_size_macro(recvtype, recvtype_size); if (recvbuf != MPI_IN_PLACE && sendtype == recvtype && sendcount == recvcount && sendcount != 0) MPIR_ERRTEST_ALIAS_COLL(sendbuf, (char*)recvbuf + comm_ptr->rank*recvcount*recvtype_size, mpi_errno);
And the same for MPI_(All)Gatherv() (which currently do not check for aliasing at all):
/* catch common aliasing cases */ MPID_Datatype_get_size_macro(recvtype, recvtype_size); if (sendbuf != MPI_IN_PLACE && sendtype == recvtype && recvcounts[comm_ptr->rank] != 0 && sendcount != 0) MPIR_ERRTEST_ALIAS_COLL(sendbuf, (char*)recvbuf + displs[comm_ptr->rank]*recvtype_size, mpi_errno);
I think this would lead to much more understandable error messages ("PMPI_Gatherv(363): Buffers must not be aliased" vs. "memcpy argument memory ranges overlap") -- or is there something that speaks against this kind of checks?
With kind regards, C. Clauss
-- Carsten Clauss Possartstrasse 20 D-81679 Muenchen www.par-tec.com _____________________________________ ParTec Cluster Competence Center GmbH
Geschäftsführer RA. Dipl.-Ing. Bernhard Frohwitter Eingetragen beim Amtsgericht München HRB 151545 Steuer-Nr. 08/32305, Ust-ID DE235527064
_______________________________________________ discuss mailing list [email protected] To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss
participants (1)
-
Rajeev Thakur