diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c3aba831edfe9456484c3d5b9560c0e89aede11..b9e68ad121eb662b9325827ffa4277b802907b18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ rpc: stage: test needs: [build] script: - - export ASAN_OPTIONS=detect_odr_violation=0 + - export ASAN_OPTIONS=detect_odr_violation=0:detect_leaks=0 - 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 - cd build/examples/ diff --git a/examples/c/ADM_cancel_transfer.c b/examples/c/ADM_cancel_transfer.c index 14831a4097a529bac89e102bb143a9f0e1749fce..193279f8007aabc8501450fe471b2eda1ba9e2a3 100644 --- a/examples/c/ADM_cancel_transfer.c +++ b/examples/c/ADM_cancel_transfer.c @@ -68,14 +68,24 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_connect_data_operation.c b/examples/c/ADM_connect_data_operation.c index 38cc1daa724fe8446da32574a980258c72a78c64..cf205bdfbab824b5fb04299eb00aeb11ba6177e6 100644 --- a/examples/c/ADM_connect_data_operation.c +++ b/examples/c/ADM_connect_data_operation.c @@ -64,18 +64,29 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; + + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } ADM_job_resources_t job_resources = ADM_job_resources_create(job_nodes, NJOB_NODES); assert(job_resources); - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_define_data_operation.c b/examples/c/ADM_define_data_operation.c index ac952793cc950719b482265cba2f5531ded4a975..894f0593b62cb3e6d0b808f46cb9b0d37a5adec1 100644 --- a/examples/c/ADM_define_data_operation.c +++ b/examples/c/ADM_define_data_operation.c @@ -69,14 +69,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_deploy_adhoc_storage.c b/examples/c/ADM_deploy_adhoc_storage.c index 37fb1e4e7f9c5f72b122a0b49036aec1920ddfd3..d5533ddfb8c5172b8c26538f67e504f245035688 100644 --- a/examples/c/ADM_deploy_adhoc_storage.c +++ b/examples/c/ADM_deploy_adhoc_storage.c @@ -60,13 +60,6 @@ main(int argc, char* argv[]) { 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); - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; diff --git a/examples/c/ADM_finalize_data_operation.c b/examples/c/ADM_finalize_data_operation.c index cc6bb5a1325be789741b90bb22fdc1eb3cbbd74c..226ddb0384b5a7873a42b5ec109cdc4bde11de36 100644 --- a/examples/c/ADM_finalize_data_operation.c +++ b/examples/c/ADM_finalize_data_operation.c @@ -65,18 +65,29 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; + + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } ADM_job_resources_t job_resources = ADM_job_resources_create(job_nodes, NJOB_NODES); assert(job_resources); - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_get_pending_transfers.c b/examples/c/ADM_get_pending_transfers.c index fe320b25545300c7569ea440efbbffe037129497..90329761de7bdfc6265b98158543d7af53c9108f 100644 --- a/examples/c/ADM_get_pending_transfers.c +++ b/examples/c/ADM_get_pending_transfers.c @@ -68,14 +68,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_get_qos_constraints.c b/examples/c/ADM_get_qos_constraints.c index 366790951263cf683aa725aa61bc833b0df9d55c..339afe5d66a4a02a959f24996e3269b26a058388 100644 --- a/examples/c/ADM_get_qos_constraints.c +++ b/examples/c/ADM_get_qos_constraints.c @@ -64,18 +64,29 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; + + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } ADM_job_resources_t job_resources = ADM_job_resources_create(job_nodes, NJOB_NODES); assert(job_resources); - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_get_statistics.c b/examples/c/ADM_get_statistics.c index 294cc6c25198cb0aed600f4a4dcd0f9acceeb9ae..0d9a56033dcb8c42ae62851b7d737f1586b9c4ff 100644 --- a/examples/c/ADM_get_statistics.c +++ b/examples/c/ADM_get_statistics.c @@ -64,18 +64,29 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; + + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } ADM_job_resources_t job_resources = ADM_job_resources_create(job_nodes, NJOB_NODES); assert(job_resources); - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_get_transfer_priority.c b/examples/c/ADM_get_transfer_priority.c index c243fea926a18eef149536f03a9bd3780aefafa9..7c33200e8912bb9efbe1f2a66c81136477e65b4b 100644 --- a/examples/c/ADM_get_transfer_priority.c +++ b/examples/c/ADM_get_transfer_priority.c @@ -68,14 +68,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_link_transfer_to_data_operation.c b/examples/c/ADM_link_transfer_to_data_operation.c index 12f9024d33331b5010ae9d0481496060a599603b..c333e7e3be951253c08525b5e2ce5695e5b64bca 100644 --- a/examples/c/ADM_link_transfer_to_data_operation.c +++ b/examples/c/ADM_link_transfer_to_data_operation.c @@ -65,18 +65,29 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; + + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } ADM_job_resources_t job_resources = ADM_job_resources_create(job_nodes, NJOB_NODES); assert(job_resources); - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_register_adhoc_storage.c b/examples/c/ADM_register_adhoc_storage.c index 9b859d4e422ac3b8c8faeeb4e0d764fc872b34d8..0302f30770914afc399a41b904939a1ddee04364 100644 --- a/examples/c/ADM_register_adhoc_storage.c +++ b/examples/c/ADM_register_adhoc_storage.c @@ -60,13 +60,6 @@ main(int argc, char* argv[]) { 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); - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; diff --git a/examples/c/ADM_register_job.c b/examples/c/ADM_register_job.c index 6b4b02ca7d33cbd97ab781a938ee9cc2c63b251a..8e7c7c1b1c44b3e62764fae3368ad24f5bcd6723 100644 --- a/examples/c/ADM_register_job.c +++ b/examples/c/ADM_register_job.c @@ -68,14 +68,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " @@ -96,7 +107,7 @@ cleanup: ADM_dataset_destroy(outputs[i]); } - ADM_storage_destroy(st); + ADM_storage_destroy(adhoc_storage); ADM_adhoc_context_destroy(ctx); diff --git a/examples/c/ADM_register_pfs_storage.c b/examples/c/ADM_register_pfs_storage.c index 9d09281f5fd6e44a2e084fcf281bc64ecf488bfb..149631a4430b4bf5549ee2d05c09acf307310d79 100644 --- a/examples/c/ADM_register_pfs_storage.c +++ b/examples/c/ADM_register_pfs_storage.c @@ -57,9 +57,6 @@ main(int argc, char* argv[]) { ADM_pfs_context_t ctx = ADM_pfs_context_create("/gpfs"); assert(ctx); - ADM_storage_t st = ADM_storage_create("barbaz", ADM_STORAGE_GPFS, ctx); - assert(st); - ADM_return_t ret = ADM_register_pfs_storage(server, ctx, &pfs_storage); if(ret != ADM_SUCCESS) { diff --git a/examples/c/ADM_remove_adhoc_storage.c b/examples/c/ADM_remove_adhoc_storage.c index 45422b93fe46746f49be6d6890ebff53cd5987fc..f8b5eaba80e687b3e5dd3c1d9ca1526f933be785 100644 --- a/examples/c/ADM_remove_adhoc_storage.c +++ b/examples/c/ADM_remove_adhoc_storage.c @@ -60,13 +60,6 @@ main(int argc, char* argv[]) { 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); - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; diff --git a/examples/c/ADM_remove_job.c b/examples/c/ADM_remove_job.c index 979acc06baa41cecea9f8d6cef8429345779adc3..73dedbe4e192b27caa11a6652892fc08fab7a749 100644 --- a/examples/c/ADM_remove_job.c +++ b/examples/c/ADM_remove_job.c @@ -68,14 +68,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_remove_pfs_storage.c b/examples/c/ADM_remove_pfs_storage.c index a1a240d1915e8706327b329d4a99e835ffa7bc7c..b24b4178714f602bc0dc07745f2dfaa18cf18e3c 100644 --- a/examples/c/ADM_remove_pfs_storage.c +++ b/examples/c/ADM_remove_pfs_storage.c @@ -42,9 +42,6 @@ main(int argc, char* argv[]) { ADM_pfs_context_t ctx = ADM_pfs_context_create("/gpfs"); assert(ctx); - ADM_storage_t st = ADM_storage_create("barbaz", ADM_STORAGE_GPFS, ctx); - assert(st); - ADM_storage_t pfs_storage; ADM_return_t ret = ADM_register_pfs_storage(server, ctx, &pfs_storage); diff --git a/examples/c/ADM_set_dataset_information.c b/examples/c/ADM_set_dataset_information.c index c43169f69a989a488a4a2891e67520e033844bbf..5e342f72f4f534f45ad5417b9319302d1a6d5e19 100644 --- a/examples/c/ADM_set_dataset_information.c +++ b/examples/c/ADM_set_dataset_information.c @@ -65,18 +65,29 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; + + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } ADM_job_resources_t job_resources = ADM_job_resources_create(job_nodes, NJOB_NODES); assert(job_resources); - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_set_io_resources.c b/examples/c/ADM_set_io_resources.c index 9baed9a5a74094cae1e5b2dea0fd1032db97410e..eabe6fa9426f0f90a585338af3e77a2d52649ad4 100644 --- a/examples/c/ADM_set_io_resources.c +++ b/examples/c/ADM_set_io_resources.c @@ -64,18 +64,29 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; + + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } ADM_job_resources_t job_resources = ADM_job_resources_create(job_nodes, NJOB_NODES); assert(job_resources); - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_set_qos_constraints.c b/examples/c/ADM_set_qos_constraints.c index 20cc389cf3efb96adcc45fabb9acb30beff767bb..6353f92e04f0edec907cbdf17da97fbfbe0a98ef 100644 --- a/examples/c/ADM_set_qos_constraints.c +++ b/examples/c/ADM_set_qos_constraints.c @@ -68,14 +68,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_set_transfer_priority.c b/examples/c/ADM_set_transfer_priority.c index 77875968f72bd4085674ad8eb3638c222c60e2e6..018b294313f8e3a969c8ac8a6a110ad9b31de7c8 100644 --- a/examples/c/ADM_set_transfer_priority.c +++ b/examples/c/ADM_set_transfer_priority.c @@ -68,14 +68,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_transfer_datasets.c b/examples/c/ADM_transfer_datasets.c index f157c2bae142783b2f370e7f9e3636e1982e583b..bd918ec2b8cbde8ba93bb2a8651e4e4d52e65eab 100644 --- a/examples/c/ADM_transfer_datasets.c +++ b/examples/c/ADM_transfer_datasets.c @@ -71,14 +71,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " diff --git a/examples/c/ADM_update_adhoc_storage.c b/examples/c/ADM_update_adhoc_storage.c index e02a80331e5c781bed44d394372146dc474d496e..7080e7728e6d737244b04fb88b414cb164f0126e 100644 --- a/examples/c/ADM_update_adhoc_storage.c +++ b/examples/c/ADM_update_adhoc_storage.c @@ -60,13 +60,6 @@ main(int argc, char* argv[]) { 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); - const char* user_id = "adhoc_storage_42"; ADM_storage_t adhoc_storage; diff --git a/examples/c/ADM_update_job.c b/examples/c/ADM_update_job.c index be0b22b6ccb709565f1a7a9bf490c33eb8f3a965..35deba4b4987f9f0471376436c701966e4aee102 100644 --- a/examples/c/ADM_update_job.c +++ b/examples/c/ADM_update_job.c @@ -68,14 +68,25 @@ main(int argc, char* argv[]) { 100, false); assert(ctx); - ADM_storage_t st = ADM_storage_create("foobar", ADM_STORAGE_GEKKOFS, ctx); - assert(st); + const char* user_id = "adhoc_storage_42"; - ADM_job_requirements_t reqs = - ADM_job_requirements_create(inputs, NINPUTS, outputs, NOUTPUTS, st); + ADM_storage_t adhoc_storage; + ADM_return_t ret = + ADM_register_adhoc_storage(server, user_id, 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; + } + + ADM_job_requirements_t reqs = ADM_job_requirements_create( + inputs, NINPUTS, outputs, NOUTPUTS, adhoc_storage); assert(reqs); - ADM_return_t ret = ADM_register_job(server, job_resources, reqs, &job); + ret = ADM_register_job(server, job_resources, reqs, &job); if(ret != ADM_SUCCESS) { fprintf(stdout, "ADM_register_job() remote procedure not completed " @@ -104,7 +115,7 @@ main(int argc, char* argv[]) { } ADM_job_requirements_t new_reqs = ADM_job_requirements_create( - new_inputs, NINPUTS, new_outputs, NOUTPUTS, st); + new_inputs, NINPUTS, new_outputs, NOUTPUTS, adhoc_storage); ret = ADM_update_job(server, job, job_resources, new_reqs); diff --git a/examples/c/ADM_update_pfs_storage.c b/examples/c/ADM_update_pfs_storage.c index 6acc1127e349bc51747fdbce16664d0df83ba418..96a95afa7cdde038d4257a161891298a33b4448d 100644 --- a/examples/c/ADM_update_pfs_storage.c +++ b/examples/c/ADM_update_pfs_storage.c @@ -42,9 +42,6 @@ main(int argc, char* argv[]) { ADM_pfs_context_t ctx = ADM_pfs_context_create("/gpfs"); assert(ctx); - ADM_storage_t st = ADM_storage_create("barbaz", ADM_STORAGE_GPFS, ctx); - assert(st); - ADM_storage_t pfs_storage; ADM_return_t ret = ADM_register_pfs_storage(server, ctx, &pfs_storage); diff --git a/examples/cxx/ADM_register_adhoc_storage.cpp b/examples/cxx/ADM_register_adhoc_storage.cpp index 8e91fb73d033b7912f284b52bc0c7d8128c82cb6..8a74085a9bfb6d91b50b25cf112f92be1fe4c1b3 100644 --- a/examples/cxx/ADM_register_adhoc_storage.cpp +++ b/examples/cxx/ADM_register_adhoc_storage.cpp @@ -43,19 +43,10 @@ main(int argc, char* argv[]) { admire::server server{"tcp", argv[1]}; - const auto job_nodes = prepare_nodes(NJOB_NODES); const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); - auto p = std::make_unique( - admire::storage::type::gekkofs, "foobar", - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false); - - admire::job_requirements reqs(inputs, outputs, std::move(p)); - std::string user_id = "adhoc_storage_42"; const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ admire::adhoc_storage::execution_mode::separate_new, @@ -63,8 +54,6 @@ main(int argc, char* argv[]) { admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; try { - const auto job = admire::register_job( - server, admire::job::resources{job_nodes}, reqs); const auto adhoc_storage = admire::register_adhoc_storage( server, user_id, adhoc_storage_ctx); diff --git a/examples/cxx/ADM_register_job.cpp b/examples/cxx/ADM_register_job.cpp index c75c06b04d8d8901c09c35c5bca2f50e035165dc..9eda2df17107d5e9033dc338f27b38f9b5db2544 100644 --- a/examples/cxx/ADM_register_job.cpp +++ b/examples/cxx/ADM_register_job.cpp @@ -47,15 +47,19 @@ main(int argc, char* argv[]) { const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); - auto p = std::make_unique( - admire::storage::type::gekkofs, "foobar", + std::string user_id = "adhoc_storage_42"; + const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false); - - admire::job_requirements reqs(inputs, outputs, std::move(p)); + admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; try { + + const auto adhoc_storage = admire::register_adhoc_storage( + server, user_id, adhoc_storage_ctx); + + admire::job_requirements reqs(inputs, outputs, adhoc_storage); + [[maybe_unused]] const auto job = admire::register_job( server, admire::job::resources{job_nodes}, reqs); diff --git a/examples/cxx/ADM_transfer_datasets.cpp b/examples/cxx/ADM_transfer_datasets.cpp index c48ac934872fb04bc15dc52a3e3f186f2f3721f2..381b07778477cfe2cca74016fb3a614a87d1bb53 100644 --- a/examples/cxx/ADM_transfer_datasets.cpp +++ b/examples/cxx/ADM_transfer_datasets.cpp @@ -55,15 +55,18 @@ main(int argc, char* argv[]) { const auto qos_limits = prepare_qos_limits(NLIMITS); const auto mapping = admire::transfer::mapping::n_to_n; - auto p = std::make_unique( - admire::storage::type::gekkofs, "foobar", + std::string user_id = "adhoc_storage_42"; + const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false); - - admire::job_requirements reqs(inputs, outputs, std::move(p)); + admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; try { + const auto adhoc_storage = admire::register_adhoc_storage( + server, user_id, adhoc_storage_ctx); + + admire::job_requirements reqs(inputs, outputs, adhoc_storage); + const auto job = admire::register_job( server, admire::job::resources{job_nodes}, reqs); const auto transfer = admire::transfer_datasets( diff --git a/examples/cxx/ADM_update_job.cpp b/examples/cxx/ADM_update_job.cpp index 70bc1c8aabfcdd04c9b98f7dde5fe19f6349b9c1..84b92008487d1610e2c94e20ff328051d91c19a6 100644 --- a/examples/cxx/ADM_update_job.cpp +++ b/examples/cxx/ADM_update_job.cpp @@ -47,26 +47,22 @@ main(int argc, char* argv[]) { const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); - auto p = std::make_unique( - admire::storage::type::gekkofs, "foobar", + const auto gkfs_storage = admire::adhoc_storage{ + admire::storage::type::gekkofs, + "foobar", admire::adhoc_storage::execution_mode::separate_new, admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false); - - admire::job_requirements reqs{inputs, outputs, std::move(p)}; + admire::adhoc_storage::resources{adhoc_nodes}, + 100, + false}; + admire::job_requirements reqs{inputs, outputs, gkfs_storage}; const auto new_inputs = prepare_datasets("input-new-dataset-{}", NINPUTS); const auto new_outputs = prepare_datasets("output-new-dataset-{}", NOUTPUTS); - auto p2 = std::make_unique( - admire::storage::type::gekkofs, "foobar", - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false); - - admire::job_requirements new_reqs{new_inputs, new_outputs, std::move(p2)}; + admire::job_requirements new_reqs{new_inputs, new_outputs, gkfs_storage}; try { [[maybe_unused]] const auto job = admire::register_job( diff --git a/src/common/api/admire_types.hpp b/src/common/api/admire_types.hpp index b6ad713623b841acc3f383a7b07282c8d11bcaea..9ce2f8aa7d41ee25fdcc5dcba4df979ef1e9a32a 100644 --- a/src/common/api/admire_types.hpp +++ b/src/common/api/admire_types.hpp @@ -389,7 +389,7 @@ struct job_requirements { job_requirements(std::vector inputs, std::vector outputs, - std::unique_ptr storage); + admire::adhoc_storage adhoc_storage); explicit job_requirements(ADM_job_requirements_t reqs); @@ -406,8 +406,8 @@ struct job_requirements { inputs() const; std::vector outputs() const; - std::shared_ptr - storage() const; + std::optional + adhoc_storage() const; private: class impl; @@ -632,6 +632,20 @@ struct fmt::formatter> } }; +template <> +struct fmt::formatter> + : formatter { + + // parse is inherited from formatter. + template + auto + format(const std::optional& v, + FormatContext& ctx) const { + return formatter::format( + v ? fmt::format("{}", v.value()) : "none", ctx); + } +}; + template <> struct fmt::formatter : formatter { // parse is inherited from formatter. @@ -729,8 +743,8 @@ struct fmt::formatter : formatter { auto format(const admire::job_requirements& r, FormatContext& ctx) const { return formatter::format( - fmt::format("{{inputs: {}, outputs: {}, storage: {}}}", - r.inputs(), r.outputs(), r.storage()), + fmt::format("{{inputs: {}, outputs: {}, adhoc_storage: {}}}", + r.inputs(), r.outputs(), r.adhoc_storage()), ctx); } }; diff --git a/src/common/api/convert.cpp b/src/common/api/convert.cpp index 8f6e5f80d7ae8bca94c4d96b5f50139ed737643d..2d256784e46cacce2e53bcc639a65e4b53a5c060 100644 --- a/src/common/api/convert.cpp +++ b/src/common/api/convert.cpp @@ -96,6 +96,16 @@ convert(const adhoc_storage::ctx& ctx) { std::move(managed_adhoc_resources)}; } +managed_ctype +convert(const std::optional& adhoc_storage) { + + if(!adhoc_storage) { + return managed_ctype{}; + } + + return convert(adhoc_storage.value()); +} + managed_ctype convert(const admire::adhoc_storage& st) { @@ -106,6 +116,10 @@ convert(const admire::adhoc_storage& st) { st.user_id().c_str(), static_cast(st.type()), managed_ctx.get()); + if(st.id()) { + c_st->s_server_id = static_cast(st.id().value()); + } + return managed_ctype{c_st, std::move(managed_ctx)}; } @@ -174,8 +188,7 @@ convert(const job::resources& res) { managed_ctype convert(const admire::job_requirements& reqs) { - const auto& adhoc_storage = - *std::dynamic_pointer_cast(reqs.storage()); + const auto& adhoc_storage = reqs.adhoc_storage(); auto managed_storage = convert(adhoc_storage); auto managed_inputs = as_ctype_array(reqs.inputs()); diff --git a/src/common/api/convert.hpp b/src/common/api/convert.hpp index 7d1e84a7af8a5c32f0ed46eacb10fa9b3c58f0c5..e8ed9bbc226eb2442565f23a100f5e07a7885470 100644 --- a/src/common/api/convert.hpp +++ b/src/common/api/convert.hpp @@ -118,6 +118,8 @@ struct admire::api::managed_ctype { template <> struct admire::api::managed_ctype_array { + managed_ctype_array() = default; + explicit managed_ctype_array(ADM_node_t* data, size_t size) : m_nodes(data, size) {} @@ -150,6 +152,8 @@ struct admire::api::managed_ctype_array { template <> struct admire::api::managed_ctype { + managed_ctype() = default; + explicit managed_ctype(ADM_adhoc_resources_t res, managed_ctype_array&& nodes) : m_adhoc_resources(res), m_nodes(std::move(nodes)) {} @@ -161,6 +165,7 @@ struct admire::api::managed_ctype { ADM_adhoc_resources_t release() { + std::ignore = m_nodes.release(); return m_adhoc_resources.release(); } @@ -172,6 +177,8 @@ struct admire::api::managed_ctype { template <> struct admire::api::managed_ctype { + managed_ctype() = default; + explicit managed_ctype(ADM_adhoc_context_t ctx, managed_ctype&& resources) : m_adhoc_context(ctx), m_adhoc_resources(std::move(resources)) {} @@ -183,6 +190,7 @@ struct admire::api::managed_ctype { ADM_adhoc_context_t release() { + std::ignore = m_adhoc_resources.release(); return m_adhoc_context.release(); } @@ -194,6 +202,8 @@ struct admire::api::managed_ctype { template <> struct admire::api::managed_ctype { + managed_ctype() = default; + explicit managed_ctype(ADM_storage_t st, managed_ctype&& ctx) : m_storage(st), m_ctx(std::move(ctx)) {} @@ -205,6 +215,7 @@ struct admire::api::managed_ctype { ADM_storage_t release() { + std::ignore = m_ctx.release(); return m_storage.release(); } diff --git a/src/common/api/types.cpp b/src/common/api/types.cpp index 3319471a12e100aeb633612bdd88e95f4033bf14..39375b361ee3f86c8c2dcf1b6e09ff9662ebbd00 100644 --- a/src/common/api/types.cpp +++ b/src/common/api/types.cpp @@ -463,6 +463,7 @@ ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx) { adm_storage->s_id = (const char*) calloc(strlen(id) + 1, sizeof(char)); strcpy((char*) adm_storage->s_id, id); adm_storage->s_type = type; + adm_storage->s_server_id = -1; switch(adm_storage->s_type) { case ADM_STORAGE_GEKKOFS: @@ -799,6 +800,7 @@ ADM_job_requirements_create(ADM_dataset_t inputs[], size_t inputs_len, adm_job_reqs->r_storage = ADM_storage_create(storage->s_id, storage->s_type, storage->s_adhoc_ctx); + adm_job_reqs->r_storage->s_server_id = storage->s_server_id; return adm_job_reqs; @@ -1469,9 +1471,10 @@ public: impl(std::vector inputs, std::vector outputs, - std::unique_ptr storage) + admire::adhoc_storage adhoc_storage) : m_inputs(std::move(inputs)), m_outputs(std::move(outputs)), - m_storage(std::move(storage)) {} + m_adhoc_storage(std::move(adhoc_storage)) {} + explicit impl(ADM_job_requirements_t reqs) { m_inputs.reserve(reqs->r_inputs->l_length); @@ -1487,26 +1490,14 @@ public: } if(reqs->r_storage) { - - switch(reqs->r_storage->s_type) { - - case ADM_STORAGE_GEKKOFS: - case ADM_STORAGE_DATACLAY: - case ADM_STORAGE_EXPAND: - case ADM_STORAGE_HERCULES: - m_storage = std::make_unique( - static_cast( - reqs->r_storage->s_type), - reqs->r_storage->s_id, - reqs->r_storage->s_adhoc_ctx); - break; - case ADM_STORAGE_LUSTRE: - case ADM_STORAGE_GPFS: - m_storage = std::make_unique( - static_cast( - reqs->r_storage->s_type), - reqs->r_storage->s_id, reqs->r_storage->s_pfs_ctx); - break; + // TODO add a conversion constructor + m_adhoc_storage = admire::adhoc_storage( + static_cast(reqs->r_storage->s_type), + reqs->r_storage->s_id, reqs->r_storage->s_adhoc_ctx); + + if(const auto server_id = reqs->r_storage->s_server_id; + server_id != -1) { + m_adhoc_storage->id() = server_id; } } } @@ -1528,15 +1519,15 @@ public: return m_outputs; } - std::shared_ptr - storage() const { - return m_storage; + std::optional + adhoc_storage() const { + return m_adhoc_storage; } private: std::vector m_inputs; std::vector m_outputs; - std::shared_ptr m_storage; + std::optional m_adhoc_storage; }; @@ -1546,9 +1537,9 @@ job_requirements::job_requirements(std::vector inputs, job_requirements::job_requirements(std::vector inputs, std::vector outputs, - std::unique_ptr storage) + admire::adhoc_storage adhoc_storage) : m_pimpl(std::make_unique(std::move(inputs), std::move(outputs), - std::move(storage))) {} + std::move(adhoc_storage))) {} job_requirements::job_requirements(ADM_job_requirements_t reqs) : m_pimpl(std::make_unique(reqs)) {} @@ -1579,9 +1570,9 @@ job_requirements::outputs() const { return m_pimpl->outputs(); } -std::shared_ptr -job_requirements::storage() const { - return m_pimpl->storage(); +std::optional +job_requirements::adhoc_storage() const { + return m_pimpl->adhoc_storage(); } namespace qos { diff --git a/src/common/net/proto/rpc_types.c b/src/common/net/proto/rpc_types.c index 8a2aa6645e09dcdafbaddddd9cf6925c7ec87577..2f8379842bce156627b119cded5dc40630be9b64 100644 --- a/src/common/net/proto/rpc_types.c +++ b/src/common/net/proto/rpc_types.c @@ -427,7 +427,14 @@ hg_proc_ADM_storage_t(hg_proc_t proc, void* data) { break; } - // 3. the appropriate storage context + // 3. the server_id + ret = hg_proc_hg_int64_t(proc, &tmp->s_server_id); + + if(ret != HG_SUCCESS) { + break; + } + + // 4. the appropriate storage context switch(tmp->s_type) { case ADM_STORAGE_GEKKOFS: case ADM_STORAGE_DATACLAY: @@ -474,7 +481,14 @@ hg_proc_ADM_storage_t(hg_proc_t proc, void* data) { break; } - // 3. the appropriate storage context + // 3. the server_id + ret = hg_proc_hg_int64_t(proc, &tmp->s_server_id); + + if(ret != HG_SUCCESS) { + break; + } + + // 4. the appropriate storage context switch(tmp->s_type) { case ADM_STORAGE_GEKKOFS: case ADM_STORAGE_DATACLAY: diff --git a/src/common/net/proto/rpc_types.h b/src/common/net/proto/rpc_types.h index c11bc37fa2291b10a3dae4217c5e0bd20e80c095..94ffe7eda4d62075ed0f20069196757cbe38677c 100644 --- a/src/common/net/proto/rpc_types.h +++ b/src/common/net/proto/rpc_types.h @@ -182,7 +182,7 @@ MERCURY_GEN_STRUCT_PROC( typedef struct adm_storage { const char* s_id; ADM_storage_type_t s_type; - uint64_t s_server_id; + int64_t s_server_id; union { ADM_adhoc_context_t s_adhoc_ctx; ADM_pfs_context_t s_pfs_ctx;