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

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

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

51.02
/libs/full/runtime_distributed/src/runtime_support.cpp
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
#include <hpx/config.hpp>
8
#include <hpx/components_base/agas_interface.hpp>
9
#include <hpx/components_base/detail/agas_interface_functions.hpp>
10
#include <hpx/performance_counters/detail/counter_interface_functions.hpp>
11
#include <hpx/runtime_components/component_registry.hpp>
12
#include <hpx/runtime_distributed/runtime_support.hpp>
13

14
#include <mutex>
15
#include <utility>
16

17
HPX_PLUGIN_EXPORT_LIST(HPX_PLUGIN_COMPONENT_PREFIX, factory)
×
18
HPX_REGISTER_REGISTRY_MODULE()
2,544✔
19

20
#include <hpx/config/warnings_prefix.hpp>
21

22
namespace hpx { namespace components { namespace server {
×
23

24
    void runtime_support::add_pre_startup_function(startup_function_type f)
×
25
    {
26
        if (!f.empty())
×
27
        {
×
28
            std::lock_guard<hpx::spinlock> l(globals_mtx_);
29
            pre_startup_functions_.push_back(HPX_MOVE(f));
×
30
        }
31
    }
33✔
32

33
    void runtime_support::add_startup_function(startup_function_type f)
33✔
34
    {
35
        if (!f.empty())
33✔
36
        {
33✔
37
            std::lock_guard<hpx::spinlock> l(globals_mtx_);
38
            startup_functions_.push_back(HPX_MOVE(f));
33✔
39
        }
40
    }
38✔
41

42
    void runtime_support::add_pre_shutdown_function(shutdown_function_type f)
38✔
43
    {
44
        if (!f.empty())
38✔
45
        {
38✔
46
            std::lock_guard<hpx::spinlock> l(globals_mtx_);
47
            pre_shutdown_functions_.push_back(HPX_MOVE(f));
38✔
48
        }
49
    }
4,062✔
50

51
    void runtime_support::add_shutdown_function(shutdown_function_type f)
4,062✔
52
    {
53
        if (!f.empty())
4,062✔
54
        {
4,062✔
55
            std::lock_guard<hpx::spinlock> l(globals_mtx_);
56
            shutdown_functions_.push_back(HPX_MOVE(f));
4,062✔
57
        }
58
    }
59
}}}    // namespace hpx::components::server
60

61
namespace hpx { namespace agas { namespace detail { namespace impl {
62

63
    /// \brief Invoke an asynchronous garbage collection step on the given target
×
64
    ///        locality.
65
    void garbage_collect_non_blocking_id(hpx::id_type const& id, error_code& ec)
66
    {
67
        try
×
68
        {
69
            components::stubs::runtime_support::garbage_collect_non_blocking(
70
                id);
×
71
        }
72
        catch (hpx::exception const& e)
×
73
        {
×
74
            if (&ec == &throws)
×
75
                throw;
×
76
            ec = make_error_code(e.get_error(), e.what());
×
77
        }
78
    }
79

80
    /// \brief Invoke a synchronous garbage collection step on the given target
×
81
    ///        locality.
82
    void garbage_collect_id(hpx::id_type const& id, error_code& ec)
83
    {
84
        try
×
85
        {
86
            components::stubs::runtime_support::garbage_collect(id);
×
87
        }
88
        catch (hpx::exception const& e)
×
89
        {
×
90
            if (&ec == &throws)
×
91
                throw;
×
92
            ec = make_error_code(e.get_error(), e.what());
×
93
        }
94
    }
95
}}}}    // namespace hpx::agas::detail::impl
96

97
namespace hpx { namespace agas {
98

99
    // initialize AGAS interface function pointers in components_base module
100
    struct HPX_EXPORT runtime_components_init_interface_functions
101
    {
102
        runtime_components_init_interface_functions()
32✔
103
        {
104
            detail::garbage_collect_non_blocking_id =
32✔
105
                &detail::impl::garbage_collect_non_blocking_id;
106
            detail::garbage_collect_id = &detail::impl::garbage_collect_id;
107
        }
108
    };
32✔
109

110
    runtime_components_init_interface_functions& runtime_components_init()
111
    {
32✔
112
        static runtime_components_init_interface_functions
32✔
113
            runtime_components_init_;
114
        return runtime_components_init_;
115
    }
116
}}    // namespace hpx::agas
117

118
namespace hpx { namespace components {
119

120
    // some compilers try to invoke this function, even if it's actually not
121
    // needed
122
    namespace commandline_options_provider {
×
123

124
        hpx::program_options::options_description add_commandline_options()
×
125
        {
126
            return {};
127
        }
128
    }    // namespace commandline_options_provider
129

130
    // initialize AGAS interface function pointers in components_base module
131
    struct HPX_EXPORT counter_interface_functions
132
    {
133
        counter_interface_functions()
32✔
134
        {
135
            performance_counters::detail::create_performance_counter_async =
136
                &stubs::runtime_support::create_performance_counter_async;
137
        }
138
    };
32✔
139

140
    counter_interface_functions& counter_init()
32✔
141
    {
32✔
142
        static counter_interface_functions counter_init_;
143
        return counter_init_;
144
    }
145
}}    // 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

© 2025 Coveralls, Inc