• 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

6.67
/libs/core/runtime_local/src/thread_pool_helpers.cpp
1
//  Copyright (c) 2017 Shoshana Jakobovits
2
//  Copyright (c) 2024 Hartmut Kaiser
3
//
4
//  SPDX-License-Identifier: BSL-1.0
5
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
6
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7

8
#include <hpx/config.hpp>
9
#include <hpx/modules/resource_partitioner.hpp>
10
#include <hpx/modules/threadmanager.hpp>
11
#include <hpx/modules/topology.hpp>
12
#include <hpx/runtime_local/runtime_local.hpp>
13
#include <hpx/runtime_local/thread_pool_helpers.hpp>
14

15
#include <cstddef>
16
#include <cstdint>
17
#include <string>
18

19
namespace hpx::resource {
20

21
    std::size_t get_num_thread_pools()
22
    {
23
        return get_partitioner().get_num_pools();
24
    }
×
25

26
    std::size_t get_num_threads()
×
27
    {
28
        return get_partitioner().get_num_threads();
29
    }
×
30

31
    std::size_t get_num_threads(std::string const& pool_name)
×
32
    {
33
        return get_partitioner().get_num_threads(pool_name);
34
    }
×
35

36
    std::size_t get_num_threads(std::size_t pool_index)
×
37
    {
38
        return get_partitioner().get_num_threads(pool_index);
39
    }
×
40

41
    std::size_t get_pool_index(std::string const& pool_name)
×
42
    {
43
        return get_partitioner().get_pool_index(pool_name);
44
    }
×
45

46
    std::string const& get_pool_name(std::size_t pool_index)
×
47
    {
48
        return get_partitioner().get_pool_name(pool_index);
49
    }
×
50

51
    threads::thread_pool_base& get_thread_pool(std::string const& pool_name)
×
52
    {
53
        return get_runtime().get_thread_manager().get_pool(pool_name);
54
    }
×
55

56
    threads::thread_pool_base& get_thread_pool(std::size_t pool_index)
×
57
    {
58
        return get_thread_pool(get_pool_name(pool_index));
59
    }
×
60

61
    bool pool_exists(std::string const& pool_name)
×
62
    {
63
        return get_runtime().get_thread_manager().pool_exists(pool_name);
64
    }
×
65

66
    bool pool_exists(std::size_t pool_index)
×
67
    {
68
        return get_runtime().get_thread_manager().pool_exists(pool_index);
69
    }
×
70
}    // namespace hpx::resource
71

×
72
namespace hpx::threads {
73

74
    std::int64_t get_thread_count(thread_schedule_state state)
75
    {
76
        return get_thread_manager().get_thread_count(state);
×
77
    }
78

×
79
    std::int64_t get_thread_count(
80
        thread_priority priority, thread_schedule_state state)
81
    {
×
82
        return get_thread_manager().get_thread_count(state, priority);
83
    }
84

×
85
    std::int64_t get_idle_core_count()
86
    {
87
        return get_thread_manager().get_idle_core_count();
×
88
    }
89

×
90
    mask_type get_idle_core_mask()
91
    {
92
        return get_thread_manager().get_idle_core_mask();
×
93
    }
94

×
95
    bool enumerate_threads(hpx::function<bool(thread_id_type)> const& f,
96
        thread_schedule_state state)
97
    {
1✔
98
        return get_thread_manager().enumerate_threads(f, state);
99
    }
100
}    // namespace hpx::threads
1✔
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