Verified Commit 102f5efc authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Rename ADM_set_qos_constraints_pull() to ADM_get_qos_constraints()

parent d3a66fd2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ main(int argc, char* argv[]) {
        fmt::print(stderr, "ERROR: no location provided\n");
        fmt::print(
                stderr,
                "Usage: ADM_set_qos_constraints_pull <REMOTE_IP> <SCOPE> <ELEMENT_ID>\n");
                "Usage: ADM_get_qos_constraints <REMOTE_IP> <SCOPE> <ELEMENT_ID>\n");
        exit(EXIT_FAILURE);
    }

@@ -20,9 +20,9 @@ main(int argc, char* argv[]) {

    fmt::print(
            stdout,
            "Calling ADM_set_qos_constraints_pull remote procedure on {} with scope {} and element id {} ...\n",
            "Calling ADM_get_qos_constraints remote procedure on {} with scope {} and element id {} ...\n",
            argv[1], argv[2], argv[3]);
    ADM_set_qos_constraints_pull_in_t in;
    ADM_get_qos_constraints_in_t in;
    in.scope = argv[2];
    try {
        in.element_id = std::stoi(argv[3]);
@@ -31,18 +31,18 @@ main(int argc, char* argv[]) {
        exit(EXIT_FAILURE);
    }

    ADM_set_qos_constraints_pull_out_t out;
    ADM_get_qos_constraints_out_t out;

    endp.call("ADM_set_qos_constraints_pull", &in, &out);
    endp.call("ADM_get_qos_constraints", &in, &out);

    if(out.ret < 0) {
        fmt::print(
                stderr,
                "ADM_set_qos_constraints_pull remote procedure not completed successfully\n");
                "ADM_get_qos_constraints remote procedure not completed successfully\n");
        exit(EXIT_FAILURE);
    } else {
        fmt::print(
                stdout,
                "ADM_set_qos_constraints_pull remote procedure completed successfully\n");
                "ADM_get_qos_constraints remote procedure completed successfully\n");
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ list(APPEND examples
            ADM_in_situ_ops ADM_in_transit_ops ADM_transfer_dataset
            ADM_set_dataset_information ADM_set_io_resources ADM_get_transfer_priority
            ADM_set_transfer_priority ADM_cancel_transfer ADM_get_pending_transfers
            ADM_set_qos_constraints ADM_define_data_operation ADM_connect_data_operation
            ADM_set_qos_constraints ADM_get_qos_constraints ADM_define_data_operation ADM_connect_data_operation
            ADM_finalize_data_operation ADM_link_transfer_to_data_operation ADM_get_statistics)

foreach (example IN LISTS examples)
+4 −4
Original line number Diff line number Diff line
@@ -198,10 +198,10 @@ struct engine {
                     true);

        REGISTER_RPC(m_context->m_mid, m_context->m_rpc_names,
                     "ADM_set_qos_constraints_pull",
                     ADM_set_qos_constraints_pull_in_t,
                     ADM_set_qos_constraints_pull_out_t,
                     ADM_set_qos_constraints_pull, true);
                     "ADM_get_qos_constraints",
                     ADM_get_qos_constraints_in_t,
                     ADM_get_qos_constraints_out_t,
                     ADM_get_qos_constraints, true);

        REGISTER_RPC(m_context->m_mid, m_context->m_rpc_names,
                     "ADM_define_data_operation",
+9 −9
Original line number Diff line number Diff line
@@ -1024,11 +1024,11 @@ DEFINE_MARGO_RPC_HANDLER(ADM_set_qos_constraints)
 * successfully or not.
 */
static void
ADM_set_qos_constraints_pull(hg_handle_t h) {
ADM_get_qos_constraints(hg_handle_t h) {
    hg_return_t ret;

    ADM_set_qos_constraints_pull_in_t in;
    ADM_set_qos_constraints_pull_out_t out;
    ADM_get_qos_constraints_in_t in;
    ADM_get_qos_constraints_out_t out;

    margo_instance_id mid = margo_hg_handle_get_instance(h);

@@ -1041,22 +1041,22 @@ ADM_set_qos_constraints_pull(hg_handle_t h) {
    out.list = nullptr;

    if(in.scope == nullptr) {
        LOGGER_ERROR("ADM_set_qos_constraints_pull(): invalid scope (nullptr)");
        LOGGER_ERROR("ADM_get_qos_constraints(): invalid scope (nullptr)");
    } else if(in.element_id < 0) {
        LOGGER_ERROR(
                "ADM_set_qos_constraints_pull(): invalid element_id (< 0)");
                "ADM_get_qos_constraints(): invalid element_id (< 0)");
    } else {
        LOGGER_INFO("ADM_set_qos_constraints_pull({}, {})", in.scope,
        LOGGER_INFO("ADM_get_qos_constraints({}, {})", in.scope,
                    in.element_id);
        if((scp == "dataset") || (scp == "node") || (scp == "job")) {
            LOGGER_INFO(
                    "ADM_set_qos_constraints_pull scope value is acceptable ({})",
                    "ADM_get_qos_constraints scope value is acceptable ({})",
                    in.scope);
            out.ret = 0;
            out.list = "list";
        } else {
            LOGGER_ERROR(
                    "ADM_set_qos_constraints_pull scope value is not valid. Please use: dataset, node or job ");
                    "ADM_get_qos_constraints scope value is not valid. Please use: dataset, node or job ");
        }
    }

@@ -1071,7 +1071,7 @@ ADM_set_qos_constraints_pull(hg_handle_t h) {
    assert(ret == HG_SUCCESS);
}

DEFINE_MARGO_RPC_HANDLER(ADM_set_qos_constraints_pull)
DEFINE_MARGO_RPC_HANDLER(ADM_get_qos_constraints)

/**
 * Defines a new operation, with the code found in path. The code will be
+4 −4
Original line number Diff line number Diff line
@@ -224,15 +224,15 @@ MERCURY_GEN_PROC(ADM_set_qos_constraints_out_t,

DECLARE_MARGO_RPC_HANDLER(ADM_set_qos_constraints);

/// ADM_set_qos_constraints_pull
/// ADM_get_qos_constraints

MERCURY_GEN_PROC(ADM_set_qos_constraints_pull_in_t,
MERCURY_GEN_PROC(ADM_get_qos_constraints_in_t,
                 ((hg_const_string_t) (scope))((int32_t) (element_id)))

MERCURY_GEN_PROC(ADM_set_qos_constraints_pull_out_t,
MERCURY_GEN_PROC(ADM_get_qos_constraints_out_t,
                 ((int32_t) (ret))((hg_const_string_t) (list)))

DECLARE_MARGO_RPC_HANDLER(ADM_set_qos_constraints_pull);
DECLARE_MARGO_RPC_HANDLER(ADM_get_qos_constraints);

/// ADM_define_data_operation