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

Refactoring component_base and base_action/transfer_base_action #3148

Merged
merged 1 commit into from Feb 10, 2018

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Feb 6, 2018

This allows to reduce the number of instantiated functions and exported symbols, especially for external modules that contain components.

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.

Just a minor nitpick, looks good otherwise!

naming::address component_base::get_current_address() const
{
return naming::address(get_locality(), type_,
std::uint64_t(static_cast<component_base const*>(this)));
Copy link
Member

Choose a reason for hiding this comment

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

the static cast here is not necessary, is it?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is needed as this might be different from the base address of the whole component.

Copy link
Member Author

Choose a reason for hiding this comment

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

But this code is wrong for other reasons, will fix.

@@ -174,12 +174,12 @@ namespace hpx { namespace components

// Returns the (unique) name for a given component
template <typename Component, typename Enable = void>
const char* get_component_name();
HPX_CONSTEXPR char const* const get_component_name();
Copy link
Member

Choose a reason for hiding this comment

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

the extra const generates warnings for clang.


// Returns the (unique) name of the base component. If there is none,
// nullptr is returned
template <typename Component, typename Enable = void>
const char* get_component_base_name();
HPX_CONSTEXPR const char* const get_component_base_name();
Copy link
Member

Choose a reason for hiding this comment

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

same here.

template <> HPX_ALWAYS_EXPORT \
const char* get_component_name< Component, void>() \
template <> HPX_CONSTEXPR \
char const* const get_component_name< Component, void>() \
Copy link
Member

Choose a reason for hiding this comment

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

same here.

template <> HPX_ALWAYS_EXPORT \
const char* get_component_base_name< Component, void>() \
template <> HPX_CONSTEXPR \
char const* const get_component_base_name< Component, void>() \
Copy link
Member

Choose a reason for hiding this comment

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

same here.

template <> HPX_ALWAYS_EXPORT \
const char* get_component_name< Component, void>() \
template <> HPX_CONSTEXPR \
char const* const get_component_name< Component, void>() \
Copy link
Member

Choose a reason for hiding this comment

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

same here.

template <> HPX_ALWAYS_EXPORT \
const char* get_component_base_name< Component, void>() \
template <> HPX_CONSTEXPR \
char const* const get_component_base_name< Component, void>() \
Copy link
Member

Choose a reason for hiding this comment

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

same here.

@hkaiser hkaiser force-pushed the refactor_base_action branch 7 times, most recently from c0673fc to 7e4cabf Compare February 8, 2018 15:02
@sithhell
Copy link
Member

sithhell commented Feb 9, 2018

appveyor is not happy with this right now

@hkaiser
Copy link
Member Author

hkaiser commented Feb 9, 2018

appveyor is not happy with this right now

Yes, I know - but this was introduced earlier by one of the changes to the thread scheduling.

@sithhell
Copy link
Member

sithhell commented Feb 9, 2018

Yes, I know - but this was introduced earlier by one of the changes to the thread scheduling.

Can you restart the build then? It looks like this PR is the only one affected to that timeout.

@hkaiser
Copy link
Member Author

hkaiser commented Feb 9, 2018

The same happened here: https://ci.appveyor.com/project/hkaiser/hpx/build/fix_timed_suspension-1897, apparently this got branched off at a bad time... I'll rebase and restart the tests.

…duce number of instantiated functions and exported symbols

 - making get_component_type() related functionality constexpr (instead of always exporting the functions)
@hkaiser hkaiser merged commit c45c82e into master Feb 10, 2018
@hkaiser hkaiser deleted the refactor_base_action branch February 10, 2018 01:39
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