[mpich-discuss] Hydra genv_fn() memory leaks fix

Pavan Balaji balaji at mcs.anl.gov
Wed Aug 4 14:11:58 CDT 2010


Hi,

On 08/04/2010 01:42 PM, Yauheni Zelenko wrote:
> I agree that structure may be convenient to add several environment
> variables at once. However memory management is not clear:
> programmers should always keep in mind that created structure should
> be free after insertion to list.

No, not only for list manipulations, but also when you need to keep 
track of different types of environments separately (e.g., ones which 
are inherited vs. ones which are explicitly passed by the user vs. ones 
which are set by mpiexec itself). You can see the pm/pmiserv/pmip* files 
for examples of this.

The only place it's slightly inconvenient is when the user parameters 
are being read (ui/mpich/utils.c), which I wasn't particularly concerned 
about. I'll add a new function to append environment variables without 
creating an environment structure separately to make this cleaner.

  -- Pavan

-- 
Pavan Balaji
http://www.mcs.anl.gov/~balaji


More information about the mpich-discuss mailing list