This forum has been archived. All content is frozen. Please use KDE Discuss instead.

MPI broadcast of Eigen Matrix or Vector

Tags: None
(comma "," separated)
sedibald
Registered Member
Posts
4
Karma
0
Hi,

I'd like to communicate Eigen arrays using MPI. What I do using Blitz++ arrays is the following:

Code: Select all
blitz::Array<int, 2> myArray(E, 2);
// broadcasting
MPI_Bcast(myArray.data(), myArray.size(), MPI::INT, 0, MPI::COMM_WORLD);


where
Code: Select all
myArray.data()
returns a pointer to the element whose indices are equal to the array base
(quote from Blitz++ website).

Is there a similar way of doing this in Eigen?

Thanks a lot!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
you can do the very same :) with .data() to get a pointer, and .size() to get the number of elements.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft