Commit ff48d7e6 authored by David Auer's avatar David Auer
Browse files

Compile random slicing

parent b8ab2d5b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -195,6 +195,13 @@ set_target_properties(spdlog
    INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/external"
    )

add_library(flat_segment_tree INTERFACE)
# we cannot use target_include_directories with CMake < 3.11
set_target_properties(flat_segment_tree
    PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/external"
    )

add_subdirectory(external/fmt)
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)

+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@

namespace gkfs::relocation {

void
calculate_random_slicing();

std::vector<std::pair<std::string, std::string>>
read_hosts_file();

+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ set(DAEMON_LINK_LIBRARIES
    hostsfile_util
    spdlog
    fmt::fmt
    random_slicing
    # margo libs
    ${ABT_LIBRARIES}
    mercury
+4 −0
Original line number Diff line number Diff line
@@ -462,6 +462,10 @@ parse_input(const po::variables_map& vm) {

    if(gkfs::config::dynamic_placement && vm.count("start-relocation")) {
        cout << "Starting relocation...\n";

        // TODO just testing at the moment
        gkfs::relocation::calculate_random_slicing();

        gkfs::relocation::do_relocation();
        // Don't create any directories and no interest in the other options
        exit(0);
+13 −0
Original line number Diff line number Diff line
@@ -19,10 +19,12 @@
#include <daemon/handler/rpc_util.hpp>
#include <global/hostsfile_util.hpp>
#include <global/hostsfile_util.hpp>
#include <global/random_slicing/DistRandSlice.hpp>
#include <global/rpc/rpc_types.hpp>

#include <cassert>
#include <iostream>
#include <list>

#include <fmt/format.h>

@@ -35,6 +37,17 @@ using namespace std;

namespace gkfs::relocation {

void
calculate_random_slicing() {
    VDRIVE::DistRandSlice dist(true, true);

    VDRIVE::Disk d0(0, 1, nullptr);

    list<VDRIVE::Disk*> disks = {&d0};

    dist.setConfiguration(&disks, 1, 1);
}

vector<pair<string, string>>
read_hosts_file() {
    string hostfile = GKFS_DATA->hosts_file();
Loading