Commit 924e62f1 authored by Ramon Nou's avatar Ramon Nou
Browse files

Updated transfer_update test, spdlog linking, fmt nspace

parent 1fbeabe5
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ list(APPEND c_examples_without_controller

add_library(c_examples_common STATIC)
target_sources(c_examples_common PUBLIC common.h PRIVATE common.c)
target_link_libraries(c_examples_common libscord_c_types)
target_link_libraries(c_examples_common libscord_c_types spdlog::spdlog fmt::fmt)

foreach(example IN LISTS c_examples_with_controller c_examples_without_controller)
  add_executable(${example}_c)
+11 −5
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ main(int argc, char* argv[]) {
            .name = TESTNAME,
            .requires_server = true,
            .requires_controller = true,
            .requires_data_stager = true,
    };

    const auto cli_args = process_args(argc, argv, test_info);
@@ -49,8 +50,10 @@ main(int argc, char* argv[]) {

    const auto job_nodes = prepare_nodes(NJOB_NODES);
    const auto adhoc_nodes = prepare_nodes(NADHOC_NODES);
    const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS);
    const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS);
    const auto inputs = prepare_routes("{}-input-dataset-{}", NINPUTS);
    const auto outputs = prepare_routes("{}-output-dataset-{}", NOUTPUTS);
    const auto expected_outputs =
            prepare_routes("{}-exp-output-dataset-{}", NEXPOUTPUTS);

    const auto sources = prepare_datasets("source-dataset-{}", NSOURCES);
    const auto targets = prepare_datasets("target-dataset-{}", NTARGETS);
@@ -60,8 +63,11 @@ main(int argc, char* argv[]) {
    std::string name = "adhoc_storage_42";
    const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{
            cli_args.controller_address,
            cli_args.data_stager_address,
            scord::adhoc_storage::execution_mode::separate_new,
            scord::adhoc_storage::access_type::read_write, 100, false};
            scord::adhoc_storage::access_type::read_write,
            100,
            false};
    const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes};

    try {
@@ -69,14 +75,14 @@ main(int argc, char* argv[]) {
                server, name, scord::adhoc_storage::type::gekkofs,
                adhoc_storage_ctx, adhoc_resources);

        scord::job::requirements reqs(inputs, outputs, adhoc_storage);
        scord::job::requirements reqs(inputs, outputs, expected_outputs,
                                      adhoc_storage);

        const auto job = scord::register_job(
                server, scord::job::resources{job_nodes}, reqs, 0);
        const auto transfer = scord::transfer_datasets(
                server, job, sources, targets, qos_limits, mapping);


        scord::transfer_update(server, transfer.id(), 10.0f);
        fmt::print(stdout, "ADM_transfer_update() remote procedure completed "
                           "successfully\n");
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ foreach(example IN LISTS cxx_examples_with_controller cxx_examples_without_contr
  add_executable(${example}_cxx)
  target_sources(${example}_cxx PRIVATE ${example}.cpp)
  target_link_libraries(${example}_cxx
    PUBLIC fmt::fmt libscord cxx_examples_common)
    PUBLIC fmt::fmt spdlog::spdlog libscord cxx_examples_common)
  set_target_properties(${example}_cxx PROPERTIES OUTPUT_NAME ${example})
endforeach()

+3 −3
Original line number Diff line number Diff line
@@ -122,12 +122,12 @@ struct fmt::formatter<network::rpc_info> {
    template <typename FormatContext>
    auto
    format(const network::rpc_info& rpc, FormatContext& ctx) const -> format_context::iterator {
        format_to(ctx.out(), "{}{} id: {} name: {:?} ", m_outbound ? "<=" : "=>",
        fmt::format_to(ctx.out(), "{}{} id: {} name: {:?} ", m_outbound ? "<=" : "=>",
                  rpc.pid() ? fmt::format(" pid: {}", *rpc.pid()) : "",
                  rpc.id(), rpc.name());
        return m_outbound ? format_to(ctx.out(), "to: {:?}",
        return m_outbound ? fmt::format_to(ctx.out(), "to: {:?}",
                                      rpc.address())
                          : format_to(ctx.out(), "from: {:?}",
                          : fmt::format_to(ctx.out(), "from: {:?}",
                                      rpc.address());
    }
};
+3 −3
Original line number Diff line number Diff line
@@ -725,7 +725,7 @@ struct fmt::formatter<scord::job_info> : formatter<std::string_view> {
    template <typename FormatContext>
    auto
    format(const scord::job_info& ji, FormatContext& ctx) const -> format_context::iterator {
        return format_to(ctx.out(), "{{adhoc_controller: {}, io_procs: {}}}",
        return fmt::format_to(ctx.out(), "{{adhoc_controller: {}, io_procs: {}}}",
                         ji.adhoc_controller_address(), ji.io_procs());
    }
};
@@ -923,7 +923,7 @@ struct fmt::formatter<enum scord::adhoc_storage::type> {
                break;
        }

        return format_to(ctx.out(), "{}", name);
        return fmt::format_to(ctx.out(), "{}", name);
    }
};

@@ -994,7 +994,7 @@ struct fmt::formatter<scord::adhoc_storage::ctx> : formatter<std::string_view> {
    template <typename FormatContext>
    auto
    format(const scord::adhoc_storage::ctx& c, FormatContext& ctx) const -> format_context::iterator {
        return format_to(
        return fmt::format_to(
                ctx.out(),
                "{{controller: {:?}, data_stager: {:?}, execution_mode: {}, "
                "access_type: {}, walltime: {}, should_flush: {}}}",
Loading