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

STEllAR-GROUP / hpx / #844

02 Dec 2022 12:37AM UTC coverage: 85.8% (+0.2%) from 85.634%
#844

push

StellarBot
Merge #6084

6084: Renaming hpx::apply and friends to hpx::post r=hkaiser a=hkaiser

- this is needed to be able to rename invoke_fused to apply later

working towards https://github.com/STEllAR-GROUP/hpx/issues/5497



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

468 of 468 new or added lines in 96 files covered. (100.0%)

171389 of 199753 relevant lines covered (85.8%)

1914550.97 hits per line

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

13.79
/libs/full/async_distributed/src/trigger_lco.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/assert.hpp>
8
#include <hpx/async_distributed/base_lco.hpp>
9
#include <hpx/async_distributed/post.hpp>
10
#include <hpx/async_distributed/trigger_lco.hpp>
11

12
#include <hpx/naming_base/address.hpp>
13
#include <hpx/naming_base/id_type.hpp>
14
#include <hpx/type_support/unused.hpp>
15
#if defined(HPX_MSVC) && !defined(HPX_DEBUG)
16
#include <hpx/async_distributed/base_lco_with_value.hpp>
17
#endif
18

19
#include <exception>
20
#include <utility>
21

22
namespace hpx {
23

24
    void trigger_lco_event(
78,923✔
25
        hpx::id_type const& id, naming::address&& addr, bool move_credits)
26
    {
27
#if !defined(HPX_COMPUTE_DEVICE_CODE)
28
        typedef lcos::base_lco::set_event_action set_action;
29
        if (move_credits &&
78,923✔
30
            id.get_management_type() !=
78,923✔
31
                hpx::id_type::management_type::unmanaged)
32
        {
33
            hpx::id_type target(
×
34
                id.get_gid(), id_type::management_type::managed_move_credit);
×
35
            id.make_unmanaged();
×
36

37
            detail::post_impl<set_action>(
×
38
                target, HPX_MOVE(addr), actions::action_priority<set_action>());
×
39
        }
×
40
        else
41
        {
42
            detail::post_impl<set_action>(
78,923✔
43
                id, HPX_MOVE(addr), actions::action_priority<set_action>());
78,923✔
44
        }
45
#else
46
        HPX_ASSERT(false);
47
        HPX_UNUSED(id);
48
        HPX_UNUSED(addr);
49
        HPX_UNUSED(move_credits);
50
#endif
51
    }
78,923✔
52

53
    void trigger_lco_event(hpx::id_type const& id, naming::address&& addr,
×
54
        hpx::id_type const& cont, bool move_credits)
55
    {
56
#if !defined(HPX_COMPUTE_DEVICE_CODE)
57
        typedef lcos::base_lco::set_event_action set_action;
58
        typedef hpx::traits::extract_action<set_action>::local_result_type
59
            local_result_type;
60
        typedef hpx::traits::extract_action<set_action>::remote_result_type
61
            remote_result_type;
62
        if (move_credits &&
×
63
            id.get_management_type() !=
×
64
                hpx::id_type::management_type::unmanaged)
65
        {
66
            hpx::id_type target(
×
67
                id.get_gid(), id_type::management_type::managed_move_credit);
×
68
            id.make_unmanaged();
×
69

70
            detail::post_impl<set_action>(
×
71
                actions::typed_continuation<local_result_type,
×
72
                    remote_result_type>(cont),
×
73
                target, HPX_MOVE(addr), actions::action_priority<set_action>());
×
74
        }
×
75
        else
76
        {
77
            detail::post_impl<set_action>(
×
78
                actions::typed_continuation<local_result_type,
×
79
                    remote_result_type>(cont),
×
80
                id, HPX_MOVE(addr), actions::action_priority<set_action>());
×
81
        }
82
#else
83
        HPX_ASSERT(false);
84
        HPX_UNUSED(id);
85
        HPX_UNUSED(cont);
86
        HPX_UNUSED(addr);
87
        HPX_UNUSED(move_credits);
88
#endif
89
    }
×
90

91
    void set_lco_error(hpx::id_type const& id, naming::address&& addr,
×
92
        std::exception_ptr const& e, bool move_credits)
93
    {
94
#if !defined(HPX_COMPUTE_DEVICE_CODE)
95
        typedef lcos::base_lco::set_exception_action set_action;
96
        if (move_credits &&
×
97
            id.get_management_type() !=
×
98
                hpx::id_type::management_type::unmanaged)
99
        {
100
            hpx::id_type target(
×
101
                id.get_gid(), id_type::management_type::managed_move_credit);
×
102
            id.make_unmanaged();
×
103

104
            detail::post_impl<set_action>(target, HPX_MOVE(addr),
×
105
                actions::action_priority<set_action>(), e);
×
106
        }
×
107
        else
108
        {
109
            detail::post_impl<set_action>(
×
110
                id, HPX_MOVE(addr), actions::action_priority<set_action>(), e);
×
111
        }
112
#else
113
        HPX_ASSERT(false);
114
        HPX_UNUSED(id);
115
        HPX_UNUSED(addr);
116
        HPX_UNUSED(e);
117
        HPX_UNUSED(move_credits);
118
#endif
119
    }
×
120

121
    void set_lco_error(hpx::id_type const& id,
7,144✔
122
        naming::address&& addr,    //-V659
123
        std::exception_ptr&& e, bool move_credits)
124
    {
125
#if !defined(HPX_COMPUTE_DEVICE_CODE)
126
        typedef lcos::base_lco::set_exception_action set_action;
127
        if (move_credits &&
7,144✔
128
            id.get_management_type() !=
7,144✔
129
                hpx::id_type::management_type::unmanaged)
130
        {
131
            hpx::id_type target(
×
132
                id.get_gid(), id_type::management_type::managed_move_credit);
×
133
            id.make_unmanaged();
×
134

135
            detail::post_impl<set_action>(target, HPX_MOVE(addr),
×
136
                actions::action_priority<set_action>(), HPX_MOVE(e));
×
137
        }
×
138
        else
139
        {
140
            detail::post_impl<set_action>(id, HPX_MOVE(addr),
14,288✔
141
                actions::action_priority<set_action>(), HPX_MOVE(e));
7,144✔
142
        }
143
#else
144
        HPX_ASSERT(false);
145
        HPX_UNUSED(id);
146
        HPX_UNUSED(addr);
147
        HPX_UNUSED(e);
148
        HPX_UNUSED(move_credits);
149
#endif
150
    }
7,144✔
151

152
    void set_lco_error(hpx::id_type const& id, naming::address&& addr,
×
153
        std::exception_ptr const& e, hpx::id_type const& cont,
154
        bool move_credits)
155
    {
156
#if !defined(HPX_COMPUTE_DEVICE_CODE)
157
        typedef lcos::base_lco::set_exception_action set_action;
158
        typedef hpx::traits::extract_action<set_action>::local_result_type
159
            local_result_type;
160
        typedef hpx::traits::extract_action<set_action>::remote_result_type
161
            remote_result_type;
162
        if (move_credits &&
×
163
            id.get_management_type() !=
×
164
                hpx::id_type::management_type::unmanaged)
165
        {
166
            hpx::id_type target(
×
167
                id.get_gid(), id_type::management_type::managed_move_credit);
×
168
            id.make_unmanaged();
×
169

170
            detail::post_impl<set_action>(
×
171
                actions::typed_continuation<local_result_type,
×
172
                    remote_result_type>(cont),
×
173
                target, HPX_MOVE(addr), actions::action_priority<set_action>(),
×
174
                e);
×
175
        }
×
176
        else
177
        {
178
            detail::post_impl<set_action>(
×
179
                actions::typed_continuation<local_result_type,
×
180
                    remote_result_type>(cont),
×
181
                id, HPX_MOVE(addr), actions::action_priority<set_action>(), e);
×
182
        }
183
#else
184
        HPX_ASSERT(false);
185
        HPX_UNUSED(id);
186
        HPX_UNUSED(addr);
187
        HPX_UNUSED(e);
188
        HPX_UNUSED(cont);
189
        HPX_UNUSED(move_credits);
190
#endif
191
    }
×
192

193
    void set_lco_error(hpx::id_type const& id,
×
194
        naming::address&& addr,    //-V659
195
        std::exception_ptr&& e, hpx::id_type const& cont, bool move_credits)
196
    {
197
#if !defined(HPX_COMPUTE_DEVICE_CODE)
198
        typedef lcos::base_lco::set_exception_action set_action;
199
        typedef hpx::traits::extract_action<set_action>::local_result_type
200
            local_result_type;
201
        typedef hpx::traits::extract_action<set_action>::remote_result_type
202
            remote_result_type;
203
        if (move_credits &&
×
204
            id.get_management_type() !=
×
205
                hpx::id_type::management_type::unmanaged)
206
        {
207
            hpx::id_type target(
×
208
                id.get_gid(), id_type::management_type::managed_move_credit);
×
209
            id.make_unmanaged();
×
210

211
            detail::post_impl<set_action>(
×
212
                actions::typed_continuation<local_result_type,
×
213
                    remote_result_type>(cont),
×
214
                target, HPX_MOVE(addr), actions::action_priority<set_action>(),
×
215
                HPX_MOVE(e));
×
216
        }
×
217
        else
218
        {
219
            detail::post_impl<set_action>(
×
220
                actions::typed_continuation<local_result_type,
×
221
                    remote_result_type>(cont),
×
222
                id, HPX_MOVE(addr), actions::action_priority<set_action>(),
×
223
                HPX_MOVE(e));
×
224
        }
225
#else
226
        HPX_ASSERT(false);
227
        HPX_UNUSED(id);
228
        HPX_UNUSED(addr);
229
        HPX_UNUSED(e);
230
        HPX_UNUSED(cont);
231
        HPX_UNUSED(move_credits);
232
#endif
233
    }
×
234

235
#if defined(HPX_MSVC) && !defined(HPX_DEBUG)
236
    ///////////////////////////////////////////////////////////////////////////
237
    // Explicitly instantiate specific post needed for set_lco_value for MSVC
238
    // (in release mode only, leads to missing symbols otherwise).
239
    template bool post<lcos::base_lco_with_value<util::unused_type,
240
                           util::unused_type>::set_value_action,
241
        util::unused_type>(hpx::id_type const&, util::unused_type&&);
242
#endif
243
}    // namespace hpx
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