Skip to content

Commit

Permalink
Merge pull request #1470 from STEllAR-GROUP/new_action_serialization
Browse files Browse the repository at this point in the history
Removing hpx::util::polymorphic_factory
  • Loading branch information
sithhell committed Apr 27, 2015
2 parents a79dd63 + 4174af4 commit eb0198f
Show file tree
Hide file tree
Showing 87 changed files with 699 additions and 1,502 deletions.
2 changes: 0 additions & 2 deletions docs/hpx.idx
Expand Up @@ -412,8 +412,6 @@ HPX_DEFINE_COMPONENT_ACTION "" "HPX_DEFINE_COMPONENT_ACTION"
HPX_DEFINE_COMPONENT_CONST_ACTION "" "HPX_DEFINE_COMPONENT_CONST_ACTION"

# hpx/runtime/actions/plain_action.hpp
HPX_REGISTER_PLAIN_ACTION "" "HPX_REGISTER_PLAIN_ACTION"
HPX_DEFINE_PLAIN_ACTION "" "HPX_DEFINE_PLAIN_ACTION"
HPX_PLAIN_ACTION "" "HPX_PLAIN_ACTION"

# hpx/runtime/components/component_factory.hpp
Expand Down
6 changes: 3 additions & 3 deletions docs/manual/applying_actions.qbk
Expand Up @@ -37,7 +37,7 @@ the action type. Here is an example demonstrating this:
If the action type should be defined somewhere not in global namespace, the
action type definition has to be split into two macro invocations
([macroref HPX_DEFINE_PLAIN_ACTION `HPX_DEFINE_PLAIN_ACTION`] and
[macroref HPX_REGISTER_PLAIN_ACTION `HPX_REGISTER_PLAIN_ACTION`]) as shown in
[macroref HPX_REGISTER_ACTION `HPX_REGISTER_ACTION`]) as shown in
the next example:

namespace app
Expand All @@ -61,7 +61,7 @@ the next example:
// The following macro expands to a series of definitions of global objects
// which are needed for proper serialization and initialization support
// enabling the remote invocation of the function `some_global_function`.
``[macroref HPX_REGISTER_PLAIN_ACTION `HPX_REGISTER_PLAIN_ACTION`]``(app::some_global_action, app_some_global_action);
``[macroref HPX_REGISTER_ACTION `HPX_REGISTER_ACTION`]``(app::some_global_action, app_some_global_action);

The shown code defines an action type `some_global_action` inside the namespace
`app`.
Expand All @@ -70,7 +70,7 @@ The shown code defines an action type `some_global_action` inside the namespace
above, the name of the action type to create has to be the same for
both macro invocations (here `some_global_action`).]

