-
Notifications
You must be signed in to change notification settings - Fork 51
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
Enhancements to mpi::datatype #49
Conversation
- Adds dup() for all implementations of Datatype trait - Adds as_ref() to get a DatatypeRef from any Datatype - Adds example of dup()
- Adds new types: UncommittedUserDatatype + UncommittedDatatypeRef - same constructors as UserDatatype and DatatypeRef - UncommittedUserDatatype::commit consumes the old value to produce a UserDatatype - structured constructor takes a slice that can be passed directly to underlying MPI_Type_create_struct call without copy - Adds UncommittedDatatype trait - Implemented for UncommittedUserDatatype, UncommittedDatatypeRef, UserDatatype, and DatatypeRef - Supports capability for duplicating the datatype - New generic trait: FromRaw - Provides fixed way for constructing an mpi::Foo from a MPI_Foo - Implemented for all the Datatype types - New generic trait: MatchesRaw - Marker trait that indicates it's representationally safe to treat a slice of Foo as a slice of Foo::Raw - Implemented for all of the Datatype types - Adds a complex_datatype test that constructs a UserDatatype from multiple UncommittedUserDatatype values -
Cool! Could I ask you for two additions? First, I think it would be good to at least mention the Second, I was going to ask you to add an assertion to |
I'm not 100% sure the suggestion to promote the datatype to committed is a good idea. It seems like the rest of the On the other hand, I think that's the only potential negative side effect. I'm just uncomfortable with it because it seems side-effecty in a way that may be unexpected. Thoughts? |
All right, since |
UncommittedUserDatatype
+UncommittedDatatypeRef
UserDatatype
andDatatypeRef
UncommittedUserDatatype::commit
consumes the old value to produce aUserDatatype
UserDatatype::structured
andUncommittedUserDatatype::structured
constructors takes a slice that can be passed directly to underlyingMPI_Type_create_struct
call without copyas_ref()
functions forUserDatatype
andUncommittedUserDatatype
UncommittedDatatype
traitFrom
implemented for Datatype types to allow downcasting of heterogeneous types when being mixed into a single contiguous array. Utility demonstrated bybool::equivalent_datatype().into()
incomplex_datatype.rs
.FromRaw
mpi::Foo
from aMPI_Foo
MatchesRaw
Foo
as a slice ofFoo::Raw
complex_datatype.rs
test that constructs aUserDatatype
from multipleUncommittedUserDatatype
values