diff --git a/examples/c/ADM_deploy_adhoc_storage.c b/examples/c/ADM_deploy_adhoc_storage.c index a882a80ed83fac90f6888724556544ddc3d0af98..37fb1e4e7f9c5f72b122a0b49036aec1920ddfd3 100644 --- a/examples/c/ADM_deploy_adhoc_storage.c +++ b/examples/c/ADM_deploy_adhoc_storage.c @@ -28,7 +28,6 @@ #include #include "common.h" -#define NJOB_NODES 50 #define NADHOC_NODES 25 #define NINPUTS 10 #define NOUTPUTS 5 @@ -45,9 +44,6 @@ main(int argc, char* argv[]) { int exit_status = EXIT_SUCCESS; ADM_server_t server = ADM_server_create("tcp", argv[1]); - ADM_job_t job; - ADM_node_t* job_nodes = prepare_nodes(NJOB_NODES); - assert(job_nodes); ADM_node_t* adhoc_nodes = prepare_nodes(NADHOC_NODES); assert(adhoc_nodes); ADM_dataset_t* inputs = prepare_datasets("input-dataset-%d", NINPUTS); @@ -55,10 +51,6 @@ main(int argc, char* argv[]) { ADM_dataset_t* outputs = prepare_datasets("output-dataset-%d", NOUTPUTS); assert(outputs); - ADM_job_resources_t job_resources = - ADM_job_resources_create(job_nodes, NJOB_NODES); - assert(job_resources); - ADM_adhoc_resources_t adhoc_resources = ADM_adhoc_resources_create(adhoc_nodes, NADHOC_NODES); assert(adhoc_resources); @@ -75,18 +67,11 @@ main(int argc, char* argv[]) { ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); - - if(ret != ADM_SUCCESS) { - fprintf(stdout, "ADM_register_job() remote procedure not completed " - "successfully\n"); - exit_status = EXIT_FAILURE; - } - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ret = ADM_register_adhoc_storage(server, job, user_id, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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 e6b7865e6a41d2fabe2549853564435c935a2aca..9b859d4e422ac3b8c8faeeb4e0d764fc872b34d8 100644 --- a/examples/c/ADM_register_adhoc_storage.c +++ b/examples/c/ADM_register_adhoc_storage.c @@ -29,7 +29,6 @@ #include "common.h" #define NADHOC_NODES 25 -#define NJOB_NODES 50 #define NINPUTS 10 #define NOUTPUTS 5 @@ -45,9 +44,6 @@ main(int argc, char* argv[]) { int exit_status = EXIT_SUCCESS; ADM_server_t server = ADM_server_create("tcp", argv[1]); - ADM_job_t job; - ADM_node_t* job_nodes = prepare_nodes(NJOB_NODES); - assert(job_nodes); ADM_node_t* adhoc_nodes = prepare_nodes(NADHOC_NODES); assert(adhoc_nodes); ADM_dataset_t* inputs = prepare_datasets("input-dataset-%d", NINPUTS); @@ -55,10 +51,6 @@ main(int argc, char* argv[]) { ADM_dataset_t* outputs = prepare_datasets("output-dataset-%d", NOUTPUTS); assert(outputs); - ADM_job_resources_t job_resources = - ADM_job_resources_create(job_nodes, NJOB_NODES); - assert(job_resources); - ADM_adhoc_resources_t adhoc_resources = ADM_adhoc_resources_create(adhoc_nodes, NADHOC_NODES); assert(adhoc_resources); @@ -75,18 +67,11 @@ main(int argc, char* argv[]) { ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); - - if(ret != ADM_SUCCESS) { - fprintf(stdout, "ADM_register_job() remote procedure not completed " - "successfully\n"); - exit_status = EXIT_FAILURE; - } - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ret = ADM_register_adhoc_storage(server, job, user_id, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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 95826ebd7e6d1c944df52ac30beacfc2eaded741..45422b93fe46746f49be6d6890ebff53cd5987fc 100644 --- a/examples/c/ADM_remove_adhoc_storage.c +++ b/examples/c/ADM_remove_adhoc_storage.c @@ -28,7 +28,6 @@ #include #include "common.h" -#define NJOB_NODES 50 #define NADHOC_NODES 25 #define NINPUTS 10 #define NOUTPUTS 5 @@ -45,9 +44,6 @@ main(int argc, char* argv[]) { int exit_status = EXIT_SUCCESS; ADM_server_t server = ADM_server_create("tcp", argv[1]); - ADM_job_t job; - ADM_node_t* job_nodes = prepare_nodes(NJOB_NODES); - assert(job_nodes); ADM_node_t* adhoc_nodes = prepare_nodes(NADHOC_NODES); assert(adhoc_nodes); ADM_dataset_t* inputs = prepare_datasets("input-dataset-%d", NINPUTS); @@ -55,10 +51,6 @@ main(int argc, char* argv[]) { ADM_dataset_t* outputs = prepare_datasets("output-dataset-%d", NOUTPUTS); assert(outputs); - ADM_job_resources_t job_resources = - ADM_job_resources_create(job_nodes, NJOB_NODES); - assert(job_resources); - ADM_adhoc_resources_t adhoc_resources = ADM_adhoc_resources_create(adhoc_nodes, NADHOC_NODES); assert(adhoc_resources); @@ -75,18 +67,11 @@ main(int argc, char* argv[]) { ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); - - if(ret != ADM_SUCCESS) { - fprintf(stdout, "ADM_register_job() remote procedure not completed " - "successfully\n"); - exit_status = EXIT_FAILURE; - } - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ret = ADM_register_adhoc_storage(server, job, user_id, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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 bd876193569b34afd6a6be17aeda0f780545c752..e02a80331e5c781bed44d394372146dc474d496e 100644 --- a/examples/c/ADM_update_adhoc_storage.c +++ b/examples/c/ADM_update_adhoc_storage.c @@ -28,7 +28,6 @@ #include #include "common.h" -#define NJOB_NODES 50 #define NADHOC_NODES 25 #define NINPUTS 10 #define NOUTPUTS 5 @@ -45,9 +44,6 @@ main(int argc, char* argv[]) { int exit_status = EXIT_SUCCESS; ADM_server_t server = ADM_server_create("tcp", argv[1]); - ADM_job_t job; - ADM_node_t* job_nodes = prepare_nodes(NJOB_NODES); - assert(job_nodes); ADM_node_t* adhoc_nodes = prepare_nodes(NADHOC_NODES); assert(adhoc_nodes); ADM_dataset_t* inputs = prepare_datasets("input-dataset-%d", NINPUTS); @@ -55,10 +51,6 @@ main(int argc, char* argv[]) { ADM_dataset_t* outputs = prepare_datasets("output-dataset-%d", NOUTPUTS); assert(outputs); - ADM_job_resources_t job_resources = - ADM_job_resources_create(job_nodes, NJOB_NODES); - assert(job_resources); - ADM_adhoc_resources_t adhoc_resources = ADM_adhoc_resources_create(adhoc_nodes, NADHOC_NODES); assert(adhoc_resources); @@ -75,19 +67,11 @@ main(int argc, char* argv[]) { ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); - - if(ret != ADM_SUCCESS) { - fprintf(stdout, "ADM_register_job() remote procedure not completed " - "successfully\n"); - exit_status = EXIT_FAILURE; - goto cleanup; - } - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; - ret = ADM_register_adhoc_storage(server, job, user_id, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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 542acad2f4b11a4d1c81b24777966cba598201c3..8e91fb73d033b7912f284b52bc0c7d8128c82cb6 100644 --- a/examples/cxx/ADM_register_adhoc_storage.cpp +++ b/examples/cxx/ADM_register_adhoc_storage.cpp @@ -61,28 +61,19 @@ main(int argc, char* argv[]) { admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; - ADM_return_t ret = ADM_SUCCESS; try { const auto job = admire::register_job( server, admire::job::resources{job_nodes}, reqs); const auto adhoc_storage = admire::register_adhoc_storage( - server, job, user_id, adhoc_storage_ctx); + server, user_id, adhoc_storage_ctx); + + fmt::print(stdout, + "ADM_register_adhoc_storage() remote procedure completed " + "successfully\n"); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_register_adhoc_storage() failed: {}\n", e.what()); exit(EXIT_FAILURE); } - - if(ret != ADM_SUCCESS) { - fmt::print( - stdout, - "ADM_register_adhoc_storage() remote procedure not completed " - "successfully\n"); - exit(EXIT_FAILURE); - } - - fmt::print(stdout, - "ADM_register_adhoc_storage() remote procedure completed " - "successfully\n"); } diff --git a/src/common/net/proto/rpc_types.h b/src/common/net/proto/rpc_types.h index d4826fe81b49c12c4b0ffd5945ef011700dd58e2..c11bc37fa2291b10a3dae4217c5e0bd20e80c095 100644 --- a/src/common/net/proto/rpc_types.h +++ b/src/common/net/proto/rpc_types.h @@ -329,7 +329,6 @@ MERCURY_GEN_PROC( /// ADM_register_adhoc_storage MERCURY_GEN_PROC( ADM_register_adhoc_storage_in_t, - ((ADM_job_t) (job)) ((hg_const_string_t) (id)) ((ADM_adhoc_context_t)(ctx)) ); diff --git a/src/lib/admire.cpp b/src/lib/admire.cpp index e94ad7f702fa40075130d4dddfa324d614807269..a7991fabd21f4222c639d0349659b9af269db45f 100644 --- a/src/lib/admire.cpp +++ b/src/lib/admire.cpp @@ -234,11 +234,10 @@ remove_job(const server& srv, const job& job) { } admire::adhoc_storage -register_adhoc_storage(const server& srv, const job& job, - const std::string& user_id, +register_adhoc_storage(const server& srv, const std::string& user_id, const adhoc_storage::ctx& ctx) { - const auto rv = detail::register_adhoc_storage(srv, job, user_id, ctx); + const auto rv = detail::register_adhoc_storage(srv, user_id, ctx); if(!rv) { throw std::runtime_error( diff --git a/src/lib/admire.h b/src/lib/admire.h index 355da02e58e9ed048205dd9097b2478084bafd35..aa52deff6baf1b443df90495d6c08f4cf6d42d8c 100644 --- a/src/lib/admire.h +++ b/src/lib/admire.h @@ -89,7 +89,6 @@ ADM_remove_job(ADM_server_t server, ADM_job_t job); * Register an adhoc storage system. * * @param[in] server The server to which the request is directed - * @param[in] job An ADM_JOB identifying the originating job. * @param[in] user_id The desired user id 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 @@ -98,8 +97,8 @@ ADM_remove_job(ADM_server_t server, ADM_job_t job); * successfully. */ ADM_return_t -ADM_register_adhoc_storage(ADM_server_t server, ADM_job_t job, - const char* user_id, ADM_adhoc_context_t ctx, +ADM_register_adhoc_storage(ADM_server_t server, const char* user_id, + ADM_adhoc_context_t ctx, ADM_storage_t* adhoc_storage); /** diff --git a/src/lib/admire.hpp b/src/lib/admire.hpp index d44275cb506c3b878054dc1e168764328f96a40e..d62a9850d2988a9dd081e790da9438b202be9b01 100644 --- a/src/lib/admire.hpp +++ b/src/lib/admire.hpp @@ -59,8 +59,7 @@ ADM_return_t remove_job(const server& srv, const job& job); admire::adhoc_storage -register_adhoc_storage(const server& srv, const job& job, - const std::string& user_id, +register_adhoc_storage(const server& srv, const std::string& user_id, const adhoc_storage::ctx& ctx); ADM_return_t diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index cf375e0c84093724e189cb8fc40938badd337453..6ac4a26d35ad3568ec8539916ea35cda8ba166cd 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -81,14 +81,14 @@ ADM_remove_job(ADM_server_t server, ADM_job_t job) { } ADM_return_t -ADM_register_adhoc_storage(ADM_server_t server, ADM_job_t job, - const char* user_id, ADM_adhoc_context_t ctx, +ADM_register_adhoc_storage(ADM_server_t server, const char* user_id, + ADM_adhoc_context_t ctx, ADM_storage_t* adhoc_storage) { const admire::server srv{server}; const auto rv = admire::detail::register_adhoc_storage( - srv, admire::job{job}, user_id, admire::adhoc_storage::ctx{ctx}); + srv, user_id, admire::adhoc_storage::ctx{ctx}); if(!rv) { diff --git a/src/lib/detail/impl.cpp b/src/lib/detail/impl.cpp index 1d7f593c39dfac464338dbe6f479b0126f4e9734..7e9f712070f691f3747a356c9808a42c38d6110c 100644 --- a/src/lib/detail/impl.cpp +++ b/src/lib/detail/impl.cpp @@ -315,8 +315,7 @@ remove_job(const server& srv, const job& job) { } tl::expected -register_adhoc_storage(const server& srv, const job& job, - const std::string& user_id, +register_adhoc_storage(const server& srv, const std::string& user_id, const adhoc_storage::ctx& ctx) { scord::network::rpc_client rpc_client{srv.protocol(), rpc_registration_cb}; @@ -325,16 +324,14 @@ register_adhoc_storage(const server& srv, const job& job, auto endp = rpc_client.lookup(srv.address()); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{job: {}}}", + "body: {{user_id: {}, adhoc_ctx: {}}}", rpc_id, std::quoted("ADM_"s + __FUNCTION__), - std::quoted(rpc_client.self_address()), job); + std::quoted(rpc_client.self_address()), user_id, ctx); - const auto rpc_job = api::convert(job); const auto rpc_user_id = user_id.c_str(); const auto rpc_ctx = api::convert(ctx); - ADM_register_adhoc_storage_in_t in{rpc_job.get(), rpc_user_id, - rpc_ctx.get()}; + ADM_register_adhoc_storage_in_t in{rpc_user_id, rpc_ctx.get()}; ADM_register_adhoc_storage_out_t out; const auto rpc = endp.call("ADM_register_adhoc_storage", &in, &out); diff --git a/src/lib/detail/impl.hpp b/src/lib/detail/impl.hpp index 2a5eb1b1725692bad7c7ac5553474cd970a9b693..8505b16832698570a3c93006d5ef83d3020e00d5 100644 --- a/src/lib/detail/impl.hpp +++ b/src/lib/detail/impl.hpp @@ -53,7 +53,7 @@ transfer_datasets(const server& srv, const job& job, transfer::mapping mapping); tl::expected -register_adhoc_storage(const server& srv, const job& job, const std::string& id, +register_adhoc_storage(const server& srv, const std::string& id, const adhoc_storage::ctx& ctx); } // namespace admire::detail diff --git a/src/scord/rpc_handlers.cpp b/src/scord/rpc_handlers.cpp index d236c32e694e5e48acc71cd6ef35c0c1733e9676..3bbeefaf42e543e56c93060a7be7cc3c53eb0035 100644 --- a/src/scord/rpc_handlers.cpp +++ b/src/scord/rpc_handlers.cpp @@ -236,15 +236,14 @@ ADM_register_adhoc_storage(hg_handle_t h) { ret = margo_get_input(h, &in); assert(ret == HG_SUCCESS); - const admire::job job(in.job); const std::string id(in.id); const admire::adhoc_storage::ctx ctx(in.ctx); const auto rpc_id = remote_procedure::new_id(); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{job: {}}}", + "body: {{user_id: {}, adhoc_ctx: {}}}", rpc_id, std::quoted(__FUNCTION__), std::quoted(get_address(h)), - job); + id, ctx); const auto adhoc_storage = adhoc_storage_manager::create( admire::adhoc_storage::type::gekkofs, id, ctx);