From 347294d9f9d35e9baffe37b135fa048cffd311b9 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Fri, 14 Oct 2022 11:55:35 +0200 Subject: [PATCH] register_adhoc_storage: Add missing `type` argument --- examples/c/ADM_cancel_transfer.c | 4 ++-- examples/c/ADM_connect_data_operation.c | 4 ++-- examples/c/ADM_define_data_operation.c | 4 ++-- examples/c/ADM_deploy_adhoc_storage.c | 4 ++-- examples/c/ADM_finalize_data_operation.c | 4 ++-- examples/c/ADM_get_pending_transfers.c | 4 ++-- examples/c/ADM_get_qos_constraints.c | 4 ++-- examples/c/ADM_get_statistics.c | 4 ++-- examples/c/ADM_get_transfer_priority.c | 4 ++-- examples/c/ADM_link_transfer_to_data_operation.c | 4 ++-- examples/c/ADM_register_adhoc_storage.c | 4 ++-- examples/c/ADM_register_job.c | 4 ++-- examples/c/ADM_remove_adhoc_storage.c | 4 ++-- examples/c/ADM_remove_job.c | 4 ++-- examples/c/ADM_set_dataset_information.c | 4 ++-- examples/c/ADM_set_io_resources.c | 4 ++-- examples/c/ADM_set_qos_constraints.c | 4 ++-- examples/c/ADM_set_transfer_priority.c | 4 ++-- examples/c/ADM_transfer_datasets.c | 4 ++-- examples/c/ADM_update_adhoc_storage.c | 4 ++-- examples/c/ADM_update_job.c | 4 ++-- examples/cxx/ADM_register_adhoc_storage.cpp | 5 +++-- examples/cxx/ADM_register_job.cpp | 5 +++-- examples/cxx/ADM_transfer_datasets.cpp | 5 +++-- examples/cxx/ADM_update_job.cpp | 2 +- src/common/net/proto/rpc_types.c | 2 ++ src/common/net/proto/rpc_types.h | 3 +++ src/lib/admire.cpp | 3 ++- src/lib/admire.h | 3 ++- src/lib/admire.hpp | 1 + src/lib/c_wrapper.cpp | 6 +++--- src/lib/detail/impl.cpp | 11 ++++++----- src/lib/detail/impl.hpp | 1 + src/scord/rpc_handlers.cpp | 8 ++++---- 34 files changed, 76 insertions(+), 63 deletions(-) diff --git a/examples/c/ADM_cancel_transfer.c b/examples/c/ADM_cancel_transfer.c index 26dc84d5..9d215cce 100644 --- a/examples/c/ADM_cancel_transfer.c +++ b/examples/c/ADM_cancel_transfer.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_adhoc_storage() remote procedure not " diff --git a/examples/c/ADM_connect_data_operation.c b/examples/c/ADM_connect_data_operation.c index aeb19788..bcdbaa12 100644 --- a/examples/c/ADM_connect_data_operation.c +++ b/examples/c/ADM_connect_data_operation.c @@ -67,8 +67,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_define_data_operation.c b/examples/c/ADM_define_data_operation.c index d4514293..c23257fe 100644 --- a/examples/c/ADM_define_data_operation.c +++ b/examples/c/ADM_define_data_operation.c @@ -72,8 +72,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_deploy_adhoc_storage.c b/examples/c/ADM_deploy_adhoc_storage.c index 52b37bee..810043ce 100644 --- a/examples/c/ADM_deploy_adhoc_storage.c +++ b/examples/c/ADM_deploy_adhoc_storage.c @@ -63,8 +63,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_finalize_data_operation.c b/examples/c/ADM_finalize_data_operation.c index d84fdeaf..a8d653cf 100644 --- a/examples/c/ADM_finalize_data_operation.c +++ b/examples/c/ADM_finalize_data_operation.c @@ -68,8 +68,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_get_pending_transfers.c b/examples/c/ADM_get_pending_transfers.c index 907a1778..e7d2f0d4 100644 --- a/examples/c/ADM_get_pending_transfers.c +++ b/examples/c/ADM_get_pending_transfers.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_get_qos_constraints.c b/examples/c/ADM_get_qos_constraints.c index 93ec70aa..f167aa16 100644 --- a/examples/c/ADM_get_qos_constraints.c +++ b/examples/c/ADM_get_qos_constraints.c @@ -67,8 +67,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_get_statistics.c b/examples/c/ADM_get_statistics.c index 080dedb7..78ce2ee2 100644 --- a/examples/c/ADM_get_statistics.c +++ b/examples/c/ADM_get_statistics.c @@ -67,8 +67,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_get_transfer_priority.c b/examples/c/ADM_get_transfer_priority.c index 211c693a..e3c63942 100644 --- a/examples/c/ADM_get_transfer_priority.c +++ b/examples/c/ADM_get_transfer_priority.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_link_transfer_to_data_operation.c b/examples/c/ADM_link_transfer_to_data_operation.c index 18a353bc..7aec6040 100644 --- a/examples/c/ADM_link_transfer_to_data_operation.c +++ b/examples/c/ADM_link_transfer_to_data_operation.c @@ -68,8 +68,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_register_adhoc_storage.c b/examples/c/ADM_register_adhoc_storage.c index 144f0a71..be126cce 100644 --- a/examples/c/ADM_register_adhoc_storage.c +++ b/examples/c/ADM_register_adhoc_storage.c @@ -63,8 +63,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_register_job.c b/examples/c/ADM_register_job.c index 75a8fd4a..482607d1 100644 --- a/examples/c/ADM_register_job.c +++ b/examples/c/ADM_register_job.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_remove_adhoc_storage.c b/examples/c/ADM_remove_adhoc_storage.c index f35f6acc..1818f555 100644 --- a/examples/c/ADM_remove_adhoc_storage.c +++ b/examples/c/ADM_remove_adhoc_storage.c @@ -63,8 +63,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_remove_job.c b/examples/c/ADM_remove_job.c index 299c85d5..dd0dabcc 100644 --- a/examples/c/ADM_remove_job.c +++ b/examples/c/ADM_remove_job.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_set_dataset_information.c b/examples/c/ADM_set_dataset_information.c index fa4a1042..34c9a5ab 100644 --- a/examples/c/ADM_set_dataset_information.c +++ b/examples/c/ADM_set_dataset_information.c @@ -68,8 +68,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_set_io_resources.c b/examples/c/ADM_set_io_resources.c index 0be040a1..2fd90e6f 100644 --- a/examples/c/ADM_set_io_resources.c +++ b/examples/c/ADM_set_io_resources.c @@ -67,8 +67,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_set_qos_constraints.c b/examples/c/ADM_set_qos_constraints.c index aa665752..58fdb024 100644 --- a/examples/c/ADM_set_qos_constraints.c +++ b/examples/c/ADM_set_qos_constraints.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_set_transfer_priority.c b/examples/c/ADM_set_transfer_priority.c index 22067d1f..eee815a6 100644 --- a/examples/c/ADM_set_transfer_priority.c +++ b/examples/c/ADM_set_transfer_priority.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_transfer_datasets.c b/examples/c/ADM_transfer_datasets.c index 9af25809..19464da5 100644 --- a/examples/c/ADM_transfer_datasets.c +++ b/examples/c/ADM_transfer_datasets.c @@ -74,8 +74,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_update_adhoc_storage.c b/examples/c/ADM_update_adhoc_storage.c index ee3b96d7..7cb64a29 100644 --- a/examples/c/ADM_update_adhoc_storage.c +++ b/examples/c/ADM_update_adhoc_storage.c @@ -63,8 +63,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/c/ADM_update_job.c b/examples/c/ADM_update_job.c index 639727bd..7ee5e5a8 100644 --- a/examples/c/ADM_update_job.c +++ b/examples/c/ADM_update_job.c @@ -71,8 +71,8 @@ main(int argc, char* argv[]) { const char* name = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ADM_return_t ret = - ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage); + ADM_return_t ret = ADM_register_adhoc_storage( + server, name, ADM_STORAGE_GEKKOFS, ctx, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stdout, diff --git a/examples/cxx/ADM_register_adhoc_storage.cpp b/examples/cxx/ADM_register_adhoc_storage.cpp index 3029d619..f877d7f2 100644 --- a/examples/cxx/ADM_register_adhoc_storage.cpp +++ b/examples/cxx/ADM_register_adhoc_storage.cpp @@ -54,8 +54,9 @@ main(int argc, char* argv[]) { admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; try { - const auto adhoc_storage = - admire::register_adhoc_storage(server, name, adhoc_storage_ctx); + const auto adhoc_storage = admire::register_adhoc_storage( + server, name, admire::storage::type::gekkofs, + adhoc_storage_ctx); fmt::print(stdout, "ADM_register_adhoc_storage() remote procedure completed " diff --git a/examples/cxx/ADM_register_job.cpp b/examples/cxx/ADM_register_job.cpp index d757c39e..05f07f5e 100644 --- a/examples/cxx/ADM_register_job.cpp +++ b/examples/cxx/ADM_register_job.cpp @@ -55,8 +55,9 @@ main(int argc, char* argv[]) { try { - const auto adhoc_storage = - admire::register_adhoc_storage(server, name, adhoc_storage_ctx); + const auto adhoc_storage = admire::register_adhoc_storage( + server, name, admire::storage::type::gekkofs, + adhoc_storage_ctx); admire::job_requirements reqs(inputs, outputs, adhoc_storage); diff --git a/examples/cxx/ADM_transfer_datasets.cpp b/examples/cxx/ADM_transfer_datasets.cpp index ff19f803..e74ed350 100644 --- a/examples/cxx/ADM_transfer_datasets.cpp +++ b/examples/cxx/ADM_transfer_datasets.cpp @@ -62,8 +62,9 @@ main(int argc, char* argv[]) { admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; try { - const auto adhoc_storage = - admire::register_adhoc_storage(server, name, adhoc_storage_ctx); + const auto adhoc_storage = admire::register_adhoc_storage( + server, name, admire::storage::type::gekkofs, + adhoc_storage_ctx); admire::job_requirements reqs(inputs, outputs, adhoc_storage); diff --git a/examples/cxx/ADM_update_job.cpp b/examples/cxx/ADM_update_job.cpp index 7df3a8c4..b08f50e1 100644 --- a/examples/cxx/ADM_update_job.cpp +++ b/examples/cxx/ADM_update_job.cpp @@ -48,7 +48,7 @@ main(int argc, char* argv[]) { const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); const auto gkfs_storage = admire::register_adhoc_storage( - server, "foobar", + server, "foobar", admire::storage::type::gekkofs, admire::adhoc_storage::ctx{ admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, diff --git a/src/common/net/proto/rpc_types.c b/src/common/net/proto/rpc_types.c index 6bcbca11..c2df5d57 100644 --- a/src/common/net/proto/rpc_types.c +++ b/src/common/net/proto/rpc_types.c @@ -24,6 +24,8 @@ #include "rpc_types.h" +hg_return_t (*hg_proc_ADM_storage_type_t)(hg_proc_t, + void*) = hg_proc_hg_uint32_t; hg_return_t (*hg_proc_ADM_qos_scope_t)(hg_proc_t, void*) = hg_proc_hg_uint32_t; hg_return_t (*hg_proc_ADM_qos_class_t)(hg_proc_t, void*) = hg_proc_hg_uint32_t; diff --git a/src/common/net/proto/rpc_types.h b/src/common/net/proto/rpc_types.h index 4caa3fc8..2f7e536a 100644 --- a/src/common/net/proto/rpc_types.h +++ b/src/common/net/proto/rpc_types.h @@ -179,6 +179,8 @@ MERCURY_GEN_STRUCT_PROC( ); // clang-format on +extern hg_return_t (*hg_proc_ADM_storage_type_t)(hg_proc_t, void*); + typedef struct adm_storage { const char* s_name; ADM_storage_type_t s_type; @@ -330,6 +332,7 @@ MERCURY_GEN_PROC( MERCURY_GEN_PROC( ADM_register_adhoc_storage_in_t, ((hg_const_string_t) (name)) + ((ADM_storage_type_t) (type)) ((ADM_adhoc_context_t) (ctx)) ); diff --git a/src/lib/admire.cpp b/src/lib/admire.cpp index e3c5dc88..71efcccc 100644 --- a/src/lib/admire.cpp +++ b/src/lib/admire.cpp @@ -235,9 +235,10 @@ remove_job(const server& srv, const job& job) { admire::adhoc_storage register_adhoc_storage(const server& srv, const std::string& name, + enum adhoc_storage::type type, const adhoc_storage::ctx& ctx) { - const auto rv = detail::register_adhoc_storage(srv, name, ctx); + const auto rv = detail::register_adhoc_storage(srv, name, type, ctx); if(!rv) { throw std::runtime_error( diff --git a/src/lib/admire.h b/src/lib/admire.h index a74337a5..3ebb14fd 100644 --- a/src/lib/admire.h +++ b/src/lib/admire.h @@ -90,6 +90,7 @@ ADM_remove_job(ADM_server_t server, ADM_job_t job); * * @param[in] server The server to which the request is directed * @param[in] name The desired name for the adhoc storage system. + * @param[in] type The desired type for the adhoc storage system. * @param[in] ctx The EXECUTION_CONTEXT for the adhoc storage system. * @param[out] adhoc_storage An ADM_STORAGE referring to the newly-created * adhoc storage instance. @@ -98,7 +99,7 @@ ADM_remove_job(ADM_server_t server, ADM_job_t job); */ ADM_return_t ADM_register_adhoc_storage(ADM_server_t server, const char* name, - ADM_adhoc_context_t ctx, + ADM_storage_type_t type, ADM_adhoc_context_t ctx, ADM_storage_t* adhoc_storage); /** diff --git a/src/lib/admire.hpp b/src/lib/admire.hpp index a26848b1..d3e27224 100644 --- a/src/lib/admire.hpp +++ b/src/lib/admire.hpp @@ -60,6 +60,7 @@ remove_job(const server& srv, const job& job); admire::adhoc_storage register_adhoc_storage(const server& srv, const std::string& name, + enum adhoc_storage::type type, const adhoc_storage::ctx& ctx); ADM_return_t diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index 9100970c..0bd3e7f6 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -82,14 +82,14 @@ ADM_remove_job(ADM_server_t server, ADM_job_t job) { ADM_return_t ADM_register_adhoc_storage(ADM_server_t server, const char* name, - ADM_adhoc_context_t ctx, + ADM_storage_type_t type, ADM_adhoc_context_t ctx, ADM_storage_t* adhoc_storage) { const admire::server srv{server}; + const auto cxx_type = static_cast(type); const auto rv = admire::detail::register_adhoc_storage( - srv, name, admire::adhoc_storage::ctx{ctx}); - + srv, name, cxx_type, admire::adhoc_storage::ctx{ctx}); if(!rv) { return rv.error(); diff --git a/src/lib/detail/impl.cpp b/src/lib/detail/impl.cpp index 96a637f3..770db97f 100644 --- a/src/lib/detail/impl.cpp +++ b/src/lib/detail/impl.cpp @@ -316,6 +316,7 @@ remove_job(const server& srv, const job& job) { tl::expected register_adhoc_storage(const server& srv, const std::string& name, + enum adhoc_storage::type type, const adhoc_storage::ctx& ctx) { scord::network::rpc_client rpc_client{srv.protocol(), rpc_registration_cb}; @@ -324,14 +325,15 @@ register_adhoc_storage(const server& srv, const std::string& name, auto endp = rpc_client.lookup(srv.address()); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{name: {}, adhoc_ctx: {}}}", + "body: {{name: {}, type: {}, adhoc_ctx: {}}}", rpc_id, std::quoted("ADM_"s + __FUNCTION__), - std::quoted(rpc_client.self_address()), name, ctx); + std::quoted(rpc_client.self_address()), name, type, ctx); const auto rpc_name = name.c_str(); + const auto rpc_type = static_cast(type); const auto rpc_ctx = api::convert(ctx); - ADM_register_adhoc_storage_in_t in{rpc_name, rpc_ctx.get()}; + ADM_register_adhoc_storage_in_t in{rpc_name, rpc_type, rpc_ctx.get()}; ADM_register_adhoc_storage_out_t out; const auto rpc = endp.call("ADM_register_adhoc_storage", &in, &out); @@ -345,8 +347,7 @@ register_adhoc_storage(const server& srv, const std::string& name, return tl::make_unexpected(retval); } - auto rpc_adhoc_storage = admire::adhoc_storage{ - admire::storage::type::gekkofs, name, out.id, ctx}; + auto rpc_adhoc_storage = admire::adhoc_storage{type, name, out.id, ctx}; LOGGER_INFO("rpc id: {} name: {} from: {} <= " "body: {{retval: {}, id: {}}} [op_id: {}]", diff --git a/src/lib/detail/impl.hpp b/src/lib/detail/impl.hpp index 4580914f..4c709294 100644 --- a/src/lib/detail/impl.hpp +++ b/src/lib/detail/impl.hpp @@ -54,6 +54,7 @@ transfer_datasets(const server& srv, const job& job, tl::expected register_adhoc_storage(const server& srv, const std::string& name, + enum adhoc_storage::type type, const adhoc_storage::ctx& ctx); } // namespace admire::detail diff --git a/src/scord/rpc_handlers.cpp b/src/scord/rpc_handlers.cpp index 1a672de9..2c65181f 100644 --- a/src/scord/rpc_handlers.cpp +++ b/src/scord/rpc_handlers.cpp @@ -236,16 +236,16 @@ ADM_register_adhoc_storage(hg_handle_t h) { assert(ret == HG_SUCCESS); const std::string name(in.name); + const auto type = static_cast(in.type); const admire::adhoc_storage::ctx ctx(in.ctx); const auto rpc_id = remote_procedure::new_id(); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{name: {}, adhoc_ctx: {}}}", + "body: {{name: {}, type: {}, adhoc_ctx: {}}}", rpc_id, std::quoted(__FUNCTION__), std::quoted(get_address(h)), - name, ctx); + name, type, ctx); - const auto adhoc_storage = adhoc_storage_manager::create( - admire::adhoc_storage::type::gekkofs, name, ctx); + const auto adhoc_storage = adhoc_storage_manager::create(type, name, ctx); admire::error_code rv = ADM_SUCCESS; -- GitLab