• 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

7.69
/libs/full/compute/src/get_host_targets.cpp
1
//  Copyright (c) 2016-2022 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

9
#if defined(HPX_HAVE_DISTRIBUTED_RUNTIME)
10
#include <hpx/actions_base/plain_action.hpp>
11
#include <hpx/compute/host/distributed_target.hpp>
12
#include <hpx/compute/host/get_targets.hpp>
13
#include <hpx/modules/async_distributed.hpp>
14
#include <hpx/modules/futures.hpp>
15
#include <hpx/modules/resource_partitioner.hpp>
16
#include <hpx/modules/runtime_local.hpp>
17
#include <hpx/modules/serialization.hpp>
18
#include <hpx/modules/topology.hpp>
19
#include <hpx/naming_base/id_type.hpp>
20
#include <hpx/runtime_distributed/find_here.hpp>
21

22
#include <vector>
23

24
HPX_PLAIN_ACTION(
25
    hpx::compute::host::get_local_targets, compute_host_get_targets_action)
26

192✔
27
namespace hpx::compute::host::distributed {
28

29
    namespace detail {
30

31
        std::vector<host::distributed::target> get_remote_targets(
32
            std::vector<host::target> const& targets)
33
        {
×
34
            std::vector<host::distributed::target> remote_targets;
35
            remote_targets.reserve(targets.size());
36
            for (auto const& t : targets)
×
37
            {
×
38
                remote_targets.emplace_back(t);
×
39
            }
40
            return remote_targets;
×
41
        }
42
    }    // namespace detail
×
43

×
44
    hpx::future<std::vector<host::distributed::target>> get_targets(
45
        hpx::id_type const& locality)
46
    {
×
47
        if (locality == hpx::find_here())
48
        {
49
            return hpx::make_ready_future(
×
50
                detail::get_remote_targets(get_local_targets()));
51
        }
52

×
53
        return hpx::async(compute_host_get_targets_action(), locality)
54
            .then([](auto&& f) { return detail::get_remote_targets(f.get()); });
55
    }
×
56
}    // namespace hpx::compute::host::distributed
×
57

58
#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