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

HDFGroup / hermes / 4851036339

pending completion
4851036339

Pull #515

github

GitHub
Merge aee741046 into 87672e106
Pull Request #515: v1.0

5501 of 5501 new or added lines in 117 files covered. (100.0%)

4997 of 7299 relevant lines covered (68.46%)

6131966.73 hits per line

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

87.5
/src/data_placement_engine.cc
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
 * Distributed under BSD 3-Clause license.                                   *
3
 * Copyright by The HDF Group.                                               *
4
 * Copyright by the Illinois Institute of Technology.                        *
5
 * All rights reserved.                                                      *
6
 *                                                                           *
7
 * This file is part of Hermes. The full Hermes copyright notice, including  *
8
 * terms governing use, modification, and redistribution, is contained in    *
9
 * the COPYING file, which can be found at the top directory. If you do not  *
10
 * have access to the file, you may request a copy from help@hdfgroup.org.   *
11
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12

13
#include "data_placement_engine_factory.h"
14

15
#include <assert.h>
16
#include <math.h>
17

18
#include <utility>
19
#include <random>
20
#include <map>
21

22
#include "hermes.h"
23
#include "hermes_types.h"
24
#include "buffer_pool.h"
25

26
namespace hermes {
27

28
/** Constructor. */
29
DPE::DPE() : mdm_(&HERMES->mdm_) {}
37✔
30

31
/** calculate data placement */
32
Status DPE::CalculatePlacement(const std::vector<size_t> &blob_sizes,
28,000✔
33
                               std::vector<PlacementSchema> &output,
34
                               api::Context &ctx) {
35
  AUTO_TRACE(1)
36
  Status result;
28,000✔
37

38
  // NOTE(chogan): Start with local targets and gradually expand the target
39
  // list until the placement succeeds.
40
  for (int i = 0; i < static_cast<int>(TopologyType::kCount); ++i) {
28,000✔
41
    // Reset the output schema
42
    output.clear();
28,000✔
43
    // Get the capacity/bandwidth of targets
44
    std::vector<TargetInfo> targets;
28,000✔
45
    switch (static_cast<TopologyType>(i)) {
28,000✔
46
      case TopologyType::Local: {
28,000✔
47
        targets = mdm_->LocalGetTargetInfo();
56,000✔
48
        break;
28,000✔
49
      }
50
      case TopologyType::Neighborhood: {
51
        // targets = mdm_->GetNeighborhoodTargetInfo();
52
        break;
53
      }
54
      case TopologyType::Global: {
55
        // targets = mdm_->GetGlobalTargetInfo();
56
        break;
57
      }
58
      case TopologyType::kCount: {
59
        HELOG(kFatal, "Not a valid topology type")
60
      }
61
    }
62
    if (targets.size() == 0) {
28,000✔
63
      result = DPE_PLACEMENT_SCHEMA_EMPTY;
×
64
      continue;
×
65
    }
66
    // Calculate a placement schema
67
    result = Placement(blob_sizes, targets, ctx, output);
28,000✔
68
    if (!result.Fail()) {
28,000✔
69
      break;
70
    }
71
  }
72
  return result;
28,000✔
73
}
74

75
}  // namespace hermes
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