Skip to content

Developer's Guide

H. Joe Lee edited this page Jul 26, 2022 · 20 revisions

Changing Catch2 Version

Update ci/install_deps.sh, test/catch_config.h, and adapter/test/catch_config.h. See this pull request for an example.

Adding a New Test

API Test

Update test/CMakeLists.txt with your new .cc test code name. For example, if you add trait_order.cc, add trait_order as follows:

set(API_TESTS dpe_optimization_test dpe_random_test
    dpe_roundrobin_test end_to_end_test vbucket_test trait_order)

Debugging Test Code

First, make sure that you build testing codes with Debug option.

cmake .. -DCMAKE_BUILD_TYPE=Debug

Insert LOG(INFO) << "debug message for var=" << var; or use std::cerr << "temporary debug message" <<std::endl;. Then, run a specific test to debug.

ctest --verbose -I 13,13

Adding a New Adapter

  1. Create a new directory under the adapter directory.

Customizing Data Placement Engine

Data Placement Engine (DPE) is the heart of Hermes performance. Developers may want to replace the default engine using different optimization algorithms.

Codes for Testing DPE

You can quickly check how DPE is tested.

Codes for Calling Problem Solver

This is the code that you need to modify.

If you look at the line 206 Status result; in MinimizeIoTimePlacement(), the default value of result is always HERMES_SUCCESS as defined in src/hermes_status.h.

The goal is to assemble placement schema for BLOBs.

for (size_t i {0}; i < num_blobs; ++i) {
    PlacementSchema schema;
    // schema will have results from your problem solver.
    output.push_back(schema);
  }

Total Constraints

The -1 is for Placement Ratio constraint, which iterates 1 less than num_targets.

  const size_t total_constraints =
      num_blobs + (num_targets * constraints_per_target) - 1; 

Steps for Replacing OR-Tools-based Problem Solver

  1. Replace the header file #include "ortools/linear_solver/linear_solver.h".
  2. Update CMakeLists.txt files to remove gortools dependendency.
Clone this wiki locally