Skip to content
Snippets Groups Projects
Verified Commit eba88555 authored by ANA MANZANO RODRIGUEZ's avatar ANA MANZANO RODRIGUEZ Committed by Alberto Miranda
Browse files

Update examples for ADM_remove_adhoc_storage

parent 39b12989
No related branches found
No related tags found
1 merge request!62Resolve "Refactor library RPC implementation of `admire::remove_adhoc_storage`"
Pipeline #3342 passed
...@@ -22,9 +22,14 @@ ...@@ -22,9 +22,14 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/ *****************************************************************************/
#include "fmt/format.h" #include <fmt/format.h>
#include "admire.hpp" #include <admire.hpp>
#include "common.hpp"
#define NJOB_NODES 50
#define NADHOC_NODES 25
#define NINPUTS 10
#define NOUTPUTS 5
int int
main(int argc, char* argv[]) { main(int argc, char* argv[]) {
...@@ -38,24 +43,28 @@ main(int argc, char* argv[]) { ...@@ -38,24 +43,28 @@ main(int argc, char* argv[]) {
admire::server server{"tcp", argv[1]}; admire::server server{"tcp", argv[1]};
ADM_storage_t adhoc_storage{}; const auto adhoc_nodes = prepare_nodes(NADHOC_NODES);
ADM_return_t ret = ADM_SUCCESS; const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS);
const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS);
std::string name = "adhoc_storage_42";
const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{
admire::adhoc_storage::execution_mode::separate_new,
admire::adhoc_storage::access_type::read_write,
admire::adhoc_storage::resources{adhoc_nodes}, 100, false};
try { try {
ret = admire::remove_adhoc_storage(server, adhoc_storage); const auto adhoc_storage = admire::register_adhoc_storage(
server, name, admire::storage::type::gekkofs,
adhoc_storage_ctx);
admire::remove_adhoc_storage(server, adhoc_storage);
fmt::print(stdout,
"ADM_remove_adhoc_storage() remote procedure completed "
"successfully\n");
exit(EXIT_SUCCESS);
} catch(const std::exception& e) { } catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_remove_adhoc_storage() failed: {}\n", fmt::print(stderr, "FATAL: ADM_remove_adhoc_storage() failed: {}\n",
e.what()); e.what());
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if(ret != ADM_SUCCESS) {
fmt::print(stdout,
"ADM_remove_adhoc_storage() remote procedure not completed "
"successfully\n");
exit(EXIT_FAILURE);
}
fmt::print(stdout, "ADM_remove_adhoc_storage() remote procedure completed "
"successfully\n");
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment