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: 2003-07-05 06:54:52


On Fri, 4 Jul 2003, Lingyan Zhang wrote:

> When I commit a struct, I got run time error says "invalid datatype
> argument". Does any one can tell me why? Here is the source code
>
> [snipped]
> MPI_A.Create_struct(2, blockLength, local, types);
> MPI_A.Commit();

Note that MPI::Datatype::Create_struct() returns the new datatype; it does
not operate on (*this). So your code should read:

MPI_A = MPI::Datatype::Create_struct(2, blockLength, local, types);
MPI_A.Commit();

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