Newsgroups: comp.parallel.mpi
From: eddemain@neumann.uwaterloo.ca (Erik Demaine)
Subject: Re: Possible Memory Leak in MPI update
Organization: University of Waterloo
Date: Fri, 12 Jul 1996 12:08:24 GMT
Message-ID: <DuFJ20.D9C@undergrad.math.uwaterloo.ca>

Christopher Ditchman (cjd@yosemite.jpl.nasa.gov) wrote:
: C is not my strong language.   I would like to see if I could
: modify the package and get around having to continually create
: and free the datatype.  It has been suggested that I make use
: of static variables to match MPI datatypes to the data structures
: in my program.  Could someone give me an example of how to 
: go about this?  

If I understand correctly, you've been continually creating and destroying
an MPI datatype, which has caused a memory leak?  So instead, you want to
create it once and use it throughout?  It seems then that you could do this:

	integer mytype
	common /datatypes/ mytype

in each function/subroutine that uses mytype; once it's created, it can be
used many times.

If you're using Fortran 90, create a module to store your datatypes in.

If I'm incorrect in understanding, sorry.
Erik
--
Erik Demaine                 \/  e-mail: eddemain@neumann.uwaterloo.ca
Dept. of Computer Science    /\  URL   : http://barrow.uwaterloo.ca/~eddemain/
University of Waterloo       \/  Most jugglers do poorly while drunk, especially
Waterloo, ON Canada N2L 3G1  /\  in a large wavelength gravity field.

