Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Open MPI dynamic data structure error
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2010-10-20 17:46:42


If you want to use the STL with MPI, your best bet is the boost.mpi library.

On Oct 19, 2010, at 4:40 PM, Jack Bryan wrote:

> Hi,
>
> I need to design a data structure to transfer data between nodes on Open MPI system.
>
> Some elements of the the structure has dynamic size.
>
> For example,
>
> typedef struct{
>
> double data1;
> vector<double> dataVec;
>
> } myDataType;
>
> The size of the dataVec depends on some intermidiate computing results.
>
> If I only declear it as the above myDataType, I think, only a pointer is transfered.
>
> When the data receiver try to access the elements of vector<double> dataVec, it got
> segmentation fault error.
>
> But, I also need to use the myDataType to declear other data structures.
>
> such as vector<myDataType> newDataVec;
>
> I cannot declear myDataType in a function , sucjh as main(), I got errors:
>
>
> main.cpp:200: error: main(int, char**)::myDataType; uses local type main(int, char**)::myDataType;
>
>
> Any help is really appreciated.
>
> thanks
>
> Jack
>
> Oct. 19 2010
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/