Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] memcpy overlap in ompi_ddt_copy_content_same_ddt and glibc 2.12
From: e-mail number.cruncher (number.cruncher_at_[hidden])
Date: 2010-11-10 16:08:23


On 10 November 2010 17:25, Jed Brown <jed_at_[hidden]> wrote:
>
> Is the memcpy-back code ever executed when called as memcpy()?  I can't
> imagine why it would be, but it would make plenty of sense to use it inside
> memmove when the destination is at a higher address than the source.
> Jed

Oh yes. And, after further reading, it seems I'm not alone. There's an
article at http://lwn.net/Articles/414467/ about the new glibc changes
and a bug at https://bugzilla.redhat.com/show_bug.cgi?id=638477
relating directly to memcpy. The Fedora bug is particularly insightful
with some interesting contributions from Linus Torvalds himself,
amongst other.

In short, someone from Intel submitted a glibc patch that does faster
memcpy's on e.g. Intel i7, respects the ISO C definition, but does
things backwards. I think any software that ignores the ISO warning
"If copying takes place between objects that overlap, the behavior is
undefined" needs fixing.