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

Adding overload for hpx::init/hpx::start for use with resource partitioner #4374

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Feb 10, 2020

  • this helps resolving linker errors on Windows if the main entry point to HPX is in a shared library
  • this also cleans up the API as it makes the use of the resource partitioner explicit

Note that this is a breaking API as the use of the no-argument versions of init and start is now deprecated when using an explicit resource partitioner.

@msimberg
Copy link
Contributor

Thanks @hkaiser for starting this. @aurianer has another PR almost ready to go which actually passes a callback to init/start to create thread pools etc. with the resource partitioner. This PR still allows initializing the rp explicitly outside of init/start and I was actually hoping to disallow that, but we could go this way as well. The critical change that I wanted to have is to not have the rp grab things like parcelport configs directly but have them passed to it by init/start. Is this for a specific use case of yours or related to the discussions we had earlier on cleaning up use of the rp with init/start?

@hkaiser
Copy link
Member Author

hkaiser commented Feb 11, 2020

Thanks @msimberg. This change is to avoid a linker error on Windows under certain circumstances. The problem I'm trying to solve is that in cases were the resource-manager is initialized explicitly (with an explicit HPX-main function) the no-argument overload of hpx::init still passes hpx_main as a symbol to the runtime, causing linker errors in applications. This new overload exposes a separate entry point function that works around the issue.

This PR also makes passing the resource-partitioner to the runtime explicit. I never liked the implicit 'pseudo-global' resource partitioner that was snug in behind the scenes.

I have no issue to achieve the two goals in any different way, however.

…rtitioner

- this helps resolving linker errors on Windows if the main entry point to HPX is in a shared library
- this also cleans up the API as it makes the use of the resource partitioner explicit

Note that this is a breaking API as the use of the no-argument versions of `init` and `start` is now deprecated when using an explicit resource partitioner.
@msimberg
Copy link
Contributor

Thanks @hkaiser. I suggest we go with this first (and if you can add a small test demonstrating the linking problems that would be great). We'll adapt @aurianer's changes to fit this.

Copy link
Contributor

@msimberg msimberg left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@msimberg msimberg merged commit f5403e9 into master Feb 12, 2020
@msimberg msimberg deleted the resource_partitioner_init branch February 12, 2020 08:56
@aurianer
Copy link
Contributor

Thanks !

@msimberg
Copy link
Contributor

I already forgot about the test when I merged this. Let's figure out a test on IRC.

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.

3 participants