diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0bb8359b49337832d0af66fee79e736f9eb23f7d..d0424c79910356e0b6dc563c5f43f037bb12a7cb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -46,10 +46,12 @@ rpc:
needs: [build]
script:
- export ASAN_OPTIONS=detect_odr_violation=0
- - export LSAN_OPTIONS=verbosity=1:log_threads=1:suppressions=tests/LSanSuppress.supp
+ - export LSAN_OPTIONS=verbosity=1:log_threads=1:suppressions=${CI_PROJECT_DIR}/tests/LSanSuppress.supp
- export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib
- compiled/bin/scord -f --force-console &
- build/examples/cxx/ADM_ping ofi+tcp://127.0.0.1:52000
+ - cd build/examples/
+ - ctest -j$(nproc) --output-on-failure --output-junit report.xml
- pkill -TERM scord
# run unit tests
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78e2d3e8472d14388f33688d8f855e168b6b8efb..27f606aa311c8e83ad9035e6f6ae720e12c7fd35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,6 +82,7 @@ set(CMAKE_SHARED_LINKER_FLAGS_ASAN
# make sure that debug versions for targets are used (if provided) in Debug mode
set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS Debug)
+set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS ASan)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/examples/c/ADM_cancel_transfer.c b/examples/c/ADM_cancel_transfer.c
new file mode 100644
index 0000000000000000000000000000000000000000..5b2d79dadc94aecc4e71f92d4e9a824aa232931c
--- /dev/null
+++ b/examples/c/ADM_cancel_transfer.c
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_cancel_transfer \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_dataset_t** sources = NULL;
+ ADM_dataset_t** targets = NULL;
+ ADM_qos_limit_t** limits = NULL;
+ ADM_transfer_mapping_t mapping = ADM_MAPPING_ONE_TO_ONE;
+ ADM_transfer_t tx;
+ ret = ADM_transfer_dataset(server, job, sources, targets, limits, mapping,
+ &tx);
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_transfer_dataset() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ ret = ADM_cancel_transfer(server, job, tx);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_cancel_transfer() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_cancel_transfer() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_connect_data_operation.c b/examples/c/ADM_connect_data_operation.c
new file mode 100644
index 0000000000000000000000000000000000000000..35ad5bdcaa202e26ef01a0ed368c042bc57c017e
--- /dev/null
+++ b/examples/c/ADM_connect_data_operation.c
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no server address provided\n");
+ fprintf(stderr, "Usage: ADM_connect_data_operation \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ exit_status = EXIT_SUCCESS;
+
+ bool should_stream = false;
+ ret = ADM_connect_data_operation(server, job, inputs[0], outputs[0],
+ should_stream);
+
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_connect_data_operation() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_connect_data_operation() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+ for(int i = 0; i < NINPUTS; ++i) {
+ ADM_dataset_destroy(inputs[i]);
+ }
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ ADM_dataset_destroy(outputs[i]);
+ }
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_define_data_operation.c b/examples/c/ADM_define_data_operation.c
new file mode 100644
index 0000000000000000000000000000000000000000..5d8a5754e1e261933b51cc7ea664e5cf0c4d6f6b
--- /dev/null
+++ b/examples/c/ADM_define_data_operation.c
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_define_data_operation \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_data_operation_t op;
+ const char* path = "/tmpxxxxx";
+ // va_list args; // FIXME placeholder
+
+ ret = ADM_define_data_operation(server, job, path, &op);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_define_data_operation() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_define_data_operation() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_deploy_adhoc_storage.c b/examples/c/ADM_deploy_adhoc_storage.c
new file mode 100644
index 0000000000000000000000000000000000000000..7985be8734acd0ddbaf64a6dabecfc2570f193ba
--- /dev/null
+++ b/examples/c/ADM_deploy_adhoc_storage.c
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_deploy_adhoc_storage \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_storage_t adhoc_storage;
+
+ ret = ADM_register_adhoc_storage(server, job, ctx, &adhoc_storage);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_register_adhoc_storage() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_register_adhoc_storage() remote procedure completed "
+ "successfully\n");
+
+ ret = ADM_deploy_adhoc_storage(server, job, adhoc_storage);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_deploy_adhoc_storage() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_deploy_adhoc_storage() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_finalize_data_operation.c b/examples/c/ADM_finalize_data_operation.c
new file mode 100644
index 0000000000000000000000000000000000000000..4c4231f62efa701e53e0113e19bfb46347897442
--- /dev/null
+++ b/examples/c/ADM_finalize_data_operation.c
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr,
+ "Usage: ADM_finalize_data_operation \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+ ADM_data_operation_t op;
+ const char* path = "/tmpxxxxx";
+
+ ADM_define_data_operation(server, job, path, &op);
+ ADM_data_operation_status_t status;
+
+ ret = ADM_finalize_data_operation(server, job, op, &status);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_finalize_data_operation() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_finalize_data_operation() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_get_pending_transfers.c b/examples/c/ADM_get_pending_transfers.c
new file mode 100644
index 0000000000000000000000000000000000000000..55f4b15cd4efaa2975d5ffbe4793b12a1fefce53
--- /dev/null
+++ b/examples/c/ADM_get_pending_transfers.c
@@ -0,0 +1,103 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_get_pending_transfers \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+ ADM_transfer_t** tx = NULL;
+
+ ret = ADM_get_pending_transfers(server, job, tx);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_get_pending_transfers() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_get_pending_transfers() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_get_qos_constraints.c b/examples/c/ADM_get_qos_constraints.c
new file mode 100644
index 0000000000000000000000000000000000000000..03265442ed4145a903138a2d1e42f70b697c7874
--- /dev/null
+++ b/examples/c/ADM_get_qos_constraints.c
@@ -0,0 +1,106 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_get_qos_constraints \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_qos_entity_t entity = NULL;
+ ADM_qos_limit_t* limits;
+
+ ret = ADM_get_qos_constraints(server, job, entity, &limits);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_get_qos_constraints() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_get_qos_constraints() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_get_statistics.c b/examples/c/ADM_get_statistics.c
new file mode 100644
index 0000000000000000000000000000000000000000..af8a3f19cc7efe14fe25abb083c885ae7076648f
--- /dev/null
+++ b/examples/c/ADM_get_statistics.c
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_get_statistics \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+ ADM_job_stats_t* stats = NULL;
+
+ ret = ADM_get_statistics(server, job, &stats);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_get_statistics() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_get_statistics() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_get_transfer_priority.c b/examples/c/ADM_get_transfer_priority.c
new file mode 100644
index 0000000000000000000000000000000000000000..e07fb07363356419c8399b1558619fccf489b746
--- /dev/null
+++ b/examples/c/ADM_get_transfer_priority.c
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_get_transfer_priority \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_dataset_t** sources = NULL;
+ ADM_dataset_t** targets = NULL;
+ ADM_qos_limit_t** limits = NULL;
+ ADM_transfer_mapping_t mapping = ADM_MAPPING_ONE_TO_ONE;
+ ADM_transfer_t tx;
+ ret = ADM_transfer_dataset(server, job, sources, targets, limits, mapping,
+ &tx);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_transfer_dataset() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+ ADM_transfer_priority_t priority;
+
+ ret = ADM_get_transfer_priority(server, job, tx, &priority);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_get_transfer_priority() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_get_transfer_priority() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_link_transfer_to_data_operation.c b/examples/c/ADM_link_transfer_to_data_operation.c
new file mode 100644
index 0000000000000000000000000000000000000000..ba03648207ead7cbf23b5df3f8f99762199c1b69
--- /dev/null
+++ b/examples/c/ADM_link_transfer_to_data_operation.c
@@ -0,0 +1,124 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr,
+ "Usage: ADM_link_transfer_to_data_operation \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_data_operation_t op;
+ const char* path = "/tmpxxxxx";
+ ADM_define_data_operation(server, job, path, &op);
+ ADM_dataset_t** sources = NULL;
+ ADM_dataset_t** targets = NULL;
+ ADM_qos_limit_t** limits = NULL;
+ ADM_transfer_mapping_t mapping = ADM_MAPPING_ONE_TO_ONE;
+ ADM_transfer_t tx;
+ ret = ADM_transfer_dataset(server, job, sources, targets, limits, mapping,
+ &tx);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_transfer_dataset() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+ bool should_stream = false;
+ va_list args;
+
+ ret = ADM_link_transfer_to_data_operation(server, job, op, tx,
+ should_stream, args);
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_link_transfer_to_data_operation() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout,
+ "ADM_link_transfer_to_data_operation() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_register_adhoc_storage.c b/examples/c/ADM_register_adhoc_storage.c
new file mode 100644
index 0000000000000000000000000000000000000000..2964ae5147ed9915add3d15a0c8ae1a489e144dc
--- /dev/null
+++ b/examples/c/ADM_register_adhoc_storage.c
@@ -0,0 +1,106 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_register_adhoc_storage \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_storage_t adhoc_storage;
+
+ ret = ADM_register_adhoc_storage(server, job, ctx, &adhoc_storage);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_register_adhoc_storage() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_register_adhoc_storage() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_register_job.c b/examples/c/ADM_register_job.c
index 7c53dceb0b9eebc065d054427f22fdd9d70d3259..6d59e74cffab3373fbc50c35ecc003de15ba2080 100644
--- a/examples/c/ADM_register_job.c
+++ b/examples/c/ADM_register_job.c
@@ -1,7 +1,31 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
-#include
#include
+#include
#define NINPUTS 10
#define NOUTPUTS 5
@@ -11,7 +35,7 @@ main(int argc, char* argv[]) {
if(argc != 2) {
fprintf(stderr, "ERROR: no location provided\n");
- fprintf(stderr, "Usage: ADM_register_job \n");
+ fprintf(stderr, "Usage: ADM_register_job \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/c/ADM_remove_adhoc_storage.c b/examples/c/ADM_remove_adhoc_storage.c
new file mode 100644
index 0000000000000000000000000000000000000000..b84208d723776eb4d0271bb183a418deea496995
--- /dev/null
+++ b/examples/c/ADM_remove_adhoc_storage.c
@@ -0,0 +1,116 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_remove_adhoc_storage \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_storage_t adhoc_storage;
+ ret = ADM_register_adhoc_storage(server, job, ctx, &adhoc_storage);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_register_adhoc_storage() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_register_adhoc_storage() remote procedure completed "
+ "successfully\n");
+
+ ret = ADM_remove_adhoc_storage(server, job, adhoc_storage);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_remove_adhoc_storage() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_remove_adhoc_storage() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_remove_job.c b/examples/c/ADM_remove_job.c
new file mode 100644
index 0000000000000000000000000000000000000000..6172c890ee3876faa0b813ded94b4446214650c7
--- /dev/null
+++ b/examples/c/ADM_remove_job.c
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_remove_job \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ret = ADM_remove_job(server, job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_remove_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_remove_job() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_set_dataset_information.c b/examples/c/ADM_set_dataset_information.c
new file mode 100644
index 0000000000000000000000000000000000000000..7e3e3d410226a39127e899890e114102dde1ae2c
--- /dev/null
+++ b/examples/c/ADM_set_dataset_information.c
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr,
+ "Usage: ADM_set_dataset_information \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_dataset_t target = NULL;
+ ADM_dataset_info_t info = NULL;
+ ret = ADM_set_dataset_information(server, job, target, info);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_set_dataset_information() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_set_dataset_information() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_set_io_resources.c b/examples/c/ADM_set_io_resources.c
new file mode 100644
index 0000000000000000000000000000000000000000..307c3294309f7e273b28dd2ba6fab51d4feb5a68
--- /dev/null
+++ b/examples/c/ADM_set_io_resources.c
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_set_io_resources \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_storage_t tier = NULL;
+ ADM_storage_resources_t resources = NULL;
+ ret = ADM_set_io_resources(server, job, tier, resources);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_set_io_resources() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_set_io_resources() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_set_qos_constraints.c b/examples/c/ADM_set_qos_constraints.c
new file mode 100644
index 0000000000000000000000000000000000000000..03e0423c7ac1fbfbdeae3c1b3a1227fc145f458d
--- /dev/null
+++ b/examples/c/ADM_set_qos_constraints.c
@@ -0,0 +1,106 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_set_qos_constraints \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_qos_entity_t entity = NULL;
+ ADM_qos_limit_t limit = NULL;
+
+ ret = ADM_set_qos_constraints(server, job, entity, limit);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_set_qos_constraints() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_set_qos_constraints() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_set_transfer_priority.c b/examples/c/ADM_set_transfer_priority.c
new file mode 100644
index 0000000000000000000000000000000000000000..4993e9e7dacb9741eab11430685d43aa1bfd7643
--- /dev/null
+++ b/examples/c/ADM_set_transfer_priority.c
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_set_transfer_priority \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_dataset_t** sources = NULL;
+ ADM_dataset_t** targets = NULL;
+ ADM_qos_limit_t** limits = NULL;
+ ADM_transfer_mapping_t mapping = ADM_MAPPING_ONE_TO_ONE;
+ ADM_transfer_t tx;
+ ret = ADM_transfer_dataset(server, job, sources, targets, limits, mapping,
+ &tx);
+
+ int incr = 42;
+ ret = ADM_set_transfer_priority(server, job, tx, incr);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_set_transfer_priority() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_set_transfer_priority() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_transfer_dataset.c b/examples/c/ADM_transfer_dataset.c
new file mode 100644
index 0000000000000000000000000000000000000000..6f540511a117d18583654f48678bd32f5d114e06
--- /dev/null
+++ b/examples/c/ADM_transfer_dataset.c
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_transfer_dataset \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_dataset_t** sources = NULL;
+ ADM_dataset_t** targets = NULL;
+ ADM_qos_limit_t** limits = NULL;
+ ADM_transfer_mapping_t mapping = ADM_MAPPING_ONE_TO_ONE;
+ ADM_transfer_t tx;
+ ret = ADM_transfer_dataset(server, job, sources, targets, limits, mapping,
+ &tx);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_transfer_dataset() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_transfer_dataset() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_update_adhoc_storage.c b/examples/c/ADM_update_adhoc_storage.c
new file mode 100644
index 0000000000000000000000000000000000000000..c8dbaf74bd35fe7f7856db531a25a67d96068693
--- /dev/null
+++ b/examples/c/ADM_update_adhoc_storage.c
@@ -0,0 +1,116 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_update_adhoc_storage \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_storage_t adhoc_storage;
+ ret = ADM_register_adhoc_storage(server, job, ctx, &adhoc_storage);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_register_adhoc_storage() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_register_adhoc_storage() remote procedure completed "
+ "successfully\n");
+
+ ret = ADM_update_adhoc_storage(server, job, ctx, adhoc_storage);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout,
+ "ADM_update_adhoc_storage() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_update_adhoc_storage() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/ADM_update_job.c b/examples/c/ADM_update_job.c
new file mode 100644
index 0000000000000000000000000000000000000000..62fbbd39be01ebdbef901866bea50b27d96ce6c1
--- /dev/null
+++ b/examples/c/ADM_update_job.c
@@ -0,0 +1,133 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
+#include
+#include
+#include
+#include
+
+#define NINPUTS 10
+#define NOUTPUTS 5
+
+int
+main(int argc, char* argv[]) {
+
+ if(argc != 2) {
+ fprintf(stderr, "ERROR: no location provided\n");
+ fprintf(stderr, "Usage: ADM_update_job \n");
+ exit(EXIT_FAILURE);
+ }
+
+ int exit_status = EXIT_SUCCESS;
+ ADM_server_t server = ADM_server_create("tcp", argv[1]);
+
+ ADM_job_t job;
+
+ ADM_dataset_t inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_adhoc_context_t ctx = ADM_adhoc_context_create(
+ ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 42, 100, false);
+ assert(ctx);
+
+ ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx);
+ assert(st);
+
+ ADM_job_requirements_t reqs =
+ ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st);
+ assert(reqs);
+
+ ADM_return_t ret = ADM_register_job(server, reqs, &job);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_register_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ }
+
+ ADM_dataset_t new_inputs[NINPUTS];
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ const char* pattern = "input-new-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ new_inputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_dataset_t new_outputs[NOUTPUTS];
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ const char* pattern = "output-new-dataset-%d";
+ size_t n = snprintf(NULL, 0, pattern, i);
+ char* id = (char*) alloca(n + 1);
+ snprintf(id, n + 1, pattern, i);
+ new_outputs[i] = ADM_dataset_create(id);
+ }
+
+ ADM_job_requirements_t new_reqs = ADM_job_requirements_create(
+ new_inputs, NINPUTS, new_outputs, NOUTPUTS, st);
+
+ ret = ADM_update_job(server, job, new_reqs);
+
+ if(ret != ADM_SUCCESS) {
+ fprintf(stdout, "ADM_update_job() remote procedure not completed "
+ "successfully\n");
+ exit_status = EXIT_FAILURE;
+ goto cleanup;
+ }
+
+ fprintf(stdout, "ADM_update_job() remote procedure completed "
+ "successfully\n");
+
+cleanup:
+
+ for(int i = 0; i < NINPUTS; ++i) {
+ ADM_dataset_destroy(inputs[i]);
+ }
+
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ ADM_dataset_destroy(outputs[i]);
+ }
+
+ ADM_server_destroy(server);
+ exit(exit_status);
+}
diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt
index ff36f94ac65f6402b2f6ffec6b5d6cedc23c889d..3f683cc04b26cd6000b522bc74253a87ec9c81d3 100644
--- a/examples/c/CMakeLists.txt
+++ b/examples/c/CMakeLists.txt
@@ -1,5 +1,5 @@
################################################################################
-# Copyright 2021-2022, Barcelona Supercomputing Center (BSC), Spain #
+# Copyright 2021, Barcelona Supercomputing Center (BSC), Spain #
# #
# This software was partially supported by the EuroHPC-funded project ADMIRE #
# (Project ID: 956748, https://www.admire-eurohpc.eu). #
@@ -22,11 +22,68 @@
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
-list(APPEND examples_c ADM_register_job)
+list(APPEND examples_c ADM_register_job ADM_cancel_transfer ADM_connect_data_operation ADM_define_data_operation
+ ADM_deploy_adhoc_storage ADM_finalize_data_operation ADM_get_pending_transfers ADM_get_qos_constraints
+ ADM_get_statistics ADM_get_transfer_priority ADM_link_transfer_to_data_operation
+ ADM_register_adhoc_storage ADM_remove_adhoc_storage ADM_remove_job ADM_set_dataset_information
+ ADM_set_io_resources ADM_set_qos_constraints ADM_set_transfer_priority ADM_transfer_dataset
+ ADM_update_adhoc_storage ADM_update_job)
+# ADM_in_situ_ops ADM_in_transit_ops not implemented
foreach(example IN LISTS examples_c)
add_executable(${example}_c)
target_sources(${example}_c PRIVATE ${example}.c)
target_link_libraries(${example}_c PUBLIC adm_iosched)
set_target_properties(${example}_c PROPERTIES OUTPUT_NAME ${example})
endforeach()
+
+if(SCORD_BUILD_TESTS)
+ add_test(ADM_register_job_c_test ADM_register_job ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_cancel_transfer_c_test ADM_cancel_transfer ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_connect_data_operation_c_test ADM_connect_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_define_data_operation_c_test ADM_define_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_deploy_adhoc_storage_c_test ADM_deploy_adhoc_storage ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_finalize_data_operation_c_test ADM_finalize_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_get_pending_transfers_c_test ADM_get_pending_transfers ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_get_qos_constraints_c_test ADM_get_qos_constraints ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_get_statistics_c_test ADM_get_statistics ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_get_transfer_priority_c_test ADM_get_transfer_priority ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_link_transfer_to_data_operation_c_test ADM_link_transfer_to_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_register_adhoc_storage_c_test ADM_register_adhoc_storage ofi+tcp://127.0.0.1:52000)
+
+ # TODO: ADM_register_pfs_storage test is missing because is not working in cpp.
+ # Will be created when it works in cpp.
+ add_test(ADM_remove_adhoc_storage_c_test ADM_remove_adhoc_storage ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_remove_job_c_test ADM_remove_job ofi+tcp://127.0.0.1:52000)
+
+ # TODO: ADM_remove_pfs_storage test is missing because is not working in cpp.
+ # Will be created when it works in cpp.
+ add_test(ADM_set_dataset_information_c_test ADM_set_dataset_information ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_set_io_resources_c_test ADM_set_io_resources ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_set_qos_constraints_c_test ADM_set_qos_constraints ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_set_transfer_priority_c_test ADM_set_transfer_priority ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_transfer_dataset_c_test ADM_transfer_dataset ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_update_adhoc_storage_c_test ADM_update_adhoc_storage ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_update_job_c_test ADM_update_job ofi+tcp://127.0.0.1:52000)
+
+ # TODO: ADM_update_pfs_storage test is missing because is not working in cpp.
+ # Will be created when it works in cpp.
+endif()
diff --git a/examples/cxx/ADM_cancel_transfer.cpp b/examples/cxx/ADM_cancel_transfer.cpp
index 966b0c1161ea813d87f93ade90f3084653b625b0..4543974f99bababf96c4014ba25d6a79bf9b783d 100644
--- a/examples/cxx/ADM_cancel_transfer.cpp
+++ b/examples/cxx/ADM_cancel_transfer.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,21 +29,20 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr,
- "Usage: ADM_cancel_transfer \n");
+ fmt::print(stderr, "Usage: ADM_cancel_transfer \n");
exit(EXIT_FAILURE);
}
admire::server server{"tcp", argv[1]};
ADM_job_t job{};
- ADM_transfer_t tx_handle{};
+ ADM_transfer_t tx{};
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::cancel_transfer(server, job, tx_handle);
+ ret = admire::cancel_transfer(server, job, tx);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n",
e.what());
diff --git a/examples/cxx/ADM_connect_data_operation.cpp b/examples/cxx/ADM_connect_data_operation.cpp
index b16c6c52227bac129e7e34954f2c399d9143a311..62614f9285521ce800c988fbe9917453ab09a648 100644
--- a/examples/cxx/ADM_connect_data_operation.cpp
+++ b/examples/cxx/ADM_connect_data_operation.cpp
@@ -1,26 +1,37 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
-bool
-string_to_convert(std::string s) {
- if(s == "true" || s == "TRUE" || s == "True") {
- return true;
- } else if(s == "false" || s == "FALSE" || s == "False") {
- return false;
- } else {
- throw std::invalid_argument(
- "ERROR: Incorrect input value. Please try again.\n");
- }
-}
-
int
main(int argc, char* argv[]) {
- if(argc != 7) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_connect_data_operation \n");
+ fmt::print(stderr,
+ "Usage: ADM_connect_data_operation \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_define_data_operation.cpp b/examples/cxx/ADM_define_data_operation.cpp
index bd6cdf2dbc085b05891fd4af586771052566f9d2..1d2a0297363c79cd7ed894415039f0044663f22a 100644
--- a/examples/cxx/ADM_define_data_operation.cpp
+++ b/examples/cxx/ADM_define_data_operation.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,25 +29,23 @@
int
main(int argc, char* argv[]) {
- if(argc != 5) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_define_data_operation \n");
+ fmt::print(stderr,
+ "Usage: ADM_define_data_operation \n");
exit(EXIT_FAILURE);
}
admire::server server{"tcp", argv[1]};
ADM_job_t job{};
- const char* path = "";
- ADM_data_operation_t op_handle;
+ const char* path = "/tmpxxxxx";
+ ADM_data_operation_t op;
va_list args; // FIXME: placeholder
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::define_data_operation(server, job, path, &op_handle,
- args);
+ ret = admire::define_data_operation(server, job, path, &op, args);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_define_data_operation() failed: {}\n",
e.what());
diff --git a/examples/cxx/ADM_deploy_adhoc_storage.cpp b/examples/cxx/ADM_deploy_adhoc_storage.cpp
index 9350fa5a15469162fc42415cd61e984076c00c96..f5badb35a4a58dd13f0f102ced1e4985f20ad2b6 100644
--- a/examples/cxx/ADM_deploy_adhoc_storage.cpp
+++ b/examples/cxx/ADM_deploy_adhoc_storage.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,10 +29,10 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_deploy_adhoc_storage "
- "\n");
+ fmt::print(stderr,
+ "Usage: ADM_deploy_adhoc_storage \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_finalize_data_operation.cpp b/examples/cxx/ADM_finalize_data_operation.cpp
index da05c8d4b5397e567a284febe4b86b01e3e0dc20..c3eab90cb65330e23f348e2e4495751344695504 100644
--- a/examples/cxx/ADM_finalize_data_operation.cpp
+++ b/examples/cxx/ADM_finalize_data_operation.cpp
@@ -1,26 +1,49 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_finalize_data_operation \n");
+ fmt::print(stderr,
+ "Usage: ADM_finalize_data_operation \n");
exit(EXIT_FAILURE);
}
admire::server server{"tcp", argv[1]};
ADM_job_t job{};
- ADM_data_operation_t op_handle{};
+ ADM_data_operation_t op{};
ADM_data_operation_status_t status;
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::finalize_data_operation(server, job, op_handle, &status);
+ ret = admire::finalize_data_operation(server, job, op, &status);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_finalize_data_operation() failed: {}\n",
e.what());
diff --git a/examples/cxx/ADM_get_pending_transfers.cpp b/examples/cxx/ADM_get_pending_transfers.cpp
index 3a146dad0cf6262980c7a9b75da98af7dd373d02..4d3c69f5fa7c6e054a42bec6ec92c5cd7fde0c7d 100644
--- a/examples/cxx/ADM_get_pending_transfers.cpp
+++ b/examples/cxx/ADM_get_pending_transfers.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -7,18 +31,19 @@ main(int argc, char* argv[]) {
if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_get_pending_transfers \n");
+ fmt::print(stderr,
+ "Usage: ADM_get_pending_transfers \n");
exit(EXIT_FAILURE);
}
admire::server server{"tcp", argv[1]};
ADM_job_t job{};
- ADM_transfer_t** tx_handles = nullptr;
+ ADM_transfer_t** tx = nullptr;
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::get_pending_transfers(server, job, tx_handles);
+ ret = admire::get_pending_transfers(server, job, tx);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_get_pending_transfers() failed: {}\n",
e.what());
diff --git a/examples/cxx/ADM_get_qos_constraints.cpp b/examples/cxx/ADM_get_qos_constraints.cpp
index da64bcbfdf99bfbdec40fd7a4dcdd40d8535db43..c1828aa46efcda74f096b04c911a4b5dc3139610 100644
--- a/examples/cxx/ADM_get_qos_constraints.cpp
+++ b/examples/cxx/ADM_get_qos_constraints.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,11 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 4) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_get_qos_constraints \n");
+ fmt::print(stderr, "Usage: ADM_get_qos_constraints \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_get_statistics.cpp b/examples/cxx/ADM_get_statistics.cpp
index eccb9f8963806c7bfa0f0d92419e32c044fd0175..b3c78675240aa188f7be55e7336b84e07c7c5f2b 100644
--- a/examples/cxx/ADM_get_statistics.cpp
+++ b/examples/cxx/ADM_get_statistics.cpp
@@ -1,14 +1,36 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
int
main(int argc, char* argv[]) {
- if(argc != 4) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_get_statistics \n");
+ fmt::print(stderr, "Usage: ADM_get_statistics \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_get_transfer_priority.cpp b/examples/cxx/ADM_get_transfer_priority.cpp
index f52152d10129592d4b7934b890b4df9985d3c77d..8fef9925adc2a3ac8c70b683fa31b7928c290aa2 100644
--- a/examples/cxx/ADM_get_transfer_priority.cpp
+++ b/examples/cxx/ADM_get_transfer_priority.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,23 +29,22 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_get_transfer_priority \n");
+ fmt::print(stderr,
+ "Usage: ADM_get_transfer_priority \n");
exit(EXIT_FAILURE);
}
admire::server server{"tcp", argv[1]};
ADM_job_t job{};
- ADM_transfer_t tx_handle{};
+ ADM_transfer_t tx{};
ADM_transfer_priority_t priority;
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::get_transfer_priority(server, job, tx_handle, &priority);
+ ret = admire::get_transfer_priority(server, job, tx, &priority);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_get_transfer_priority() failed: {}\n",
e.what());
diff --git a/examples/cxx/ADM_in_situ_ops.cpp b/examples/cxx/ADM_in_situ_ops.cpp
index b870e6ec3a84205220bdd7d0073404baa32053db..517b0fd6ae59813ecc1293d0551fadcceea0ad9e 100644
--- a/examples/cxx/ADM_in_situ_ops.cpp
+++ b/examples/cxx/ADM_in_situ_ops.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,10 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr,
- "Usage: ADM_in_situ_ops \n");
+ fmt::print(stderr, "Usage: ADM_in_situ_ops \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_in_transit_ops.cpp b/examples/cxx/ADM_in_transit_ops.cpp
index 4eef3e9496ea40980411d79c77a72ce481644a9b..bf3ce2b054d8abefc31f898ef91542828fccbb19 100644
--- a/examples/cxx/ADM_in_transit_ops.cpp
+++ b/examples/cxx/ADM_in_transit_ops.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,10 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr,
- "Usage: ADM_in_transit_ops \n");
+ fmt::print(stderr, "Usage: ADM_in_transit_ops \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_link_transfer_to_data_operation.cpp b/examples/cxx/ADM_link_transfer_to_data_operation.cpp
index 623b640927cabbb7b8bd0fbe15d3c171d7d0379d..8ebb02c39d7007630583a4cabf0f61261eb0700b 100644
--- a/examples/cxx/ADM_link_transfer_to_data_operation.cpp
+++ b/examples/cxx/ADM_link_transfer_to_data_operation.cpp
@@ -1,27 +1,52 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
int
main(int argc, char* argv[]) {
- if(argc != 7) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
fmt::print(
stderr,
- "Usage: ADM_link_transfer_to_data_operation \n");
+ "Usage: ADM_link_transfer_to_data_operation \n");
exit(EXIT_FAILURE);
}
admire::server server{"tcp", argv[1]};
ADM_job_t job{};
- ADM_data_operation_t op_handle{};
+ ADM_data_operation_t op{};
bool should_stream = false;
va_list args;
+ ADM_transfer_t transfer{};
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::link_transfer_to_data_operation(server, job, op_handle,
+ ret = admire::link_transfer_to_data_operation(server, job, op, transfer,
should_stream, args);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n",
diff --git a/examples/cxx/ADM_register_adhoc_storage.cpp b/examples/cxx/ADM_register_adhoc_storage.cpp
index f97aa69257198270e24698bd84c638ef09145384..2a61716940c33a1a3bf0ee1f9ef3519a35205094 100644
--- a/examples/cxx/ADM_register_adhoc_storage.cpp
+++ b/examples/cxx/ADM_register_adhoc_storage.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,10 +29,10 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_register_adhoc_storage "
- "\n");
+ fmt::print(stderr,
+ "Usage: ADM_register_adhoc_storage \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_register_job.cpp b/examples/cxx/ADM_register_job.cpp
index cd31c15c307454e797adf0f56bddf498df19109b..8f3a149b95ee991e9cb0d75fe6acff3f76d71791 100644
--- a/examples/cxx/ADM_register_job.cpp
+++ b/examples/cxx/ADM_register_job.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
diff --git a/examples/cxx/ADM_register_pfs_storage.cpp b/examples/cxx/ADM_register_pfs_storage.cpp
index 0adafce845a0cefb86dfcf7faa5f6af6e8979b67..dc0c83148ece3d238f76f06fdb50f857284ac5a8 100644
--- a/examples/cxx/ADM_register_pfs_storage.cpp
+++ b/examples/cxx/ADM_register_pfs_storage.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,10 +29,10 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_register_pfs_storage "
- "\n");
+ fmt::print(stderr,
+ "Usage: ADM_register_pfs_storage \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_remove_adhoc_storage.cpp b/examples/cxx/ADM_remove_adhoc_storage.cpp
index d622bf013368853f826d55eeac9e2577496471bd..9d6f2aea1ea0297567611eb6186072e33c296b92 100644
--- a/examples/cxx/ADM_remove_adhoc_storage.cpp
+++ b/examples/cxx/ADM_remove_adhoc_storage.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include "fmt/format.h"
#include "admire.hpp"
@@ -5,10 +29,10 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_remove_adhoc_storage "
- "\n");
+ fmt::print(stderr,
+ "Usage: ADM_remove_adhoc_storage \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_remove_job.cpp b/examples/cxx/ADM_remove_job.cpp
index 55261e99e8caf0c64c97894e3fd7e74a0d6adbc9..682de21665d16ceb45ed017537aa7eba6ce0516c 100644
--- a/examples/cxx/ADM_remove_job.cpp
+++ b/examples/cxx/ADM_remove_job.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
diff --git a/examples/cxx/ADM_remove_pfs_storage.cpp b/examples/cxx/ADM_remove_pfs_storage.cpp
index 2df326ac53827a39a46cfc35ef4b190633d65905..ad05f50b3c8ca081c4ec5eb04cdd4ef8b80c2087 100644
--- a/examples/cxx/ADM_remove_pfs_storage.cpp
+++ b/examples/cxx/ADM_remove_pfs_storage.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include "fmt/format.h"
#include "admire.hpp"
@@ -5,10 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_remove_pfs_storage "
- "\n");
+ fmt::print(stderr, "Usage: ADM_remove_pfs_storage \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_set_dataset_information.cpp b/examples/cxx/ADM_set_dataset_information.cpp
index eeff1f012a93134ebd93fe8757b12ba00b72225c..3d1ac5ba7df4e3e58b1761e335d355d64f8da67c 100644
--- a/examples/cxx/ADM_set_dataset_information.cpp
+++ b/examples/cxx/ADM_set_dataset_information.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,11 +29,10 @@
int
main(int argc, char* argv[]) {
- if(argc != 5) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_set_dataset_information \n");
+ fmt::print(stderr,
+ "Usage: ADM_set_dataset_information \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_set_io_resources.cpp b/examples/cxx/ADM_set_io_resources.cpp
index e4ee70a032aaa679a042fb902e4704a99c1d7f90..cf394845b8bc78f7660b0406c1e58171f16e0f5c 100644
--- a/examples/cxx/ADM_set_io_resources.cpp
+++ b/examples/cxx/ADM_set_io_resources.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,11 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 5) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_set_io_resources \n");
+ fmt::print(stderr, "Usage: ADM_set_io_resources \n");
exit(EXIT_FAILURE);
}
@@ -23,18 +45,18 @@ main(int argc, char* argv[]) {
try {
ret = admire::set_io_resources(server, job, tier, resources);
} catch(const std::exception& e) {
- fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n",
+ fmt::print(stderr, "FATAL: ADM_set_io_resources() failed: {}\n",
e.what());
exit(EXIT_FAILURE);
}
if(ret != ADM_SUCCESS) {
fmt::print(stdout,
- "ADM_cancel_transfer() remote procedure not completed "
+ "ADM_set_io_resources() remote procedure not completed "
"successfully\n");
exit(EXIT_FAILURE);
}
- fmt::print(stdout, "ADM_cancel_transfer() remote procedure completed "
+ fmt::print(stdout, "ADM_set_io_resources() remote procedure completed "
"successfully\n");
}
diff --git a/examples/cxx/ADM_set_qos_constraints.cpp b/examples/cxx/ADM_set_qos_constraints.cpp
index cdd50a89c0947f08a151f2b5c81beef94e9565e4..3b3f84fe44406033a5073fb3dcc98fd0690aacba 100644
--- a/examples/cxx/ADM_set_qos_constraints.cpp
+++ b/examples/cxx/ADM_set_qos_constraints.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,11 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 6) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_set_qos_constraints \n");
+ fmt::print(stderr, "Usage: ADM_set_qos_constraints \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_set_transfer_priority.cpp b/examples/cxx/ADM_set_transfer_priority.cpp
index 516a9159a687b16ed9788d09dd1e40191a68fd6f..f9fe2e69f714cfba409afa600e9be78c6d307b06 100644
--- a/examples/cxx/ADM_set_transfer_priority.cpp
+++ b/examples/cxx/ADM_set_transfer_priority.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,23 +29,22 @@
int
main(int argc, char* argv[]) {
- if(argc != 4) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_set_transfer_priority \n");
+ fmt::print(stderr,
+ "Usage: ADM_set_transfer_priority \n");
exit(EXIT_FAILURE);
}
admire::server server{"tcp", argv[1]};
ADM_job_t job{};
- ADM_transfer_t tx_handle{};
+ ADM_transfer_t tx{};
int incr = 42;
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::set_transfer_priority(server, job, tx_handle, incr);
+ ret = admire::set_transfer_priority(server, job, tx, incr);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_set_transfer_priority() failed: {}\n",
e.what());
diff --git a/examples/cxx/ADM_transfer_dataset.cpp b/examples/cxx/ADM_transfer_dataset.cpp
index 0c736284f2b5b114d63b19dcf9dcdf43bcf0fd84..1eb3f2c56b4ba9d51f708ee102668a3d34036966 100644
--- a/examples/cxx/ADM_transfer_dataset.cpp
+++ b/examples/cxx/ADM_transfer_dataset.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,12 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 7) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(
- stderr,
- "Usage: ADM_transfer_dataset "
- "\n");
+ fmt::print(stderr, "Usage: ADM_transfer_dataset \n");
exit(EXIT_FAILURE);
}
@@ -21,12 +42,12 @@ main(int argc, char* argv[]) {
ADM_dataset_t** targets = nullptr;
ADM_qos_limit_t** limits = nullptr;
ADM_transfer_mapping_t mapping = ADM_MAPPING_ONE_TO_ONE;
- ADM_transfer_t tx_handle{};
+ ADM_transfer_t tx{};
ADM_return_t ret = ADM_SUCCESS;
try {
ret = admire::transfer_dataset(server, job, sources, targets, limits,
- mapping, &tx_handle);
+ mapping, &tx);
} catch(const std::exception& e) {
fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n",
e.what());
diff --git a/examples/cxx/ADM_update_adhoc_storage.cpp b/examples/cxx/ADM_update_adhoc_storage.cpp
index 2d43d7df40390ac5130f51997f593dc5574b7af7..8b9debd3851ab123ec71f74e01c604480ca9031e 100644
--- a/examples/cxx/ADM_update_adhoc_storage.cpp
+++ b/examples/cxx/ADM_update_adhoc_storage.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,10 +29,10 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_update_adhoc_storage "
- "\n");
+ fmt::print(stderr,
+ "Usage: ADM_update_adhoc_storage \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/ADM_update_job.cpp b/examples/cxx/ADM_update_job.cpp
index a82a2dae19ca2929d17abc866b8ddadbf1461cc9..14846cc2b4f05c1a384f5887876365a621add949 100644
--- a/examples/cxx/ADM_update_job.cpp
+++ b/examples/cxx/ADM_update_job.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -32,14 +56,45 @@ main(int argc, char* argv[]) {
admire::adhoc_storage::execution_mode::separate_new,
admire::adhoc_storage::access_type::read_write, 42, 100, false);
- admire::job job{42};
admire::job_requirements reqs{inputs, outputs, std::move(p)};
+
+
+ std::vector new_inputs;
+ new_inputs.reserve(NINPUTS);
+ for(int i = 0; i < NINPUTS; ++i) {
+ new_inputs.emplace_back(fmt::format("input-new-dataset-{}", i));
+ }
+
+ std::vector new_outputs;
+ new_outputs.reserve(NOUTPUTS);
+ for(int i = 0; i < NOUTPUTS; ++i) {
+ new_outputs.emplace_back(fmt::format("output-new-dataset-{}", i));
+ }
+
+ auto p2 = std::make_unique(
+ admire::storage::type::gekkofs, "foobar",
+ admire::adhoc_storage::execution_mode::separate_new,
+ admire::adhoc_storage::access_type::read_write, 42, 100, false);
+
+ admire::job_requirements new_reqs{new_inputs, new_outputs, std::move(p2)};
+
+
ADM_return_t ret = ADM_SUCCESS;
try {
- ret = admire::update_job(server, job, reqs);
+ [[maybe_unused]] const auto job = admire::register_job(server, reqs);
+
+ ret = admire::update_job(server, job, new_reqs);
+
+ fmt::print(
+ stdout,
+ "ADM_register_job() and ADM_update_job() remote procedure completed "
+ "successfully\n");
+ exit(EXIT_SUCCESS);
} catch(const std::exception& e) {
- fmt::print(stderr, "FATAL: ADM_update_job() failed: {}\n", e.what());
+ fmt::print(stderr,
+ "FATAL: ADM_register_job() or ADM_update_job() failed: {}\n",
+ e.what());
exit(EXIT_FAILURE);
}
@@ -48,7 +103,4 @@ main(int argc, char* argv[]) {
"successfully\n");
exit(EXIT_FAILURE);
}
-
- fmt::print(stdout, "ADM_update_job() remote procedure completed "
- "successfully\n");
}
diff --git a/examples/cxx/ADM_update_pfs_storage.cpp b/examples/cxx/ADM_update_pfs_storage.cpp
index f8be25691d1cd0b3b03c0302cd0d95f74c2cd8c4..e09173d58749df4f51c427c86b4124e9e520353f 100644
--- a/examples/cxx/ADM_update_pfs_storage.cpp
+++ b/examples/cxx/ADM_update_pfs_storage.cpp
@@ -1,3 +1,27 @@
+/******************************************************************************
+ * Copyright 2021, Barcelona Supercomputing Center (BSC), Spain
+ *
+ * This software was partially supported by the EuroHPC-funded project ADMIRE
+ * (Project ID: 956748, https://www.admire-eurohpc.eu).
+ *
+ * This file is part of scord.
+ *
+ * scord is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * scord is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with scord. If not, see .
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *****************************************************************************/
+
#include
#include
@@ -5,10 +29,9 @@
int
main(int argc, char* argv[]) {
- if(argc != 3) {
+ if(argc != 2) {
fmt::print(stderr, "ERROR: no location provided\n");
- fmt::print(stderr, "Usage: ADM_update_pfs_storage "
- "\n");
+ fmt::print(stderr, "Usage: ADM_update_pfs_storage \n");
exit(EXIT_FAILURE);
}
diff --git a/examples/cxx/CMakeLists.txt b/examples/cxx/CMakeLists.txt
index 1ee8d2d57ba07432a76a517ec9423ef4ae0fc747..ec8d44092afd9b75fd2ba431fe76598733aaff14 100644
--- a/examples/cxx/CMakeLists.txt
+++ b/examples/cxx/CMakeLists.txt
@@ -1,5 +1,5 @@
################################################################################
-# Copyright 2021-2022, Barcelona Supercomputing Center (BSC), Spain #
+# Copyright 2021, Barcelona Supercomputing Center (BSC), Spain #
# #
# This software was partially supported by the EuroHPC-funded project ADMIRE #
# (Project ID: 956748, https://www.admire-eurohpc.eu). #
@@ -23,23 +23,71 @@
################################################################################
list(APPEND examples_cxx
- ADM_ping
- ADM_register_job ADM_update_job ADM_remove_job
- ADM_register_adhoc_storage ADM_update_adhoc_storage
- ADM_remove_adhoc_storage ADM_deploy_adhoc_storage
- ADM_register_pfs_storage ADM_update_pfs_storage
- ADM_remove_pfs_storage
- # 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_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_cxx)
- add_executable(${example}_cxx)
- target_sources(${example}_cxx PRIVATE ${example}.cpp)
- target_link_libraries(${example}_cxx
- PUBLIC common::network::engine fmt::fmt adm_iosched)
- set_target_properties(${example}_cxx PROPERTIES OUTPUT_NAME ${example})
+ ADM_ping
+ ADM_register_job ADM_update_job ADM_remove_job
+ ADM_register_adhoc_storage ADM_update_adhoc_storage
+ ADM_remove_adhoc_storage ADM_deploy_adhoc_storage
+ ADM_register_pfs_storage ADM_update_pfs_storage
+ ADM_remove_pfs_storage
+
+ # 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_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_cxx)
+ add_executable(${example}_cxx)
+ target_sources(${example}_cxx PRIVATE ${example}.cpp)
+ target_link_libraries(${example}_cxx
+ PUBLIC common::network::engine fmt::fmt adm_iosched)
+ set_target_properties(${example}_cxx PROPERTIES OUTPUT_NAME ${example})
endforeach()
+
+if(SCORD_BUILD_TESTS)
+ add_test(ADM_ping_test ADM_ping ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_cancel_transfer_cxx_test ADM_cancel_transfer ofi+tcp://127.0.0.1:52000)
+ set_tests_properties(ADM_cancel_transfer_cxx_test PROPERTIES LABELS "ADM_cancel_transfer;cxx")
+
+ add_test(ADM_connect_data_operation_cxx_test ADM_connect_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_define_data_operation_cxx_test ADM_define_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_deploy_adhoc_storage_cxx_test ADM_deploy_adhoc_storage ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_finalize_data_operation_cxx_test ADM_finalize_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_get_pending_transfers_cxx_test ADM_get_pending_transfers ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_get_qos_constraints_cxx_test ADM_get_qos_constraints ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_get_transfer_priority_cxx_test ADM_get_transfer_priority ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_link_transfer_to_data_operation_cxx_test ADM_link_transfer_to_data_operation ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_register_job_cxx_test ADM_register_job ofi+tcp://127.0.0.1:52000)
+
+ # TODO: add_test(ADM_register_pfs_storage_test ADM_register_pfs_storage ofi+tcp://127.0.0.1:52000)
+ add_test(ADM_remove_adhoc_storage_cxx_test ADM_remove_adhoc_storage ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_remove_job_cxx_test ADM_remove_job ofi+tcp://127.0.0.1:52000)
+
+ # TODO: add_test(ADM_remove_pfs_storage_test ADM_remove_pfs_storage ofi+tcp://127.0.0.1:52000 42)
+ add_test(ADM_set_dataset_information_cxx_test ADM_set_dataset_information ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_set_io_resources_cxx_test ADM_set_io_resources ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_set_qos_constraints_cxx_test ADM_set_qos_constraints ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_set_transfer_priority_cxx_test ADM_set_transfer_priority ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_transfer_dataset_cxx_test ADM_transfer_dataset ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_update_adhoc_storage_cxx_test ADM_update_adhoc_storage ofi+tcp://127.0.0.1:52000)
+
+ add_test(ADM_update_job_cxx_test ADM_update_job ofi+tcp://127.0.0.1:52000)
+
+ # TODO: add_test(ADM_update_pfs_storage_cxx_test ADM_update_pfs_storage ofi+tcp://127.0.0.1:52000 42)
+endif()
diff --git a/src/common/net/engine.hpp b/src/common/net/engine.hpp
index c241f8a130e1ea294387bfa0d2b88e768413366e..cb31008086cf6f2d2b00d5bcbe9be64f38a7fb2a 100644
--- a/src/common/net/engine.hpp
+++ b/src/common/net/engine.hpp
@@ -126,6 +126,35 @@ struct engine {
std::shared_ptr m_context;
};
+template
+class rpc_handle {
+public:
+ rpc_handle(hg_handle_t handle, Output output)
+ : m_handle(handle), m_output(output) {}
+
+ ~rpc_handle() {
+
+ if(m_handle) {
+
+ if(m_output) {
+ margo_free_output(m_handle, m_output);
+ }
+
+ margo_destroy(m_handle);
+ }
+ }
+
+ hg_handle_t
+ native() {
+ return m_handle;
+ }
+
+private:
+ hg_handle_t m_handle;
+ Output m_output;
+};
+
+
struct endpoint {
private:
// Endpoints should only be created by calling engine::lookup()
@@ -186,7 +215,7 @@ public:
*
**/
template
- void
+ [[nodiscard]] rpc_handle
call(const std::string& id, T1 input = nullptr, T2 output = nullptr) {
const auto it = m_margo_context->m_rpc_names.find(id);
@@ -218,14 +247,7 @@ public:
ret = ::margo_get_output(handle, output);
}
-
- ret = ::margo_destroy(handle);
-
- if(ret != HG_SUCCESS) {
- throw std::runtime_error(
- fmt::format("Error during endpoint::call(): {}",
- ::HG_Error_to_string(ret)));
- }
+ return rpc_handle