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

Resource partitioner #2789

Merged
merged 121 commits into from Aug 23, 2017
Merged

Resource partitioner #2789

merged 121 commits into from Aug 23, 2017

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Jul 31, 2017

No description provided.

@biddisco
Copy link
Contributor

This cannot be merged until I (or you @hkaiser) eliminates and fixes the commit marked "WIP: FIX THIS PROPERLY"

@hkaiser hkaiser force-pushed the resource_partitioner branch 9 times, most recently from f54f94c to 7a1dfbf Compare August 4, 2017 23:28
basic structure of the resource_partitioner class working
Affinity_data as data members of resource partitioner and make them friends
Add resource partitioner's initialization step to hpx_init(...).

Add get_resource_partitioner() function returning reference to one
static instance of the resource partitioner
Adapt the initialization flow in hpx_init(...).
Undo type-erasure of runtime and threadmanager.
Type erase thread_pool. Compiles, execution not tested yet.
Modify constructors of threadmanager and threadpool accordingly.
Remove affinity_data and topology from scheduler
- change data member of threadmanager
- change constructor of threadmanager
- change member functions of threadmanager which act on pools
- make changes to threadmanager functions accordingly
- change internal data structure of resource-partitioner from
  vector<std::size_t> to mask_type
- add function in resource-partitioner checking for:
	- oversubscription (pu sharing)
	- empty default pool
	- compatibility between --hpx:threads and number of PUS
	  assigned
- make sure the default pool pool is the one that gets instantiated
  first by the threadmanager
- fix compilation errors in threadmanager
- resource partitioner instantiates a default thread pool at
construction
- threadmanager::default_pool() returns a pointer to default_pool
@biddisco
Copy link
Contributor

biddisco commented Aug 8, 2017

Could I please ask @KhalidHasanov to have a look through this branch and check if the work he contributed to the throttling policy has been accidentally deleted. If this is the case, then I will either edit the commit that deleted it and force push, or if @KhalidHasanov can provide a patch that reinstates anything missing, we can merge it back in. Thanks

@hkaiser
Copy link
Member Author

hkaiser commented Aug 8, 2017

@KhalidHasanov, @sithhell, @biddisco I think this branch allows to remove the throttling policy altogether as it now can be held outside of the core HPX libraries. This scheduler is very project specific, so let's leave it in project space.

@biddisco
Copy link
Contributor

biddisco commented Aug 8, 2017

Very good point. @KhalidHasanov you should have a look at the file

examples/resource_partitioner/simple_resource_partitioner.cpp

on this branch (around line 277) to see how to supply a custom scheduler to the default pool.
This allows you to package your scheduler in user code, rather than making it part of the main hpx distribution. At some point, we will probably go through the schedulers that are currently available and remove or clean up some of them.

@KhalidHasanov
Copy link
Contributor

@biddisco Thanks for pointing out the example file. I will have a look once the branch is merged and see how it goes.

- fix --hpx:threads=all command line option to properly interact with hpx.os_threads=N configuration setting
- adding more convenience functions for resource_partitioner
- adding some convenience headers
- Reduced exposed user interface, changed creation of RP in user-code
- shuffled things around, etc.
victim_queues_.clear();
victim_queues_.resize(num_worker_queues);
//
BOOST_ASSERT(num_worker_queues != 0);
Copy link
Member

Choose a reason for hiding this comment

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

Can we switch to HPX_ASSERT 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.

Good catch, thanks. We should add that to the obsolete macro tests in inspect.

# include <hpx/runtime/serialization/dynamic_bitset.hpp>
# endif
#endif

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 this be moved in the header of the target to enable its serialization?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this should go away. It's a leftover from Shoshana's experiments...

@sithhell
Copy link
Member

Only a few minor comments here. This PR is rather big and we should get it in ASAP, and keep improving it as we gain experience with the new feature.

@hkaiser
Copy link
Member Author

hkaiser commented Aug 22, 2017

This PR is rather big and we should get it in ASAP, and keep improving it as we gain experience with the new feature.

I couldn't agree more.

@hkaiser hkaiser merged commit 6c214b2 into master Aug 23, 2017
@hkaiser hkaiser deleted the resource_partitioner branch August 23, 2017 19:30
@hkaiser
Copy link
Member Author

hkaiser commented Aug 23, 2017

@shoshijak Thanks again for all your work on this! @aserio will get in contact with you to send a STE||AR-Group t-shirt as a small token of appreciation of your work.

@aserio
Copy link
Contributor

aserio commented Aug 23, 2017

@shoshijak would you send me an email so we can discuss getting you a T-shirt?
adrian.serio@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

6 participants