LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2004-09-29 10:27:11


We conversed about this off-list a bit and came to the conclusion that
this is correct -- the destructor should *not* be commented out.

It is already fixed in SVN.

On Sep 28, 2004, at 5:37 AM, hedman_at_[hidden] wrote:

>
> Inspired by another conversation on the list I started
> thinking about what could be done with the C++ interface.
> So reading the C++ header files of lam-mpi I find that there
> is in fact no virtual dtor defined for MPI::Intercomm; it is
> commented out. To my knowledege this means that deleting a
> class derived from MPI::Intercomm through a pointer to
> e.g. Comm will result in undefined behaviour. Am I missing
> something here, or?
>
> // From mpi2cxx/comm.h
> //
> class Comm_Null {
> public:
> // construction
> inline Comm_Null() : mpi_comm(MPI_COMM_NULL) { }
> // copy
> inline Comm_Null(const Comm_Null& data) : mpi_comm(data.mpi_comm)
> { }
> // inter-language operability
> inline Comm_Null(const MPI_Comm& data) : mpi_comm(data) { }
>
> // destruction
> //JGS virtual inline ~Comm_Null() { }
> //
> // [ ... ]
> //
> };
>
> class Comm : public Comm_Null {
> public:
> //
> // [ ... ]
> //
> // construction
> Comm() { }
>
> // copy
> Comm(const Comm_Null& data) : Comm_Null(data) { }
> //
> // [ ... ]
> //
> };
>
> // From: mpi2cxx/intercomm.h
> //
> class Intercomm : public Comm {
> public:
> // construction
> Intercomm() : Comm(MPI_COMM_NULL) { }
> // copy
> Intercomm(const Comm_Null& data) : Comm(data) { }
> // inter-language operability
> Intercomm(const MPI_Comm& data) : Comm(data) { }
> //
> // No dtor ~Intercomm() defined!?
> //
>
> //
> // [ ... ]
> //
> };
>
> --
> F.
>
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/