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

Consolidating new_<>() #1456

Merged
merged 18 commits into from Apr 17, 2015
Merged

Consolidating new_<>() #1456

merged 18 commits into from Apr 17, 2015

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Apr 13, 2015

This patch introduces a consolidation of hpx::new_<>(). The following overloads have been implemented:

// create single instances of a component
future<id_type> f = new_<Component>(loc, ...);
client c = new_<client>(loc, ...);

// create multiple instances of a component
future<std::vector<id_type>> f = new_<Component[]>(loc, ...);
future<std::vector<client>> f = new_<client[]>(loc, ...);

This patch also introduces 3 distribution policies: default_distribution_policy, binpacking_distribution_policy, and collocating_distribution_policy. All overloads of new_ above can be invoked with one of the distribution policies instead of the target locality loc, for instance:

 future<id_type> f = new_<Component>(colocated(id), ...);

All of the above also allowed to remove the new_colocated API functions, and the distributing_factory and binpacking_factory components.

For convenience, this patch also renames HPX_REGISTER_MINIMAL_COMPONENT_FACTORY to HPX_REGISTER_COMPONENT.

@hkaiser
Copy link
Member Author

hkaiser commented Apr 17, 2015

@sithhell: The last commit fixed the things you mentioned.

else if (localities_.size() == 1)
{
return stub_base<Component>::create_async(
localities_.front(), std::forward<Ts>(vs)...);
Copy link
Member

Choose a reason for hiding this comment

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

Is it intended to only use the first locality here? Shouldn't it rather use the "best"?

Copy link
Member Author

Choose a reason for hiding this comment

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

If there is only one locality it's always the first one, no?

Copy link
Member

Choose a reason for hiding this comment

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

D'oh...

sithhell added a commit that referenced this pull request Apr 17, 2015
@sithhell sithhell merged commit 682730c into master Apr 17, 2015
@sithhell sithhell deleted the fixing_1448 branch April 17, 2015 18:59
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

2 participants