diff --git a/examples/c/ADM_cancel_transfer.c b/examples/c/ADM_cancel_transfer.c index 806033118de5764719c6e85ff37f7d97c3804ad7..8a3bc88d5de2249e4aa6cf568001296795806e5d 100644 --- a/examples/c/ADM_cancel_transfer.c +++ b/examples/c/ADM_cancel_transfer.c @@ -64,15 +64,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_connect_data_operation.c b/examples/c/ADM_connect_data_operation.c index f9bf1eb3662b41be5240dca4c3dd473b76139e77..10398544879200167247455b52fa4515b7da4468 100644 --- a/examples/c/ADM_connect_data_operation.c +++ b/examples/c/ADM_connect_data_operation.c @@ -60,15 +60,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_define_data_operation.c b/examples/c/ADM_define_data_operation.c index 19d2939e20e729b2349ab6366bba0151dc468130..8b4fa0ca0e57248850cd392f053cf62fd28b4e7f 100644 --- a/examples/c/ADM_define_data_operation.c +++ b/examples/c/ADM_define_data_operation.c @@ -65,15 +65,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_deploy_adhoc_storage.c b/examples/c/ADM_deploy_adhoc_storage.c index 1cfd70b9a16a7cc6ae539df20ff60e667a3186fc..1dc7c0359a8b267da272b1ecb5ed427be34b673d 100644 --- a/examples/c/ADM_deploy_adhoc_storage.c +++ b/examples/c/ADM_deploy_adhoc_storage.c @@ -77,8 +77,7 @@ main(int argc, char* argv[]) { // 3. the adhoc storage execution context adhoc_ctx = ADM_adhoc_context_create(ADM_ADHOC_MODE_SEPARATE_NEW, - ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_ACCESS_RDWR, 100, false); if(adhoc_ctx == NULL) { fprintf(stderr, "Fatal error preparing adhoc context\n"); @@ -96,9 +95,9 @@ main(int argc, char* argv[]) { } // 2. Register the adhoc storage - if(ADM_register_adhoc_storage(server, adhoc_name, - ADM_ADHOC_STORAGE_DATACLAY, adhoc_ctx, - &adhoc_storage) != ADM_SUCCESS) { + if(ADM_register_adhoc_storage( + server, adhoc_name, ADM_ADHOC_STORAGE_DATACLAY, adhoc_ctx, + adhoc_resources, &adhoc_storage) != ADM_SUCCESS) { fprintf(stderr, "ADM_register_adhoc_storage() failed: %s\n", ADM_strerror(ret)); goto cleanup; @@ -110,8 +109,7 @@ main(int argc, char* argv[]) { // storage system new_adhoc_ctx = ADM_adhoc_context_create(ADM_ADHOC_MODE_SEPARATE_NEW, - ADM_ADHOC_ACCESS_RDWR, - adhoc_resources, 200, false); + ADM_ADHOC_ACCESS_RDWR, 200, false); if(new_adhoc_ctx == NULL) { fprintf(stderr, "Fatal error preparing new adhoc context\n"); diff --git a/examples/c/ADM_finalize_data_operation.c b/examples/c/ADM_finalize_data_operation.c index 39b311553adb4458126de2f616c55d93368ac7e5..9851326ec8e4333f976b34b334b59401d2cee9b1 100644 --- a/examples/c/ADM_finalize_data_operation.c +++ b/examples/c/ADM_finalize_data_operation.c @@ -61,15 +61,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_get_pending_transfers.c b/examples/c/ADM_get_pending_transfers.c index 7d4ba51c5d3675b30aff4ade11c7dedbe669bcc4..e2c109bf7d75360e2801e16195cf5d65674b50e1 100644 --- a/examples/c/ADM_get_pending_transfers.c +++ b/examples/c/ADM_get_pending_transfers.c @@ -64,15 +64,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_get_qos_constraints.c b/examples/c/ADM_get_qos_constraints.c index 9bcb3abcb54b2b7a15071baeec52b81171286135..6644c99ba1e1213e64f61dd05637afb90b5ea8d1 100644 --- a/examples/c/ADM_get_qos_constraints.c +++ b/examples/c/ADM_get_qos_constraints.c @@ -60,15 +60,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_get_statistics.c b/examples/c/ADM_get_statistics.c index 47b299681d74127c5dd2eabc2a0b3a588a3f43c3..9686246bb2a270854e293c3b83d5df982723edd3 100644 --- a/examples/c/ADM_get_statistics.c +++ b/examples/c/ADM_get_statistics.c @@ -60,15 +60,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_get_transfer_priority.c b/examples/c/ADM_get_transfer_priority.c index adad64834dd20356969206b2da01185572ea74e4..2be2ac0f277a9bb9512fc83048d41ac7b62cbf11 100644 --- a/examples/c/ADM_get_transfer_priority.c +++ b/examples/c/ADM_get_transfer_priority.c @@ -64,15 +64,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_link_transfer_to_data_operation.c b/examples/c/ADM_link_transfer_to_data_operation.c index 7595b926512fec676dd59ab177272f34fda109d5..66bd656b3854a7bbe5df86f6cee9a0c3c3aac7ee 100644 --- a/examples/c/ADM_link_transfer_to_data_operation.c +++ b/examples/c/ADM_link_transfer_to_data_operation.c @@ -61,15 +61,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_register_adhoc_storage.c b/examples/c/ADM_register_adhoc_storage.c index 9ffef223046b4f9a7e09d921e4b0bb108e8dd3e0..5f2a86dc3a6caeb6dfb012d02aa6685bebef0b79 100644 --- a/examples/c/ADM_register_adhoc_storage.c +++ b/examples/c/ADM_register_adhoc_storage.c @@ -74,8 +74,7 @@ main(int argc, char* argv[]) { // 3. define the adhoc execution context adhoc_ctx = ADM_adhoc_context_create(ADM_ADHOC_MODE_SEPARATE_NEW, - ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_ACCESS_RDWR, 100, false); if(adhoc_ctx == NULL) { fprintf(stderr, "Fatal error preparing adhoc context\n"); @@ -93,7 +92,8 @@ main(int argc, char* argv[]) { // 2. Register the adhoc storage if(ADM_register_adhoc_storage(server, adhoc_name, ADM_ADHOC_STORAGE_GEKKOFS, - adhoc_ctx, &adhoc_storage) != ADM_SUCCESS) { + adhoc_ctx, adhoc_resources, + &adhoc_storage) != ADM_SUCCESS) { fprintf(stderr, "ADM_register_adhoc_storage() failed: %s\n", ADM_strerror(ret)); goto cleanup; diff --git a/examples/c/ADM_register_job.c b/examples/c/ADM_register_job.c index 7105607a04be7009ca01bf8a6c108ddb3671ce67..36bc1dbb5d9acfd6e69ceb5589c00482584900f2 100644 --- a/examples/c/ADM_register_job.c +++ b/examples/c/ADM_register_job.c @@ -84,8 +84,7 @@ main(int argc, char* argv[]) { // 3. the adhoc storage execution context adhoc_ctx = ADM_adhoc_context_create(ADM_ADHOC_MODE_SEPARATE_NEW, - ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_ACCESS_RDWR, 100, false); if(adhoc_ctx == NULL) { fprintf(stderr, "Fatal error preparing adhoc context\n"); @@ -104,7 +103,8 @@ main(int argc, char* argv[]) { // 2. Register the adhoc storage if(ADM_register_adhoc_storage(server, adhoc_name, ADM_ADHOC_STORAGE_GEKKOFS, - adhoc_ctx, &adhoc_storage) != ADM_SUCCESS) { + adhoc_ctx, adhoc_resources, + &adhoc_storage) != ADM_SUCCESS) { fprintf(stderr, "ADM_register_adhoc_storage() failed: %s\n", ADM_strerror(ret)); goto cleanup; diff --git a/examples/c/ADM_remove_adhoc_storage.c b/examples/c/ADM_remove_adhoc_storage.c index 5d0834413b0b1b81167c0cd59c1bc6d16164421b..23e404bb596759944af91e9c8467375bd77c4294 100644 --- a/examples/c/ADM_remove_adhoc_storage.c +++ b/examples/c/ADM_remove_adhoc_storage.c @@ -76,8 +76,7 @@ main(int argc, char* argv[]) { // 3. the adhoc storage execution context adhoc_ctx = ADM_adhoc_context_create(ADM_ADHOC_MODE_SEPARATE_NEW, - ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_ACCESS_RDWR, 100, false); if(adhoc_ctx == NULL) { fprintf(stderr, "Fatal error preparing adhoc context\n"); @@ -96,7 +95,8 @@ main(int argc, char* argv[]) { // 2. Register the adhoc storage if(ADM_register_adhoc_storage(server, adhoc_name, ADM_ADHOC_STORAGE_GEKKOFS, - adhoc_ctx, &adhoc_storage) != ADM_SUCCESS) { + adhoc_ctx, adhoc_resources, + &adhoc_storage) != ADM_SUCCESS) { fprintf(stderr, "ADM_register_adhoc_storage() failed: %s\n", ADM_strerror(ret)); goto cleanup; diff --git a/examples/c/ADM_remove_job.c b/examples/c/ADM_remove_job.c index e95aeb55072968d7429893077850635958072673..c4d0a7c887d949f1a6c7114599dd7489bc9f5330 100644 --- a/examples/c/ADM_remove_job.c +++ b/examples/c/ADM_remove_job.c @@ -64,15 +64,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_set_dataset_information.c b/examples/c/ADM_set_dataset_information.c index 21aa11c556603ed7ce3759d6ef6d5e50dac13838..ddeefe0cf235080cb87a1f24d901b68e1aceac6e 100644 --- a/examples/c/ADM_set_dataset_information.c +++ b/examples/c/ADM_set_dataset_information.c @@ -61,15 +61,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_set_io_resources.c b/examples/c/ADM_set_io_resources.c index 8161aa0bb5b0c7347776654df72c242fe672cd5b..37989fa5b6056b76118a525b0046345e650f5a18 100644 --- a/examples/c/ADM_set_io_resources.c +++ b/examples/c/ADM_set_io_resources.c @@ -60,15 +60,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_set_qos_constraints.c b/examples/c/ADM_set_qos_constraints.c index f3b6a40f2f8420d3e55ef59eb22807fd059997d8..dec01f69424b0795655198b2e0f9c3678c8879a7 100644 --- a/examples/c/ADM_set_qos_constraints.c +++ b/examples/c/ADM_set_qos_constraints.c @@ -64,15 +64,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_set_transfer_priority.c b/examples/c/ADM_set_transfer_priority.c index fbb71729923ea91eea334c48450fe5e003f2da3f..60e33761c5f888bb5a6d181a51fb04b5ce7903fc 100644 --- a/examples/c/ADM_set_transfer_priority.c +++ b/examples/c/ADM_set_transfer_priority.c @@ -64,15 +64,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_transfer_datasets.c b/examples/c/ADM_transfer_datasets.c index 6f08030235dbca220ef79ddbe7fcedffebb66fce..73af36c5e14e7c80bc9f5f3b355a0579df1869cc 100644 --- a/examples/c/ADM_transfer_datasets.c +++ b/examples/c/ADM_transfer_datasets.c @@ -67,15 +67,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/c/ADM_update_adhoc_storage.c b/examples/c/ADM_update_adhoc_storage.c index ee74f4993c200d4e207bf8b8107d9ce6a27e83d5..f8f063979cdebf9fd480752b3798fabeb0b72a0c 100644 --- a/examples/c/ADM_update_adhoc_storage.c +++ b/examples/c/ADM_update_adhoc_storage.c @@ -27,9 +27,10 @@ #include #include "common.h" -#define NADHOC_NODES 25 -#define NINPUTS 10 -#define NOUTPUTS 5 +#define NADHOC_NODES 25 +#define N_NEW_ADHOC_NODES 10 +#define NINPUTS 10 +#define NOUTPUTS 5 int main(int argc, char* argv[]) { @@ -48,9 +49,11 @@ main(int argc, char* argv[]) { const char* adhoc_name = "adhoc_storage_42"; ADM_node_t* adhoc_nodes = NULL; + ADM_node_t* new_adhoc_nodes = NULL; ADM_adhoc_resources_t adhoc_resources = NULL; ADM_adhoc_context_t adhoc_ctx = NULL; ADM_adhoc_context_t new_adhoc_ctx = NULL; + ADM_adhoc_resources_t new_adhoc_resources = NULL; ADM_adhoc_storage_t adhoc_storage = NULL; @@ -77,8 +80,7 @@ main(int argc, char* argv[]) { // 3. the adhoc storage execution context adhoc_ctx = ADM_adhoc_context_create(ADM_ADHOC_MODE_SEPARATE_NEW, - ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_ACCESS_RDWR, 100, false); if(adhoc_ctx == NULL) { fprintf(stderr, "Fatal error preparing adhoc context\n"); @@ -97,7 +99,8 @@ main(int argc, char* argv[]) { // 2. Register the adhoc storage if(ADM_register_adhoc_storage(server, adhoc_name, ADM_ADHOC_STORAGE_GEKKOFS, - adhoc_ctx, &adhoc_storage) != ADM_SUCCESS) { + adhoc_ctx, adhoc_resources, + &adhoc_storage) != ADM_SUCCESS) { fprintf(stderr, "ADM_register_adhoc_storage() failed: %s\n", ADM_strerror(ret)); goto cleanup; @@ -105,21 +108,35 @@ main(int argc, char* argv[]) { // Now that we have an existing adhoc storage registered into the - // system, let's prepare a new execution context for the adhoc + // system, let's prepare a new set of resources for the adhoc // storage system + new_adhoc_nodes = prepare_nodes(N_NEW_ADHOC_NODES); + + if(new_adhoc_nodes == NULL) { + fprintf(stderr, "Fatal error preparing adhoc nodes\n"); + goto cleanup; + } + new_adhoc_ctx = ADM_adhoc_context_create(ADM_ADHOC_MODE_SEPARATE_NEW, - ADM_ADHOC_ACCESS_RDWR, - adhoc_resources, 200, false); + ADM_ADHOC_ACCESS_RDWR, 200, false); if(new_adhoc_ctx == NULL) { fprintf(stderr, "Fatal error preparing new adhoc context\n"); goto cleanup; } + new_adhoc_resources = + ADM_adhoc_resources_create(new_adhoc_nodes, N_NEW_ADHOC_NODES); + + if(new_adhoc_resources == NULL) { + fprintf(stderr, "Fatal error preparing new adhoc resources\n"); + goto cleanup; + } + // We can now request the update to the server - if((ret = ADM_update_adhoc_storage(server, adhoc_storage, new_adhoc_ctx)) != - ADM_SUCCESS) { + if((ret = ADM_update_adhoc_storage(server, adhoc_storage, + new_adhoc_resources)) != ADM_SUCCESS) { fprintf(stderr, "ADM_update_adhoc_storage() failed: %s\n", ADM_strerror(ret)); goto cleanup; @@ -143,6 +160,7 @@ cleanup: ADM_adhoc_context_destroy(new_adhoc_ctx); ADM_adhoc_context_destroy(adhoc_ctx); ADM_adhoc_resources_destroy(adhoc_resources); + destroy_nodes(new_adhoc_nodes, N_NEW_ADHOC_NODES); destroy_nodes(adhoc_nodes, NADHOC_NODES); exit(exit_status); } diff --git a/examples/c/ADM_update_job.c b/examples/c/ADM_update_job.c index 5e7377be2f0379d4eaa638cfae0b37c4372306b2..2e94ddedb7fe255fe007ea11c90776b8636dfece 100644 --- a/examples/c/ADM_update_job.c +++ b/examples/c/ADM_update_job.c @@ -64,15 +64,15 @@ main(int argc, char* argv[]) { assert(adhoc_resources); ADM_adhoc_context_t ctx = ADM_adhoc_context_create( - ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, adhoc_resources, - 100, false); + ADM_ADHOC_MODE_SEPARATE_NEW, ADM_ADHOC_ACCESS_RDWR, 100, false); assert(ctx); const char* name = "adhoc_storage_42"; ADM_adhoc_storage_t adhoc_storage; - ADM_return_t ret = ADM_register_adhoc_storage( - server, name, ADM_ADHOC_STORAGE_GEKKOFS, ctx, &adhoc_storage); + ADM_return_t ret = + ADM_register_adhoc_storage(server, name, ADM_ADHOC_STORAGE_GEKKOFS, + ctx, adhoc_resources, &adhoc_storage); if(ret != ADM_SUCCESS) { fprintf(stderr, diff --git a/examples/cxx/ADM_deploy_adhoc_storage.cpp b/examples/cxx/ADM_deploy_adhoc_storage.cpp index d7a34f302897497f77367e3ff15689f7ca76d788..38077ccaad2cab36c369f2f90278abf901860059 100644 --- a/examples/cxx/ADM_deploy_adhoc_storage.cpp +++ b/examples/cxx/ADM_deploy_adhoc_storage.cpp @@ -50,13 +50,13 @@ main(int argc, char* argv[]) { std::string name = "adhoc_storage_42"; const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}; + scord::adhoc_storage::access_type::read_write, 100, false}; + const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes}; try { const auto adhoc_storage = scord::register_adhoc_storage( server, name, scord::adhoc_storage::type::dataclay, - adhoc_storage_ctx); + adhoc_storage_ctx, adhoc_resources); fmt::print(stdout, "ADM_register_adhoc_storage() remote procedure completed " diff --git a/examples/cxx/ADM_register_adhoc_storage.cpp b/examples/cxx/ADM_register_adhoc_storage.cpp index 894ccd92a4efd296ca53284730bf6d5698862252..98b00c56d4808ced12d4894cbd2ec909a7e86227 100644 --- a/examples/cxx/ADM_register_adhoc_storage.cpp +++ b/examples/cxx/ADM_register_adhoc_storage.cpp @@ -50,13 +50,13 @@ main(int argc, char* argv[]) { std::string name = "adhoc_storage_42"; const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}; + scord::adhoc_storage::access_type::read_write, 100, false}; + const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes}; try { const auto adhoc_storage = scord::register_adhoc_storage( server, name, scord::adhoc_storage::type::gekkofs, - adhoc_storage_ctx); + adhoc_storage_ctx, adhoc_resources); fmt::print(stdout, "ADM_register_adhoc_storage() remote procedure completed " diff --git a/examples/cxx/ADM_register_job.cpp b/examples/cxx/ADM_register_job.cpp index 634ed2ba7a0239246c264148cf8579ab4be98ed3..267f56ad418b7ec97cfb0e919704fa489a2ec65f 100644 --- a/examples/cxx/ADM_register_job.cpp +++ b/examples/cxx/ADM_register_job.cpp @@ -50,14 +50,14 @@ main(int argc, char* argv[]) { std::string name = "adhoc_storage_42"; const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}; + scord::adhoc_storage::access_type::read_write, 100, false}; + const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes}; try { const auto adhoc_storage = scord::register_adhoc_storage( server, name, scord::adhoc_storage::type::gekkofs, - adhoc_storage_ctx); + adhoc_storage_ctx, adhoc_resources); scord::job::requirements reqs(inputs, outputs, adhoc_storage); diff --git a/examples/cxx/ADM_remove_adhoc_storage.cpp b/examples/cxx/ADM_remove_adhoc_storage.cpp index a804e41812e65341a651e3276af35a6c93d8c284..9459663b809ac91d783ed5d51d569710e1e8e27b 100644 --- a/examples/cxx/ADM_remove_adhoc_storage.cpp +++ b/examples/cxx/ADM_remove_adhoc_storage.cpp @@ -50,13 +50,13 @@ main(int argc, char* argv[]) { std::string name = "adhoc_storage_42"; const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}; + scord::adhoc_storage::access_type::read_write, 100, false}; + const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes}; try { const auto adhoc_storage = scord::register_adhoc_storage( server, name, scord::adhoc_storage::type::gekkofs, - adhoc_storage_ctx); + adhoc_storage_ctx, adhoc_resources); scord::remove_adhoc_storage(server, adhoc_storage); fmt::print(stdout, "ADM_remove_adhoc_storage() remote procedure completed " diff --git a/examples/cxx/ADM_remove_job.cpp b/examples/cxx/ADM_remove_job.cpp index ca3975f6945d80cc914a21bc406f16ce086a0dac..37498e12334b4de078305a6a25e2b53f1c4d2628 100644 --- a/examples/cxx/ADM_remove_job.cpp +++ b/examples/cxx/ADM_remove_job.cpp @@ -50,14 +50,15 @@ main(int argc, char* argv[]) { std::string name = "adhoc_storage_42"; const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}; + scord::adhoc_storage::access_type::read_write, 100, false}; + + const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes}; try { const auto adhoc_storage = scord::register_adhoc_storage( server, name, scord::adhoc_storage::type::gekkofs, - adhoc_storage_ctx); + adhoc_storage_ctx, adhoc_resources); scord::job::requirements reqs(inputs, outputs, adhoc_storage); diff --git a/examples/cxx/ADM_transfer_datasets.cpp b/examples/cxx/ADM_transfer_datasets.cpp index 56b5a24cd84da48c52dd00f2bc9d0d8dce97fed2..d13cc8ad7a1681b93c3d9719fac6d72bee02c2a1 100644 --- a/examples/cxx/ADM_transfer_datasets.cpp +++ b/examples/cxx/ADM_transfer_datasets.cpp @@ -58,13 +58,13 @@ main(int argc, char* argv[]) { std::string name = "adhoc_storage_42"; const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}; + scord::adhoc_storage::access_type::read_write, 100, false}; + const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes}; try { const auto adhoc_storage = scord::register_adhoc_storage( server, name, scord::adhoc_storage::type::gekkofs, - adhoc_storage_ctx); + adhoc_storage_ctx, adhoc_resources); scord::job::requirements reqs(inputs, outputs, adhoc_storage); diff --git a/examples/cxx/ADM_update_adhoc_storage.cpp b/examples/cxx/ADM_update_adhoc_storage.cpp index 62c3a93a39e94682dbc353894e322fd9960dce0c..36cdaf555feccddc51829a5c334781d57b163471 100644 --- a/examples/cxx/ADM_update_adhoc_storage.cpp +++ b/examples/cxx/ADM_update_adhoc_storage.cpp @@ -50,21 +50,18 @@ main(int argc, char* argv[]) { std::string name = "adhoc_storage_42"; const auto adhoc_storage_ctx = scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}; + scord::adhoc_storage::access_type::read_write, 100, false}; + const auto adhoc_resources = scord::adhoc_storage::resources{adhoc_nodes}; - const auto new_adhoc_storage_ctx = scord::adhoc_storage::ctx{ - scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{new_adhoc_nodes}, 200, false}; + const auto new_adhoc_resources = + scord::adhoc_storage::resources{new_adhoc_nodes}; try { const auto adhoc_storage = scord::register_adhoc_storage( server, name, scord::adhoc_storage::type::gekkofs, - adhoc_storage_ctx); + adhoc_storage_ctx, adhoc_resources); - scord::update_adhoc_storage(server, adhoc_storage, - new_adhoc_storage_ctx); + scord::update_adhoc_storage(server, adhoc_storage, new_adhoc_resources); fmt::print(stdout, "ADM_update_adhoc_storage() remote procedure completed " diff --git a/examples/cxx/ADM_update_job.cpp b/examples/cxx/ADM_update_job.cpp index 581029cc978a590d4a7e0d41d52a3e86c882e255..72c82031c62875295d49912bb72b4628921ea560 100644 --- a/examples/cxx/ADM_update_job.cpp +++ b/examples/cxx/ADM_update_job.cpp @@ -52,8 +52,8 @@ main(int argc, char* argv[]) { server, "foobar", scord::adhoc_storage::type::gekkofs, scord::adhoc_storage::ctx{ scord::adhoc_storage::execution_mode::separate_new, - scord::adhoc_storage::access_type::read_write, - scord::adhoc_storage::resources{adhoc_nodes}, 100, false}); + scord::adhoc_storage::access_type::read_write, 100, false}, + scord::adhoc_storage::resources{adhoc_nodes}); scord::job::requirements reqs{inputs, outputs, gkfs_storage}; diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index c00d09f38308ffd61bec57620d71d92461d42905..f4be02628c1ec4520a46e0dffd009d87db74d40f 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -112,13 +112,14 @@ ADM_return_t ADM_register_adhoc_storage(ADM_server_t server, const char* name, ADM_adhoc_storage_type_t type, ADM_adhoc_context_t ctx, + ADM_adhoc_resources_t resources, ADM_adhoc_storage_t* adhoc_storage) { - const scord::server srv{server}; - - const auto cxx_type = static_cast(type); const auto rv = scord::detail::register_adhoc_storage( - srv, name, cxx_type, scord::adhoc_storage::ctx{ctx}); + scord::server{server}, name, + static_cast(type), + scord::adhoc_storage::ctx{ctx}, + scord::adhoc_storage::resources{resources}); if(!rv) { return rv.error(); @@ -131,13 +132,13 @@ ADM_register_adhoc_storage(ADM_server_t server, const char* name, ADM_return_t ADM_update_adhoc_storage(ADM_server_t server, ADM_adhoc_storage_t adhoc_storage, - ADM_adhoc_context_t ctx) { + ADM_adhoc_resources_t new_resources) { const scord::server srv{server}; return scord::detail::update_adhoc_storage( - srv, scord::adhoc_storage::ctx{ctx}, - scord::adhoc_storage{adhoc_storage}); + srv, scord::adhoc_storage{adhoc_storage}, + scord::adhoc_storage::resources{new_resources}); } ADM_return_t diff --git a/src/lib/detail/impl.cpp b/src/lib/detail/impl.cpp index d197fb41566c379ac4d50c8d6bf75e9ffa7ba009..6f3bc40d82e359ebc7cc73e8c4153d92885ebf56 100644 --- a/src/lib/detail/impl.cpp +++ b/src/lib/detail/impl.cpp @@ -204,7 +204,8 @@ remove_job(const server& srv, const job& job) { tl::expected register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, - const adhoc_storage::ctx& ctx) { + const adhoc_storage::ctx& ctx, + const adhoc_storage::resources& resources) { scord::network::client rpc_client{srv.protocol()}; @@ -215,12 +216,14 @@ register_adhoc_storage(const server& srv, const std::string& name, const auto& endp = lookup_rv.value(); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{name: {}, type: {}, adhoc_ctx: {}}}", + "body: {{name: {}, type: {}, adhoc_ctx: {}, " + "adhoc_resources: {}}}", rpc_id, std::quoted("ADM_"s + __FUNCTION__), - std::quoted(rpc_client.self_address()), name, type, ctx); + std::quoted(rpc_client.self_address()), name, type, ctx, + resources); - if(const auto& call_rv = - endp.call("ADM_"s + __FUNCTION__, name, type, ctx); + if(const auto& call_rv = endp.call("ADM_"s + __FUNCTION__, name, type, + ctx, resources); call_rv.has_value()) { const scord::network::response_with_id resp{call_rv.value()}; @@ -236,7 +239,8 @@ register_adhoc_storage(const server& srv, const std::string& name, return tl::make_unexpected(ec); } - return scord::adhoc_storage{type, name, resp.value(), ctx}; + return scord::adhoc_storage{type, name, resp.value(), ctx, + resources}; } } @@ -245,8 +249,8 @@ register_adhoc_storage(const server& srv, const std::string& name, } scord::error_code -update_adhoc_storage(const server& srv, const adhoc_storage::ctx& new_ctx, - const adhoc_storage& adhoc_storage) { +update_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage, + const adhoc_storage::resources& new_resources) { scord::network::client rpc_client{srv.protocol()}; @@ -257,13 +261,13 @@ update_adhoc_storage(const server& srv, const adhoc_storage::ctx& new_ctx, const auto& endp = lookup_rv.value(); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{adhoc_id: {}, new_ctx: {}}}", + "body: {{adhoc_id: {}, new_resources: {}}}", rpc_id, std::quoted("ADM_"s + __FUNCTION__), std::quoted(rpc_client.self_address()), adhoc_storage.id(), - new_ctx); + new_resources); if(const auto& call_rv = endp.call("ADM_"s + __FUNCTION__, - adhoc_storage.id(), new_ctx); + adhoc_storage.id(), new_resources); call_rv.has_value()) { const scord::network::generic_response resp{call_rv.value()}; diff --git a/src/lib/detail/impl.hpp b/src/lib/detail/impl.hpp index d437b944aaa6cc46fbfa312d357da758607cff3a..40bb30c9132521941f7cec8b19f180a1db53a805 100644 --- a/src/lib/detail/impl.hpp +++ b/src/lib/detail/impl.hpp @@ -49,11 +49,12 @@ remove_job(const server& srv, const job& job); tl::expected register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, - const adhoc_storage::ctx& ctx); + const adhoc_storage::ctx& ctx, + const adhoc_storage::resources& resources); scord::error_code -update_adhoc_storage(const server& srv, const adhoc_storage::ctx& new_ctx, - const adhoc_storage& adhoc_storage); +update_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage, + const adhoc_storage::resources& new_resources); scord::error_code remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage); diff --git a/src/lib/libscord.cpp b/src/lib/libscord.cpp index 39e00510f32428100beaab16d9f8a1692d98ebad..cbe3b47c37195774ca3bbe2c88132c66d27f42c8 100644 --- a/src/lib/libscord.cpp +++ b/src/lib/libscord.cpp @@ -250,9 +250,11 @@ remove_job(const server& srv, const job& job) { scord::adhoc_storage register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, - const adhoc_storage::ctx& ctx) { + const adhoc_storage::ctx& ctx, + const adhoc_storage::resources& resources) { - const auto rv = detail::register_adhoc_storage(srv, name, type, ctx); + const auto rv = + detail::register_adhoc_storage(srv, name, type, ctx, resources); if(!rv) { throw std::runtime_error( @@ -265,9 +267,9 @@ register_adhoc_storage(const server& srv, const std::string& name, void update_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage, - const adhoc_storage::ctx& adhoc_storage_ctx) { + const adhoc_storage::resources& new_resources) { const auto ec = - detail::update_adhoc_storage(srv, adhoc_storage_ctx, adhoc_storage); + detail::update_adhoc_storage(srv, adhoc_storage, new_resources); if(!ec) { throw std::runtime_error(fmt::format( diff --git a/src/lib/scord/scord.h b/src/lib/scord/scord.h index fcfe881599569f5d7e1a6949e911089a929e66d4..fa481557a2a08c4f932cb163dab77f108c483c06 100644 --- a/src/lib/scord/scord.h +++ b/src/lib/scord/scord.h @@ -115,21 +115,21 @@ ADM_return_t ADM_register_adhoc_storage(ADM_server_t server, const char* name, ADM_adhoc_storage_type_t type, ADM_adhoc_context_t ctx, + ADM_adhoc_resources_t resources, ADM_adhoc_storage_t* adhoc_storage); /** * Update an already-registered adhoc storage system. * * @param[in] server The server to which the request is directed - * @param[in] ctx The updated EXECUTION_CONTEXT for the adhoc storage system. * @param[in] adhoc_storage An ADM_STORAGE referring to the adhoc storage - * instance of interest. + * @param[in] new_resources The new resources for teh adhoc storage instance. * @return Returns ADM_SUCCESS if the remote procedure has completed * successfully. */ ADM_return_t ADM_update_adhoc_storage(ADM_server_t server, ADM_adhoc_storage_t adhoc_storage, - ADM_adhoc_context_t ctx); + ADM_adhoc_resources_t new_resources); /** * Remove an already-registered adhoc storage system. diff --git a/src/lib/scord/scord.hpp b/src/lib/scord/scord.hpp index d3642e2847408b22084c47582e4988b2f6d6a22f..1a9a5c560b18a6df818a26b69f6b261ef48cee3b 100644 --- a/src/lib/scord/scord.hpp +++ b/src/lib/scord/scord.hpp @@ -60,11 +60,12 @@ remove_job(const server& srv, const job& job); scord::adhoc_storage register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, - const adhoc_storage::ctx& ctx); + const adhoc_storage::ctx& ctx, + const adhoc_storage::resources& resources); void update_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage, - const adhoc_storage::ctx& adhoc_storage_ctx); + const adhoc_storage::resources& new_resources); void remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage); diff --git a/src/lib/scord/types.h b/src/lib/scord/types.h index f369cc9073d2abcb416f6ffc202b957f5d91c6a8..f1f24923d809f780fdec61dce2839f3b028db3af 100644 --- a/src/lib/scord/types.h +++ b/src/lib/scord/types.h @@ -429,11 +429,13 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list); * @param[in] adhoc_ctx Some specific context information for the storage * tier or NULL if none is required. For instance, an adhoc storage system may * find it useful to provide an ADM_adhoc_context_t describing the instance. + * @param[in] adhoc_resources The adhoc resources for this instance. * @return A valid ADM_ADHOC_STORAGE if successful, or NULL in case of failure. */ ADM_adhoc_storage_t ADM_adhoc_storage_create(const char* name, ADM_adhoc_storage_type_t type, - uint64_t id, ADM_adhoc_context_t adhoc_ctx); + uint64_t id, ADM_adhoc_context_t adhoc_ctx, + ADM_adhoc_resources_t adhoc_resources); /** * Destroy an ADM_ADHOC_STORAGE created by ADM_adhoc_storage_destroy(). @@ -477,7 +479,6 @@ ADM_adhoc_resources_destroy(ADM_adhoc_resources_t res); * * @param[in] exec_mode The adhoc storage system execution mode * @param[in] access_type The adhoc storage system execution type - * @param[in] adhoc_resources The resources assigned for the storage system * @param[in] walltime The adhoc storage system walltime * @param[in] should_flush Whether the adhoc storage system should flush data in * the background @@ -485,9 +486,8 @@ ADM_adhoc_resources_destroy(ADM_adhoc_resources_t res); */ ADM_adhoc_context_t ADM_adhoc_context_create(ADM_adhoc_mode_t exec_mode, - ADM_adhoc_access_t access_type, - ADM_adhoc_resources_t adhoc_resources, - uint32_t walltime, bool should_flush); + ADM_adhoc_access_t access_type, uint32_t walltime, + bool should_flush); /** * Destroy an ADM_ADHOC_CONTEXT created by ADM_adhoc_context_create(). diff --git a/src/lib/scord/types.hpp b/src/lib/scord/types.hpp index 7978a1cd226a89015c3310d4b62ee662c10fb7ea..e017f2fbd87a25c89b0434469e5dbb0635040763 100644 --- a/src/lib/scord/types.hpp +++ b/src/lib/scord/types.hpp @@ -215,8 +215,7 @@ struct adhoc_storage { ctx() = default; ctx(execution_mode exec_mode, access_type access_type, - adhoc_storage::resources resources, std::uint32_t walltime, - bool should_flush); + std::uint32_t walltime, bool should_flush); explicit ctx(ADM_adhoc_context_t ctx); explicit operator ADM_adhoc_context_t() const; @@ -237,7 +236,6 @@ struct adhoc_storage { serialize(Archive&& ar) { ar& m_exec_mode; ar& m_access_type; - ar& m_resources; ar& m_walltime; ar& m_should_flush; } @@ -245,7 +243,6 @@ struct adhoc_storage { private: execution_mode m_exec_mode; enum access_type m_access_type; - adhoc_storage::resources m_resources; std::uint32_t m_walltime; bool m_should_flush; }; @@ -258,7 +255,8 @@ struct adhoc_storage { explicit adhoc_storage(ADM_adhoc_storage_t storage); explicit operator ADM_adhoc_storage_t() const; adhoc_storage(enum adhoc_storage::type type, std::string name, - std::uint64_t id, const scord::adhoc_storage::ctx& ctx); + std::uint64_t id, const scord::adhoc_storage::ctx& ctx, + adhoc_storage::resources resources); adhoc_storage(const adhoc_storage& other) noexcept; adhoc_storage(adhoc_storage&&) noexcept; @@ -277,9 +275,15 @@ struct adhoc_storage { adhoc_storage::ctx context() const; + adhoc_storage::resources + get_resources() const; + void update(scord::adhoc_storage::ctx new_ctx); + void + update(scord::adhoc_storage::resources new_resources); + // The implementation for this must be deferred until // after the declaration of the PIMPL class template @@ -783,11 +787,10 @@ struct fmt::formatter : formatter { auto format(const scord::adhoc_storage::ctx& c, FormatContext& ctx) const { - const auto str = - fmt::format("{{execution_mode: {}, access_type: {}, " - "resources: {}, walltime: {}, should_flush: {}}}", - c.exec_mode(), c.access_type(), c.resources(), - c.walltime(), c.should_flush()); + const auto str = fmt::format("{{execution_mode: {}, access_type: {}, " + "walltime: {}, should_flush: {}}}", + c.exec_mode(), c.access_type(), + c.walltime(), c.should_flush()); return formatter::format(str, ctx); } diff --git a/src/lib/types.c b/src/lib/types.c index 763e1b21f08bde163c5ccced1f06049b5557e1dd..0a44d15f7034a397d93e263c26faf5e53b1d05f7 100644 --- a/src/lib/types.c +++ b/src/lib/types.c @@ -430,7 +430,8 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list) { ADM_adhoc_storage_t ADM_adhoc_storage_create(const char* name, ADM_adhoc_storage_type_t type, - uint64_t id, ADM_adhoc_context_t adhoc_ctx) { + uint64_t id, ADM_adhoc_context_t adhoc_ctx, + ADM_adhoc_resources_t adhoc_resources) { struct adm_adhoc_storage* adm_adhoc_storage = (struct adm_adhoc_storage*) malloc(sizeof(*adm_adhoc_storage)); @@ -466,6 +467,8 @@ ADM_adhoc_storage_create(const char* name, ADM_adhoc_storage_type_t type, memcpy(adm_adhoc_storage->s_adhoc_ctx, adhoc_ctx, sizeof(*adhoc_ctx)); + adm_adhoc_storage->s_resources = adhoc_resources; + return adm_adhoc_storage; cleanup_on_error: @@ -654,9 +657,8 @@ ADM_data_operation_destroy(ADM_data_operation_t op) { ADM_adhoc_context_t ADM_adhoc_context_create(ADM_adhoc_mode_t exec_mode, - ADM_adhoc_access_t access_type, - ADM_adhoc_resources_t adhoc_resources, - uint32_t walltime, bool should_flush) { + ADM_adhoc_access_t access_type, uint32_t walltime, + bool should_flush) { struct adm_adhoc_context* adm_adhoc_context = (struct adm_adhoc_context*) malloc(sizeof(*adm_adhoc_context)); @@ -668,7 +670,6 @@ ADM_adhoc_context_create(ADM_adhoc_mode_t exec_mode, adm_adhoc_context->c_mode = exec_mode; adm_adhoc_context->c_access = access_type; - adm_adhoc_context->c_resources = adhoc_resources; adm_adhoc_context->c_walltime = walltime; adm_adhoc_context->c_should_bg_flush = should_flush; @@ -826,7 +827,7 @@ ADM_job_requirements_create(ADM_dataset_t inputs[], size_t inputs_len, adm_job_reqs->r_adhoc_storage = ADM_adhoc_storage_create( adhoc_storage->s_name, adhoc_storage->s_type, adhoc_storage->s_id, - adhoc_storage->s_adhoc_ctx); + adhoc_storage->s_adhoc_ctx, adhoc_storage->s_resources); return adm_job_reqs; diff --git a/src/lib/types.cpp b/src/lib/types.cpp index ca3430137257fc7e7bf1f0b5e27e4f6338f3a017..2b23bd7325ca8811e9ae5f4e39306841c55b28ea 100644 --- a/src/lib/types.cpp +++ b/src/lib/types.cpp @@ -544,23 +544,19 @@ adhoc_storage::resources::nodes() const { adhoc_storage::ctx::ctx(adhoc_storage::execution_mode exec_mode, adhoc_storage::access_type access_type, - adhoc_storage::resources resources, std::uint32_t walltime, bool should_flush) - : m_exec_mode(exec_mode), m_access_type(access_type), - m_resources(std::move(resources)), m_walltime(walltime), + : m_exec_mode(exec_mode), m_access_type(access_type), m_walltime(walltime), m_should_flush(should_flush) {} adhoc_storage::ctx::ctx(ADM_adhoc_context_t ctx) : adhoc_storage::ctx(static_cast(ctx->c_mode), static_cast(ctx->c_access), - adhoc_storage::resources{ctx->c_resources}, ctx->c_walltime, ctx->c_should_bg_flush) {} adhoc_storage::ctx::operator ADM_adhoc_context_t() const { return ADM_adhoc_context_create( static_cast(m_exec_mode), - static_cast(m_access_type), - static_cast(m_resources), m_walltime, + static_cast(m_access_type), m_walltime, m_should_flush); } @@ -574,11 +570,6 @@ adhoc_storage::ctx::access_type() const { return m_access_type; } -adhoc_storage::resources -adhoc_storage::ctx::resources() const { - return m_resources; -} - std::uint32_t adhoc_storage::ctx::walltime() const { return m_walltime; @@ -594,9 +585,10 @@ class adhoc_storage::impl { public: impl() = default; explicit impl(enum adhoc_storage::type type, std::string name, - std::uint64_t id, adhoc_storage::ctx ctx) + std::uint64_t id, adhoc_storage::ctx ctx, + struct adhoc_storage::resources resources) : m_type(type), m_name(std::move(name)), m_id(id), - m_ctx(std::move(ctx)) {} + m_ctx(std::move(ctx)), m_resources(std::move(resources)) {} impl(const impl& rhs) = default; impl(impl&& rhs) = default; impl& @@ -625,11 +617,21 @@ public: return m_ctx; } + struct adhoc_storage::resources + resources() const { + return m_resources; + }; + void update(adhoc_storage::ctx new_ctx) { m_ctx = std::move(new_ctx); } + void + update(scord::adhoc_storage::resources new_resources) { + m_resources = std::move(new_resources); + } + template void load(Archive& ar) { @@ -654,6 +656,7 @@ private: std::string m_name; std::uint64_t m_id; adhoc_storage::ctx m_ctx; + struct adhoc_storage::resources m_resources; }; adhoc_storage::adhoc_storage() = default; @@ -661,29 +664,32 @@ adhoc_storage::adhoc_storage() = default; adhoc_storage::adhoc_storage(enum adhoc_storage::type type, std::string name, std::uint64_t id, execution_mode exec_mode, access_type access_type, - adhoc_storage::resources res, + struct adhoc_storage::resources res, std::uint32_t walltime, bool should_flush) - : m_pimpl(std::make_unique( - type, std::move(name), id, - adhoc_storage::ctx{exec_mode, access_type, std::move(res), - walltime, should_flush})) {} + : m_pimpl(std::make_unique(type, std::move(name), id, + adhoc_storage::ctx{exec_mode, access_type, + walltime, should_flush}, + std::move(res))) {} adhoc_storage::adhoc_storage(ADM_adhoc_storage_t st) : m_pimpl(std::make_unique( static_cast(st->s_type), st->s_name, - st->s_id, adhoc_storage::ctx{st->s_adhoc_ctx})) {} + st->s_id, adhoc_storage::ctx{st->s_adhoc_ctx}, + adhoc_storage::resources{st->s_resources})) {} adhoc_storage::operator ADM_adhoc_storage_t() const { return ADM_adhoc_storage_create( m_pimpl->name().c_str(), static_cast(m_pimpl->type()), - m_pimpl->id(), - static_cast(m_pimpl->context())); + m_pimpl->id(), static_cast(m_pimpl->context()), + static_cast(m_pimpl->resources())); } adhoc_storage::adhoc_storage(enum adhoc_storage::type type, std::string name, - std::uint64_t id, const adhoc_storage::ctx& ctx) - : m_pimpl(std::make_unique(type, std::move(name), id, ctx)) {} + std::uint64_t id, const adhoc_storage::ctx& ctx, + adhoc_storage::resources resources) + : m_pimpl(std::make_unique(type, std::move(name), id, ctx, + std::move(resources))) {} adhoc_storage::adhoc_storage(const adhoc_storage& other) noexcept : m_pimpl(std::make_unique(*other.m_pimpl)) {} @@ -719,11 +725,21 @@ adhoc_storage::context() const { return m_pimpl->context(); } +adhoc_storage::resources +adhoc_storage::get_resources() const { + return m_pimpl->resources(); +} + void adhoc_storage::update(scord::adhoc_storage::ctx new_ctx) { return m_pimpl->update(std::move(new_ctx)); } +void +adhoc_storage::update(scord::adhoc_storage::resources new_resources) { + return m_pimpl->update(std::move(new_resources)); +} + // since the PIMPL class is fully defined at this point, we can now // define the serialization function template diff --git a/src/lib/types_private.h b/src/lib/types_private.h index 2c59eefd4ec1caaebda277cebfb9ea6bb2b37db9..db44caf5dd896f24341082fffeddcb6814cf5d60 100644 --- a/src/lib/types_private.h +++ b/src/lib/types_private.h @@ -79,8 +79,6 @@ struct adm_adhoc_context { ADM_adhoc_mode_t c_mode; /** The adhoc storage system access type */ ADM_adhoc_access_t c_access; - /** The resources assigned for the adhoc storage system */ - ADM_adhoc_resources_t c_resources; /** The adhoc storage system walltime */ uint32_t c_walltime; /** Whether the adhoc storage system should flush data in the background */ @@ -97,6 +95,8 @@ struct adm_adhoc_storage { ADM_adhoc_storage_type_t s_type; uint64_t s_id; ADM_adhoc_context_t s_adhoc_ctx; + /** The resources assigned for the adhoc storage system */ + ADM_adhoc_resources_t s_resources; }; struct adm_pfs_storage { diff --git a/src/scord/adhoc_storage_manager.hpp b/src/scord/adhoc_storage_manager.hpp index c0d6d051ebafbc374bec87634b0cb2b296d69358..381991a698497652efd5b2cdc0bced505de84d6c 100644 --- a/src/scord/adhoc_storage_manager.hpp +++ b/src/scord/adhoc_storage_manager.hpp @@ -43,7 +43,8 @@ struct adhoc_storage_manager : scord::utils::singleton { tl::expected, scord::error_code> create(enum scord::adhoc_storage::type type, const std::string& name, - const scord::adhoc_storage::ctx& ctx) { + const scord::adhoc_storage::ctx& ctx, + const scord::adhoc_storage::resources& resources) { static std::atomic_uint64_t current_id; std::uint64_t id = current_id++; @@ -54,7 +55,8 @@ struct adhoc_storage_manager : scord::utils::singleton { it == m_adhoc_storages.end()) { const auto& [it_adhoc, inserted] = m_adhoc_storages.emplace( id, std::make_shared( - scord::adhoc_storage{type, name, id, ctx})); + scord::adhoc_storage{type, name, id, ctx, + resources})); if(!inserted) { LOGGER_ERROR("{}: Emplace failed", __FUNCTION__); @@ -69,14 +71,14 @@ struct adhoc_storage_manager : scord::utils::singleton { } scord::error_code - update(std::uint64_t id, scord::adhoc_storage::ctx new_ctx) { + update(std::uint64_t id, scord::adhoc_storage::resources new_resources) { abt::unique_lock lock(m_adhoc_storages_mutex); if(const auto it = m_adhoc_storages.find(id); it != m_adhoc_storages.end()) { const auto current_adhoc_info = it->second; - current_adhoc_info->update(std::move(new_ctx)); + current_adhoc_info->update(std::move(new_resources)); return scord::error_code::success; } diff --git a/src/scord/internal_types.hpp b/src/scord/internal_types.hpp index f8064945913f016c3dbda0899cb84e25d49b6b0d..72d34e4d0371df1929e6294bf8fddbb13bd5b123 100644 --- a/src/scord/internal_types.hpp +++ b/src/scord/internal_types.hpp @@ -74,8 +74,8 @@ struct adhoc_storage_info { } void - update(scord::adhoc_storage::ctx adhoc_context) { - m_adhoc_storage.update(std::move(adhoc_context)); + update(scord::adhoc_storage::resources new_resources) { + m_adhoc_storage.update(std::move(new_resources)); } scord::error_code diff --git a/src/scord/rpc_handlers.cpp b/src/scord/rpc_handlers.cpp index 0f4909fa3c7c531f3a02a58302eaf5d6631cd6db..9c4045bc00bd88af52cf23c50cb377bc41747285 100644 --- a/src/scord/rpc_handlers.cpp +++ b/src/scord/rpc_handlers.cpp @@ -198,7 +198,8 @@ remove_job(const request& req, scord::job_id job_id) { void register_adhoc_storage(const request& req, const std::string& name, enum scord::adhoc_storage::type type, - const scord::adhoc_storage::ctx& ctx) { + const scord::adhoc_storage::ctx& ctx, + const scord::adhoc_storage::resources& resources) { using scord::network::get_address; @@ -206,15 +207,16 @@ register_adhoc_storage(const request& req, const std::string& name, const auto rpc_id = remote_procedure::new_id(); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{name: {}, type: {}, adhoc_ctx: {}}}", + "body: {{name: {}, type: {}, adhoc_ctx: {}, " + "adhoc_resources: {}}}", rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), - name, type, ctx); + name, type, ctx, resources); scord::error_code ec; std::optional adhoc_id; auto& adhoc_manager = scord::adhoc_storage_manager::instance(); - if(const auto am_result = adhoc_manager.create(type, name, ctx); + if(const auto am_result = adhoc_manager.create(type, name, ctx, resources); am_result.has_value()) { const auto& adhoc_storage_info = am_result.value(); adhoc_id = adhoc_storage_info->adhoc_storage().id(); @@ -237,7 +239,7 @@ register_adhoc_storage(const request& req, const std::string& name, void update_adhoc_storage(const request& req, std::uint64_t adhoc_id, - const scord::adhoc_storage::ctx& new_ctx) { + const scord::adhoc_storage::resources& new_resources) { using scord::network::get_address; @@ -245,12 +247,12 @@ update_adhoc_storage(const request& req, std::uint64_t adhoc_id, const auto rpc_id = remote_procedure::new_id(); LOGGER_INFO("rpc id: {} name: {} from: {} => " - "body: {{adhoc_id: {}, new_ctx: {}}}", + "body: {{adhoc_id: {}, new_resources: {}}}", rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), - adhoc_id, new_ctx); + adhoc_id, new_resources); auto& adhoc_manager = scord::adhoc_storage_manager::instance(); - const auto ec = adhoc_manager.update(adhoc_id, new_ctx); + const auto ec = adhoc_manager.update(adhoc_id, new_resources); if(!ec) { LOGGER_ERROR( @@ -323,8 +325,8 @@ deploy_adhoc_storage(const request& req, std::uint64_t adhoc_id) { if(adhoc_storage.type() == scord::adhoc_storage::type::gekkofs) { const auto adhoc_ctx = adhoc_storage.context(); /* Number of nodes */ - const std::string nodes = - std::to_string(adhoc_ctx.resources().nodes().size()); + const std::string nodes = std::to_string( + adhoc_storage.get_resources().nodes().size()); /* Walltime */ const std::string walltime = std::to_string(adhoc_ctx.walltime()); diff --git a/src/scord/rpc_handlers.hpp b/src/scord/rpc_handlers.hpp index 94d84aebab169a3cc8396d3af98e4065ef07deda..c0bc39638518673053a2ed16633b4b461e3c827b 100644 --- a/src/scord/rpc_handlers.hpp +++ b/src/scord/rpc_handlers.hpp @@ -50,10 +50,11 @@ remove_job(const request& req, scord::job_id job_id); void register_adhoc_storage(const request& req, const std::string& name, enum scord::adhoc_storage::type type, - const scord::adhoc_storage::ctx& ctx); + const scord::adhoc_storage::ctx& ctx, + const scord::adhoc_storage::resources& resources); void update_adhoc_storage(const request& req, std::uint64_t adhoc_id, - const scord::adhoc_storage::ctx& new_ctx); + const scord::adhoc_storage::resources& new_resources); void remove_adhoc_storage(const request& req, std::uint64_t adhoc_id);