Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPI] lifetime of data sent through communicator::isend()
From: Riccardo Murri (riccardo.murri_at_[hidden])
Date: 2010-11-21 04:18:14


Hi Heiko and Noel,

On Sun, Nov 21, 2010 at 9:27 AM, Heiko Bauke <heiko.bauke_at_[hidden]> wrote:
> Riccardo Murri <riccardo.murri_at_[hidden]> wrote:
>> I'm using mpi::communicator::isend where the payload data comes from a
>> pointer (e.g., "req = comm_.isend(dest, tag. *data)").
>> When am I free to "delete" the pointer?  Immediately after isend()
>> returns?  Or should I wait until the request is completed?
>
> yes, you have to wait before you can free your memory. See
> http://www.mpi-forum.org/docs/mpi22-report/node57.htm
> and the following pages.
>

Thanks for the answers. However, I think I didn't make myself clear:
I know what I should do with the C-level MPI_ISend() calls, I'm not
sure what I can do after an Boost.MPI's communicator::isend().

My reading of the docs is that Boost.MPI creates an instance of
boost::mpi::packed_oarchive archive and sends *that* one with
MPI_ISend(). So the question is: can I "delete data;" immediately
after I do "communicator::isend(..., *data);", or does the Boost.MPI
archive hold a reference to the "*data" buffer? In other words, does
Boost.MPI *copy* data into the archive or does it just reference it
somehow?

Thanks again and best regards,
Riccardo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net