[MPICH] test/mpi/comm/cmfree.c

William Gropp gropp at mcs.anl.gov
Fri Jul 13 11:54:15 CDT 2007


Anything (within the MPICH2 source code) that allocates memory using  
malloc and friends can be checked and the point of allocation  
identified when MPICH2 is configured with --enable-g=mem .  This uses  
a source code replacement with macros of the memory allocation  
routines with the "trmem" routines in src/util/mem .  I believe  
that's how I found this one - there was some space allocated but not  
freed, and I traced it to memory associated with the communicator.

This isn't as sophisticated as valgrind, but we can use it on any  
platform, and at scale.

Bill

On Jul 13, 2007, at 8:23 AM, Toon Knapen wrote:

> William Gropp wrote:
>> This was fixed after 1.0.5 was released, and isn't included in the  
>> 1.0.5p4 code (I believe).
>
>
> OK. Thanks for the info.
>
>
>
>> Our own memory leak checker caught it :)
>
>
> It's kind of silly to ask but I guess you're joking, right? Or is  
> mpich2 able to trace leaks (e.g. MPI_Group's that are constructed  
> but never free'd).
>
>
>> Bill
>> On Jul 12, 2007, at 6:51 AM, Toon Knapen wrote:
>>> Hi all,
>>>
>>> IMO test/mpi/comm/cmfree.c in mpich2-1.0.5p4 there is one  
>>> MPI_Comm_free missing.
>>>
>>> On line 29, there is a `MPI_Comm_dup(MPI_COMM_WORLD,&comm)`.  
>>> However the comm that gets created here is only freed if 'rank ==  
>>> dest' on line 54. In all ranks that are not equal to 'dest', the  
>>> communicator is never freed.
>>>
>>> Of course, this is not an error (just a leak) but wanted to let  
>>> you know nevertheless,
>>>
>>> toon
>>>
>




More information about the mpich-discuss mailing list