-
Notifications
You must be signed in to change notification settings - Fork 7
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
co_broadcast of derived types with allocatable components #73
Comments
I agree the F23 spec foolishly allows broadcasting an object with allocatable (and polymorphic!) sub-objects and specifically requires:
Does any current compiler actually implement this semantic? I don't see how we can implement this in PRIF without requiring the compiler to generate serialization/deserialization code for any On a related note, the language spec apparently fails to address how This honestly seems like a language defect. IMO arguments with allocatable and pointer subobjects should simply be forbidden as arguments to |
NAG supports it, but that may actually be it. I don't expect this to be a trivial problem to solve, but I do have use cases where I want it to work. (de)serialization would certainly be one approach to making it work. If we think that's an avenue for compilers to exploit (and my guess is it probably is) I'd vote for that approach. I don't think that even necessarily needs a change to the API. |
I think it's worth noting the "problem" here is wider than simply discontiguity and (de)serialization. When an input argument is permitted to contain allocatable and/or polymorphic subobjects, that means in general the non-root images cannot compute based on static information the size of the serialized representation they are receiving. IOW this becomes a variable-length broadcast, which might entail an additional wire-level broadcast of the length information (depending on the comm layer implementation) before the data can be broadcast. It's also notable that the restrictions on the top-level object A itself seem designed to try and avoid this:
I don't understand the rationale behind prohibiting characteristics on the |
The current implementation of co_broadcast does not support derived types with allocatable components. Not sure if we need a reworking of the API for co_broadcast or just an illustration of how a compiler would generate code to do it. See #72 for a test case demonstrating the issue.
The text was updated successfully, but these errors were encountered: