Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] [OMPI svn-full] svn:open-mpi r24047
From: George Bosilca (bosilca_at_[hidden])
Date: 2010-11-16 20:59:14


Thanks! Good catch.

  George

On Nov 16, 2010, at 18:26, Tim Mattox <timattox_at_[hidden]> wrote:

> I see a bug in this code fragment:
>
> +#define MEMMOVE(d, s, l) \
> + do { \
> + if( (((d) < (s)) && (((d) + (l)) > (s))) || \
> + (((s) < (d)) && (((s) + (l)) > (s))) ) { \
> + memmove( (d), (s), (l) ); \
> + } else { \
> + MEMCPY( (d), (s), (l) ); \
> + } \
> + } while (0)
>
> Shouldn't this line
> + (((s) < (d)) && (((s) + (l)) > (s))) ) { \
>
> be like this instead?
> + (((s) < (d)) && (((s) + (l)) > (d))) ) { \
>
> On Fri, Nov 12, 2010 at 6:22 PM, <bosilca_at_[hidden]> wrote:
>> Author: bosilca
>> Date: 2010-11-12 18:22:35 EST (Fri, 12 Nov 2010)
>> New Revision: 24047
>> URL: https://svn.open-mpi.org/trac/ompi/changeset/24047
>>
>> Log:
>> Add a second version of the datatype copy function using memmove instead of memcpy.
>> As memmove is slower than memcpy, I added the required logic to only use it when
>> really necessary.
>>
>> No modification from developers point of view, you should always call
>> opal_datatype_copy_content_same_ddt.
>>
>>
>> Added:
>> trunk/opal/datatype/opal_datatype_copy.h
>> Text files modified:
>> trunk/opal/datatype/Makefile.am | 3
>> trunk/opal/datatype/opal_datatype_copy.c | 253 +++++++--------------------------------
>> trunk/opal/datatype/opal_datatype_memcpy.h | 28 ----
>> 3 files changed, 48 insertions(+), 236 deletions(-)
>>
>> Modified: trunk/opal/datatype/Makefile.am
> [snip]
>
> --
> Tim Mattox, Ph.D. - http://homepage.mac.com/tmattox/
> timattox_at_[hidden] || tmattox_at_[hidden]
> I'm a bright... http://www.the-brights.net/
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel