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

work item variant execution should support arbitrary return types #23

Closed
sithhell opened this issue Dec 1, 2017 · 5 comments
Closed

Comments

@sithhell
Copy link
Member

sithhell commented Dec 1, 2017

Currently, the return type of a work_item variant execute function supports the following return types:

  • hpx::future<T>
  • allscale::treeture<T>
  • hpx::unused_type

The last return type is important for performance optimizations. The process variants seldomly spawn other work items asynchronously, as such, it is beneficial for performance reasons, to avoid the allscale::make_ready_treeture(...) return in such cases. Even a ready treeture is associated with some overheads.

It should be possible, to support arbitrary, non treeture return types, like void instead of hpx::util::unused_type or int.

@destructor64
Copy link
Collaborator

We are currently trying to remove calls to allscale::make_ready_treeture in this context and replace the return type with hpx::unused_type

sithhell pushed a commit that referenced this issue Dec 4, 2017
This patch allows for WorkItemDescription::process_variant::execute to return
arbitrary (non-treeture or non-future) values that are automatically propagated.
@sithhell
Copy link
Member Author

sithhell commented Dec 4, 2017

This is now possible. Please see https://github.com/allscale/allscale_runtime/blob/master/examples/fibonacci.cpp#L107-L110

as an example.

@sithhell sithhell closed this as completed Dec 4, 2017
@destructor64
Copy link
Collaborator

This has been implemented in the compiler with commit 0298fffc3b7853a1178a219e6d6a67742b0dbe85. We are now returning allscale::unused_type (which is an alias for hpx::unused_type)

We also already updated the compiler pointer in the external integration test job to reflect this.

@sithhell
Copy link
Member Author

sithhell commented Dec 5, 2017 via email

@destructor64
Copy link
Collaborator

The reason is, that we started implementing this change before that was possible. I implented this based upon the mail you sent to Herbert once regarding this situation.

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

2 participants