Re: [OMPI users] memalign usage in OpenMPI and it's consequences for TotalVIew

2009-10-01 Thread Peter Thompson
The value of 4 might be invalid (though maybe on a 32b machine, it would be 
okay?) but it's enough to allow TotalView to continue on without raising a 
memory event, so I'm okay with it ;-)


PeterT

Ashley Pittman wrote:

Simple malloc() returns pointers that are at least eight byte aligned
anyway, I'm not sure what the reason for calling memalign() with a value
of four would be be anyway.

Ashley,

On Thu, 2009-10-01 at 20:19 +0200, Åke Sandgren wrote:

No it didn't. And memalign is obsolete according to the manpage.
posix_memalign is the one to use.



https://svn.open-mpi.org/trac/ompi/changeset/21744




Re: [OMPI users] memalign usage in OpenMPI and it's consequences for TotalVIew

2009-10-01 Thread Peter Thompson
Took a look at the changes and that looks like it should work.  It's certainly 
not in 1.3.3, but as long as you guys are on top of it, that relieves my 
concerns ;-)


Thanks,
PeterT


Samuel K. Gutierrez wrote:

Ticket created (#2040).  I hope it's okay ;-).

--
Samuel K. Gutierrez
Los Alamos National Laboratory

On Oct 1, 2009, at 11:58 AM, Jeff Squyres wrote:


Did that make it over to the v1.3 branch?


On Oct 1, 2009, at 1:39 PM, Samuel K. Gutierrez wrote:


Hi,

I think Jeff has already addressed this problem.

https://svn.open-mpi.org/trac/ompi/changeset/21744

--
Samuel K. Gutierrez
Los Alamos National Laboratory

On Oct 1, 2009, at 11:25 AM, Peter Thompson wrote:

> We had a question from a user who had turned on memory debugging in
> TotalView and experience a memory event error Invalid memory
> alignment request.  Having a 1.3.3 build of OpenMPI handy, I tested
> it and sure enough, saw the error.  I traced it down to, surprise, a
> call to memalign.  I find there are a few places where memalign is
> called, but the one I think I was dealing with was from malloc.c in
> ompi/mca//io/romio/romio/adio/common in the following lines:
>
>
> #ifdef ROMIO_XFS
>new = (void *) memalign(XFS_MEMALIGN, size);
> #else
>new = (void *) malloc(size);
> #endif
>
> I searched, but couldn't find a value for XFS_MEMALIGN, so maybe it
> was from opal_pt_malloc2_component.c instead, where the call is
>
>p = memalign(1, 1024 * 1024);
>
> There are only 10 to 12 references to memalign in the code that I
> can see, so it shouldn't be too hard to find.  What I can tell you
> is that the value that TotalView saw for alignment, the first arg,
> was 1, and the second, the size, was  0x10, which is probably
> right for 1024 squared.
>
> The man page for memalign says that the first argument is the
> alignment that the allocated memory use, and it must be a power of
> two.  The second is the length you want allocated.  One could argue
> that 1 is a power of two, but it seems a bit specious to me, and
> TotalView's memory debugger certainly objects to it. Can anyone tell
> me what the intent here is, and whether the memalign alignment
> argument is thought to be valid?  Or is this a bug (that might not
> affect anyone other than TotalView memory debug users?)
>
> Thanks,
> Peter Thompson
> ___
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users

___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users




--
Jeff Squyres
jsquy...@cisco.com

___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users


___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users




Re: [OMPI users] memalign usage in OpenMPI and it's consequences for TotalVIew

2009-10-01 Thread Samuel K. Gutierrez

Hi,

I think Jeff has already addressed this problem.

https://svn.open-mpi.org/trac/ompi/changeset/21744

--
Samuel K. Gutierrez
Los Alamos National Laboratory

On Oct 1, 2009, at 11:25 AM, Peter Thompson wrote:

We had a question from a user who had turned on memory debugging in  
TotalView and experience a memory event error Invalid memory  
alignment request.  Having a 1.3.3 build of OpenMPI handy, I tested  
it and sure enough, saw the error.  I traced it down to, surprise, a  
call to memalign.  I find there are a few places where memalign is  
called, but the one I think I was dealing with was from malloc.c in  
ompi/mca//io/romio/romio/adio/common in the following lines:



#ifdef ROMIO_XFS
   new = (void *) memalign(XFS_MEMALIGN, size);
#else
   new = (void *) malloc(size);
#endif

I searched, but couldn't find a value for XFS_MEMALIGN, so maybe it  
was from opal_pt_malloc2_component.c instead, where the call is


   p = memalign(1, 1024 * 1024);

There are only 10 to 12 references to memalign in the code that I  
can see, so it shouldn't be too hard to find.  What I can tell you  
is that the value that TotalView saw for alignment, the first arg,  
was 1, and the second, the size, was  0x10, which is probably  
right for 1024 squared.


The man page for memalign says that the first argument is the  
alignment that the allocated memory use, and it must be a power of  
two.  The second is the length you want allocated.  One could argue  
that 1 is a power of two, but it seems a bit specious to me, and  
TotalView's memory debugger certainly objects to it. Can anyone tell  
me what the intent here is, and whether the memalign alignment  
argument is thought to be valid?  Or is this a bug (that might not  
affect anyone other than TotalView memory debug users?)


Thanks,
Peter Thompson
___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users




[OMPI users] memalign usage in OpenMPI and it's consequences for TotalVIew

2009-10-01 Thread Peter Thompson
We had a question from a user who had turned on memory debugging in TotalView 
and experience a memory event error Invalid memory alignment request.  Having a 
1.3.3 build of OpenMPI handy, I tested it and sure enough, saw the error.  I 
traced it down to, surprise, a call to memalign.  I find there are a few places 
where memalign is called, but the one I think I was dealing with was from 
malloc.c in ompi/mca//io/romio/romio/adio/common in the following lines:



#ifdef ROMIO_XFS
new = (void *) memalign(XFS_MEMALIGN, size);
#else
new = (void *) malloc(size);
#endif

I searched, but couldn't find a value for XFS_MEMALIGN, so maybe it was from 
opal_pt_malloc2_component.c instead, where the call is


p = memalign(1, 1024 * 1024);

There are only 10 to 12 references to memalign in the code that I can see, so it 
shouldn't be too hard to find.  What I can tell you is that the value that 
TotalView saw for alignment, the first arg, was 1, and the second, the size, was 
 0x10, which is probably right for 1024 squared.


The man page for memalign says that the first argument is the alignment that the 
allocated memory use, and it must be a power of two.  The second is the length 
you want allocated.  One could argue that 1 is a power of two, but it seems a 
bit specious to me, and TotalView's memory debugger certainly objects to it. 
Can anyone tell me what the intent here is, and whether the memalign alignment 
argument is thought to be valid?  Or is this a bug (that might not affect anyone 
other than TotalView memory debug users?)


Thanks,
Peter Thompson