-
Notifications
You must be signed in to change notification settings - Fork 52
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
Improving ergonomics of sending arrays/vectors #174
Comments
It looks like you might be able to fix the error by removing all
Removing the second one should get rid of the error. I'm not sure if this might break other things though. As a work around for current rsmpi, you could use a wrapper struct around an array that derives
There are more examples of that in |
Awesome, thanks for the advice! Removing those blanketed implementations seemed to fix things.
I am also interested in looking at implementing similar support for the |
I intend to make a custom test harness so that I don't think we can do the semantic you ask for with |
Hi, Having had a bit more of a stare at the code, I think I agree that neither of the semantics I suggested would be very easy to implement, so I will probably close this issue unless there is any objection. I managed to get something working for the use case I was looking at, but I needed to trawl through a lot of docs/integration test examples to do so. Because of this, I was wondering if it would be helpful for me to make a PR to add some more written explanations, perhaps as rustdoc for the integrations tests which could then be included in the github.io/docs.rs websites - if so, I'll have a look at doing that in the next couple of weeks when I have time. |
A PR to improve docs would absolutely be welcome! Note that we now use |
Motivation
Currently, arrays and vectors of data cannot be represented by the
ReceiveFuture
type, as they do not implement theEquivalence
trait. This means that functions likeimmediate_receive
cannot be used with them.I am working on porting a High-Performance Computing benchmark from C++ to Rust, which involves sending and receiving arrays or vectors of data. Looking through the documentation, there are various ways to do this, such as using
receive_vec
orimmediate_receive_into
. However, it would be useful if functions likeimmediate_receive
also supported these types.Example
I would like to be able to write code like this:
However, this fails as it requires
[T; D]
to implement theEquivalence
trait.Attempted solution
I attempted to create a fix which I could PR to resolve this by adding an implementation to
datatype.rs
:Unfortunately, this results in conflicting implementations for all other traits on
[T; D]
indatatype.rs
(AsDatatype
,Collection
, ...), and I am not entirely sure why all these other traits can co-exist, butEquivalence
conflicts with all of them.I am very happy to have a further look at this and PR to fix it, but would appreciate some advice on the direction to work in, as I am slightly stuck on where to go from here.
The text was updated successfully, but these errors were encountered: