Unverified Commit 3da0baa0 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Clients load hosts from file

parent e3e545e2
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include <spdlog/spdlog.h>
#include <map>
#include <mercury.h>
#include <memory>
#include <vector>
#include <string>
@@ -38,13 +39,6 @@ struct FsConfig {

    std::string rootdir;

    // rpc infos
    std::map<uint64_t, std::string> hosts;
    std::map<std::string, std::string> endpoints;
    uint64_t host_id; // my host number
    size_t host_size;
    unsigned int rpc_port;
    std::string lookup_file;
};

enum class RelativizeStatus {
@@ -66,7 +60,10 @@ class PreloadContext {
    std::string cwd_;
    std::vector<std::string> mountdir_components_;
    std::string mountdir_;
    std::string daemon_addr_str_;

    std::vector<hg_addr_t> hosts_;
    uint64_t local_host_id_;

    bool interception_enabled_;

    public:
@@ -85,12 +82,15 @@ class PreloadContext {
    const std::string& mountdir() const;
    const std::vector<std::string>& mountdir_components() const;

    void daemon_addr_str(const std::string& path);
    const std::string& daemon_addr_str() const;

    void cwd(const std::string& path);
    const std::string& cwd() const;

    const std::vector<hg_addr_t>& hosts() const;
    void hosts(const std::vector<hg_addr_t>& addrs);

    uint64_t local_host_id() const;
    void local_host_id(uint64_t id);

    RelativizeStatus relativize_fd_path(int dirfd,
                                        const char * raw_path,
                                        std::string& relative_path,
+2 −5
Original line number Diff line number Diff line
@@ -65,18 +65,15 @@ extern hg_id_t rpc_mk_symlink_id;

int metadata_to_stat(const std::string& path, const Metadata& md, struct stat& attr);

int get_daemon_pid();

std::map<std::string, std::string> load_lookup_file(const std::string& lfpath);
std::vector<std::pair<std::string, std::string>> load_hosts_file(const std::string& lfpath);

hg_addr_t get_local_addr();

void load_hosts();
bool lookup_all_hosts();

void cleanup_addresses();

bool get_addr_by_hostid(uint64_t hostid, hg_addr_t& svr_addr);

hg_return margo_create_wrap_helper(const hg_id_t rpc_id, uint64_t recipient,
                                   hg_handle_t& handle);

+0 −4
Original line number Diff line number Diff line
@@ -40,10 +40,6 @@ void init_rpc_server(const std::string& protocol);

void register_server_rpcs(margo_instance_id mid);

void register_daemon_proc();

bool deregister_daemon_proc();

void populate_lookup_file();
void destroy_lookup_file();

+0 −3
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@
#define RPC_PROTOCOL "@RPC_PROTOCOL@"
#cmakedefine01 USE_SHM

// Daemon path to auxiliary files
#define DAEMON_AUX_PATH "/tmp"

#define CHUNKSIZE 524288 // in bytes 512KB

// What metadata is used

include/global/global_func.hpp

deleted100644 → 0
+0 −22
Original line number Diff line number Diff line
/*
  Copyright 2018-2019, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2019, Johannes Gutenberg Universitaet Mainz, Germany

  This software was partially supported by the
  EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).

  This software was partially supported by the
  ADA-FS project under the SPPEXA project funded by the DFG.

  SPDX-License-Identifier: MIT
*/

#ifndef IFS_GLOBAL_FUNC_HPP
#define IFS_GLOBAL_FUNC_HPP

#include <string>
#include <global/configure.hpp>

std::string daemon_pid_path();

#endif //IFS_GLOBAL_FUNC_HPP
Loading