[important The second argument passed to [macroref HPX_REGISTER_PLAIN_ACTION `HPX_REGISTER_PLAIN_ACTION`]
[important The second argument passed to [macroref HPX_REGISTER_ACTION `HPX_REGISTER_ACTION`]
(`app_some_global_action`) has to comprise a globally unique C++
identifier representing the action. This is used for serialization
purposes.]
Expand Down
1 change: 0 additions & 1 deletion examples/1d_hydro/1d_hydro_upwind.cpp
Expand Up @@ -13,7 +13,6 @@
// INCLUDES
#include <hpx/hpx_init.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>
#include <hpx/include/async.hpp>
#include <hpx/include/iostreams.hpp>
#include <hpx/lcos/future_wait.hpp>
Expand Down
3 changes: 1 addition & 2 deletions examples/heartbeat/heartbeat.cpp
Expand Up @@ -8,10 +8,9 @@

#include <hpx/hpx_init.hpp>
#include <hpx/exception.hpp>
#include <hpx/runtime/applier/applier.hpp>
#include <hpx/include/performance_counters.hpp>
#include <hpx/include/lcos.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>
#include <hpx/runtime/threads/thread_helpers.hpp>
#include <hpx/lcos/future.hpp>
#include <hpx/state.hpp>
Expand Down
1 change: 0 additions & 1 deletion examples/quickstart/1d_wave_equation.cpp
Expand Up @@ -22,7 +22,6 @@
// Include statements.
#include <hpx/hpx_init.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>
#include <hpx/include/async.hpp>
#include <hpx/lcos/future_wait.hpp>
#include <hpx/include/iostreams.hpp>
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart/fibonacci.cpp
Expand Up @@ -9,6 +9,7 @@

#include <hpx/hpx_init.hpp>
#include <hpx/include/actions.hpp>
#include <hpx/include/async.hpp>
#include <hpx/include/util.hpp>

#include <iostream>
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart/fibonacci_one.cpp
Expand Up @@ -11,6 +11,7 @@

#include <hpx/hpx_init.hpp>
#include <hpx/include/actions.hpp>
#include <hpx/include/async.hpp>
#include <hpx/include/util.hpp>

#include <iostream>
Expand Down
5 changes: 1 addition & 4 deletions examples/quickstart/non_atomic_rma.cpp
Expand Up @@ -17,7 +17,6 @@
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>
#include <hpx/runtime/serialization/serialize.hpp>
#include <hpx/runtime/serialization/vector.hpp>

Expand Down Expand Up @@ -80,10 +79,8 @@ int hpx_main(po::variables_map &vm)
int result = 0;
double elapsed = 0.0;

components::component_type type =
components::get_component_type<components::server::plain_function<set_initialdata_action> >();
std::vector<naming::id_type> localities =
hpx::find_remote_localities(type);
hpx::find_remote_localities();

naming::id_type this_prefix = hpx::find_here();

Expand Down
16 changes: 7 additions & 9 deletions examples/quickstart/print_to_console.cpp
Expand Up @@ -4,15 +4,16 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

///////////////////////////////////////////////////////////////////////////////
// This is not demonstrating the recommended way of printing things to the
// console - this can be done easily using hpx::cout instead. The purpose of
// this example is to demonstrate how to use templated plain actions.
// This is not demonstrating the recommended way of printing things to the
// console - this can be done easily using hpx::cout instead. The purpose of
// this example is to demonstrate how to use templated plain actions.

#include <hpx/hpx_main.hpp>
#include <hpx/include/actions.hpp>
#include <hpx/include/async.hpp>

///////////////////////////////////////////////////////////////////////////////
template <typename T>
template <typename T>
void print(T const& t)
{
std::cout << t << "\n";
Expand All @@ -24,17 +25,14 @@ struct print_action
: hpx::actions::make_action<void (*)(T const&), &print<T>, print_action<T> >
{};

HPX_REGISTER_PLAIN_ACTION_TEMPLATE((template <typename T>), (print_action<T>));

// define a direct action which is semantically equivalent to the plain action
// above
template <typename T>
struct print_direct_action
: hpx::actions::make_direct_action<void (*)(T const&), &print<T>, print_direct_action<T> >
: hpx::actions::make_direct_action<
void (*)(T const&), &print<T>, print_direct_action<T> >
{};

HPX_REGISTER_PLAIN_ACTION_TEMPLATE((template <typename T>), (print_direct_action<T>));

///////////////////////////////////////////////////////////////////////////////
int main()
{
Expand Down
1 change: 0 additions & 1 deletion examples/quickstart/quicksort.cpp
Expand Up @@ -7,7 +7,6 @@
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>
#include <hpx/util/high_resolution_timer.hpp>
#include <hpx/include/async.hpp>

Expand Down
Expand Up @@ -176,10 +176,6 @@ namespace hpx { namespace components { namespace server
{};
}}}

HPX_REGISTER_PLAIN_ACTION_TEMPLATE(
(template <typename Component>),
(hpx::components::server::trigger_migrate_from_storage_here_action<Component>))

#endif


Expand Up @@ -208,14 +208,6 @@ namespace hpx { namespace components { namespace server
{};
}}}

HPX_REGISTER_PLAIN_ACTION_TEMPLATE(
(template <typename Component>),
(hpx::components::server::migrate_to_storage_here_action<Component>))

HPX_REGISTER_PLAIN_ACTION_TEMPLATE(
(template <typename Component>),
(hpx::components::server::trigger_migrate_to_storage_here_action<Component>))

#endif


33 changes: 18 additions & 15 deletions hpx/hpx_fwd.hpp
Expand Up @@ -548,43 +548,46 @@ namespace hpx
// component creation, etc). One per locality.
component_runtime_support = 0,

// Pseudo-component to be used for plain actions
component_plain_function = 1,

// Pseudo-component for direct access to local virtual memory.
component_memory = 1,
component_memory = 2,

// Generic memory blocks.
component_memory_block = 2,
component_memory_block = 3,

// Base component for LCOs that do not produce a value.
component_base_lco = 3,
component_base_lco = 4,

// Base component for LCOs that do produce values.
component_base_lco_with_value = 4,
component_base_lco_with_value = 5,

// Synchronization latch, barrier, and flex_barrier LCOs.
component_latch = ((5 << 16) | component_base_lco_with_value),
component_barrier = ((6 << 16) | component_base_lco),
component_flex_barrier = ((7 << 16) | component_base_lco),
component_latch = ((6 << 16) | component_base_lco_with_value),
component_barrier = ((7 << 16) | component_base_lco),
component_flex_barrier = ((8 << 16) | component_base_lco),

// An LCO representing a value which may not have been computed yet.
component_promise = ((8 << 16) | component_base_lco_with_value),
component_promise = ((9 << 16) | component_base_lco_with_value),

// AGAS locality services.
component_agas_locality_namespace = 9,
component_agas_locality_namespace = 10,

// AGAS primary address resolution services.
component_agas_primary_namespace = 10,
component_agas_primary_namespace = 11,

// AGAS global type system.
component_agas_component_namespace = 11,
component_agas_component_namespace = 12,

// AGAS symbolic naming services.
component_agas_symbol_namespace = 12,
component_agas_symbol_namespace = 13,

#if defined(HPX_HAVE_SODIUM)
// root CA, subordinate CA
signed_certificate_promise = ((13 << 16) | component_base_lco_with_value),
component_root_certificate_authority = 14,
component_subordinate_certificate_authority = 15,
signed_certificate_promise = ((14 << 16) | component_base_lco_with_value),
component_root_certificate_authority = 15,
component_subordinate_certificate_authority = 16,
#endif

component_last,
Expand Down
2 changes: 0 additions & 2 deletions hpx/include/actions.hpp
Expand Up @@ -13,8 +13,6 @@
#include <hpx/runtime/actions/manage_object_action.hpp>
#include <hpx/runtime/actions/continuation.hpp>
#include <hpx/runtime/actions/action_invoke_no_more_than.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>
#include <hpx/runtime/components/component_factory.hpp>

#endif

1 change: 0 additions & 1 deletion hpx/include/components.hpp
Expand Up @@ -12,7 +12,6 @@

#include <hpx/runtime/components/component_factory.hpp>
#include <hpx/runtime/components/derived_component_factory.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>

#include <hpx/runtime/components/component_startup_shutdown.hpp>
#include <hpx/runtime/components/component_commandline.hpp>
Expand Down
1 change: 0 additions & 1 deletion hpx/include/plain_actions.hpp
Expand Up @@ -9,7 +9,6 @@
#include <hpx/hpx_fwd.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/runtime/actions/continuation.hpp>
#include <hpx/runtime/components/plain_component_factory.hpp>

#endif

8 changes: 4 additions & 4 deletions hpx/lcos/broadcast.hpp
Expand Up @@ -955,7 +955,7 @@ namespace hpx { namespace lcos
HPX_REGISTER_BROADCAST_APPLY_ACTION_2(Action, Action) \
/**/
#define HPX_REGISTER_BROADCAST_APPLY_ACTION_2(Action, Name) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_broadcast_apply_action<Action>::type \
, BOOST_PP_CAT(broadcast_apply_, Name) \
) \
Expand Down Expand Up @@ -1011,7 +1011,7 @@ namespace hpx { namespace lcos
HPX_REGISTER_BROADCAST_APPLY_WITH_INDEX_ACTION_2(Action, Action) \
/**/
#define HPX_REGISTER_BROADCAST_APPLY_WITH_INDEX_ACTION_2(Action, Name) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_broadcast_apply_action< \
::hpx::lcos::detail::broadcast_with_index<Action> \
>::type \
Expand Down Expand Up @@ -1064,7 +1064,7 @@ namespace hpx { namespace lcos
HPX_REGISTER_BROADCAST_ACTION_2(Action, Action) \
/**/
#define HPX_REGISTER_BROADCAST_ACTION_2(Action, Name) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_broadcast_action<Action>::type \
, BOOST_PP_CAT(broadcast_, Name) \
) \
Expand Down Expand Up @@ -1118,7 +1118,7 @@ namespace hpx { namespace lcos
HPX_REGISTER_BROADCAST_WITH_INDEX_ACTION_2(Action, Action) \
/**/
#define HPX_REGISTER_BROADCAST_WITH_INDEX_ACTION_2(Action, Name) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_broadcast_action< \
::hpx::lcos::detail::broadcast_with_index<Action> \
>::type \
Expand Down
8 changes: 4 additions & 4 deletions hpx/lcos/fold.hpp
Expand Up @@ -719,14 +719,14 @@ namespace hpx { namespace lcos
/**/

#define HPX_REGISTER_FOLD_ACTION_2(Action, FoldOp) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_fold_action<Action>:: \
fold_invoker<FoldOp>::type \
, BOOST_PP_CAT(BOOST_PP_CAT(fold_, Action), FoldOp) \
) \
/**/
#define HPX_REGISTER_FOLD_ACTION_3(Action, FoldOp, Name) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_fold_action<Action>:: \
fold_invoker<FoldOp>::type \
, BOOST_PP_CAT(fold_, Name) \
Expand Down Expand Up @@ -772,15 +772,15 @@ namespace hpx { namespace lcos
/**/

#define HPX_REGISTER_FOLD_WITH_INDEX_ACTION_2(Action, FoldOp) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_fold_action< \
::hpx::lcos::detail::fold_with_index<Action> \
>::fold_invoker<FoldOp>::type \
, BOOST_PP_CAT(BOOST_PP_CAT(fold_, Action), FoldOp) \
) \
/**/
#define HPX_REGISTER_FOLD_WITH_INDEX_ACTION_3(Action, FoldOp, Name) \
HPX_REGISTER_PLAIN_ACTION( \
HPX_REGISTER_ACTION( \
::hpx::lcos::detail::make_fold_action< \
::hpx::lcos::detail::fold_with_index<Action> \
>::fold_invoker<FoldOp>::type \
Expand Down

0 comments on commit eb0198f

Please sign in to comment.