Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a struct datatype for use in collective? #21

Open
thvasilo opened this issue Oct 29, 2019 · 0 comments
Open

Creating a struct datatype for use in collective? #21

thvasilo opened this issue Oct 29, 2019 · 0 comments

Comments

@thvasilo
Copy link

Hello,

I'm wondering what's the correct way to define a custom struct datatype to be later used in a collective.

I'm my case I have structs defined as:

MyStruct{
float a;
float b;
int c;
};

that I would like to collect to the root using gatherv.

I know how to do this using plain MPI, but I'm wondering what's the process for mxx in order to avoid the error

static assertion failed: Type `T` is not a `trivial` type and is thus not supported for mxx send/recv operations. This type needs one of the following to be supported as trivial datatype: specialized build_datatype<T>, a member function `datatype`, or global function `make_datatype(Layout& l, T&)`

The error describes my options but I haven't been able to find examples of how to make mxx aware of custom datatypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant