• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #866

14 Jan 2023 04:16PM UTC coverage: 85.951% (-0.5%) from 86.431%
#866

push

StellarBot
Merge #6134

6134: Adding notification function for parcelports to be called after early parcel handling r=hkaiser a=hkaiser

Parcelports now can override a new function `void initialized()` that will be called after early parcel handling is finished and before the thread pools are operational (i.e. before background work starts).

`@JiakunYan` please let me know if this is what you requested.

Co-authored-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>

4 of 4 new or added lines in 2 files covered. (100.0%)

173540 of 201905 relevant lines covered (85.95%)

1871917.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.0
/libs/full/runtime_distributed/include/hpx/runtime_distributed/copy_component.hpp
1
//  Copyright (c) 2007-2021 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
/// \file copy_component.hpp
8

9
#pragma once
10

11
#include <hpx/config.hpp>
12
#include <hpx/actions_base/plain_action.hpp>
13
#include <hpx/async_colocated/async_colocated.hpp>
14
#include <hpx/async_distributed/async.hpp>
15
#include <hpx/components_base/traits/is_component.hpp>
16
#include <hpx/futures/future.hpp>
17
#include <hpx/naming_base/id_type.hpp>
18
#include <hpx/runtime_distributed/server/copy_component.hpp>
19

20
#include <type_traits>
21

22
namespace hpx { namespace components {
23

24
    /// \brief Copy given component to the specified target locality
25
    ///
26
    /// The function \a copy<Component> will create a copy of the component
27
    /// referenced by \a to_copy on the locality specified with
28
    /// \a target_locality. It returns a future referring to the newly created
29
    /// component instance.
30
    ///
31
    /// \param to_copy         [in] The global id of the component to copy
32
    ///
33
    /// \tparam  The only template argument specifies the component type to
34
    ///          create.
35
    ///
36
    /// \returns A future representing the global id of the newly (copied)
37
    ///          component instance.
38
    ///
39
    /// \note The new component instance is created on the locality of the
40
    ///       component instance which is to be copied.
41
    ///
42
    template <typename Component>
43
#if defined(DOXYGEN)
44
    future<hpx::id_type>
45
#else
46
    inline typename std::enable_if<traits::is_component<Component>::value,
47
        future<hpx::id_type>>::type
48
#endif
49
    copy(hpx::id_type const& to_copy)
760✔
50
    {
51
        typedef server::copy_component_action_here<Component> action_type;
52
        return hpx::detail::async_colocated<action_type>(to_copy, to_copy);
760✔
53
    }
54

55
    /// \brief Copy given component to the specified target locality
56
    ///
57
    /// The function \a copy<Component> will create a copy of the component
58
    /// referenced by \a to_copy on the locality specified with
59
    /// \a target_locality. It returns a future referring to the newly created
60
    /// component instance.
61
    ///
62
    /// \param to_copy         [in] The global id of the component to copy
63
    /// \param target_locality [in ] The locality where the copy
64
    ///                        should be created.
65
    ///
66
    /// \tparam  The only template argument specifies the component type to
67
    ///          create.
68
    ///
69
    /// \returns A future representing the global id of the newly (copied)
70
    ///          component instance.
71
    ///
72
    template <typename Component>
73
#if defined(DOXYGEN)
74
    future<hpx::id_type>
75
#else
76
    inline typename std::enable_if<traits::is_component<Component>::value,
77
        future<hpx::id_type>>::type
78
#endif
79
    copy(hpx::id_type const& to_copy, hpx::id_type const& target_locality)
×
80
    {
81
        typedef server::copy_component_action<Component> action_type;
82
        return hpx::detail::async_colocated<action_type>(
×
83
            to_copy, to_copy, target_locality);
×
84
    }
85

86
    ///////////////////////////////////////////////////////////////////////////
87
    /// \brief Copy given component to the specified target locality
88
    ///
89
    /// The function \a copy will create a copy of the component
90
    /// referenced by the client side object \a to_copy on the locality
91
    /// specified with \a target_locality. It returns a new client side object
92
    /// future referring to the newly created component instance.
93
    ///
94
    /// \param to_copy         [in] The client side object representing the
95
    ///                        component to copy
96
    /// \param target_locality [in, optional] The locality where the copy
97
    ///                        should be created (default is same locality
98
    ///                        as source).
99
    ///
100
    /// \tparam  The only template argument specifies the component type to
101
    ///          create.
102
    ///
103
    /// \returns A future representing the global id of the newly (copied)
104
    ///          component instance.
105
    ///
106
    /// \note If the second argument is omitted (or is invalid_id) the
107
    ///       new component instance is created on the locality of the
108
    ///       component instance which is to be copied.
109
    ///
110
    template <typename Derived, typename Stub>
111
    Derived copy(client_base<Derived, Stub> const& to_copy,
112
        hpx::id_type const& target_locality = hpx::invalid_id)
113
    {
114
        typedef typename client_base<Derived, Stub>::server_component_type
115
            component_type;
116
        typedef server::copy_component_action<component_type> action_type;
117

118
        id_type id = to_copy.get_id();
119
        return Derived(hpx::detail::async_colocated<action_type>(
120
            to_copy, to_copy, target_locality));
121
    }
122
}}    // namespace hpx::components
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc