Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
utils.h File Reference
#include <assert.h>
#include <chrono>
#include <map>
#include "hermes_types.h"
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hermes::testing::TargetViewState
 

Namespaces

 hermes
 

Macros

#define HERMES_BEGIN_TIMED_BLOCK(func_name)
 
#define HERMES_END_TIMED_BLOCK()
 

Enumerations

enum class  hermes::testing::BlobSizeRange {
  kSmall , kMedium , kLarge , kXLarge ,
  kHuge
}
 

Functions

size_t hermes::RoundUpToMultiple (size_t val, size_t multiple)
 
size_t hermes::RoundDownToMultiple (size_t val, size_t multiple)
 
void hermes::InitDefaultConfig (Config *config)
 
void hermes::FailedLibraryCall (std::string func)
 
TargetViewState hermes::testing::InitDeviceState (u64 total_target, bool homo_dist)
 
u64 hermes::testing::UpdateDeviceState (PlacementSchema &schema, TargetViewState &node_state)
 
void hermes::testing::PrintNodeState (TargetViewState &node_state)
 
std::vector< TargetID > hermes::testing::GetDefaultTargets (size_t n)
 
std::vector< size_t > hermes::testing::GenFixedTotalBlobSize (size_t total_size, BlobSizeRange range)
 

Detailed Description

Utility classes and functions for Hermes.

Macro Definition Documentation

◆ HERMES_BEGIN_TIMED_BLOCK

#define HERMES_BEGIN_TIMED_BLOCK (   func_name)

begin timing

◆ HERMES_END_TIMED_BLOCK

#define HERMES_END_TIMED_BLOCK ( )

end timing

Enumeration Type Documentation

◆ BlobSizeRange

A class to represent BLOB size

Function Documentation

◆ InitDeviceState()

TargetViewState hermes::testing::InitDeviceState ( u64  total_target = 4,
bool  homo_dist = true 
)

Initialize device state with default values.

Parameters
total_targetTotal number of target.
homo_distThe device distribution is homogeneous or not.
Returns
The TargetViewState struct with device information.

Use Megabytes

Use Megabytes/Sec

< MB

< MB

◆ UpdateDeviceState()

u64 hermes::testing::UpdateDeviceState ( PlacementSchema schema,
TargetViewState node_state 
)

Update device state.

Parameters
schemaThe PlacementSchema return from a data placement engine calculation.
node_stateThe device status after schema is placed.
Returns
Total size of placed blobs.

◆ PrintNodeState()

void hermes::testing::PrintNodeState ( TargetViewState node_state)

Print device state.

Parameters
node_stateThe TargetViewState with current state.

< MB

◆ GetDefaultTargets()

std::vector< TargetID > hermes::testing::GetDefaultTargets ( size_t  n)

Get default targets.

Parameters
nThe number of target type.

@

Returns
The vector of default targets.

◆ GenFixedTotalBlobSize()

std::vector< size_t > hermes::testing::GenFixedTotalBlobSize ( size_t  total_size,
BlobSizeRange  range 
)

Generate a vector of blob size with fixed total blob size.

Parameters
total_sizeThe number of target type.
rangeThe blob size range for test.

@

Returns
The vector blob size.