Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
minimize_io_time.h
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 #ifndef HERMES_SRC_DPE_MINIMIZE_IO_TIME_H_
14 #define HERMES_SRC_DPE_MINIMIZE_IO_TIME_H_
15 
16 #include "data_placement_engine.h"
17 
18 namespace hermes {
22 class MinimizeIoTime : public DPE {
23  private:
24  std::vector<double> placement_ratios_;
26  public:
27  MinimizeIoTime() : DPE(PlacementPolicy::kMinimizeIoTime) {}
28  ~MinimizeIoTime() = default;
29  Status Placement(const std::vector<size_t> &blob_sizes,
30  const std::vector<u64> &node_state,
31  const std::vector<TargetID> &targets,
32  const api::Context &ctx,
33  std::vector<PlacementSchema> &output);
34 
35  private:
37  size_t AbsDiff(size_t x, size_t y, bool &y_gt_x);
39  void PlaceBytes(size_t j, ssize_t bytes, std::vector<size_t> &vars_bytes,
40  const std::vector<u64> &node_state);
42  void GetPlacementRatios(const std::vector<u64> &node_state,
43  const api::Context &ctx);
44 };
45 
46 } // namespace hermes
47 
48 #endif // HERMES_SRC_DPE_MINIMIZE_IO_TIME_H_
Definition: hermes_status.h:80
Definition: data_placement_engine.h:35
Definition: minimize_io_time.h:22
Status Placement(const std::vector< size_t > &blob_sizes, const std::vector< u64 > &node_state, const std::vector< TargetID > &targets, const api::Context &ctx, std::vector< PlacementSchema > &output)
Definition: minimize_io_time.cc:21
void PlaceBytes(size_t j, ssize_t bytes, std::vector< size_t > &vars_bytes, const std::vector< u64 > &node_state)
Definition: minimize_io_time.cc:135
size_t AbsDiff(size_t x, size_t y, bool &y_gt_x)
void GetPlacementRatios(const std::vector< u64 > &node_state, const api::Context &ctx)
Definition: minimize_io_time.cc:159
std::vector< double > placement_ratios_
Definition: minimize_io_time.h:24
Definition: adapter_utils.cc:35
Definition: hermes_types.h:137