Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Sending an objects vector via MPI C++
From: Saygin Arkan (saygenius_at_[hidden])
Date: 2010-07-07 05:07:01


I'm a newbie on MPI, just playing around with the things.
I've searched through the internet but couldn't find an appropriate code
example for my problem.

I'm making comparisons, correlations on my cluster, and gaining the results
like this:
vector<ComparisonResult> results;

In every node, they calculate and create the results array, in their local
And then I'd like to collect these vectors in my server node, rank (0).

I had done this with MPI gather but just for double arrays, not with objects
or vectors.

I have some guess about MPI::Create_contiguous, or MPI::Create_vector
but all these ask for another associated MPI type, such as CHAR or INT or
And I don't know if I should use packing somehow...

is there a way to collect these vectors in my server node with Gather
or even with send & recv?

Thanks a lot,