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

Broadcast async #2546

Closed
wants to merge 6 commits into from
Closed

Broadcast async #2546

wants to merge 6 commits into from

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Mar 19, 2017

This adds a new implementation/API of broadcast

Copy link
Member

@sithhell sithhell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. I guess apart from the comments here, what's missing is an optimization in the symbol namespace to avoid an additional turnaround, right?

hpx::unregister_with_basename(name, this_site).get();

// propagate result
return f.get();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we return something like this here:

return hpx::when_all(hpx::unregister_with_basename(name, this_site), std::move(f)).then(
    [](auto futures)
    {
        return hpx::util::get<1>(futures);
    });

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? We don't care about the result of the unregister_with_basename and nothing depends on it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't care, why do we explicitly wait until it completed using .get()?


// find_from_basename is always a local operation (see assert above)
typedef typename std::decay<T>::type result_type;
return hpx::dataflow(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use the sync policy here.

hpx::future<bool> was_registered =
hpx::register_with_basename(name, p.get_id(), this_site);

return hpx::dataflow(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use the sync policy here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, for the dataflow(), ok.

std::forward<T>(t));
}

std::vector<hpx::future<void> > futures;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use the already exisiting broadcast functionality here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately that does not quite fit the bill. It would amount to sending the std::map<std::uint32_t, std::vector<std::size_t> > to everybody which is much more than needed... I was contemplating about creating a special broadcast which splits off the map, but wanted to leave that to future optimizations.

@hkaiser
Copy link
Member Author

hkaiser commented Mar 22, 2017

Overall looks good. I guess apart from the comments here, what's missing is an optimization in the symbol namespace to avoid an additional turnaround, right?

I thought about that but unfortunately this is not possible. The purpose of the symbolic name to id mapping is to allow encoding the target locality without knowing it upfront. In order to do what you suggest we would have to explicitly encode the target locality into the name which would defeat the purpose.

One possibility would be to go the MPI route and to introduce communicators (or similar) to be used for the collective operations.

@hkaiser hkaiser modified the milestones: 1.1.0, 1.0.0 Apr 18, 2017
@sithhell
Copy link
Member

I think having something along the lines of communicators is our best shot here. I would recommend designing those first and place the wanted collectives on top of them afterwards.

@hkaiser
Copy link
Member Author

hkaiser commented May 29, 2017

I think having something along the lines of communicators is our best shot here. I would recommend designing those first and place the wanted collectives on top of them afterwards.

I was thinking about this exact thing as well - just couldn't come up with an appropriate name ;)

@msimberg
Copy link
Contributor

How far along is this? Is this likely to be done for the next release (max 3-4 months)?

@hkaiser
Copy link
Member Author

hkaiser commented Dec 4, 2017

Let's abandon this for now. We should get back to this after we have a come up with a global strategy of handling 'communicators'.

@hkaiser hkaiser closed this Dec 4, 2017
@hkaiser hkaiser deleted the broadcast_async branch December 4, 2017 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants