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/
|