• 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

76.92
/libs/full/resiliency_distributed/tests/unit/async_replay_distributed_plain.cpp
1
//  Copyright (c) 2019-2020 Nikunj Gupta
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
#if !defined(HPX_COMPUTE_DEVICE_CODE)
9

10
#include <hpx/actions_base/plain_action.hpp>
11
#include <hpx/hpx_init.hpp>
12
#include <hpx/include/runtime.hpp>
13
#include <hpx/modules/futures.hpp>
14
#include <hpx/modules/resiliency.hpp>
15
#include <hpx/modules/resiliency_distributed.hpp>
16
#include <hpx/modules/testing.hpp>
17

18
#include <cstddef>
19
#include <random>
20
#include <vector>
21

22
std::random_device rd;
2✔
23
std::mt19937 mt(rd());
2✔
24
std::uniform_real_distribution<double> dist(1.0, 10.0);
2✔
25

26
int universal_ans()
3✔
27
{
28
    if (dist(mt) > 5)
3✔
29
        return 42;
×
30
    return 84;
3✔
31
}
3✔
32

33
HPX_PLAIN_ACTION(universal_ans, universal_action)
11✔
34

35
bool validate(int ans)
2✔
36
{
37
    return ans == 42;
2✔
38
}
39

40
int hpx_main()
1✔
41
{
42
    std::vector<hpx::id_type> locals = hpx::find_all_localities();
1✔
43

44
    // Allow a task to replay on the same locality if there is only 1 locality
45
    if (locals.size() == 1)
1✔
46
    {
47
        locals.insert(locals.end(), 9, hpx::find_here());
×
48
    }
×
49

50
    {
51
        universal_action our_action;
52
        hpx::future<int> f =
53
            hpx::resiliency::experimental::async_replay(locals, our_action);
1✔
54

55
        try
56
        {
57
            f.get();
1✔
58
        }
1✔
59
        catch (hpx::resiliency::experimental::abort_replay_exception const&)
60
        {
61
            HPX_TEST(true);
×
62
        }
×
63
        catch (...)
64
        {
65
            HPX_TEST(false);
×
66
        }
×
67
    }
1✔
68

69
    {
70
        universal_action our_action;
71
        hpx::future<int> f =
72
            hpx::resiliency::experimental::async_replay_validate(
1✔
73
                locals, &validate, our_action);
1✔
74

75
        try
76
        {
77
            f.get();
1✔
78
        }
1✔
79
        catch (hpx::resiliency::experimental::abort_replay_exception const&)
80
        {
81
            HPX_TEST(true);
1✔
82
        }
1✔
83
        catch (...)
84
        {
85
            HPX_TEST(false);
×
86
        }
1✔
87
    }
1✔
88

89
    return hpx::finalize();
1✔
90
}
2✔
91

92
int main(int argc, char* argv[])
2✔
93
{
94
    // Initialize and run HPX
95
    HPX_TEST(hpx::init(argc, argv) == 0);
2✔
96
    return hpx::util::report_errors();
2✔
97
}
×
98

99
#endif
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