Commit c47cd466 authored by Ramon Nou's avatar Ramon Nou
Browse files

Adding period

parent 4a84a83c
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ struct ftio_config {
    std::string server_address;
    float confidence;
    float probability;
    float period;
};

ftio_config
@@ -57,6 +58,10 @@ parse_command_line(int argc, char* argv[]) {
            ->option_text("float")
            ->default_str("-1.0");

    app.add_option("-t,--period", cfg.period, "period")
            ->option_text("float")
            ->required();


    try {
        app.parse(argc, argv);
@@ -89,7 +94,7 @@ main(int argc, char* argv[]) {

        if(const auto result = rpc_client.lookup(address); result.has_value()) {
            const auto& endpoint = result.value();
            const auto retval = endpoint.call("ftio_int", cfg.confidence, cfg.probability);
            const auto retval = endpoint.call("ftio_int", cfg.confidence, cfg.probability, cfg.period);

            if(retval.has_value()) {

+11 −10
Original line number Diff line number Diff line
@@ -185,10 +185,10 @@ master_server::ftio_scheduling_ult() {


        // Do something with the confidence and probability
        if (ftio_changed) {
            ftio_changed = false;
        LOGGER_INFO("Confidence is {}, probability is {}", confidence,
                    probability);
        if (m_ftio_changed) {
            m_ftio_changed = false;
        LOGGER_INFO("Confidence is {}, probability is {} and period is {}", m_confidence,
                    m_probability, m_period);
        }
    }

@@ -452,18 +452,19 @@ master_server::transfer_statuses(const network::request& req,

void
master_server::ftio_int(const network::request& req, float conf,
                        float prob) {
                        float prob, float period) {
    using network::get_address;
    using network::rpc_info;
    using proto::generic_response;
    mpi::communicator world;
    const auto rpc = rpc_info::create(RPC_NAME(), get_address(req));

    confidence = conf;
    probability = prob;
    ftio_changed = true;
    LOGGER_INFO("rpc {:>} body: {{confidence: {}, probability: {}}}", rpc,
                conf, prob);
    m_confidence = conf;
    m_probability = prob;
    m_period = period;
    m_ftio_changed = true;
    LOGGER_INFO("rpc {:>} body: {{confidence: {}, probability: {}, period: {}}}", rpc,
                conf, prob, period);

    // do the magic here

+5 −4
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ private:


    void 
    ftio_int(const network::request& req, float confidence, float probability);
    ftio_int(const network::request& req, float confidence, float probability, float period);

private:
    // Dedicated execution stream for the MPI listener ULT
@@ -83,9 +83,10 @@ private:
    // ULT for the ftio scheduler
    thallium::managed<thallium::thread> m_ftio_listener_ult;
    // FTIO decision values (below 0, implies not used)
    float confidence = -1.0f;
    float probability = -1.0f;
    bool ftio_changed = true;
    float m_confidence = -1.0f;
    float m_probability = -1.0f;
    float m_period = -1.0f;
    bool m_ftio_changed = true;
    // Request manager
    request_manager m_request_manager;
};