From bf97d7e4154030286c4e46f5bdf1dcc714cd9105 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 13:03:01 +0100 Subject: [PATCH 01/10] Rename API library to libscord.so --- examples/c/CMakeLists.txt | 2 +- examples/cxx/CMakeLists.txt | 2 +- src/lib/CMakeLists.txt | 14 ++++++++------ src/lib/admire.cpp | 4 ++-- tests/CMakeLists.txt | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 4db1d89d..d9c9d948 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -52,7 +52,7 @@ target_link_libraries(c_examples_common common::api::types) foreach(example IN LISTS examples_c) add_executable(${example}_c) target_sources(${example}_c PRIVATE ${example}.c) - target_link_libraries(${example}_c PUBLIC adm_iosched c_examples_common) + target_link_libraries(${example}_c PUBLIC libscord c_examples_common) set_target_properties(${example}_c PROPERTIES OUTPUT_NAME ${example}) endforeach() diff --git a/examples/cxx/CMakeLists.txt b/examples/cxx/CMakeLists.txt index 24d14c57..a06c06b3 100644 --- a/examples/cxx/CMakeLists.txt +++ b/examples/cxx/CMakeLists.txt @@ -53,7 +53,7 @@ foreach(example IN LISTS examples_cxx) add_executable(${example}_cxx) target_sources(${example}_cxx PRIVATE ${example}.cpp) target_link_libraries(${example}_cxx - PUBLIC fmt::fmt adm_iosched cxx_examples_common) + PUBLIC fmt::fmt libscord cxx_examples_common) set_target_properties(${example}_cxx PROPERTIES OUTPUT_NAME ${example}) endforeach() diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index e3817f51..ba5a496d 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -22,23 +22,25 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ################################################################################ -add_library(adm_iosched SHARED) +add_library(libscord SHARED) -target_sources(adm_iosched +target_sources(libscord PUBLIC admire.h admire.hpp PRIVATE admire.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp) -set_target_properties(adm_iosched PROPERTIES PUBLIC_HEADER "admire.h;admire.hpp") +set_target_properties(libscord PROPERTIES PUBLIC_HEADER "admire.h;admire.hpp") -target_include_directories(adm_iosched PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(libscord PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(adm_iosched PRIVATE +target_link_libraries(libscord PRIVATE common::network::rpc_client common::network::rpc_types PUBLIC tl::expected common::api::types) +set_target_properties(libscord PROPERTIES OUTPUT_NAME "scord") + install( - TARGETS adm_iosched + TARGETS libscord LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} diff --git a/src/lib/admire.cpp b/src/lib/admire.cpp index e94384b9..63a70415 100644 --- a/src/lib/admire.cpp +++ b/src/lib/admire.cpp @@ -54,10 +54,10 @@ init_logger() { if(const auto p = std::getenv(admire::env::LOG); p && !std::string{p}.empty() && std::string{p} != "0") { if(const auto log_file = std::getenv(admire::env::LOG_OUTPUT)) { - scord::logger::create_global_logger("libadm_iosched", "file", + scord::logger::create_global_logger("libscord", "file", log_file); } else { - scord::logger::create_global_logger("libadm_iosched", + scord::logger::create_global_logger("libscord", "console color"); } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 679503c6..62f61732 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,7 +25,7 @@ add_executable(tests) target_sources(tests PRIVATE test.cpp) -target_link_libraries(tests PRIVATE Catch2::Catch2WithMain adm_iosched) +target_link_libraries(tests PRIVATE Catch2::Catch2WithMain libscord) include(Catch) catch_discover_tests(tests) -- GitLab From 9db332a6cb144da9e9fefba6fb5eb62930035a12 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 13:16:23 +0100 Subject: [PATCH 02/10] Public headers now live in $PREFIX/include/scord --- src/common/api/CMakeLists.txt | 5 ----- src/lib/CMakeLists.txt | 29 ++++++++++++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/common/api/CMakeLists.txt b/src/common/api/CMakeLists.txt index e2eb4e98..8c36e118 100644 --- a/src/common/api/CMakeLists.txt +++ b/src/common/api/CMakeLists.txt @@ -33,8 +33,3 @@ target_link_libraries(_api_types PRIVATE Margo::Margo common::logger PUBLIC fmt::fmt common::abt_cxx) set_property(TARGET _api_types PROPERTY POSITION_INDEPENDENT_CODE ON) - -install( - FILES admire_types.h admire_types.hpp - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index ba5a496d..cb6808bc 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -24,18 +24,29 @@ add_library(libscord SHARED) -target_sources(libscord +target_sources( + libscord PUBLIC admire.h admire.hpp - PRIVATE admire.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp) + PRIVATE admire.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp +) -set_target_properties(libscord PROPERTIES PUBLIC_HEADER "admire.h;admire.hpp") +list(APPEND public_headers "admire.h" + "${CMAKE_SOURCE_DIR}/src/common/api/admire_types.h" "admire.hpp" + "${CMAKE_SOURCE_DIR}/src/common/api/admire_types.hpp" +) -target_include_directories(libscord PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +set_target_properties(libscord PROPERTIES PUBLIC_HEADER "${public_headers}") -target_link_libraries(libscord PRIVATE - common::network::rpc_client - common::network::rpc_types PUBLIC - tl::expected common::api::types) +target_include_directories( + libscord PUBLIC $ + $ +) + +target_link_libraries( + libscord + PRIVATE common::network::rpc_client common::network::rpc_types + PUBLIC tl::expected common::api::types +) set_target_properties(libscord PROPERTIES OUTPUT_NAME "scord") @@ -43,5 +54,5 @@ install( TARGETS libscord LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) -- GitLab From e9f337febd8d857bdd8a06200f482cbf4bb09fe1 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 13:29:26 +0100 Subject: [PATCH 03/10] Rename admire_types.h to scord/types.h --- examples/c/common.c | 1 - examples/c/common.h | 2 +- src/common/api/CMakeLists.txt | 2 +- src/common/api/admire_types.hpp | 2 +- src/common/api/convert.hpp | 2 +- src/common/api/errors.c | 2 +- src/common/api/{admire_types.h => scord/types.h} | 6 +++--- src/common/net/proto/CMakeLists.txt | 2 +- src/common/net/proto/rpc_types.h | 2 +- src/lib/CMakeLists.txt | 2 +- src/lib/admire.h | 4 ++-- src/lib/c_wrapper.cpp | 2 +- 12 files changed, 14 insertions(+), 15 deletions(-) rename src/common/api/{admire_types.h => scord/types.h} (99%) diff --git a/examples/c/common.c b/examples/c/common.c index 19c7ece2..eaeae2b5 100644 --- a/examples/c/common.c +++ b/examples/c/common.c @@ -3,7 +3,6 @@ #include #include "common.h" -#include "admire_types.h" ADM_node_t* prepare_nodes(size_t n) { diff --git a/examples/c/common.h b/examples/c/common.h index 92f0d9c1..0aeab9c9 100644 --- a/examples/c/common.h +++ b/examples/c/common.h @@ -1,7 +1,7 @@ #ifndef SCORD_C_EXAMPLES_COMMON_H #define SCORD_C_EXAMPLES_COMMON_H -#include +#include ADM_node_t* prepare_nodes(size_t n); diff --git a/src/common/api/CMakeLists.txt b/src/common/api/CMakeLists.txt index 8c36e118..b35531d5 100644 --- a/src/common/api/CMakeLists.txt +++ b/src/common/api/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(_api_types STATIC) -target_sources(_api_types PUBLIC admire_types.h admire_types.hpp PRIVATE +target_sources(_api_types PUBLIC scord/types.h admire_types.hpp PRIVATE types.cpp convert.hpp convert.cpp internal_types.hpp errors.c) target_include_directories(_api_types PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/common/api/admire_types.hpp b/src/common/api/admire_types.hpp index 9719690f..65c95c97 100644 --- a/src/common/api/admire_types.hpp +++ b/src/common/api/admire_types.hpp @@ -33,7 +33,7 @@ #include #include #include -#include "admire_types.h" +#include namespace admire { diff --git a/src/common/api/convert.hpp b/src/common/api/convert.hpp index 7c95b640..09e0c373 100644 --- a/src/common/api/convert.hpp +++ b/src/common/api/convert.hpp @@ -25,7 +25,7 @@ #ifndef SCORD_CONVERT_HPP #define SCORD_CONVERT_HPP -#include "admire_types.h" +#include "scord/types.h" #include "admire_types.hpp" namespace admire::api { diff --git a/src/common/api/errors.c b/src/common/api/errors.c index 19cc00ea..5c4b2bd8 100644 --- a/src/common/api/errors.c +++ b/src/common/api/errors.c @@ -22,7 +22,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#include +#include "scord/types.h" const char* const adm_errlist[ADM_ERR_MAX + 1] = { [ADM_SUCCESS] = "Success", diff --git a/src/common/api/admire_types.h b/src/common/api/scord/types.h similarity index 99% rename from src/common/api/admire_types.h rename to src/common/api/scord/types.h index 197780d7..f369cc90 100644 --- a/src/common/api/admire_types.h +++ b/src/common/api/scord/types.h @@ -22,8 +22,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#ifndef SCORD_ADMIRE_TYPES_H -#define SCORD_ADMIRE_TYPES_H +#ifndef SCORD_TYPES_H +#define SCORD_TYPES_H #include #include @@ -652,4 +652,4 @@ ADM_data_operation_destroy(ADM_data_operation_t op); } // extern "C" #endif -#endif // SCORD_ADMIRE_TYPES_H +#endif // SCORD_TYPES_H diff --git a/src/common/net/proto/CMakeLists.txt b/src/common/net/proto/CMakeLists.txt index 10702cb0..32681285 100644 --- a/src/common/net/proto/CMakeLists.txt +++ b/src/common/net/proto/CMakeLists.txt @@ -29,7 +29,7 @@ set_property(TARGET _rpc_types PROPERTY POSITION_INDEPENDENT_CODE ON) target_include_directories(_rpc_types PUBLIC ${CMAKE_SOURCE_DIR}/src/lib) target_sources( _rpc_types - PRIVATE rpc_types.h rpc_types.c ${CMAKE_SOURCE_DIR}/src/lib/admire.h + PRIVATE rpc_types.h rpc_types.c ) target_link_libraries(_rpc_types PRIVATE common::api::types Mercury::Mercury diff --git a/src/common/net/proto/rpc_types.h b/src/common/net/proto/rpc_types.h index cf9b5187..8fbd581f 100644 --- a/src/common/net/proto/rpc_types.h +++ b/src/common/net/proto/rpc_types.h @@ -28,7 +28,7 @@ #include // NOLINT #include #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index cb6808bc..6d5f7ed7 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -31,7 +31,7 @@ target_sources( ) list(APPEND public_headers "admire.h" - "${CMAKE_SOURCE_DIR}/src/common/api/admire_types.h" "admire.hpp" + "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.h" "admire.hpp" "${CMAKE_SOURCE_DIR}/src/common/api/admire_types.hpp" ) diff --git a/src/lib/admire.h b/src/lib/admire.h index 186b8329..b3b82f7b 100644 --- a/src/lib/admire.h +++ b/src/lib/admire.h @@ -28,7 +28,7 @@ #include #include #include -#include "admire_types.h" +#include #ifdef __cplusplus extern "C" { @@ -44,7 +44,7 @@ extern "C" { /* Public type definitions and type-related functions */ /******************************************************************************/ -// See admire_types.h +// See types.h /******************************************************************************/ diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index c608ae47..72beff48 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "detail/impl.hpp" -- GitLab From ca7437f282cf77a0c7dd8ff8e908abd39dedeff7 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 14:40:40 +0100 Subject: [PATCH 04/10] Rename admire_types.hpp to scord/types.hpp --- examples/cxx/common.hpp | 2 +- src/common/api/CMakeLists.txt | 2 +- src/common/api/convert.hpp | 2 +- src/common/api/{admire_types.hpp => scord/types.hpp} | 6 +++--- src/common/api/types.cpp | 2 +- src/common/net/request.hpp | 2 +- src/lib/CMakeLists.txt | 2 +- src/lib/admire.h | 2 +- src/lib/admire.hpp | 4 ++-- src/lib/c_wrapper.cpp | 2 +- src/lib/detail/impl.cpp | 2 +- src/scord-ctl/rpc_handlers.hpp | 2 +- src/scord/adhoc_storage_manager.hpp | 2 +- src/scord/job_manager.hpp | 2 +- src/scord/pfs_storage_manager.hpp | 2 +- src/scord/rpc_handlers.hpp | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) rename src/common/api/{admire_types.hpp => scord/types.hpp} (99%) diff --git a/examples/cxx/common.hpp b/examples/cxx/common.hpp index ca08c7e5..38ffe7f0 100644 --- a/examples/cxx/common.hpp +++ b/examples/cxx/common.hpp @@ -2,7 +2,7 @@ #define SCORD_CXX_EXAMPLES_COMMON_HPP #include -#include +#include std::vector prepare_nodes(size_t n); diff --git a/src/common/api/CMakeLists.txt b/src/common/api/CMakeLists.txt index b35531d5..01d93dd2 100644 --- a/src/common/api/CMakeLists.txt +++ b/src/common/api/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(_api_types STATIC) -target_sources(_api_types PUBLIC scord/types.h admire_types.hpp PRIVATE +target_sources(_api_types PUBLIC scord/types.h scord/types.hpp PRIVATE types.cpp convert.hpp convert.cpp internal_types.hpp errors.c) target_include_directories(_api_types PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/common/api/convert.hpp b/src/common/api/convert.hpp index 09e0c373..6189a5cb 100644 --- a/src/common/api/convert.hpp +++ b/src/common/api/convert.hpp @@ -26,7 +26,7 @@ #define SCORD_CONVERT_HPP #include "scord/types.h" -#include "admire_types.hpp" +#include "scord/types.hpp" namespace admire::api { diff --git a/src/common/api/admire_types.hpp b/src/common/api/scord/types.hpp similarity index 99% rename from src/common/api/admire_types.hpp rename to src/common/api/scord/types.hpp index 65c95c97..98a1326a 100644 --- a/src/common/api/admire_types.hpp +++ b/src/common/api/scord/types.hpp @@ -22,8 +22,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#ifndef SCORD_ADMIRE_TYPES_HPP -#define SCORD_ADMIRE_TYPES_HPP +#ifndef SCORD_TYPES_HPP +#define SCORD_TYPES_HPP #include #include @@ -1041,4 +1041,4 @@ struct fmt::formatter> } }; -#endif // SCORD_ADMIRE_TYPES_HPP +#endif // SCORD_TYPES_HPP diff --git a/src/common/api/types.cpp b/src/common/api/types.cpp index 56f2a124..dda37ccf 100644 --- a/src/common/api/types.cpp +++ b/src/common/api/types.cpp @@ -28,7 +28,7 @@ #include #include #include -#include "admire_types.hpp" +#include "scord/types.hpp" #include "internal_types.hpp" /******************************************************************************/ diff --git a/src/common/net/request.hpp b/src/common/net/request.hpp index 5c36cb88..84ead0d2 100644 --- a/src/common/net/request.hpp +++ b/src/common/net/request.hpp @@ -26,7 +26,7 @@ #define SCORD_NET_REQUEST_HPP #include -#include "admire_types.hpp" +#include namespace scord::network { diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 6d5f7ed7..4ebb8683 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -32,7 +32,7 @@ target_sources( list(APPEND public_headers "admire.h" "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.h" "admire.hpp" - "${CMAKE_SOURCE_DIR}/src/common/api/admire_types.hpp" + "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.hpp" ) set_target_properties(libscord PROPERTIES PUBLIC_HEADER "${public_headers}") diff --git a/src/lib/admire.h b/src/lib/admire.h index b3b82f7b..b9991f27 100644 --- a/src/lib/admire.h +++ b/src/lib/admire.h @@ -44,7 +44,7 @@ extern "C" { /* Public type definitions and type-related functions */ /******************************************************************************/ -// See types.h +// See scord/types.h /******************************************************************************/ diff --git a/src/lib/admire.hpp b/src/lib/admire.hpp index a7106a9d..403f2e27 100644 --- a/src/lib/admire.hpp +++ b/src/lib/admire.hpp @@ -25,7 +25,7 @@ #include #include #include -#include "admire_types.hpp" +#include "scord/types.hpp" #include "net/proto/rpc_types.h" #ifndef SCORD_ADMIRE_HPP @@ -35,7 +35,7 @@ /* Public type definitions and type-related functions */ /******************************************************************************/ -// See admire_types.hpp +// See scord/types.hpp /******************************************************************************/ diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index 72beff48..5a8a4b46 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include "detail/impl.hpp" diff --git a/src/lib/detail/impl.cpp b/src/lib/detail/impl.cpp index 67ab4a70..63f2ce93 100644 --- a/src/lib/detail/impl.cpp +++ b/src/lib/detail/impl.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "impl.hpp" using namespace std::literals; diff --git a/src/scord-ctl/rpc_handlers.hpp b/src/scord-ctl/rpc_handlers.hpp index 199ca912..a896d794 100644 --- a/src/scord-ctl/rpc_handlers.hpp +++ b/src/scord-ctl/rpc_handlers.hpp @@ -27,7 +27,7 @@ #include #include -#include +#include namespace scord::network::handlers { diff --git a/src/scord/adhoc_storage_manager.hpp b/src/scord/adhoc_storage_manager.hpp index 65d0a1f7..98c87e28 100644 --- a/src/scord/adhoc_storage_manager.hpp +++ b/src/scord/adhoc_storage_manager.hpp @@ -26,7 +26,7 @@ #ifndef SCORD_ADHOC_STORAGE_MANAGER_HPP #define SCORD_ADHOC_STORAGE_MANAGER_HPP -#include +#include #include #include #include diff --git a/src/scord/job_manager.hpp b/src/scord/job_manager.hpp index 2c8ead05..df608331 100644 --- a/src/scord/job_manager.hpp +++ b/src/scord/job_manager.hpp @@ -25,7 +25,7 @@ #ifndef SCORD_JOB_MANAGER_HPP #define SCORD_JOB_MANAGER_HPP -#include +#include #include #include #include diff --git a/src/scord/pfs_storage_manager.hpp b/src/scord/pfs_storage_manager.hpp index 48b31037..c71c1b8f 100644 --- a/src/scord/pfs_storage_manager.hpp +++ b/src/scord/pfs_storage_manager.hpp @@ -25,7 +25,7 @@ #ifndef SCORD_PFS_STORAGE_MANAGER_HPP #define SCORD_PFS_STORAGE_MANAGER_HPP -#include +#include #include #include #include diff --git a/src/scord/rpc_handlers.hpp b/src/scord/rpc_handlers.hpp index d901fb39..880c6913 100644 --- a/src/scord/rpc_handlers.hpp +++ b/src/scord/rpc_handlers.hpp @@ -27,7 +27,7 @@ #include #include -#include +#include namespace scord::network::handlers { -- GitLab From 61699d8d282727b9498e52575ea6d90414a6931b Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 14:54:17 +0100 Subject: [PATCH 05/10] Move internal_types.hpp to scord/internal_types.hpp --- src/common/api/CMakeLists.txt | 2 +- src/common/api/{ => scord}/internal_types.hpp | 0 src/common/api/types.cpp | 2 +- src/lib/{admire.h => scord.h} | 0 src/scord/adhoc_storage_manager.hpp | 2 +- src/scord/job_manager.hpp | 2 +- src/scord/pfs_storage_manager.hpp | 2 +- 7 files changed, 5 insertions(+), 5 deletions(-) rename src/common/api/{ => scord}/internal_types.hpp (100%) rename src/lib/{admire.h => scord.h} (100%) diff --git a/src/common/api/CMakeLists.txt b/src/common/api/CMakeLists.txt index 01d93dd2..99d81b70 100644 --- a/src/common/api/CMakeLists.txt +++ b/src/common/api/CMakeLists.txt @@ -25,7 +25,7 @@ add_library(_api_types STATIC) target_sources(_api_types PUBLIC scord/types.h scord/types.hpp PRIVATE - types.cpp convert.hpp convert.cpp internal_types.hpp errors.c) + types.cpp convert.hpp convert.cpp scord/internal_types.hpp errors.c) target_include_directories(_api_types PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/common/api/internal_types.hpp b/src/common/api/scord/internal_types.hpp similarity index 100% rename from src/common/api/internal_types.hpp rename to src/common/api/scord/internal_types.hpp diff --git a/src/common/api/types.cpp b/src/common/api/types.cpp index dda37ccf..824c95d0 100644 --- a/src/common/api/types.cpp +++ b/src/common/api/types.cpp @@ -29,7 +29,7 @@ #include #include #include "scord/types.hpp" -#include "internal_types.hpp" +#include "scord/internal_types.hpp" /******************************************************************************/ /* C Type definitions and related functions */ diff --git a/src/lib/admire.h b/src/lib/scord.h similarity index 100% rename from src/lib/admire.h rename to src/lib/scord.h diff --git a/src/scord/adhoc_storage_manager.hpp b/src/scord/adhoc_storage_manager.hpp index 98c87e28..32c975ce 100644 --- a/src/scord/adhoc_storage_manager.hpp +++ b/src/scord/adhoc_storage_manager.hpp @@ -27,7 +27,7 @@ #define SCORD_ADHOC_STORAGE_MANAGER_HPP #include -#include +#include #include #include #include diff --git a/src/scord/job_manager.hpp b/src/scord/job_manager.hpp index df608331..74023fd8 100644 --- a/src/scord/job_manager.hpp +++ b/src/scord/job_manager.hpp @@ -26,7 +26,7 @@ #define SCORD_JOB_MANAGER_HPP #include -#include +#include #include #include #include diff --git a/src/scord/pfs_storage_manager.hpp b/src/scord/pfs_storage_manager.hpp index c71c1b8f..46b0182c 100644 --- a/src/scord/pfs_storage_manager.hpp +++ b/src/scord/pfs_storage_manager.hpp @@ -26,7 +26,7 @@ #define SCORD_PFS_STORAGE_MANAGER_HPP #include -#include +#include #include #include #include -- GitLab From 4b4bfa56702492f0b440233e4ed8132d7375038d Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 15:32:06 +0100 Subject: [PATCH 06/10] Rename admire.h to scord/scord.h --- examples/c/ADM_cancel_transfer.c | 2 +- examples/c/ADM_connect_data_operation.c | 2 +- examples/c/ADM_define_data_operation.c | 2 +- examples/c/ADM_deploy_adhoc_storage.c | 2 +- examples/c/ADM_finalize_data_operation.c | 2 +- examples/c/ADM_get_pending_transfers.c | 2 +- examples/c/ADM_get_qos_constraints.c | 2 +- examples/c/ADM_get_statistics.c | 2 +- examples/c/ADM_get_transfer_priority.c | 2 +- examples/c/ADM_link_transfer_to_data_operation.c | 2 +- examples/c/ADM_ping.c | 2 +- examples/c/ADM_register_adhoc_storage.c | 2 +- examples/c/ADM_register_job.c | 2 +- examples/c/ADM_register_pfs_storage.c | 2 +- examples/c/ADM_remove_adhoc_storage.c | 2 +- examples/c/ADM_remove_job.c | 2 +- examples/c/ADM_remove_pfs_storage.c | 2 +- examples/c/ADM_set_dataset_information.c | 2 +- examples/c/ADM_set_io_resources.c | 2 +- examples/c/ADM_set_qos_constraints.c | 2 +- examples/c/ADM_set_transfer_priority.c | 2 +- examples/c/ADM_transfer_datasets.c | 2 +- examples/c/ADM_update_adhoc_storage.c | 2 +- examples/c/ADM_update_job.c | 2 +- examples/c/ADM_update_pfs_storage.c | 2 +- src/lib/CMakeLists.txt | 4 ++-- src/lib/admire.hpp | 2 +- src/lib/c_wrapper.cpp | 2 +- src/lib/{ => scord}/scord.h | 6 +++--- tests/test.cpp | 2 +- 30 files changed, 33 insertions(+), 33 deletions(-) rename src/lib/{ => scord}/scord.h (99%) diff --git a/examples/c/ADM_cancel_transfer.c b/examples/c/ADM_cancel_transfer.c index fb921ded..80603311 100644 --- a/examples/c/ADM_cancel_transfer.c +++ b/examples/c/ADM_cancel_transfer.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_connect_data_operation.c b/examples/c/ADM_connect_data_operation.c index d47ffa0a..f9bf1eb3 100644 --- a/examples/c/ADM_connect_data_operation.c +++ b/examples/c/ADM_connect_data_operation.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_define_data_operation.c b/examples/c/ADM_define_data_operation.c index cc63b091..19d2939e 100644 --- a/examples/c/ADM_define_data_operation.c +++ b/examples/c/ADM_define_data_operation.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_deploy_adhoc_storage.c b/examples/c/ADM_deploy_adhoc_storage.c index ef77fb0b..1cfd70b9 100644 --- a/examples/c/ADM_deploy_adhoc_storage.c +++ b/examples/c/ADM_deploy_adhoc_storage.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "common.h" #define NADHOC_NODES 25 diff --git a/examples/c/ADM_finalize_data_operation.c b/examples/c/ADM_finalize_data_operation.c index 62dd9c34..39b31155 100644 --- a/examples/c/ADM_finalize_data_operation.c +++ b/examples/c/ADM_finalize_data_operation.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_get_pending_transfers.c b/examples/c/ADM_get_pending_transfers.c index 26ea286a..7d4ba51c 100644 --- a/examples/c/ADM_get_pending_transfers.c +++ b/examples/c/ADM_get_pending_transfers.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_get_qos_constraints.c b/examples/c/ADM_get_qos_constraints.c index f1b15b83..9bcb3abc 100644 --- a/examples/c/ADM_get_qos_constraints.c +++ b/examples/c/ADM_get_qos_constraints.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_get_statistics.c b/examples/c/ADM_get_statistics.c index fcec8a87..47b29968 100644 --- a/examples/c/ADM_get_statistics.c +++ b/examples/c/ADM_get_statistics.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_get_transfer_priority.c b/examples/c/ADM_get_transfer_priority.c index 3ed3b1ae..adad6483 100644 --- a/examples/c/ADM_get_transfer_priority.c +++ b/examples/c/ADM_get_transfer_priority.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_link_transfer_to_data_operation.c b/examples/c/ADM_link_transfer_to_data_operation.c index 348d54ff..7595b926 100644 --- a/examples/c/ADM_link_transfer_to_data_operation.c +++ b/examples/c/ADM_link_transfer_to_data_operation.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_ping.c b/examples/c/ADM_ping.c index 0140a9d1..a197642f 100644 --- a/examples/c/ADM_ping.c +++ b/examples/c/ADM_ping.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include int diff --git a/examples/c/ADM_register_adhoc_storage.c b/examples/c/ADM_register_adhoc_storage.c index 756f2f7c..9ffef223 100644 --- a/examples/c/ADM_register_adhoc_storage.c +++ b/examples/c/ADM_register_adhoc_storage.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "common.h" #define NADHOC_NODES 25 diff --git a/examples/c/ADM_register_job.c b/examples/c/ADM_register_job.c index 2ee75d15..7105607a 100644 --- a/examples/c/ADM_register_job.c +++ b/examples/c/ADM_register_job.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "common.h" #define NJOB_NODES 50 diff --git a/examples/c/ADM_register_pfs_storage.c b/examples/c/ADM_register_pfs_storage.c index 5b65a411..8510bfc3 100644 --- a/examples/c/ADM_register_pfs_storage.c +++ b/examples/c/ADM_register_pfs_storage.c @@ -24,7 +24,7 @@ #include #include -#include +#include int main(int argc, char* argv[]) { diff --git a/examples/c/ADM_remove_adhoc_storage.c b/examples/c/ADM_remove_adhoc_storage.c index d8c1bbce..5d083441 100644 --- a/examples/c/ADM_remove_adhoc_storage.c +++ b/examples/c/ADM_remove_adhoc_storage.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "common.h" #define NADHOC_NODES 25 diff --git a/examples/c/ADM_remove_job.c b/examples/c/ADM_remove_job.c index 826e950f..e95aeb55 100644 --- a/examples/c/ADM_remove_job.c +++ b/examples/c/ADM_remove_job.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_remove_pfs_storage.c b/examples/c/ADM_remove_pfs_storage.c index 8f0ab302..d2bc0017 100644 --- a/examples/c/ADM_remove_pfs_storage.c +++ b/examples/c/ADM_remove_pfs_storage.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include int diff --git a/examples/c/ADM_set_dataset_information.c b/examples/c/ADM_set_dataset_information.c index a04735a7..21aa11c5 100644 --- a/examples/c/ADM_set_dataset_information.c +++ b/examples/c/ADM_set_dataset_information.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_set_io_resources.c b/examples/c/ADM_set_io_resources.c index 6b6c6f48..8161aa0b 100644 --- a/examples/c/ADM_set_io_resources.c +++ b/examples/c/ADM_set_io_resources.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_set_qos_constraints.c b/examples/c/ADM_set_qos_constraints.c index b82941e2..f3b6a40f 100644 --- a/examples/c/ADM_set_qos_constraints.c +++ b/examples/c/ADM_set_qos_constraints.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_set_transfer_priority.c b/examples/c/ADM_set_transfer_priority.c index dc13d14d..fbb71729 100644 --- a/examples/c/ADM_set_transfer_priority.c +++ b/examples/c/ADM_set_transfer_priority.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_transfer_datasets.c b/examples/c/ADM_transfer_datasets.c index d0be9ed4..6f080302 100644 --- a/examples/c/ADM_transfer_datasets.c +++ b/examples/c/ADM_transfer_datasets.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_update_adhoc_storage.c b/examples/c/ADM_update_adhoc_storage.c index 89bd4738..ee74f499 100644 --- a/examples/c/ADM_update_adhoc_storage.c +++ b/examples/c/ADM_update_adhoc_storage.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "common.h" #define NADHOC_NODES 25 diff --git a/examples/c/ADM_update_job.c b/examples/c/ADM_update_job.c index 18fdb7d6..5e7377be 100644 --- a/examples/c/ADM_update_job.c +++ b/examples/c/ADM_update_job.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "common.h" diff --git a/examples/c/ADM_update_pfs_storage.c b/examples/c/ADM_update_pfs_storage.c index 55b369d6..95aea01c 100644 --- a/examples/c/ADM_update_pfs_storage.c +++ b/examples/c/ADM_update_pfs_storage.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include int diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 4ebb8683..670171e9 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -26,11 +26,11 @@ add_library(libscord SHARED) target_sources( libscord - PUBLIC admire.h admire.hpp + PUBLIC scord/scord.h admire.hpp PRIVATE admire.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp ) -list(APPEND public_headers "admire.h" +list(APPEND public_headers "scord/scord.h" "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.h" "admire.hpp" "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.hpp" ) diff --git a/src/lib/admire.hpp b/src/lib/admire.hpp index 403f2e27..c2dfc0e3 100644 --- a/src/lib/admire.hpp +++ b/src/lib/admire.hpp @@ -22,7 +22,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#include +#include #include #include #include "scord/types.hpp" diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index 5a8a4b46..15b930e0 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -22,7 +22,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#include +#include #include #include #include diff --git a/src/lib/scord.h b/src/lib/scord/scord.h similarity index 99% rename from src/lib/scord.h rename to src/lib/scord/scord.h index b9991f27..a686ea57 100644 --- a/src/lib/scord.h +++ b/src/lib/scord/scord.h @@ -22,8 +22,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#ifndef SCORD_ADMIRE_H -#define SCORD_ADMIRE_H +#ifndef SCORD_H +#define SCORD_H #include #include @@ -473,4 +473,4 @@ ADM_strerror(ADM_return_t errnum); } // extern "C" #endif -#endif // SCORD_ADMIRE_H +#endif // SCORD_H diff --git a/tests/test.cpp b/tests/test.cpp index f7830dc8..31cdd319 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include SCENARIO("Error messages can be printed", "[lib][ADM_strerror]") { -- GitLab From 70c3447b1cb4fb1b8398081284be8428c2ac28fc Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 15:46:47 +0100 Subject: [PATCH 07/10] Rename admire.hpp to scord/scord.hpp --- examples/cxx/ADM_cancel_transfer.cpp | 2 +- examples/cxx/ADM_connect_data_operation.cpp | 2 +- examples/cxx/ADM_define_data_operation.cpp | 2 +- examples/cxx/ADM_deploy_adhoc_storage.cpp | 2 +- examples/cxx/ADM_finalize_data_operation.cpp | 2 +- examples/cxx/ADM_get_pending_transfers.cpp | 2 +- examples/cxx/ADM_get_qos_constraints.cpp | 2 +- examples/cxx/ADM_get_statistics.cpp | 2 +- examples/cxx/ADM_get_transfer_priority.cpp | 2 +- examples/cxx/ADM_link_transfer_to_data_operation.cpp | 2 +- examples/cxx/ADM_ping.cpp | 2 +- examples/cxx/ADM_register_adhoc_storage.cpp | 2 +- examples/cxx/ADM_register_job.cpp | 2 +- examples/cxx/ADM_register_pfs_storage.cpp | 2 +- examples/cxx/ADM_remove_adhoc_storage.cpp | 2 +- examples/cxx/ADM_remove_job.cpp | 2 +- examples/cxx/ADM_remove_pfs_storage.cpp | 4 ++-- examples/cxx/ADM_set_dataset_information.cpp | 2 +- examples/cxx/ADM_set_io_resources.cpp | 2 +- examples/cxx/ADM_set_qos_constraints.cpp | 2 +- examples/cxx/ADM_set_transfer_priority.cpp | 2 +- examples/cxx/ADM_transfer_datasets.cpp | 2 +- examples/cxx/ADM_update_adhoc_storage.cpp | 2 +- examples/cxx/ADM_update_job.cpp | 2 +- examples/cxx/ADM_update_pfs_storage.cpp | 2 +- src/lib/CMakeLists.txt | 4 ++-- src/lib/admire.cpp | 2 +- src/lib/c_wrapper.cpp | 2 +- src/lib/detail/impl.hpp | 2 +- src/lib/{admire.hpp => scord/scord.hpp} | 6 +++--- 30 files changed, 34 insertions(+), 34 deletions(-) rename src/lib/{admire.hpp => scord/scord.hpp} (98%) diff --git a/examples/cxx/ADM_cancel_transfer.cpp b/examples/cxx/ADM_cancel_transfer.cpp index 4543974f..3f4dada0 100644 --- a/examples/cxx/ADM_cancel_transfer.cpp +++ b/examples/cxx/ADM_cancel_transfer.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_connect_data_operation.cpp b/examples/cxx/ADM_connect_data_operation.cpp index 62614f92..0c48a4ad 100644 --- a/examples/cxx/ADM_connect_data_operation.cpp +++ b/examples/cxx/ADM_connect_data_operation.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int main(int argc, char* argv[]) { diff --git a/examples/cxx/ADM_define_data_operation.cpp b/examples/cxx/ADM_define_data_operation.cpp index 1d2a0297..fb75b042 100644 --- a/examples/cxx/ADM_define_data_operation.cpp +++ b/examples/cxx/ADM_define_data_operation.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_deploy_adhoc_storage.cpp b/examples/cxx/ADM_deploy_adhoc_storage.cpp index ccfc76c1..ab8296f7 100644 --- a/examples/cxx/ADM_deploy_adhoc_storage.cpp +++ b/examples/cxx/ADM_deploy_adhoc_storage.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NJOB_NODES 50 diff --git a/examples/cxx/ADM_finalize_data_operation.cpp b/examples/cxx/ADM_finalize_data_operation.cpp index c3eab90c..9b422dd6 100644 --- a/examples/cxx/ADM_finalize_data_operation.cpp +++ b/examples/cxx/ADM_finalize_data_operation.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int main(int argc, char* argv[]) { diff --git a/examples/cxx/ADM_get_pending_transfers.cpp b/examples/cxx/ADM_get_pending_transfers.cpp index 4d3c69f5..9df1504c 100644 --- a/examples/cxx/ADM_get_pending_transfers.cpp +++ b/examples/cxx/ADM_get_pending_transfers.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_get_qos_constraints.cpp b/examples/cxx/ADM_get_qos_constraints.cpp index c1828aa4..13d5955d 100644 --- a/examples/cxx/ADM_get_qos_constraints.cpp +++ b/examples/cxx/ADM_get_qos_constraints.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_get_statistics.cpp b/examples/cxx/ADM_get_statistics.cpp index b3c78675..9fa1723e 100644 --- a/examples/cxx/ADM_get_statistics.cpp +++ b/examples/cxx/ADM_get_statistics.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int main(int argc, char* argv[]) { diff --git a/examples/cxx/ADM_get_transfer_priority.cpp b/examples/cxx/ADM_get_transfer_priority.cpp index 8fef9925..0436c0d0 100644 --- a/examples/cxx/ADM_get_transfer_priority.cpp +++ b/examples/cxx/ADM_get_transfer_priority.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_link_transfer_to_data_operation.cpp b/examples/cxx/ADM_link_transfer_to_data_operation.cpp index 8ebb02c3..d7b6b6b8 100644 --- a/examples/cxx/ADM_link_transfer_to_data_operation.cpp +++ b/examples/cxx/ADM_link_transfer_to_data_operation.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int main(int argc, char* argv[]) { diff --git a/examples/cxx/ADM_ping.cpp b/examples/cxx/ADM_ping.cpp index d687e60f..a5916892 100644 --- a/examples/cxx/ADM_ping.cpp +++ b/examples/cxx/ADM_ping.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int main(int argc, char* argv[]) { diff --git a/examples/cxx/ADM_register_adhoc_storage.cpp b/examples/cxx/ADM_register_adhoc_storage.cpp index 4b00c3d4..a6708966 100644 --- a/examples/cxx/ADM_register_adhoc_storage.cpp +++ b/examples/cxx/ADM_register_adhoc_storage.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NJOB_NODES 50 diff --git a/examples/cxx/ADM_register_job.cpp b/examples/cxx/ADM_register_job.cpp index a016ea2f..e9409037 100644 --- a/examples/cxx/ADM_register_job.cpp +++ b/examples/cxx/ADM_register_job.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NJOB_NODES 50 diff --git a/examples/cxx/ADM_register_pfs_storage.cpp b/examples/cxx/ADM_register_pfs_storage.cpp index b3ad5e47..ad56507c 100644 --- a/examples/cxx/ADM_register_pfs_storage.cpp +++ b/examples/cxx/ADM_register_pfs_storage.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_remove_adhoc_storage.cpp b/examples/cxx/ADM_remove_adhoc_storage.cpp index a9714cc3..5acbc039 100644 --- a/examples/cxx/ADM_remove_adhoc_storage.cpp +++ b/examples/cxx/ADM_remove_adhoc_storage.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NJOB_NODES 50 diff --git a/examples/cxx/ADM_remove_job.cpp b/examples/cxx/ADM_remove_job.cpp index 1320946f..45b190c2 100644 --- a/examples/cxx/ADM_remove_job.cpp +++ b/examples/cxx/ADM_remove_job.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NJOB_NODES 50 diff --git a/examples/cxx/ADM_remove_pfs_storage.cpp b/examples/cxx/ADM_remove_pfs_storage.cpp index d03833a4..903b5dca 100644 --- a/examples/cxx/ADM_remove_pfs_storage.cpp +++ b/examples/cxx/ADM_remove_pfs_storage.cpp @@ -22,8 +22,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#include "fmt/format.h" -#include "admire.hpp" +#include +#include int diff --git a/examples/cxx/ADM_set_dataset_information.cpp b/examples/cxx/ADM_set_dataset_information.cpp index 3d1ac5ba..863dd322 100644 --- a/examples/cxx/ADM_set_dataset_information.cpp +++ b/examples/cxx/ADM_set_dataset_information.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_set_io_resources.cpp b/examples/cxx/ADM_set_io_resources.cpp index ab9108a4..342a0cb3 100644 --- a/examples/cxx/ADM_set_io_resources.cpp +++ b/examples/cxx/ADM_set_io_resources.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_set_qos_constraints.cpp b/examples/cxx/ADM_set_qos_constraints.cpp index 3b3f84fe..2a46f110 100644 --- a/examples/cxx/ADM_set_qos_constraints.cpp +++ b/examples/cxx/ADM_set_qos_constraints.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_set_transfer_priority.cpp b/examples/cxx/ADM_set_transfer_priority.cpp index f9fe2e69..1e2e9fa5 100644 --- a/examples/cxx/ADM_set_transfer_priority.cpp +++ b/examples/cxx/ADM_set_transfer_priority.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/examples/cxx/ADM_transfer_datasets.cpp b/examples/cxx/ADM_transfer_datasets.cpp index efd62144..0d3571a4 100644 --- a/examples/cxx/ADM_transfer_datasets.cpp +++ b/examples/cxx/ADM_transfer_datasets.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NJOB_NODES 50 diff --git a/examples/cxx/ADM_update_adhoc_storage.cpp b/examples/cxx/ADM_update_adhoc_storage.cpp index 54b6033b..7787aae0 100644 --- a/examples/cxx/ADM_update_adhoc_storage.cpp +++ b/examples/cxx/ADM_update_adhoc_storage.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NADHOC_NODES 25 diff --git a/examples/cxx/ADM_update_job.cpp b/examples/cxx/ADM_update_job.cpp index 1d8152f6..cf70a971 100644 --- a/examples/cxx/ADM_update_job.cpp +++ b/examples/cxx/ADM_update_job.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include "common.hpp" #define NJOB_NODES 50 diff --git a/examples/cxx/ADM_update_pfs_storage.cpp b/examples/cxx/ADM_update_pfs_storage.cpp index 6a090a6c..696af2e4 100644 --- a/examples/cxx/ADM_update_pfs_storage.cpp +++ b/examples/cxx/ADM_update_pfs_storage.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include int diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 670171e9..5fd26b59 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -26,12 +26,12 @@ add_library(libscord SHARED) target_sources( libscord - PUBLIC scord/scord.h admire.hpp + PUBLIC scord/scord.h scord/scord.hpp PRIVATE admire.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp ) list(APPEND public_headers "scord/scord.h" - "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.h" "admire.hpp" + "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.h" "scord/scord.hpp" "${CMAKE_SOURCE_DIR}/src/common/api/scord/types.hpp" ) diff --git a/src/lib/admire.cpp b/src/lib/admire.cpp index 63a70415..ca1f2102 100644 --- a/src/lib/admire.cpp +++ b/src/lib/admire.cpp @@ -22,7 +22,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -#include +#include #include #include #include diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index 15b930e0..15e06703 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -23,7 +23,7 @@ *****************************************************************************/ #include -#include +#include #include #include #include diff --git a/src/lib/detail/impl.hpp b/src/lib/detail/impl.hpp index bb24d14e..337f6e18 100644 --- a/src/lib/detail/impl.hpp +++ b/src/lib/detail/impl.hpp @@ -26,7 +26,7 @@ #ifndef SCORD_ADMIRE_IMPL_HPP #define SCORD_ADMIRE_IMPL_HPP -#include +#include #include namespace admire::detail { diff --git a/src/lib/admire.hpp b/src/lib/scord/scord.hpp similarity index 98% rename from src/lib/admire.hpp rename to src/lib/scord/scord.hpp index c2dfc0e3..4933f574 100644 --- a/src/lib/admire.hpp +++ b/src/lib/scord/scord.hpp @@ -28,8 +28,8 @@ #include "scord/types.hpp" #include "net/proto/rpc_types.h" -#ifndef SCORD_ADMIRE_HPP -#define SCORD_ADMIRE_HPP +#ifndef SCORD_HPP +#define SCORD_HPP /******************************************************************************/ /* Public type definitions and type-related functions */ @@ -146,4 +146,4 @@ get_statistics(const server& srv, ADM_job_t job, ADM_job_stats_t** stats); } // namespace admire -#endif // SCORD_ADMIRE_HPP +#endif // SCORD_HPP -- GitLab From 71f41b89238d8a49f98eed1d849835c1d9553167 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 15:48:32 +0100 Subject: [PATCH 08/10] Rename admire.cpp to libscord.cpp --- src/lib/CMakeLists.txt | 2 +- src/lib/{admire.cpp => libscord.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/lib/{admire.cpp => libscord.cpp} (100%) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 5fd26b59..cae76952 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -27,7 +27,7 @@ add_library(libscord SHARED) target_sources( libscord PUBLIC scord/scord.h scord/scord.hpp - PRIVATE admire.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp + PRIVATE libscord.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp ) list(APPEND public_headers "scord/scord.h" diff --git a/src/lib/admire.cpp b/src/lib/libscord.cpp similarity index 100% rename from src/lib/admire.cpp rename to src/lib/libscord.cpp -- GitLab From f697f41fa1ea42a943784f89e299c2ef283d4f91 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 16:08:39 +0100 Subject: [PATCH 09/10] Rename admire:: namespace to scord:: --- examples/cxx/ADM_cancel_transfer.cpp | 4 +- examples/cxx/ADM_connect_data_operation.cpp | 6 +- examples/cxx/ADM_define_data_operation.cpp | 4 +- examples/cxx/ADM_deploy_adhoc_storage.cpp | 16 +- examples/cxx/ADM_finalize_data_operation.cpp | 4 +- examples/cxx/ADM_get_pending_transfers.cpp | 4 +- examples/cxx/ADM_get_qos_constraints.cpp | 4 +- examples/cxx/ADM_get_statistics.cpp | 4 +- examples/cxx/ADM_get_transfer_priority.cpp | 4 +- .../ADM_link_transfer_to_data_operation.cpp | 6 +- examples/cxx/ADM_ping.cpp | 4 +- examples/cxx/ADM_register_adhoc_storage.cpp | 14 +- examples/cxx/ADM_register_job.cpp | 20 +- examples/cxx/ADM_register_pfs_storage.cpp | 8 +- examples/cxx/ADM_remove_adhoc_storage.cpp | 16 +- examples/cxx/ADM_remove_job.cpp | 22 +-- examples/cxx/ADM_remove_pfs_storage.cpp | 10 +- examples/cxx/ADM_set_dataset_information.cpp | 4 +- examples/cxx/ADM_set_io_resources.cpp | 4 +- examples/cxx/ADM_set_qos_constraints.cpp | 4 +- examples/cxx/ADM_set_transfer_priority.cpp | 4 +- examples/cxx/ADM_transfer_datasets.cpp | 24 +-- examples/cxx/ADM_update_adhoc_storage.cpp | 26 +-- examples/cxx/ADM_update_job.cpp | 22 +-- examples/cxx/ADM_update_pfs_storage.cpp | 12 +- examples/cxx/common.cpp | 14 +- examples/cxx/common.hpp | 6 +- src/common/api/convert.cpp | 63 +++---- src/common/api/convert.hpp | 52 +++--- src/common/api/scord/internal_types.hpp | 50 ++--- src/common/api/scord/types.hpp | 176 +++++++++--------- src/common/api/types.cpp | 122 ++++++------ src/common/net/request.hpp | 8 +- src/lib/c_wrapper.cpp | 144 +++++++------- src/lib/detail/impl.cpp | 62 +++--- src/lib/detail/impl.hpp | 30 +-- src/lib/env.hpp | 4 +- src/lib/libscord.cpp | 20 +- src/lib/scord/scord.hpp | 20 +- src/scord-ctl/rpc_handlers.cpp | 4 +- src/scord/adhoc_storage_manager.hpp | 50 ++--- src/scord/job_manager.hpp | 43 ++--- src/scord/pfs_storage_manager.hpp | 38 ++-- src/scord/rpc_handlers.cpp | 66 +++---- src/scord/rpc_handlers.hpp | 34 ++-- 45 files changed, 626 insertions(+), 630 deletions(-) diff --git a/examples/cxx/ADM_cancel_transfer.cpp b/examples/cxx/ADM_cancel_transfer.cpp index 3f4dada0..1abff9ca 100644 --- a/examples/cxx/ADM_cancel_transfer.cpp +++ b/examples/cxx/ADM_cancel_transfer.cpp @@ -35,14 +35,14 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_transfer_t tx{}; ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::cancel_transfer(server, job, tx); + ret = scord::cancel_transfer(server, job, tx); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_connect_data_operation.cpp b/examples/cxx/ADM_connect_data_operation.cpp index 0c48a4ad..5ff68267 100644 --- a/examples/cxx/ADM_connect_data_operation.cpp +++ b/examples/cxx/ADM_connect_data_operation.cpp @@ -35,7 +35,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_dataset_t input{}; @@ -45,8 +45,8 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::connect_data_operation(server, job, input, output, - should_stream, args); + ret = scord::connect_data_operation(server, job, input, output, + should_stream, args); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_connect_data_operation() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_define_data_operation.cpp b/examples/cxx/ADM_define_data_operation.cpp index fb75b042..bf087508 100644 --- a/examples/cxx/ADM_define_data_operation.cpp +++ b/examples/cxx/ADM_define_data_operation.cpp @@ -36,7 +36,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; const char* path = "/tmpxxxxx"; @@ -45,7 +45,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::define_data_operation(server, job, path, &op, args); + ret = scord::define_data_operation(server, job, path, &op, args); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_define_data_operation() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_deploy_adhoc_storage.cpp b/examples/cxx/ADM_deploy_adhoc_storage.cpp index ab8296f7..d7a34f30 100644 --- a/examples/cxx/ADM_deploy_adhoc_storage.cpp +++ b/examples/cxx/ADM_deploy_adhoc_storage.cpp @@ -41,28 +41,28 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); std::string name = "adhoc_storage_42"; - const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; + 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}; try { - const auto adhoc_storage = admire::register_adhoc_storage( - server, name, admire::adhoc_storage::type::dataclay, + const auto adhoc_storage = scord::register_adhoc_storage( + server, name, scord::adhoc_storage::type::dataclay, adhoc_storage_ctx); fmt::print(stdout, "ADM_register_adhoc_storage() remote procedure completed " "successfully\n"); - admire::deploy_adhoc_storage(server, adhoc_storage); + scord::deploy_adhoc_storage(server, adhoc_storage); } catch(const std::exception& e) { fmt::print(stderr, diff --git a/examples/cxx/ADM_finalize_data_operation.cpp b/examples/cxx/ADM_finalize_data_operation.cpp index 9b422dd6..147ae686 100644 --- a/examples/cxx/ADM_finalize_data_operation.cpp +++ b/examples/cxx/ADM_finalize_data_operation.cpp @@ -35,7 +35,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_data_operation_t op{}; @@ -43,7 +43,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::finalize_data_operation(server, job, op, &status); + ret = scord::finalize_data_operation(server, job, op, &status); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_finalize_data_operation() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_get_pending_transfers.cpp b/examples/cxx/ADM_get_pending_transfers.cpp index 9df1504c..f60be4b2 100644 --- a/examples/cxx/ADM_get_pending_transfers.cpp +++ b/examples/cxx/ADM_get_pending_transfers.cpp @@ -36,14 +36,14 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_transfer_t** tx = nullptr; ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::get_pending_transfers(server, job, tx); + ret = scord::get_pending_transfers(server, job, tx); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_get_pending_transfers() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_get_qos_constraints.cpp b/examples/cxx/ADM_get_qos_constraints.cpp index 13d5955d..ba34766c 100644 --- a/examples/cxx/ADM_get_qos_constraints.cpp +++ b/examples/cxx/ADM_get_qos_constraints.cpp @@ -35,7 +35,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_qos_entity_t entity{}; @@ -43,7 +43,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::get_qos_constraints(server, job, entity, &limits); + ret = scord::get_qos_constraints(server, job, entity, &limits); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_get_statistics.cpp b/examples/cxx/ADM_get_statistics.cpp index 9fa1723e..cb8c0cdc 100644 --- a/examples/cxx/ADM_get_statistics.cpp +++ b/examples/cxx/ADM_get_statistics.cpp @@ -34,14 +34,14 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_job_stats_t* stats = nullptr; ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::get_statistics(server, job, &stats); + ret = scord::get_statistics(server, job, &stats); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_get_transfer_priority.cpp b/examples/cxx/ADM_get_transfer_priority.cpp index 0436c0d0..7dbd585b 100644 --- a/examples/cxx/ADM_get_transfer_priority.cpp +++ b/examples/cxx/ADM_get_transfer_priority.cpp @@ -36,7 +36,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_transfer_t tx{}; @@ -44,7 +44,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::get_transfer_priority(server, job, tx, &priority); + ret = scord::get_transfer_priority(server, job, tx, &priority); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_get_transfer_priority() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_link_transfer_to_data_operation.cpp b/examples/cxx/ADM_link_transfer_to_data_operation.cpp index d7b6b6b8..9c993c08 100644 --- a/examples/cxx/ADM_link_transfer_to_data_operation.cpp +++ b/examples/cxx/ADM_link_transfer_to_data_operation.cpp @@ -36,7 +36,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_data_operation_t op{}; @@ -46,8 +46,8 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::link_transfer_to_data_operation(server, job, op, transfer, - should_stream, args); + ret = scord::link_transfer_to_data_operation(server, job, op, transfer, + should_stream, args); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_cancel_transfer() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_ping.cpp b/examples/cxx/ADM_ping.cpp index a5916892..8570c17b 100644 --- a/examples/cxx/ADM_ping.cpp +++ b/examples/cxx/ADM_ping.cpp @@ -34,10 +34,10 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; try { - admire::ping(server); + scord::ping(server); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_ping() failed: {}\n", e.what()); exit(EXIT_FAILURE); diff --git a/examples/cxx/ADM_register_adhoc_storage.cpp b/examples/cxx/ADM_register_adhoc_storage.cpp index a6708966..894ccd92 100644 --- a/examples/cxx/ADM_register_adhoc_storage.cpp +++ b/examples/cxx/ADM_register_adhoc_storage.cpp @@ -41,21 +41,21 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); std::string name = "adhoc_storage_42"; - const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; + 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}; try { - const auto adhoc_storage = admire::register_adhoc_storage( - server, name, admire::adhoc_storage::type::gekkofs, + const auto adhoc_storage = scord::register_adhoc_storage( + server, name, scord::adhoc_storage::type::gekkofs, adhoc_storage_ctx); fmt::print(stdout, diff --git a/examples/cxx/ADM_register_job.cpp b/examples/cxx/ADM_register_job.cpp index e9409037..b9621752 100644 --- a/examples/cxx/ADM_register_job.cpp +++ b/examples/cxx/ADM_register_job.cpp @@ -40,7 +40,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto job_nodes = prepare_nodes(NJOB_NODES); const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); @@ -48,21 +48,21 @@ main(int argc, char* argv[]) { const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); std::string name = "adhoc_storage_42"; - const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; + 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}; try { - const auto adhoc_storage = admire::register_adhoc_storage( - server, name, admire::adhoc_storage::type::gekkofs, + const auto adhoc_storage = scord::register_adhoc_storage( + server, name, scord::adhoc_storage::type::gekkofs, adhoc_storage_ctx); - admire::job_requirements reqs(inputs, outputs, adhoc_storage); + scord::job_requirements reqs(inputs, outputs, adhoc_storage); - [[maybe_unused]] const auto job = admire::register_job( - server, admire::job::resources{job_nodes}, reqs, 0); + [[maybe_unused]] const auto job = scord::register_job( + server, scord::job::resources{job_nodes}, reqs, 0); // do something with job diff --git a/examples/cxx/ADM_register_pfs_storage.cpp b/examples/cxx/ADM_register_pfs_storage.cpp index ad56507c..712409dc 100644 --- a/examples/cxx/ADM_register_pfs_storage.cpp +++ b/examples/cxx/ADM_register_pfs_storage.cpp @@ -36,15 +36,15 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; std::string pfs_name = "gpfs_scratch"; std::string pfs_mount = "/gpfs/scratch"; try { - admire::register_pfs_storage(server, pfs_name, - admire::pfs_storage::type::gpfs, - admire::pfs_storage::ctx{pfs_mount}); + scord::register_pfs_storage(server, pfs_name, + scord::pfs_storage::type::gpfs, + scord::pfs_storage::ctx{pfs_mount}); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_register_pfs_storage() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_remove_adhoc_storage.cpp b/examples/cxx/ADM_remove_adhoc_storage.cpp index 5acbc039..a804e418 100644 --- a/examples/cxx/ADM_remove_adhoc_storage.cpp +++ b/examples/cxx/ADM_remove_adhoc_storage.cpp @@ -41,23 +41,23 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); std::string name = "adhoc_storage_42"; - const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; + 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}; try { - const auto adhoc_storage = admire::register_adhoc_storage( - server, name, admire::adhoc_storage::type::gekkofs, + const auto adhoc_storage = scord::register_adhoc_storage( + server, name, scord::adhoc_storage::type::gekkofs, adhoc_storage_ctx); - admire::remove_adhoc_storage(server, adhoc_storage); + scord::remove_adhoc_storage(server, adhoc_storage); fmt::print(stdout, "ADM_remove_adhoc_storage() remote procedure completed " "successfully\n"); diff --git a/examples/cxx/ADM_remove_job.cpp b/examples/cxx/ADM_remove_job.cpp index 45b190c2..f4f4100f 100644 --- a/examples/cxx/ADM_remove_job.cpp +++ b/examples/cxx/ADM_remove_job.cpp @@ -40,7 +40,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto job_nodes = prepare_nodes(NJOB_NODES); const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); @@ -48,28 +48,28 @@ main(int argc, char* argv[]) { const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); std::string name = "adhoc_storage_42"; - const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; + 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}; try { - const auto adhoc_storage = admire::register_adhoc_storage( - server, name, admire::adhoc_storage::type::gekkofs, + const auto adhoc_storage = scord::register_adhoc_storage( + server, name, scord::adhoc_storage::type::gekkofs, adhoc_storage_ctx); - admire::job_requirements reqs(inputs, outputs, adhoc_storage); + scord::job_requirements reqs(inputs, outputs, adhoc_storage); - [[maybe_unused]] const auto job = admire::register_job( - server, admire::job::resources{job_nodes}, reqs, 0); + [[maybe_unused]] const auto job = scord::register_job( + server, scord::job::resources{job_nodes}, reqs, 0); // do something with job fmt::print(stdout, "ADM_register_job() remote procedure completed " "successfully\n"); - admire::remove_job(server, job); + scord::remove_job(server, job); fmt::print(stdout, "ADM_remove_job() remote procedure completed " "successfully\n"); diff --git a/examples/cxx/ADM_remove_pfs_storage.cpp b/examples/cxx/ADM_remove_pfs_storage.cpp index 903b5dca..c2cdaeec 100644 --- a/examples/cxx/ADM_remove_pfs_storage.cpp +++ b/examples/cxx/ADM_remove_pfs_storage.cpp @@ -35,17 +35,17 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; std::string pfs_name = "gpfs_scratch"; std::string pfs_mount = "/gpfs/scratch"; try { - const auto pfs_storage = admire::register_pfs_storage( - server, pfs_name, admire::pfs_storage::type::gpfs, - admire::pfs_storage::ctx{pfs_mount}); + const auto pfs_storage = scord::register_pfs_storage( + server, pfs_name, scord::pfs_storage::type::gpfs, + scord::pfs_storage::ctx{pfs_mount}); - admire::remove_pfs_storage(server, pfs_storage); + scord::remove_pfs_storage(server, pfs_storage); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_register_pfs_storage() or " diff --git a/examples/cxx/ADM_set_dataset_information.cpp b/examples/cxx/ADM_set_dataset_information.cpp index 863dd322..9f7b7d33 100644 --- a/examples/cxx/ADM_set_dataset_information.cpp +++ b/examples/cxx/ADM_set_dataset_information.cpp @@ -36,7 +36,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_dataset_t target{}; @@ -44,7 +44,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::set_dataset_information(server, job, target, info); + ret = scord::set_dataset_information(server, job, target, info); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_set_dataset_information() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_set_io_resources.cpp b/examples/cxx/ADM_set_io_resources.cpp index 342a0cb3..c36f2c65 100644 --- a/examples/cxx/ADM_set_io_resources.cpp +++ b/examples/cxx/ADM_set_io_resources.cpp @@ -35,7 +35,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_adhoc_storage_t tier{}; @@ -43,7 +43,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::set_io_resources(server, job, tier, resources); + ret = scord::set_io_resources(server, job, tier, resources); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_set_io_resources() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_set_qos_constraints.cpp b/examples/cxx/ADM_set_qos_constraints.cpp index 2a46f110..65b798f1 100644 --- a/examples/cxx/ADM_set_qos_constraints.cpp +++ b/examples/cxx/ADM_set_qos_constraints.cpp @@ -35,7 +35,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_qos_entity_t entity{}; @@ -43,7 +43,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::set_qos_constraints(server, job, entity, limit); + ret = scord::set_qos_constraints(server, job, entity, limit); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_set_qos_constraints() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_set_transfer_priority.cpp b/examples/cxx/ADM_set_transfer_priority.cpp index 1e2e9fa5..040cde0e 100644 --- a/examples/cxx/ADM_set_transfer_priority.cpp +++ b/examples/cxx/ADM_set_transfer_priority.cpp @@ -36,7 +36,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; ADM_job_t job{}; ADM_transfer_t tx{}; @@ -44,7 +44,7 @@ main(int argc, char* argv[]) { ADM_return_t ret = ADM_SUCCESS; try { - ret = admire::set_transfer_priority(server, job, tx, incr); + ret = scord::set_transfer_priority(server, job, tx, incr); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_set_transfer_priority() failed: {}\n", e.what()); diff --git a/examples/cxx/ADM_transfer_datasets.cpp b/examples/cxx/ADM_transfer_datasets.cpp index 0d3571a4..393c3e39 100644 --- a/examples/cxx/ADM_transfer_datasets.cpp +++ b/examples/cxx/ADM_transfer_datasets.cpp @@ -43,7 +43,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto job_nodes = prepare_nodes(NJOB_NODES); const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); @@ -53,24 +53,24 @@ main(int argc, char* argv[]) { const auto sources = prepare_datasets("source-dataset-{}", NSOURCES); const auto targets = prepare_datasets("target-dataset-{}", NTARGETS); const auto qos_limits = prepare_qos_limits(NLIMITS); - const auto mapping = admire::transfer::mapping::n_to_n; + const auto mapping = scord::transfer::mapping::n_to_n; std::string name = "adhoc_storage_42"; - const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; + 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}; try { - const auto adhoc_storage = admire::register_adhoc_storage( - server, name, admire::adhoc_storage::type::gekkofs, + const auto adhoc_storage = scord::register_adhoc_storage( + server, name, scord::adhoc_storage::type::gekkofs, adhoc_storage_ctx); - admire::job_requirements reqs(inputs, outputs, adhoc_storage); + scord::job_requirements reqs(inputs, outputs, adhoc_storage); - const auto job = admire::register_job( - server, admire::job::resources{job_nodes}, reqs, 0); - const auto transfer = admire::transfer_datasets( + const auto job = scord::register_job( + server, scord::job::resources{job_nodes}, reqs, 0); + const auto transfer = scord::transfer_datasets( server, job, sources, targets, qos_limits, mapping); fmt::print(stdout, "ADM_transfer_datasets() remote procedure completed " diff --git a/examples/cxx/ADM_update_adhoc_storage.cpp b/examples/cxx/ADM_update_adhoc_storage.cpp index 7787aae0..62c3a93a 100644 --- a/examples/cxx/ADM_update_adhoc_storage.cpp +++ b/examples/cxx/ADM_update_adhoc_storage.cpp @@ -40,7 +40,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto adhoc_nodes = prepare_nodes(NADHOC_NODES); const auto new_adhoc_nodes = prepare_nodes(NADHOC_NODES * 2); @@ -48,23 +48,23 @@ main(int argc, char* argv[]) { const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); std::string name = "adhoc_storage_42"; - const auto adhoc_storage_ctx = admire::adhoc_storage::ctx{ - admire::adhoc_storage::execution_mode::separate_new, - admire::adhoc_storage::access_type::read_write, - admire::adhoc_storage::resources{adhoc_nodes}, 100, false}; + 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}; - const auto new_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{new_adhoc_nodes}, 200, false}; + 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}; try { - const auto adhoc_storage = admire::register_adhoc_storage( - server, name, admire::adhoc_storage::type::gekkofs, + const auto adhoc_storage = scord::register_adhoc_storage( + server, name, scord::adhoc_storage::type::gekkofs, adhoc_storage_ctx); - admire::update_adhoc_storage(server, adhoc_storage, - new_adhoc_storage_ctx); + scord::update_adhoc_storage(server, adhoc_storage, + new_adhoc_storage_ctx); 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 cf70a971..cf837e2b 100644 --- a/examples/cxx/ADM_update_job.cpp +++ b/examples/cxx/ADM_update_job.cpp @@ -40,7 +40,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; const auto job_nodes = prepare_nodes(NJOB_NODES); const auto new_job_nodes = prepare_nodes(NJOB_NODES * 2); @@ -48,24 +48,24 @@ main(int argc, char* argv[]) { const auto inputs = prepare_datasets("input-dataset-{}", NINPUTS); const auto outputs = prepare_datasets("output-dataset-{}", NOUTPUTS); - const auto gkfs_storage = admire::register_adhoc_storage( - server, "foobar", admire::adhoc_storage::type::gekkofs, - 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}); + const auto gkfs_storage = scord::register_adhoc_storage( + 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}); - admire::job_requirements reqs{inputs, outputs, gkfs_storage}; + scord::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); try { - [[maybe_unused]] const auto job = admire::register_job( - server, admire::job::resources{job_nodes}, reqs, 0); + [[maybe_unused]] const auto job = scord::register_job( + server, scord::job::resources{job_nodes}, reqs, 0); - admire::update_job(server, job, admire::job::resources{new_job_nodes}); + scord::update_job(server, job, scord::job::resources{new_job_nodes}); fmt::print( stdout, diff --git a/examples/cxx/ADM_update_pfs_storage.cpp b/examples/cxx/ADM_update_pfs_storage.cpp index 696af2e4..74fea88b 100644 --- a/examples/cxx/ADM_update_pfs_storage.cpp +++ b/examples/cxx/ADM_update_pfs_storage.cpp @@ -35,7 +35,7 @@ main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - admire::server server{"tcp", argv[1]}; + scord::server server{"tcp", argv[1]}; std::string pfs_name = "gpfs_scratch"; std::string pfs_mount = "/gpfs/scratch"; @@ -43,12 +43,12 @@ main(int argc, char* argv[]) { try { - const auto pfs_storage = admire::register_pfs_storage( - server, pfs_name, admire::pfs_storage::type::gpfs, - admire::pfs_storage::ctx{pfs_mount}); + const auto pfs_storage = scord::register_pfs_storage( + server, pfs_name, scord::pfs_storage::type::gpfs, + scord::pfs_storage::ctx{pfs_mount}); - admire::update_pfs_storage(server, pfs_storage, - admire::pfs_storage::ctx{new_pfs_mount}); + scord::update_pfs_storage(server, pfs_storage, + scord::pfs_storage::ctx{new_pfs_mount}); } catch(const std::exception& e) { fmt::print(stderr, "FATAL: ADM_update_pfs_storage() or " diff --git a/examples/cxx/common.cpp b/examples/cxx/common.cpp index 31c57c67..d0acaafc 100644 --- a/examples/cxx/common.cpp +++ b/examples/cxx/common.cpp @@ -1,8 +1,8 @@ #include "common.hpp" -std::vector +std::vector prepare_nodes(size_t n) { - std::vector nodes; + std::vector nodes; nodes.reserve(n); for(size_t i = 0; i < n; ++i) { nodes.emplace_back(fmt::format("node-{:02d}", i)); @@ -11,9 +11,9 @@ prepare_nodes(size_t n) { return nodes; } -std::vector +std::vector prepare_datasets(const std::string& pattern, size_t n) { - std::vector datasets; + std::vector datasets; datasets.reserve(n); for(size_t i = 0; i < n; ++i) { datasets.emplace_back(fmt::format(fmt::runtime(pattern), i)); @@ -22,14 +22,14 @@ prepare_datasets(const std::string& pattern, size_t n) { return datasets; } -std::vector +std::vector prepare_qos_limits(size_t n) { - std::vector limits; + std::vector limits; limits.reserve(n); for(size_t i = 0; i < n; ++i) { - limits.emplace_back(admire::qos::subclass::bandwidth, 50); + limits.emplace_back(scord::qos::subclass::bandwidth, 50); } return limits; diff --git a/examples/cxx/common.hpp b/examples/cxx/common.hpp index 38ffe7f0..ee76624c 100644 --- a/examples/cxx/common.hpp +++ b/examples/cxx/common.hpp @@ -4,13 +4,13 @@ #include #include -std::vector +std::vector prepare_nodes(size_t n); -std::vector +std::vector prepare_datasets(const std::string& pattern, size_t n); -std::vector +std::vector prepare_qos_limits(size_t n); #endif // SCORD_CXX_EXAMPLES_COMMON_HPP diff --git a/src/common/api/convert.cpp b/src/common/api/convert.cpp index 1822695f..ab24eb40 100644 --- a/src/common/api/convert.cpp +++ b/src/common/api/convert.cpp @@ -35,35 +35,35 @@ ADM_transfer_create(uint64_t id); namespace { -admire::api::managed_ctype_array -as_ctype_array(const std::vector& nodes) { +scord::api::managed_ctype_array +as_ctype_array(const std::vector& nodes) { std::vector tmp; std::transform(nodes.cbegin(), nodes.cend(), std::back_inserter(tmp), - [](const admire::node& n) { + [](const scord::node& n) { return ADM_node_create(n.hostname().c_str()); }); - return admire::api::managed_ctype_array{std::move(tmp)}; + return scord::api::managed_ctype_array{std::move(tmp)}; } -admire::api::managed_ctype_array -as_ctype_array(const std::vector& datasets) { +scord::api::managed_ctype_array +as_ctype_array(const std::vector& datasets) { std::vector tmp; std::transform(datasets.cbegin(), datasets.cend(), std::back_inserter(tmp), - [](const admire::dataset& d) { + [](const scord::dataset& d) { return ADM_dataset_create(d.id().c_str()); }); - return admire::api::managed_ctype_array{std::move(tmp)}; + return scord::api::managed_ctype_array{std::move(tmp)}; } } // namespace -namespace admire::api { +namespace scord::api { managed_ctype convert(const node& node) { @@ -97,7 +97,7 @@ convert(const adhoc_storage::ctx& ctx) { } managed_ctype -convert(const std::optional& adhoc_storage) { +convert(const std::optional& adhoc_storage) { if(!adhoc_storage) { return managed_ctype{}; @@ -107,7 +107,7 @@ convert(const std::optional& adhoc_storage) { } managed_ctype -convert(const admire::adhoc_storage& st) { +convert(const scord::adhoc_storage& st) { auto managed_ctx = convert(st.context()); ADM_adhoc_storage_t c_st = ADM_adhoc_storage_create( @@ -124,7 +124,7 @@ convert(const pfs_storage::ctx& ctx) { } managed_ctype -convert(const std::optional& pfs_storage) { +convert(const std::optional& pfs_storage) { if(!pfs_storage) { return managed_ctype{}; @@ -134,7 +134,7 @@ convert(const std::optional& pfs_storage) { } managed_ctype -convert(const admire::pfs_storage& st) { +convert(const scord::pfs_storage& st) { auto managed_ctx = convert(st.context()); ADM_pfs_storage_t c_st = ADM_pfs_storage_create( @@ -145,18 +145,18 @@ convert(const admire::pfs_storage& st) { } managed_ctype -convert(const admire::dataset& dataset) { +convert(const scord::dataset& dataset) { return managed_ctype( ADM_dataset_create(dataset.id().c_str())); } managed_ctype -convert(const std::vector& datasets) { +convert(const std::vector& datasets) { std::vector tmp; std::transform(datasets.cbegin(), datasets.cend(), std::back_inserter(tmp), - [](const admire::dataset& d) { + [](const scord::dataset& d) { return ADM_dataset_create(d.id().c_str()); }); @@ -169,10 +169,10 @@ convert(const std::vector& datasets) { return rv; } -std::vector +std::vector convert(ADM_dataset_t datasets[], size_t datasets_len) { - std::vector rv; + std::vector rv; rv.reserve(datasets_len); for(size_t i = 0; i < datasets_len; ++i) { @@ -182,10 +182,10 @@ convert(ADM_dataset_t datasets[], size_t datasets_len) { return rv; } -std::vector +std::vector convert(ADM_dataset_list_t list) { - std::vector rv; + std::vector rv; rv.reserve(list->l_length); for(size_t i = 0; i < list->l_length; ++i) { @@ -207,7 +207,7 @@ convert(const job::resources& res) { } managed_ctype -convert(const admire::job_requirements& reqs) { +convert(const scord::job_requirements& reqs) { const auto& adhoc_storage = reqs.adhoc_storage(); @@ -233,7 +233,7 @@ convert(const job& j) { job convert(ADM_job_t j) { - return admire::job{j}; + return scord::job{j}; } managed_ctype @@ -253,7 +253,7 @@ convert(const std::vector& limits) { std::transform( limits.cbegin(), limits.cend(), std::back_inserter(tmp), - [](const admire::qos::limit& l) { + [](const scord::qos::limit& l) { ADM_qos_entity_t e = nullptr; if(l.entity()) { @@ -262,7 +262,7 @@ convert(const std::vector& limits) { case qos::scope::dataset: { e = ADM_qos_entity_create( static_cast(s), - convert(l.entity()->data()) + convert(l.entity()->data()) .release()); break; } @@ -270,7 +270,7 @@ convert(const std::vector& limits) { case qos::scope::node: { e = ADM_qos_entity_create( static_cast(s), - convert(l.entity()->data()) + convert(l.entity()->data()) .release()); break; } @@ -278,7 +278,7 @@ convert(const std::vector& limits) { case qos::scope::job: { e = ADM_qos_entity_create( static_cast(s), - convert(l.entity()->data()) + convert(l.entity()->data()) .release()); break; } @@ -286,8 +286,7 @@ convert(const std::vector& limits) { case qos::scope::transfer: { e = ADM_qos_entity_create( static_cast(s), - convert(l.entity() - ->data()) + convert(l.entity()->data()) .release()); break; } @@ -311,7 +310,7 @@ convert(const std::vector& limits) { std::vector convert(ADM_qos_limit_t limits[], size_t limits_len) { - std::vector rv; + std::vector rv; rv.reserve(limits_len); for(size_t i = 0; i < limits_len; ++i) { @@ -321,10 +320,10 @@ convert(ADM_qos_limit_t limits[], size_t limits_len) { return rv; } -std::vector +std::vector convert(ADM_qos_limit_list_t list) { - std::vector rv; + std::vector rv; rv.reserve(list->l_length); for(size_t i = 0; i < list->l_length; ++i) { @@ -335,4 +334,4 @@ convert(ADM_qos_limit_list_t list) { } -} // namespace admire::api +} // namespace scord::api diff --git a/src/common/api/convert.hpp b/src/common/api/convert.hpp index 6189a5cb..db9e92f4 100644 --- a/src/common/api/convert.hpp +++ b/src/common/api/convert.hpp @@ -28,7 +28,7 @@ #include "scord/types.h" #include "scord/types.hpp" -namespace admire::api { +namespace scord::api { // convenience types for managing the types from the C API in a RAII fashion template @@ -49,31 +49,31 @@ managed_ctype convert(const adhoc_storage::ctx& ctx); managed_ctype -convert(const admire::adhoc_storage& st); +convert(const scord::adhoc_storage& st); managed_ctype convert(const pfs_storage::ctx& ctx); managed_ctype -convert(const admire::pfs_storage& st); +convert(const scord::pfs_storage& st); managed_ctype -convert(const admire::dataset& dataset); +convert(const scord::dataset& dataset); managed_ctype -convert(const std::vector& datasets); +convert(const std::vector& datasets); -std::vector +std::vector convert(ADM_dataset_t datasets[], size_t datasets_len); -std::vector +std::vector convert(ADM_dataset_list_t list); managed_ctype convert(const job::resources& res); managed_ctype -convert(const admire::job_requirements& reqs); +convert(const scord::job_requirements& reqs); managed_ctype convert(const job& j); @@ -93,10 +93,10 @@ convert(const std::vector& limits); std::vector convert(ADM_qos_limit_t limits[], size_t limits_len); -std::vector +std::vector convert(ADM_qos_limit_list_t list); -} // namespace admire::api +} // namespace scord::api //////////////////////////////////////////////////////////////////////////////// @@ -104,7 +104,7 @@ convert(ADM_qos_limit_list_t list); //////////////////////////////////////////////////////////////////////////////// template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_node_t node) : m_node(node) {} @@ -122,7 +122,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype_array { +struct scord::api::managed_ctype_array { managed_ctype_array() = default; @@ -156,7 +156,7 @@ struct admire::api::managed_ctype_array { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { managed_ctype() = default; @@ -181,7 +181,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { managed_ctype() = default; @@ -206,7 +206,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { managed_ctype() = default; @@ -231,7 +231,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { managed_ctype() = default; @@ -252,7 +252,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { managed_ctype() = default; @@ -277,7 +277,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_dataset_t dataset) : m_dataset(dataset) {} @@ -295,7 +295,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype_array { +struct scord::api::managed_ctype_array { explicit managed_ctype_array(ADM_dataset_t* data, size_t size) : m_datasets(data, size) {} @@ -328,7 +328,7 @@ struct admire::api::managed_ctype_array { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_dataset_list_t list) : m_list(list) {} @@ -347,7 +347,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_job_resources_t res, managed_ctype_array&& nodes) @@ -369,7 +369,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_job_requirements_t reqs, managed_ctype_array&& inputs, @@ -407,7 +407,7 @@ ADM_return_t ADM_transfer_destroy(ADM_transfer_t tx); template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_job_t job) : m_job(job) {} @@ -425,7 +425,7 @@ struct admire::api::managed_ctype { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_transfer_t tx) : m_transfer(tx) {} @@ -446,7 +446,7 @@ ADM_return_t ADM_qos_limit_destroy_all(ADM_qos_limit_t l); template <> -struct admire::api::managed_ctype_array { +struct scord::api::managed_ctype_array { explicit managed_ctype_array(ADM_qos_limit_t data[], size_t size) : m_qos_limits(data, size) {} @@ -479,7 +479,7 @@ struct admire::api::managed_ctype_array { }; template <> -struct admire::api::managed_ctype { +struct scord::api::managed_ctype { explicit managed_ctype(ADM_qos_limit_list_t list) : m_list(list) {} diff --git a/src/common/api/scord/internal_types.hpp b/src/common/api/scord/internal_types.hpp index 131b2eed..8d41f34b 100644 --- a/src/common/api/scord/internal_types.hpp +++ b/src/common/api/scord/internal_types.hpp @@ -28,58 +28,58 @@ #include -namespace admire::internal { +namespace scord::internal { struct job_info { - explicit job_info(admire::job job) : m_job(std::move(job)) {} + explicit job_info(scord::job job) : m_job(std::move(job)) {} - job_info(admire::job job, admire::job::resources resources, - admire::job_requirements requirements) + job_info(scord::job job, scord::job::resources resources, + scord::job_requirements requirements) : m_job(std::move(job)), m_resources(std::move(resources)), m_requirements(std::move(requirements)) {} - admire::job + scord::job job() const { return m_job; } - std::optional + std::optional resources() const { return m_resources; } - std::optional + std::optional requirements() const { return m_requirements; } void - update(admire::job::resources resources) { + update(scord::job::resources resources) { m_resources = std::move(resources); } - admire::job m_job; - std::optional m_resources; - std::optional m_requirements; + scord::job m_job; + std::optional m_resources; + std::optional m_requirements; }; struct adhoc_storage_info { - explicit adhoc_storage_info(admire::adhoc_storage adhoc_storage) + explicit adhoc_storage_info(scord::adhoc_storage adhoc_storage) : m_adhoc_storage(std::move(adhoc_storage)) {} - admire::adhoc_storage + scord::adhoc_storage adhoc_storage() const { return m_adhoc_storage; } void - update(admire::adhoc_storage::ctx adhoc_context) { + update(scord::adhoc_storage::ctx adhoc_context) { m_adhoc_storage.update(std::move(adhoc_context)); } - admire::error_code - add_client_info(std::shared_ptr job_info) { + scord::error_code + add_client_info(std::shared_ptr job_info) { scord::abt::unique_lock lock(m_info_mutex); @@ -100,36 +100,36 @@ struct adhoc_storage_info { m_client_info.reset(); } - std::shared_ptr + std::shared_ptr client_info() const { scord::abt::shared_lock lock(m_info_mutex); return m_client_info; } - admire::adhoc_storage m_adhoc_storage; - std::shared_ptr m_client_info; + scord::adhoc_storage m_adhoc_storage; + std::shared_ptr m_client_info; mutable scord::abt::shared_mutex m_info_mutex; }; struct pfs_storage_info { - explicit pfs_storage_info(admire::pfs_storage pfs_storage) + explicit pfs_storage_info(scord::pfs_storage pfs_storage) : m_pfs_storage(std::move(pfs_storage)) {} - admire::pfs_storage + scord::pfs_storage pfs_storage() const { return m_pfs_storage; } void - update(admire::pfs_storage::ctx pfs_context) { + update(scord::pfs_storage::ctx pfs_context) { m_pfs_storage.update(std::move(pfs_context)); } - admire::pfs_storage m_pfs_storage; - std::shared_ptr m_client_info; + scord::pfs_storage m_pfs_storage; + std::shared_ptr m_client_info; }; -} // namespace admire::internal +} // namespace scord::internal #endif // SCORD_INTERNAL_TYPES_HPP diff --git a/src/common/api/scord/types.hpp b/src/common/api/scord/types.hpp index 98a1326a..26a3381b 100644 --- a/src/common/api/scord/types.hpp +++ b/src/common/api/scord/types.hpp @@ -35,7 +35,7 @@ #include #include -namespace admire { +namespace scord { struct error_code { @@ -173,10 +173,10 @@ struct job { struct resources { resources(); - explicit resources(std::vector nodes); + explicit resources(std::vector nodes); explicit resources(ADM_job_resources_t res); - std::vector + std::vector nodes() const; template @@ -186,7 +186,7 @@ struct job { } private: - std::vector m_nodes; + std::vector m_nodes; }; job(); @@ -269,7 +269,7 @@ struct entity { entity(); template - entity(admire::qos::scope s, T&& data); + entity(scord::qos::scope s, T&& data); explicit entity(ADM_qos_entity_t entity); entity(const entity&) noexcept; @@ -281,7 +281,7 @@ struct entity { ~entity(); - admire::qos::scope + scord::qos::scope scope() const; template @@ -302,9 +302,9 @@ private: struct limit { limit(); - limit(admire::qos::subclass cls, uint64_t value); - limit(admire::qos::subclass cls, uint64_t value, - const admire::qos::entity& e); + limit(scord::qos::subclass cls, uint64_t value); + limit(scord::qos::subclass cls, uint64_t value, + const scord::qos::entity& e); explicit limit(ADM_qos_limit_t l); limit(const limit&) noexcept; @@ -316,10 +316,10 @@ struct limit { ~limit(); - std::optional + std::optional entity() const; - admire::qos::subclass + scord::qos::subclass subclass() const; uint64_t @@ -389,10 +389,10 @@ struct adhoc_storage { struct resources { resources() = default; - explicit resources(std::vector nodes); + explicit resources(std::vector nodes); explicit resources(ADM_adhoc_resources_t res); - std::vector + std::vector nodes() const; template @@ -402,7 +402,7 @@ struct adhoc_storage { } private: - std::vector m_nodes; + std::vector m_nodes; }; struct ctx { @@ -451,7 +451,7 @@ struct adhoc_storage { std::uint32_t walltime, bool should_flush); explicit adhoc_storage(ADM_adhoc_storage_t storage); adhoc_storage(enum adhoc_storage::type type, std::string name, - std::uint64_t id, const admire::adhoc_storage::ctx& ctx); + std::uint64_t id, const scord::adhoc_storage::ctx& ctx); adhoc_storage(const adhoc_storage& other) noexcept; adhoc_storage(adhoc_storage&&) noexcept; @@ -471,7 +471,7 @@ struct adhoc_storage { context() const; void - update(admire::adhoc_storage::ctx new_ctx); + update(scord::adhoc_storage::ctx new_ctx); // The implementation for this must be deferred until // after the declaration of the PIMPL class @@ -540,7 +540,7 @@ struct pfs_storage { context() const; void - update(admire::pfs_storage::ctx new_ctx); + update(scord::pfs_storage::ctx new_ctx); // The implementation for this must be deferred until // after the declaration of the PIMPL class @@ -557,12 +557,12 @@ struct job_requirements { job_requirements(); - job_requirements(std::vector inputs, - std::vector outputs); + job_requirements(std::vector inputs, + std::vector outputs); - job_requirements(std::vector inputs, - std::vector outputs, - admire::adhoc_storage adhoc_storage); + job_requirements(std::vector inputs, + std::vector outputs, + scord::adhoc_storage adhoc_storage); explicit job_requirements(ADM_job_requirements_t reqs); @@ -575,11 +575,11 @@ struct job_requirements { ~job_requirements(); - std::vector + std::vector inputs() const; - std::vector + std::vector outputs() const; - std::optional + std::optional adhoc_storage() const; // The implementation for this must be deferred until @@ -601,21 +601,21 @@ private: //////////////////////////////////////////////////////////////////////////////// template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::error_code& ec, FormatContext& ctx) const { + format(const scord::error_code& ec, FormatContext& ctx) const { return formatter::format(ec.name(), ctx); } }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::job& j, FormatContext& ctx) const { + format(const scord::job& j, FormatContext& ctx) const { return formatter::format( fmt::format("{{id: {}, slurm_id: {}}}", j.id(), j.slurm_id()), ctx); @@ -623,22 +623,22 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::dataset& d, FormatContext& ctx) const { + format(const scord::dataset& d, FormatContext& ctx) const { const auto str = fmt::format("{{id: {}}}", std::quoted(d.id())); return formatter::format(str, ctx); } }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::node& n, FormatContext& ctx) const { + format(const scord::node& n, FormatContext& ctx) const { const auto str = fmt::format("{{hostname: {}}}", std::quoted(n.hostname())); return formatter::format(str, ctx); @@ -646,15 +646,15 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const enum admire::adhoc_storage::type& t, + format(const enum scord::adhoc_storage::type& t, FormatContext& ctx) const { - using admire::adhoc_storage; + using scord::adhoc_storage; std::string_view name = "unknown"; switch(t) { @@ -677,15 +677,15 @@ struct fmt::formatter }; template <> -struct fmt::formatter +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::adhoc_storage::execution_mode& exec_mode, + format(const scord::adhoc_storage::execution_mode& exec_mode, FormatContext& ctx) const { - using execution_mode = admire::adhoc_storage::execution_mode; + using execution_mode = scord::adhoc_storage::execution_mode; std::string_view name = "unknown"; @@ -709,15 +709,15 @@ struct fmt::formatter }; template <> -struct fmt::formatter +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::adhoc_storage::access_type& type, + format(const scord::adhoc_storage::access_type& type, FormatContext& ctx) const { - using access_type = admire::adhoc_storage::access_type; + using access_type = scord::adhoc_storage::access_type; std::string_view name = "unknown"; @@ -750,11 +750,11 @@ struct fmt::formatter> : formatter { }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::adhoc_storage& s, FormatContext& ctx) const { + format(const scord::adhoc_storage& s, FormatContext& ctx) const { const auto str = fmt::format( "{{type: {}, id: {}, name: {}, context: {}}}", s.type(), s.id(), std::quoted(s.name()), s.context()); @@ -763,12 +763,12 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::adhoc_storage::resources& r, + format(const scord::adhoc_storage::resources& r, FormatContext& ctx) const { const auto str = fmt::format("{{nodes: {}}}", r.nodes()); @@ -779,12 +779,12 @@ struct fmt::formatter template <> -struct fmt::formatter +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::adhoc_storage::ctx& c, FormatContext& ctx) const { + format(const scord::adhoc_storage::ctx& c, FormatContext& ctx) const { const auto str = fmt::format("{{execution_mode: {}, access_type: {}, " @@ -797,14 +797,14 @@ struct fmt::formatter }; template <> -struct fmt::formatter +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const enum admire::pfs_storage::type& t, FormatContext& ctx) const { + format(const enum scord::pfs_storage::type& t, FormatContext& ctx) const { - using admire::pfs_storage; + using scord::pfs_storage; std::string_view name = "unknown"; switch(t) { @@ -821,44 +821,44 @@ struct fmt::formatter }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::pfs_storage& s, FormatContext& ctx) const { + format(const scord::pfs_storage& s, FormatContext& ctx) const { const auto str = fmt::format("{{context: {}}}", s.context()); return formatter::format(str, ctx); } }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::pfs_storage::ctx& c, FormatContext& ctx) const { + format(const scord::pfs_storage::ctx& c, FormatContext& ctx) const { const auto str = fmt::format("{{mount_point: {}}}", c.mount_point()); return formatter::format(str, ctx); } }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::job::resources& r, FormatContext& ctx) const { + format(const scord::job::resources& r, FormatContext& ctx) const { const auto str = fmt::format("{{nodes: {}}}", r.nodes()); return formatter::format(str, ctx); } }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::job_requirements& r, FormatContext& ctx) const { + format(const scord::job_requirements& r, FormatContext& ctx) const { return formatter::format( fmt::format("{{inputs: {}, outputs: {}, adhoc_storage: {}}}", r.inputs(), r.outputs(), r.adhoc_storage()), @@ -867,13 +867,13 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::qos::scope& s, FormatContext& ctx) const { + format(const scord::qos::scope& s, FormatContext& ctx) const { - using scope = admire::qos::scope; + using scope = scord::qos::scope; std::string_view name = "unknown"; @@ -897,12 +897,12 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter> +struct fmt::formatter> : formatter { // parse is inherited from formatter. template auto - format(const std::optional& e, + format(const std::optional& e, FormatContext& ctx) const { if(!e) { @@ -912,17 +912,17 @@ struct fmt::formatter> std::string_view data = "unknown"; switch(e->scope()) { - case admire::qos::scope::dataset: - data = fmt::format("{}", e->data()); + case scord::qos::scope::dataset: + data = fmt::format("{}", e->data()); break; - case admire::qos::scope::node: - data = fmt::format("{}", e->data()); + case scord::qos::scope::node: + data = fmt::format("{}", e->data()); break; - case admire::qos::scope::job: - data = fmt::format("{}", e->data()); + case scord::qos::scope::job: + data = fmt::format("{}", e->data()); break; - case admire::qos::scope::transfer: - data = fmt::format("{}", e->data()); + case scord::qos::scope::transfer: + data = fmt::format("{}", e->data()); break; } @@ -933,13 +933,13 @@ struct fmt::formatter> }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::qos::subclass& sc, FormatContext& ctx) const { + format(const scord::qos::subclass& sc, FormatContext& ctx) const { - using subclass = admire::qos::subclass; + using subclass = scord::qos::subclass; std::string_view name = "unknown"; @@ -957,11 +957,11 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::qos::limit& l, FormatContext& ctx) const { + format(const scord::qos::limit& l, FormatContext& ctx) const { const auto str = fmt::format("{{entity: {}, subclass: {}, value: {}}}", l.entity(), l.subclass(), l.value()); return formatter::format(str, ctx); @@ -969,13 +969,13 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::transfer::mapping& m, FormatContext& ctx) const { + format(const scord::transfer::mapping& m, FormatContext& ctx) const { - using mapping = admire::transfer::mapping; + using mapping = scord::transfer::mapping; std::string_view name = "unknown"; @@ -996,46 +996,46 @@ struct fmt::formatter : formatter { }; template <> -struct fmt::formatter : formatter { +struct fmt::formatter : formatter { // parse is inherited from formatter. template auto - format(const admire::transfer& tx, FormatContext& ctx) const { + format(const scord::transfer& tx, FormatContext& ctx) const { const auto str = fmt::format("{{id: {}}}", tx.id()); return formatter::format(str, ctx); } }; template <> -struct fmt::formatter> : formatter { +struct fmt::formatter> : formatter { // parse is inherited from formatter. template auto - format(const std::vector& v, FormatContext& ctx) const { + format(const std::vector& v, FormatContext& ctx) const { const auto str = fmt::format("[{}]", fmt::join(v, ", ")); return formatter::format(str, ctx); } }; template <> -struct fmt::formatter> +struct fmt::formatter> : formatter { // parse is inherited from formatter. template auto - format(const std::vector& v, FormatContext& ctx) const { + format(const std::vector& v, FormatContext& ctx) const { const auto str = fmt::format("[{}]", fmt::join(v, ", ")); return formatter::format(str, ctx); } }; template <> -struct fmt::formatter> +struct fmt::formatter> : formatter { // parse is inherited from formatter. template auto - format(const std::vector& l, FormatContext& ctx) const { + format(const std::vector& l, FormatContext& ctx) const { const auto str = fmt::format("[{}]", fmt::join(l, ", ")); return formatter::format(str, ctx); } diff --git a/src/common/api/types.cpp b/src/common/api/types.cpp index 824c95d0..e2b18014 100644 --- a/src/common/api/types.cpp +++ b/src/common/api/types.cpp @@ -1060,7 +1060,7 @@ const char* ADM_strerror(ADM_return_t errnum); }; -namespace admire { +namespace scord { std::string_view error_code::message() const { @@ -1237,7 +1237,7 @@ private: job::resources::resources() = default; -job::resources::resources(std::vector nodes) +job::resources::resources(std::vector nodes) : m_nodes(std::move(nodes)) {} job::resources::resources(ADM_job_resources_t res) { @@ -1249,7 +1249,7 @@ job::resources::resources(ADM_job_resources_t res) { } } -std::vector +std::vector job::resources::nodes() const { return m_nodes; } @@ -1476,7 +1476,7 @@ template void dataset::serialize( scord::network::serialization::input_archive&); -adhoc_storage::resources::resources(std::vector nodes) +adhoc_storage::resources::resources(std::vector nodes) : m_nodes(std::move(nodes)) {} adhoc_storage::resources::resources(ADM_adhoc_resources_t res) { @@ -1488,7 +1488,7 @@ adhoc_storage::resources::resources(ADM_adhoc_resources_t res) { } } -std::vector +std::vector adhoc_storage::resources::nodes() const { return m_nodes; } @@ -1655,7 +1655,7 @@ adhoc_storage::context() const { } void -adhoc_storage::update(admire::adhoc_storage::ctx new_ctx) { +adhoc_storage::update(scord::adhoc_storage::ctx new_ctx) { return m_pimpl->update(std::move(new_ctx)); } @@ -1817,7 +1817,7 @@ pfs_storage::context() const { } void -pfs_storage::update(admire::pfs_storage::ctx new_ctx) { +pfs_storage::update(scord::pfs_storage::ctx new_ctx) { return m_pimpl->update(std::move(new_ctx)); } @@ -1851,13 +1851,13 @@ class job_requirements::impl { public: impl() = default; - impl(std::vector inputs, - std::vector outputs) + impl(std::vector inputs, + std::vector outputs) : m_inputs(std::move(inputs)), m_outputs(std::move(outputs)) {} - impl(std::vector inputs, - std::vector outputs, - admire::adhoc_storage adhoc_storage) + impl(std::vector inputs, + std::vector outputs, + scord::adhoc_storage adhoc_storage) : m_inputs(std::move(inputs)), m_outputs(std::move(outputs)), m_adhoc_storage(std::move(adhoc_storage)) {} @@ -1876,7 +1876,7 @@ public: } if(reqs->r_adhoc_storage) { - m_adhoc_storage = admire::adhoc_storage(reqs->r_adhoc_storage); + m_adhoc_storage = scord::adhoc_storage(reqs->r_adhoc_storage); } } @@ -1887,17 +1887,17 @@ public: impl& operator=(impl&&) noexcept = default; - std::vector + std::vector inputs() const { return m_inputs; } - std::vector + std::vector outputs() const { return m_outputs; } - std::optional + std::optional adhoc_storage() const { return m_adhoc_storage; } @@ -1919,21 +1919,21 @@ public: } private: - std::vector m_inputs; - std::vector m_outputs; - std::optional m_adhoc_storage; + std::vector m_inputs; + std::vector m_outputs; + std::optional m_adhoc_storage; }; job_requirements::job_requirements() = default; -job_requirements::job_requirements(std::vector inputs, - std::vector outputs) +job_requirements::job_requirements(std::vector inputs, + std::vector outputs) : m_pimpl(std::make_unique(std::move(inputs), std::move(outputs))) {} -job_requirements::job_requirements(std::vector inputs, - std::vector outputs, - admire::adhoc_storage adhoc_storage) +job_requirements::job_requirements(std::vector inputs, + std::vector outputs, + scord::adhoc_storage adhoc_storage) : m_pimpl(std::make_unique(std::move(inputs), std::move(outputs), std::move(adhoc_storage))) {} @@ -1956,17 +1956,17 @@ job_requirements::operator=(job_requirements&&) noexcept = default; job_requirements::~job_requirements() = default; -std::vector +std::vector job_requirements::inputs() const { return m_pimpl->inputs(); } -std::vector +std::vector job_requirements::outputs() const { return m_pimpl->outputs(); } -std::optional +std::optional job_requirements::adhoc_storage() const { return m_pimpl->adhoc_storage(); } @@ -2004,7 +2004,7 @@ public: impl() = default; template - impl(const admire::qos::scope& s, T&& data) : m_scope(s), m_data(data) {} + impl(const scord::qos::scope& s, T&& data) : m_scope(s), m_data(data) {} explicit impl(ADM_qos_entity_t entity) : m_scope(static_cast(entity->e_scope)), @@ -2017,7 +2017,7 @@ public: impl& operator=(impl&&) noexcept = default; - admire::qos::scope + scord::qos::scope scope() const { return m_scope; } @@ -2047,13 +2047,13 @@ private: init_helper(ADM_qos_entity_t entity) { switch(entity->e_scope) { case ADM_QOS_SCOPE_DATASET: - return admire::dataset(entity->e_dataset); + return scord::dataset(entity->e_dataset); case ADM_QOS_SCOPE_NODE: - return admire::node(entity->e_node); + return scord::node(entity->e_node); case ADM_QOS_SCOPE_JOB: - return admire::job(entity->e_job); + return scord::job(entity->e_job); case ADM_QOS_SCOPE_TRANSFER: - return admire::transfer(entity->e_transfer); + return scord::transfer(entity->e_transfer); default: throw std::runtime_error(fmt::format( "Unexpected scope value: {}", entity->e_scope)); @@ -2062,14 +2062,14 @@ private: private: - admire::qos::scope m_scope; + scord::qos::scope m_scope; std::variant m_data; }; entity::entity() = default; template -entity::entity(admire::qos::scope s, T&& data) +entity::entity(scord::qos::scope s, T&& data) : m_pimpl(std::make_unique(s, std::forward(data))) {} entity::entity(ADM_qos_entity_t entity) @@ -2091,33 +2091,33 @@ entity::operator=(entity&&) noexcept = default; entity::~entity() = default; -admire::qos::scope +scord::qos::scope entity::scope() const { return m_pimpl->scope(); } template <> -admire::node -entity::data() const { - return m_pimpl->data(); +scord::node +entity::data() const { + return m_pimpl->data(); } template <> -admire::job -entity::data() const { - return m_pimpl->data(); +scord::job +entity::data() const { + return m_pimpl->data(); } template <> -admire::dataset -entity::data() const { - return m_pimpl->data(); +scord::dataset +entity::data() const { + return m_pimpl->data(); } template <> -admire::transfer -entity::data() const { - return m_pimpl->data(); +scord::transfer +entity::data() const { + return m_pimpl->data(); } // since the PIMPL class is fully defined at this point, we can now @@ -2150,16 +2150,16 @@ class limit::impl { public: impl() = default; - impl(admire::qos::subclass cls, uint64_t value, admire::qos::entity e) + impl(scord::qos::subclass cls, uint64_t value, scord::qos::entity e) : m_subclass(cls), m_value(value), m_entity(std::move(e)) {} - impl(admire::qos::subclass cls, uint64_t value) + impl(scord::qos::subclass cls, uint64_t value) : m_subclass(cls), m_value(value) {} explicit impl(ADM_qos_limit_t l) : m_subclass(static_cast(l->l_class)), m_value(l->l_value), - m_entity(l->l_entity ? std::optional(admire::qos::entity(l->l_entity)) + m_entity(l->l_entity ? std::optional(scord::qos::entity(l->l_entity)) : std::nullopt) {} impl(const impl& rhs) = default; @@ -2169,12 +2169,12 @@ public: impl& operator=(impl&&) noexcept = default; - std::optional + std::optional entity() const { return m_entity; } - admire::qos::subclass + scord::qos::subclass subclass() const { return m_subclass; } @@ -2201,18 +2201,18 @@ public: } private: - admire::qos::subclass m_subclass; + scord::qos::subclass m_subclass; uint64_t m_value; - std::optional m_entity; + std::optional m_entity; }; limit::limit() = default; -limit::limit(admire::qos::subclass cls, uint64_t value) +limit::limit(scord::qos::subclass cls, uint64_t value) : m_pimpl(std::make_unique(cls, value)) {} -limit::limit(admire::qos::subclass cls, uint64_t value, - const admire::qos::entity& e) +limit::limit(scord::qos::subclass cls, uint64_t value, + const scord::qos::entity& e) : m_pimpl(std::make_unique(cls, value, e)) {} limit::limit(ADM_qos_limit_t l) : m_pimpl(std::make_unique(l)) {} @@ -2233,12 +2233,12 @@ limit::operator=(limit&&) noexcept = default; limit::~limit() = default; -std::optional +std::optional limit::entity() const { return m_pimpl->entity(); } -admire::qos::subclass +scord::qos::subclass limit::subclass() const { return m_pimpl->subclass(); } @@ -2276,4 +2276,4 @@ limit::serialize( } // namespace qos -} // namespace admire +} // namespace scord diff --git a/src/common/net/request.hpp b/src/common/net/request.hpp index 84ead0d2..0f4ad7c5 100644 --- a/src/common/net/request.hpp +++ b/src/common/net/request.hpp @@ -43,7 +43,7 @@ class generic_response { public: constexpr generic_response() noexcept = default; constexpr generic_response(std::uint64_t op_id, - admire::error_code ec) noexcept + scord::error_code ec) noexcept : m_op_id(op_id), m_error_code(ec) {} constexpr std::uint64_t @@ -51,7 +51,7 @@ public: return m_op_id; } - constexpr admire::error_code + constexpr scord::error_code error_code() const noexcept { return m_error_code; } @@ -65,7 +65,7 @@ public: private: std::uint64_t m_op_id; - admire::error_code m_error_code; + scord::error_code m_error_code; }; template @@ -74,7 +74,7 @@ class response_with_value : public generic_response { public: constexpr response_with_value() noexcept = default; - constexpr response_with_value(std::uint64_t op_id, admire::error_code ec, + constexpr response_with_value(std::uint64_t op_id, scord::error_code ec, std::optional value) noexcept : generic_response(op_id, ec), m_value(std::move(value)) {} diff --git a/src/lib/c_wrapper.cpp b/src/lib/c_wrapper.cpp index 15e06703..8a31f996 100644 --- a/src/lib/c_wrapper.cpp +++ b/src/lib/c_wrapper.cpp @@ -38,8 +38,8 @@ /******************************************************************************/ ADM_return_t ADM_ping(ADM_server_t server) { - const admire::server srv{server}; - return admire::detail::ping(srv); + const scord::server srv{server}; + return scord::detail::ping(srv); } ADM_return_t @@ -47,17 +47,17 @@ ADM_register_job(ADM_server_t server, ADM_job_resources_t res, ADM_job_requirements_t reqs, uint64_t slurm_id, ADM_job_t* job) { - const admire::server srv{server}; + const scord::server srv{server}; - const auto rv = admire::detail::register_job( - srv, admire::job::resources{res}, admire::job_requirements{reqs}, - slurm_id); + const auto rv = scord::detail::register_job(srv, scord::job::resources{res}, + scord::job_requirements{reqs}, + slurm_id); if(!rv) { return rv.error(); } - *job = admire::api::convert(*rv).release(); + *job = scord::api::convert(*rv).release(); return ADM_SUCCESS; } @@ -66,18 +66,18 @@ ADM_return_t ADM_update_job(ADM_server_t server, ADM_job_t job, ADM_job_resources_t job_resources) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::detail::update_job(srv, admire::job{job}, - admire::job::resources{job_resources}); + return scord::detail::update_job(srv, scord::job{job}, + scord::job::resources{job_resources}); } ADM_return_t ADM_remove_job(ADM_server_t server, ADM_job_t job) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::detail::remove_job(srv, admire::job{job}); + return scord::detail::remove_job(srv, scord::job{job}); } ADM_return_t @@ -86,17 +86,17 @@ ADM_register_adhoc_storage(ADM_server_t server, const char* name, ADM_adhoc_context_t ctx, ADM_adhoc_storage_t* adhoc_storage) { - const admire::server srv{server}; + const scord::server srv{server}; - const auto cxx_type = static_cast(type); - const auto rv = admire::detail::register_adhoc_storage( - srv, name, cxx_type, admire::adhoc_storage::ctx{ctx}); + const auto cxx_type = static_cast(type); + const auto rv = scord::detail::register_adhoc_storage( + srv, name, cxx_type, scord::adhoc_storage::ctx{ctx}); if(!rv) { return rv.error(); } - *adhoc_storage = admire::api::convert(*rv).release(); + *adhoc_storage = scord::api::convert(*rv).release(); return ADM_SUCCESS; } @@ -105,31 +105,31 @@ ADM_return_t ADM_update_adhoc_storage(ADM_server_t server, ADM_adhoc_storage_t adhoc_storage, ADM_adhoc_context_t ctx) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::detail::update_adhoc_storage( - srv, admire::adhoc_storage::ctx{ctx}, - admire::adhoc_storage{adhoc_storage}); + return scord::detail::update_adhoc_storage( + srv, scord::adhoc_storage::ctx{ctx}, + scord::adhoc_storage{adhoc_storage}); } ADM_return_t ADM_remove_adhoc_storage(ADM_server_t server, ADM_adhoc_storage_t adhoc_storage) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::detail::remove_adhoc_storage( - srv, admire::adhoc_storage{adhoc_storage}); + return scord::detail::remove_adhoc_storage( + srv, scord::adhoc_storage{adhoc_storage}); } ADM_return_t ADM_deploy_adhoc_storage(ADM_server_t server, ADM_adhoc_storage_t adhoc_storage) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::detail::deploy_adhoc_storage( - srv, admire::adhoc_storage{adhoc_storage}); + return scord::detail::deploy_adhoc_storage( + srv, scord::adhoc_storage{adhoc_storage}); } ADM_return_t @@ -137,16 +137,16 @@ ADM_register_pfs_storage(ADM_server_t server, const char* name, ADM_pfs_storage_type_t type, ADM_pfs_context_t ctx, ADM_pfs_storage_t* pfs_storage) { - const auto rv = admire::detail::register_pfs_storage( - admire::server{server}, name, - static_cast(type), - admire::pfs_storage::ctx{ctx}); + const auto rv = scord::detail::register_pfs_storage( + scord::server{server}, name, + static_cast(type), + scord::pfs_storage::ctx{ctx}); if(!rv) { return rv.error(); } - *pfs_storage = admire::api::convert(rv.value()).release(); + *pfs_storage = scord::api::convert(rv.value()).release(); return ADM_SUCCESS; } @@ -155,15 +155,15 @@ ADM_return_t ADM_update_pfs_storage(ADM_server_t server, ADM_pfs_storage_t pfs_storage, ADM_pfs_context_t ctx) { - return admire::detail::update_pfs_storage(admire::server{server}, - admire::pfs_storage{pfs_storage}, - admire::pfs_storage::ctx{ctx}); + return scord::detail::update_pfs_storage(scord::server{server}, + scord::pfs_storage{pfs_storage}, + scord::pfs_storage::ctx{ctx}); } ADM_return_t ADM_remove_pfs_storage(ADM_server_t server, ADM_pfs_storage_t pfs_storage) { - return admire::detail::remove_pfs_storage(admire::server{server}, - admire::pfs_storage{pfs_storage}); + return scord::detail::remove_pfs_storage(scord::server{server}, + scord::pfs_storage{pfs_storage}); } ADM_return_t @@ -174,18 +174,18 @@ ADM_transfer_datasets(ADM_server_t server, ADM_job_t job, ADM_transfer_mapping_t mapping, ADM_transfer_t* transfer) { - const auto rv = admire::detail::transfer_datasets( - admire::server{server}, admire::job{job}, - admire::api::convert(sources, sources_len), - admire::api::convert(targets, targets_len), - admire::api::convert(limits, limits_len), - static_cast(mapping)); + const auto rv = scord::detail::transfer_datasets( + scord::server{server}, scord::job{job}, + scord::api::convert(sources, sources_len), + scord::api::convert(targets, targets_len), + scord::api::convert(limits, limits_len), + static_cast(mapping)); if(!rv) { return rv.error(); } - *transfer = admire::api::convert(*rv).release(); + *transfer = scord::api::convert(*rv).release(); return ADM_SUCCESS; } @@ -194,9 +194,9 @@ ADM_return_t ADM_set_dataset_information(ADM_server_t server, ADM_job_t job, ADM_dataset_t target, ADM_dataset_info_t info) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::set_dataset_information(srv, job, target, info); + return scord::set_dataset_information(srv, job, target, info); } ADM_return_t @@ -204,9 +204,9 @@ ADM_set_io_resources(ADM_server_t server, ADM_job_t job, ADM_adhoc_storage_t tier, ADM_adhoc_resources_t resources) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::set_io_resources(srv, job, tier, resources); + return scord::set_io_resources(srv, job, tier, resources); } ADM_return_t @@ -214,65 +214,65 @@ ADM_get_transfer_priority(ADM_server_t server, ADM_job_t job, ADM_transfer_t transfer, ADM_transfer_priority_t* priority) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::get_transfer_priority(srv, job, transfer, priority); + return scord::get_transfer_priority(srv, job, transfer, priority); } ADM_return_t ADM_set_transfer_priority(ADM_server_t server, ADM_job_t job, ADM_transfer_t transfer, int incr) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::set_transfer_priority(srv, job, transfer, incr); + return scord::set_transfer_priority(srv, job, transfer, incr); } ADM_return_t ADM_cancel_transfer(ADM_server_t server, ADM_job_t job, ADM_transfer_t transfer) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::cancel_transfer(srv, job, transfer); + return scord::cancel_transfer(srv, job, transfer); } ADM_return_t ADM_get_pending_transfers(ADM_server_t server, ADM_job_t job, ADM_transfer_t** pending_transfers) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::get_pending_transfers(srv, job, pending_transfers); + return scord::get_pending_transfers(srv, job, pending_transfers); } ADM_return_t ADM_set_qos_constraints(ADM_server_t server, ADM_job_t job, ADM_qos_entity_t entity, ADM_qos_limit_t limit) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::set_qos_constraints(srv, job, entity, limit); + return scord::set_qos_constraints(srv, job, entity, limit); } ADM_return_t ADM_get_qos_constraints(ADM_server_t server, ADM_job_t job, ADM_qos_entity_t entity, ADM_qos_limit_t** limits) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::get_qos_constraints(srv, job, entity, limits); + return scord::get_qos_constraints(srv, job, entity, limits); } ADM_return_t ADM_define_data_operation(ADM_server_t server, ADM_job_t job, const char* path, ADM_data_operation_t* op, ...) { - const admire::server srv{server}; + const scord::server srv{server}; va_list args; va_start(args, op); - auto ret = admire::define_data_operation(srv, job, path, op, args); + auto ret = scord::define_data_operation(srv, job, path, op, args); va_end(args); return ret; @@ -283,12 +283,12 @@ ADM_connect_data_operation(ADM_server_t server, ADM_job_t job, ADM_dataset_t input, ADM_dataset_t output, bool should_stream, ...) { - const admire::server srv{server}; + const scord::server srv{server}; va_list args; va_start(args, should_stream); - auto ret = admire::connect_data_operation(srv, job, input, output, - should_stream, args); + auto ret = scord::connect_data_operation(srv, job, input, output, + should_stream, args); va_end(args); return ret; @@ -299,9 +299,9 @@ ADM_finalize_data_operation(ADM_server_t server, ADM_job_t job, ADM_data_operation_t op, ADM_data_operation_status_t* status) { - const admire::server srv{server}; + const scord::server srv{server}; - return admire::finalize_data_operation(srv, job, op, status); + return scord::finalize_data_operation(srv, job, op, status); } @@ -311,12 +311,12 @@ ADM_link_transfer_to_data_operation(ADM_server_t server, ADM_job_t job, ADM_transfer_t transfer, bool should_stream, ...) { - const admire::server srv{server}; + const scord::server srv{server}; va_list args; va_start(args, should_stream); - auto ret = admire::link_transfer_to_data_operation(srv, job, op, transfer, - should_stream, args); + auto ret = scord::link_transfer_to_data_operation(srv, job, op, transfer, + should_stream, args); va_end(args); return ret; @@ -325,6 +325,6 @@ ADM_link_transfer_to_data_operation(ADM_server_t server, ADM_job_t job, ADM_return_t ADM_get_statistics(ADM_server_t server, ADM_job_t job, ADM_job_stats_t** stats) { - const admire::server srv{server}; - return admire::get_statistics(srv, job, stats); + const scord::server srv{server}; + return scord::get_statistics(srv, job, stats); } diff --git a/src/lib/detail/impl.cpp b/src/lib/detail/impl.cpp index 63f2ce93..2eaf848f 100644 --- a/src/lib/detail/impl.cpp +++ b/src/lib/detail/impl.cpp @@ -44,9 +44,9 @@ struct remote_procedure { } // namespace api -namespace admire::detail { +namespace scord::detail { -admire::error_code +scord::error_code ping(const server& srv) { scord::network::client rpc_client{srv.protocol()}; @@ -79,13 +79,13 @@ ping(const server& srv) { } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } -tl::expected +tl::expected register_job(const server& srv, const job::resources& job_resources, const job_requirements& job_requirements, - admire::slurm_job_id slurm_id) { + scord::slurm_job_id slurm_id) { scord::network::client rpc_client{srv.protocol()}; @@ -120,15 +120,15 @@ register_job(const server& srv, const job::resources& job_resources, return tl::make_unexpected(resp.error_code()); } - return admire::job{resp.value(), slurm_id}; + return scord::job{resp.value(), slurm_id}; } } LOGGER_ERROR("rpc call failed"); - return tl::make_unexpected(admire::error_code::other); + return tl::make_unexpected(scord::error_code::other); } -admire::error_code +scord::error_code update_job(const server& srv, const job& job, const job::resources& new_resources) { @@ -163,10 +163,10 @@ update_job(const server& srv, const job& job, } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } -admire::error_code +scord::error_code remove_job(const server& srv, const job& job) { scord::network::client rpc_client{srv.protocol()}; @@ -198,10 +198,10 @@ remove_job(const server& srv, const job& job) { } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } -tl::expected +tl::expected register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, const adhoc_storage::ctx& ctx) { @@ -236,15 +236,15 @@ register_adhoc_storage(const server& srv, const std::string& name, return tl::make_unexpected(ec); } - return admire::adhoc_storage{type, name, resp.value(), ctx}; + return scord::adhoc_storage{type, name, resp.value(), ctx}; } } LOGGER_ERROR("rpc call failed"); - return tl::make_unexpected(admire::error_code::other); + return tl::make_unexpected(scord::error_code::other); } -admire::error_code +scord::error_code update_adhoc_storage(const server& srv, const adhoc_storage::ctx& new_ctx, const adhoc_storage& adhoc_storage) { @@ -280,10 +280,10 @@ update_adhoc_storage(const server& srv, const adhoc_storage::ctx& new_ctx, } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } -admire::error_code +scord::error_code remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage) { scord::network::client rpc_client{srv.protocol()}; @@ -317,10 +317,10 @@ remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage) { } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } -tl::expected +tl::expected register_pfs_storage(const server& srv, const std::string& name, enum pfs_storage::type type, const pfs_storage::ctx& ctx) { @@ -354,17 +354,17 @@ register_pfs_storage(const server& srv, const std::string& name, return tl::make_unexpected(ec); } - return admire::pfs_storage{type, name, resp.value(), ctx}; + return scord::pfs_storage{type, name, resp.value(), ctx}; } } LOGGER_ERROR("rpc call failed"); - return tl::make_unexpected(admire::error_code::other); + return tl::make_unexpected(scord::error_code::other); } -admire::error_code +scord::error_code update_pfs_storage(const server& srv, const pfs_storage& pfs_storage, - const admire::pfs_storage::ctx& new_ctx) { + const scord::pfs_storage::ctx& new_ctx) { scord::network::client rpc_client{srv.protocol()}; @@ -398,10 +398,10 @@ update_pfs_storage(const server& srv, const pfs_storage& pfs_storage, } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } -admire::error_code +scord::error_code remove_pfs_storage(const server& srv, const pfs_storage& pfs_storage) { scord::network::client rpc_client{srv.protocol()}; @@ -435,10 +435,10 @@ remove_pfs_storage(const server& srv, const pfs_storage& pfs_storage) { } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } -admire::error_code +scord::error_code deploy_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage) { scord::network::client rpc_client{srv.protocol()}; @@ -472,7 +472,7 @@ deploy_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage) { } LOGGER_ERROR("rpc call failed"); - return admire::error_code::other; + return scord::error_code::other; } tl::expected @@ -514,12 +514,12 @@ transfer_datasets(const server& srv, const job& job, return tl::make_unexpected(ec); } - return admire::transfer{resp.value()}; + return scord::transfer{resp.value()}; } } LOGGER_ERROR("rpc call failed"); - return tl::make_unexpected(admire::error_code::other); + return tl::make_unexpected(scord::error_code::other); } -} // namespace admire::detail +} // namespace scord::detail diff --git a/src/lib/detail/impl.hpp b/src/lib/detail/impl.hpp index 337f6e18..369b0836 100644 --- a/src/lib/detail/impl.hpp +++ b/src/lib/detail/impl.hpp @@ -29,47 +29,47 @@ #include #include -namespace admire::detail { +namespace scord::detail { -admire::error_code +scord::error_code ping(const server& srv); -tl::expected +tl::expected register_job(const server& srv, const job::resources& job_resources, const job_requirements& job_requirements, - admire::slurm_job_id slurm_id); + scord::slurm_job_id slurm_id); -admire::error_code +scord::error_code update_job(const server& srv, const job& job, const job::resources& new_resources); -admire::error_code +scord::error_code remove_job(const server& srv, const job& job); -tl::expected +tl::expected register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, const adhoc_storage::ctx& ctx); -admire::error_code +scord::error_code update_adhoc_storage(const server& srv, const adhoc_storage::ctx& new_ctx, const adhoc_storage& adhoc_storage); -admire::error_code +scord::error_code remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage); -admire::error_code +scord::error_code deploy_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage); -tl::expected +tl::expected register_pfs_storage(const server& srv, const std::string& name, enum pfs_storage::type type, const pfs_storage::ctx& ctx); -admire::error_code +scord::error_code update_pfs_storage(const server& srv, const pfs_storage& pfs_storage, - const admire::pfs_storage::ctx& new_ctx); + const scord::pfs_storage::ctx& new_ctx); -admire::error_code +scord::error_code remove_pfs_storage(const server& srv, const pfs_storage& pfs_storage); tl::expected @@ -79,6 +79,6 @@ transfer_datasets(const server& srv, const job& job, const std::vector& limits, transfer::mapping mapping); -} // namespace admire::detail +} // namespace scord::detail #endif // SCORD_ADMIRE_IMPL_HPP diff --git a/src/lib/env.hpp b/src/lib/env.hpp index 5329efdc..7eab24df 100644 --- a/src/lib/env.hpp +++ b/src/lib/env.hpp @@ -28,12 +28,12 @@ #define LIBSCORD_ENV_PREFIX "LIBSCORD_" #define ADD_PREFIX(str) LIBSCORD_ENV_PREFIX str -namespace admire::env { +namespace scord::env { static constexpr auto LOG = ADD_PREFIX("LOG"); static constexpr auto LOG_OUTPUT = ADD_PREFIX("LOG_OUTPUT"); -} // namespace admire::env +} // namespace scord::env #endif // LIBSCORD_ENV_HPP diff --git a/src/lib/libscord.cpp b/src/lib/libscord.cpp index ca1f2102..b0ef7163 100644 --- a/src/lib/libscord.cpp +++ b/src/lib/libscord.cpp @@ -51,9 +51,9 @@ init_logger() { try { - if(const auto p = std::getenv(admire::env::LOG); + if(const auto p = std::getenv(scord::env::LOG); p && !std::string{p}.empty() && std::string{p} != "0") { - if(const auto log_file = std::getenv(admire::env::LOG_OUTPUT)) { + if(const auto log_file = std::getenv(scord::env::LOG_OUTPUT)) { scord::logger::create_global_logger("libscord", "file", log_file); } else { @@ -198,7 +198,7 @@ rpc_registration_cb(scord::network::rpc_client* client) { } // namespace -namespace admire { +namespace scord { void ping(const server& srv) { @@ -209,9 +209,9 @@ ping(const server& srv) { } -admire::job +scord::job register_job(const server& srv, const job::resources& resources, - const job_requirements& reqs, admire::slurm_job_id slurm_job_id) { + const job_requirements& reqs, scord::slurm_job_id slurm_job_id) { const auto rv = detail::register_job(srv, resources, reqs, slurm_job_id); @@ -246,7 +246,7 @@ remove_job(const server& srv, const job& job) { } } -admire::adhoc_storage +scord::adhoc_storage register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, const adhoc_storage::ctx& ctx) { @@ -296,7 +296,7 @@ deploy_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage) { } } -admire::pfs_storage +scord::pfs_storage register_pfs_storage(const server& srv, const std::string& name, enum pfs_storage::type type, const pfs_storage::ctx& ctx) { @@ -313,7 +313,7 @@ register_pfs_storage(const server& srv, const std::string& name, void update_pfs_storage(const server& srv, const pfs_storage& pfs_storage, - const admire::pfs_storage::ctx& pfs_storage_ctx) { + const scord::pfs_storage::ctx& pfs_storage_ctx) { const auto ec = detail::update_pfs_storage(srv, pfs_storage, pfs_storage_ctx); @@ -335,7 +335,7 @@ remove_pfs_storage(const server& srv, const pfs_storage& pfs_storage) { } } -admire::transfer +scord::transfer transfer_datasets(const server& srv, const job& job, const std::vector& sources, const std::vector& targets, @@ -776,4 +776,4 @@ get_statistics(const server& srv, ADM_job_t job, ADM_job_stats_t** stats) { return ADM_SUCCESS; } -} // namespace admire +} // namespace scord diff --git a/src/lib/scord/scord.hpp b/src/lib/scord/scord.hpp index 4933f574..254b46c6 100644 --- a/src/lib/scord/scord.hpp +++ b/src/lib/scord/scord.hpp @@ -42,14 +42,14 @@ /* Public prototypes */ /******************************************************************************/ -namespace admire { +namespace scord { void ping(const server& srv); -admire::job +scord::job register_job(const server& srv, const job::resources& job_resources, - const job_requirements& reqs, admire::slurm_job_id slurm_id); + const job_requirements& reqs, scord::slurm_job_id slurm_id); void update_job(const server& srv, const job&, const job::resources& job_resources); @@ -57,7 +57,7 @@ update_job(const server& srv, const job&, const job::resources& job_resources); void remove_job(const server& srv, const job& job); -admire::adhoc_storage +scord::adhoc_storage register_adhoc_storage(const server& srv, const std::string& name, enum adhoc_storage::type type, const adhoc_storage::ctx& ctx); @@ -72,19 +72,19 @@ remove_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage); void deploy_adhoc_storage(const server& srv, const adhoc_storage& adhoc_storage); -admire::pfs_storage +scord::pfs_storage register_pfs_storage(const server& srv, const std::string& name, - enum admire::pfs_storage::type type, - const admire::pfs_storage::ctx& ctx); + enum scord::pfs_storage::type type, + const scord::pfs_storage::ctx& ctx); void update_pfs_storage(const server& srv, const pfs_storage& pfs_storage, - const admire::pfs_storage::ctx& pfs_storage_ctx); + const scord::pfs_storage::ctx& pfs_storage_ctx); void remove_pfs_storage(const server& srv, const pfs_storage& pfs_storage); -admire::transfer +scord::transfer transfer_datasets(const server& srv, const job& job, const std::vector& sources, const std::vector& targets, @@ -144,6 +144,6 @@ link_transfer_to_data_operation(const server& srv, ADM_job_t job, ADM_return_t get_statistics(const server& srv, ADM_job_t job, ADM_job_stats_t** stats); -} // namespace admire +} // namespace scord #endif // SCORD_HPP diff --git a/src/scord-ctl/rpc_handlers.cpp b/src/scord-ctl/rpc_handlers.cpp index 274623df..c021a466 100644 --- a/src/scord-ctl/rpc_handlers.cpp +++ b/src/scord-ctl/rpc_handlers.cpp @@ -49,12 +49,12 @@ ping(const scord::network::request& req) { rpc_id, std::quoted(__FUNCTION__), std::quoted(get_address(req))); - const auto resp = generic_response{rpc_id, admire::error_code::success}; + const auto resp = generic_response{rpc_id, scord::error_code::success}; LOGGER_INFO("rpc id: {} name: {} to: {} <= " "body: {{retval: {}}}", rpc_id, std::quoted(__FUNCTION__), - std::quoted(get_address(req)), admire::error_code::success); + std::quoted(get_address(req)), scord::error_code::success); req.respond(resp); } diff --git a/src/scord/adhoc_storage_manager.hpp b/src/scord/adhoc_storage_manager.hpp index 32c975ce..5ff62a50 100644 --- a/src/scord/adhoc_storage_manager.hpp +++ b/src/scord/adhoc_storage_manager.hpp @@ -40,10 +40,10 @@ namespace scord { struct adhoc_storage_manager : scord::utils::singleton { - tl::expected, - admire::error_code> - create(enum admire::adhoc_storage::type type, const std::string& name, - const admire::adhoc_storage::ctx& ctx) { + tl::expected, + scord::error_code> + create(enum scord::adhoc_storage::type type, const std::string& name, + const scord::adhoc_storage::ctx& ctx) { static std::atomic_uint64_t current_id; std::uint64_t id = current_id++; @@ -53,23 +53,23 @@ struct adhoc_storage_manager : scord::utils::singleton { if(const auto it = m_adhoc_storages.find(id); it == m_adhoc_storages.end()) { const auto& [it_adhoc, inserted] = m_adhoc_storages.emplace( - id, std::make_shared( - admire::adhoc_storage{type, name, id, ctx})); + id, std::make_shared( + scord::adhoc_storage{type, name, id, ctx})); if(!inserted) { LOGGER_ERROR("{}: Emplace failed", __FUNCTION__); - return tl::make_unexpected(admire::error_code::snafu); + return tl::make_unexpected(scord::error_code::snafu); } return it_adhoc->second; } LOGGER_ERROR("{}: Adhoc storage '{}' already exists", __FUNCTION__, id); - return tl::make_unexpected(admire::error_code::entity_exists); + return tl::make_unexpected(scord::error_code::entity_exists); } - admire::error_code - update(std::uint64_t id, admire::adhoc_storage::ctx new_ctx) { + scord::error_code + update(std::uint64_t id, scord::adhoc_storage::ctx new_ctx) { abt::unique_lock lock(m_adhoc_storages_mutex); @@ -77,15 +77,15 @@ struct adhoc_storage_manager : scord::utils::singleton { it != m_adhoc_storages.end()) { const auto current_adhoc_info = it->second; current_adhoc_info->update(std::move(new_ctx)); - return admire::error_code::success; + return scord::error_code::success; } LOGGER_ERROR("{}: Adhoc storage '{}' does not exist", __FUNCTION__, id); - return admire::error_code::no_such_entity; + return scord::error_code::no_such_entity; } - tl::expected, - admire::error_code> + tl::expected, + scord::error_code> find(std::uint64_t id) { abt::shared_lock lock(m_adhoc_storages_mutex); @@ -97,47 +97,47 @@ struct adhoc_storage_manager : scord::utils::singleton { LOGGER_ERROR("Adhoc storage '{}' was not registered or was already " "deleted", id); - return tl::make_unexpected(admire::error_code::no_such_entity); + return tl::make_unexpected(scord::error_code::no_such_entity); } - admire::error_code + scord::error_code remove(std::uint64_t id) { abt::unique_lock lock(m_adhoc_storages_mutex); if(m_adhoc_storages.count(id) != 0) { m_adhoc_storages.erase(id); - return admire::error_code::success; + return scord::error_code::success; } LOGGER_ERROR("Adhoc storage '{}' was not registered or was already " "deleted", id); - return admire::error_code::no_such_entity; + return scord::error_code::no_such_entity; } - admire::error_code + scord::error_code add_client_info(std::uint64_t adhoc_id, - std::shared_ptr job_info) { + std::shared_ptr job_info) { if(auto am_result = find(adhoc_id); am_result.has_value()) { const auto adhoc_storage_info = am_result.value(); return adhoc_storage_info->add_client_info(std::move(job_info)); } - return admire::error_code::no_such_entity; + return scord::error_code::no_such_entity; } - admire::error_code + scord::error_code remove_client_info(std::uint64_t adhoc_id) { if(auto am_result = find(adhoc_id); am_result.has_value()) { const auto adhoc_storage_info = *am_result; adhoc_storage_info->remove_client_info(); - return admire::error_code::success; + return scord::error_code::success; } - return admire::error_code::no_such_entity; + return scord::error_code::no_such_entity; } @@ -147,7 +147,7 @@ private: mutable abt::shared_mutex m_adhoc_storages_mutex; std::unordered_map> + std::shared_ptr> m_adhoc_storages; }; diff --git a/src/scord/job_manager.hpp b/src/scord/job_manager.hpp index 74023fd8..70dbb0aa 100644 --- a/src/scord/job_manager.hpp +++ b/src/scord/job_manager.hpp @@ -40,53 +40,51 @@ namespace scord { struct job_manager : scord::utils::singleton { - tl::expected, - admire::error_code> - create(admire::slurm_job_id slurm_id, admire::job::resources job_resources, - admire::job_requirements job_requirements) { + tl::expected, scord::error_code> + create(scord::slurm_job_id slurm_id, scord::job::resources job_resources, + scord::job_requirements job_requirements) { static std::atomic_uint64_t current_id; - admire::job_id id = current_id++; + scord::job_id id = current_id++; abt::unique_lock lock(m_jobs_mutex); if(const auto it = m_jobs.find(id); it == m_jobs.end()) { const auto& [it_job, inserted] = m_jobs.emplace( id, - std::make_shared( - admire::job{id, slurm_id}, std::move(job_resources), + std::make_shared( + scord::job{id, slurm_id}, std::move(job_resources), std::move(job_requirements))); if(!inserted) { LOGGER_ERROR("{}: Emplace failed", __FUNCTION__); - return tl::make_unexpected(admire::error_code::snafu); + return tl::make_unexpected(scord::error_code::snafu); } return it_job->second; } LOGGER_ERROR("{}: Job '{}' already exists", __FUNCTION__, id); - return tl::make_unexpected(admire::error_code::entity_exists); + return tl::make_unexpected(scord::error_code::entity_exists); } - admire::error_code - update(admire::job_id id, admire::job::resources job_resources) { + scord::error_code + update(scord::job_id id, scord::job::resources job_resources) { abt::unique_lock lock(m_jobs_mutex); if(const auto it = m_jobs.find(id); it != m_jobs.end()) { const auto& current_job_info = it->second; current_job_info->update(std::move(job_resources)); - return admire::error_code::success; + return scord::error_code::success; } LOGGER_ERROR("{}: Job '{}' does not exist", __FUNCTION__, id); - return admire::error_code::no_such_entity; + return scord::error_code::no_such_entity; } - tl::expected, - admire::error_code> - find(admire::job_id id) { + tl::expected, scord::error_code> + find(scord::job_id id) { abt::shared_lock lock(m_jobs_mutex); @@ -95,12 +93,11 @@ struct job_manager : scord::utils::singleton { } LOGGER_ERROR("Job '{}' was not registered or was already deleted", id); - return tl::make_unexpected(admire::error_code::no_such_entity); + return tl::make_unexpected(scord::error_code::no_such_entity); } - tl::expected, - admire::error_code> - remove(admire::job_id id) { + tl::expected, scord::error_code> + remove(scord::job_id id) { abt::unique_lock lock(m_jobs_mutex); @@ -111,7 +108,7 @@ struct job_manager : scord::utils::singleton { LOGGER_ERROR("Job '{}' was not registered or was already deleted", id); - return tl::make_unexpected(admire::error_code::no_such_entity); + return tl::make_unexpected(scord::error_code::no_such_entity); } private: @@ -119,8 +116,8 @@ private: job_manager() = default; mutable abt::shared_mutex m_jobs_mutex; - std::unordered_map> + std::unordered_map> m_jobs; }; diff --git a/src/scord/pfs_storage_manager.hpp b/src/scord/pfs_storage_manager.hpp index 46b0182c..de021848 100644 --- a/src/scord/pfs_storage_manager.hpp +++ b/src/scord/pfs_storage_manager.hpp @@ -39,10 +39,10 @@ namespace scord { struct pfs_storage_manager : scord::utils::singleton { - tl::expected, - admire::error_code> - create(enum admire::pfs_storage::type type, const std::string& name, - const admire::pfs_storage::ctx& ctx) { + tl::expected, + scord::error_code> + create(enum scord::pfs_storage::type type, const std::string& name, + const scord::pfs_storage::ctx& ctx) { static std::atomic_uint64_t current_id; std::uint64_t id = current_id++; @@ -52,23 +52,23 @@ struct pfs_storage_manager : scord::utils::singleton { if(const auto it = m_pfs_storages.find(id); it == m_pfs_storages.end()) { const auto& [it_pfs, inserted] = m_pfs_storages.emplace( - id, std::make_shared( - admire::pfs_storage{type, name, id, ctx})); + id, std::make_shared( + scord::pfs_storage{type, name, id, ctx})); if(!inserted) { LOGGER_ERROR("{}: Emplace failed", __FUNCTION__); - return tl::make_unexpected(admire::error_code::snafu); + return tl::make_unexpected(scord::error_code::snafu); } return it_pfs->second; } LOGGER_ERROR("{}: PFS storage '{}' already exists", __FUNCTION__, id); - return tl::make_unexpected(admire::error_code::entity_exists); + return tl::make_unexpected(scord::error_code::entity_exists); } - admire::error_code - update(std::uint64_t id, admire::pfs_storage::ctx new_ctx) { + scord::error_code + update(std::uint64_t id, scord::pfs_storage::ctx new_ctx) { abt::unique_lock lock(m_pfs_storages_mutex); @@ -76,15 +76,15 @@ struct pfs_storage_manager : scord::utils::singleton { it != m_pfs_storages.end()) { const auto current_pfs_info = it->second; current_pfs_info->update(std::move(new_ctx)); - return admire::error_code::success; + return scord::error_code::success; } LOGGER_ERROR("{}: Adhoc storage '{}' does not exist", __FUNCTION__, id); - return admire::error_code::no_such_entity; + return scord::error_code::no_such_entity; } - tl::expected, - admire::error_code> + tl::expected, + scord::error_code> find(std::uint64_t id) { abt::shared_lock lock(m_pfs_storages_mutex); @@ -96,24 +96,24 @@ struct pfs_storage_manager : scord::utils::singleton { LOGGER_ERROR("PFS storage '{}' was not registered or was already " "deleted", id); - return tl::make_unexpected(admire::error_code::no_such_entity); + return tl::make_unexpected(scord::error_code::no_such_entity); } - admire::error_code + scord::error_code remove(std::uint64_t id) { abt::unique_lock lock(m_pfs_storages_mutex); if(m_pfs_storages.count(id) != 0) { m_pfs_storages.erase(id); - return admire::error_code::success; + return scord::error_code::success; } LOGGER_ERROR("PFS storage '{}' was not registered or was already " "deleted", id); - return admire::error_code::no_such_entity; + return scord::error_code::no_such_entity; } private: @@ -122,7 +122,7 @@ private: mutable abt::shared_mutex m_pfs_storages_mutex; std::unordered_map> + std::shared_ptr> m_pfs_storages; }; diff --git a/src/scord/rpc_handlers.cpp b/src/scord/rpc_handlers.cpp index b128cb26..9ffe0646 100644 --- a/src/scord/rpc_handlers.cpp +++ b/src/scord/rpc_handlers.cpp @@ -58,21 +58,21 @@ ping(const scord::network::request& req) { "body: {{}}", rpc_id, std::quoted(rpc_name), std::quoted(get_address(req))); - const auto resp = generic_response{rpc_id, admire::error_code::success}; + const auto resp = generic_response{rpc_id, scord::error_code::success}; LOGGER_INFO("rpc id: {} name: {} to: {} <= " "body: {{retval: {}}}", rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), - admire::error_code::success); + scord::error_code::success); req.respond(resp); } void register_job(const scord::network::request& req, - const admire::job::resources& job_resources, - const admire::job_requirements& job_requirements, - admire::slurm_job_id slurm_id) { + const scord::job::resources& job_resources, + const scord::job_requirements& job_requirements, + scord::slurm_job_id slurm_id) { using scord::network::get_address; @@ -85,8 +85,8 @@ register_job(const scord::network::request& req, rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), job_resources, job_requirements, slurm_id); - admire::error_code ec; - std::optional job_id; + scord::error_code ec; + std::optional job_id; auto& jm = scord::job_manager::instance(); if(const auto jm_result = @@ -121,8 +121,8 @@ register_job(const scord::network::request& req, } void -update_job(const request& req, admire::job_id job_id, - const admire::job::resources& new_resources) { +update_job(const request& req, scord::job_id job_id, + const scord::job::resources& new_resources) { using scord::network::get_address; @@ -153,7 +153,7 @@ update_job(const request& req, admire::job_id job_id, } void -remove_job(const request& req, admire::job_id job_id) { +remove_job(const request& req, scord::job_id job_id) { using scord::network::get_address; @@ -165,7 +165,7 @@ remove_job(const request& req, admire::job_id job_id) { rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), job_id); - admire::error_code ec; + scord::error_code ec; auto& jm = scord::job_manager::instance(); const auto jm_result = jm.remove(job_id); @@ -197,8 +197,8 @@ remove_job(const request& req, admire::job_id job_id) { void register_adhoc_storage(const request& req, const std::string& name, - enum admire::adhoc_storage::type type, - const admire::adhoc_storage::ctx& ctx) { + enum scord::adhoc_storage::type type, + const scord::adhoc_storage::ctx& ctx) { using scord::network::get_address; @@ -210,7 +210,7 @@ register_adhoc_storage(const request& req, const std::string& name, rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), name, type, ctx); - admire::error_code ec; + scord::error_code ec; std::optional adhoc_id; auto& adhoc_manager = scord::adhoc_storage_manager::instance(); @@ -237,7 +237,7 @@ register_adhoc_storage(const request& req, const std::string& name, void update_adhoc_storage(const request& req, std::uint64_t adhoc_id, - const admire::adhoc_storage::ctx& new_ctx) { + const scord::adhoc_storage::ctx& new_ctx) { using scord::network::get_address; @@ -282,7 +282,7 @@ remove_adhoc_storage(const request& req, std::uint64_t adhoc_id) { adhoc_id); auto& adhoc_manager = scord::adhoc_storage_manager::instance(); - admire::error_code ec = adhoc_manager.remove(adhoc_id); + scord::error_code ec = adhoc_manager.remove(adhoc_id); if(!ec) { LOGGER_ERROR("rpc id: {} error_msg: \"Error removing job: {}\"", rpc_id, @@ -312,7 +312,7 @@ deploy_adhoc_storage(const request& req, std::uint64_t adhoc_id) { rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), adhoc_id); - auto ec = admire::error_code::success; + auto ec = scord::error_code::success; auto& adhoc_manager = scord::adhoc_storage_manager::instance(); if(const auto am_result = adhoc_manager.find(adhoc_id); @@ -320,7 +320,7 @@ deploy_adhoc_storage(const request& req, std::uint64_t adhoc_id) { const auto& storage_info = am_result.value(); const auto adhoc_storage = storage_info->adhoc_storage(); - if(adhoc_storage.type() == admire::adhoc_storage::type::gekkofs) { + if(adhoc_storage.type() == scord::adhoc_storage::type::gekkofs) { const auto adhoc_ctx = adhoc_storage.context(); /* Number of nodes */ const std::string nodes = @@ -354,7 +354,7 @@ deploy_adhoc_storage(const request& req, std::uint64_t adhoc_id) { break; } case -1: { - ec = admire::error_code::other; + ec = scord::error_code::other; LOGGER_ERROR("rpc id: {} name: {} to: {} <= " "body: {{retval: {}}}", rpc_id, std::quoted(rpc_name), @@ -368,12 +368,12 @@ deploy_adhoc_storage(const request& req, std::uint64_t adhoc_id) { LOGGER_ERROR( "rpc id: {} error_msg: \"Error waitpid code: {}\"", rpc_id, retwait); - ec = admire::error_code::other; + ec = scord::error_code::other; } else { if(WEXITSTATUS(wstatus) != 0) { - ec = admire::error_code::other; + ec = scord::error_code::other; } else { - ec = admire::error_code::success; + ec = scord::error_code::success; } } break; @@ -401,8 +401,8 @@ deploy_adhoc_storage(const request& req, std::uint64_t adhoc_id) { void register_pfs_storage(const request& req, const std::string& name, - enum admire::pfs_storage::type type, - const admire::pfs_storage::ctx& ctx) { + enum scord::pfs_storage::type type, + const scord::pfs_storage::ctx& ctx) { using scord::network::get_address; @@ -414,7 +414,7 @@ register_pfs_storage(const request& req, const std::string& name, rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), name, type, ctx); - admire::error_code ec; + scord::error_code ec; std::optional pfs_id = 0; auto& pfs_manager = scord::pfs_storage_manager::instance(); @@ -440,7 +440,7 @@ register_pfs_storage(const request& req, const std::string& name, void update_pfs_storage(const request& req, std::uint64_t pfs_id, - const admire::pfs_storage::ctx& new_ctx) { + const scord::pfs_storage::ctx& new_ctx) { using scord::network::get_address; @@ -484,7 +484,7 @@ remove_pfs_storage(const request& req, std::uint64_t pfs_id) { pfs_id); auto& pfs_manager = scord::pfs_storage_manager::instance(); - admire::error_code ec = pfs_manager.remove(pfs_id); + scord::error_code ec = pfs_manager.remove(pfs_id); if(!ec) { LOGGER_ERROR("rpc id: {} error_msg: \"Error removing pfs storage: {}\"", @@ -502,11 +502,11 @@ remove_pfs_storage(const request& req, std::uint64_t pfs_id) { } void -transfer_datasets(const request& req, admire::job_id job_id, - const std::vector& sources, - const std::vector& targets, - const std::vector& limits, - enum admire::transfer::mapping mapping) { +transfer_datasets(const request& req, scord::job_id job_id, + const std::vector& sources, + const std::vector& targets, + const std::vector& limits, + enum scord::transfer::mapping mapping) { using scord::network::get_address; @@ -519,7 +519,7 @@ transfer_datasets(const request& req, admire::job_id job_id, rpc_id, std::quoted(rpc_name), std::quoted(get_address(req)), job_id, sources, targets, limits, mapping); - admire::error_code ec; + scord::error_code ec; std::optional tx_id; diff --git a/src/scord/rpc_handlers.hpp b/src/scord/rpc_handlers.hpp index 880c6913..285bb962 100644 --- a/src/scord/rpc_handlers.hpp +++ b/src/scord/rpc_handlers.hpp @@ -36,24 +36,24 @@ ping(const scord::network::request& req); void register_job(const scord::network::request& req, - const admire::job::resources& job_resources, - const admire::job_requirements& job_requirements, - admire::slurm_job_id slurm_id); + const scord::job::resources& job_resources, + const scord::job_requirements& job_requirements, + scord::slurm_job_id slurm_id); void -update_job(const request& req, admire::job_id job_id, - const admire::job::resources& new_resources); +update_job(const request& req, scord::job_id job_id, + const scord::job::resources& new_resources); void -remove_job(const request& req, admire::job_id job_id); +remove_job(const request& req, scord::job_id job_id); void register_adhoc_storage(const request& req, const std::string& name, - enum admire::adhoc_storage::type type, - const admire::adhoc_storage::ctx& ctx); + enum scord::adhoc_storage::type type, + const scord::adhoc_storage::ctx& ctx); void update_adhoc_storage(const request& req, std::uint64_t adhoc_id, - const admire::adhoc_storage::ctx& new_ctx); + const scord::adhoc_storage::ctx& new_ctx); void remove_adhoc_storage(const request& req, std::uint64_t adhoc_id); @@ -63,22 +63,22 @@ deploy_adhoc_storage(const request& req, std::uint64_t adhoc_id); void register_pfs_storage(const request& req, const std::string& name, - enum admire::pfs_storage::type type, - const admire::pfs_storage::ctx& ctx); + enum scord::pfs_storage::type type, + const scord::pfs_storage::ctx& ctx); void update_pfs_storage(const request& req, std::uint64_t pfs_id, - const admire::pfs_storage::ctx& new_ctx); + const scord::pfs_storage::ctx& new_ctx); void remove_pfs_storage(const request& req, std::uint64_t pfs_id); void -transfer_datasets(const request& req, admire::job_id job_id, - const std::vector& sources, - const std::vector& targets, - const std::vector& limits, - enum admire::transfer::mapping mapping); +transfer_datasets(const request& req, scord::job_id job_id, + const std::vector& sources, + const std::vector& targets, + const std::vector& limits, + enum scord::transfer::mapping mapping); } // namespace scord::network::handlers -- GitLab From 66e1f05e758159865f73168dc61b69600025a95f Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 14 Feb 2023 16:18:51 +0100 Subject: [PATCH 10/10] Rename internal macros --- src/lib/scord/scord.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/scord/scord.h b/src/lib/scord/scord.h index a686ea57..fcfe8815 100644 --- a/src/lib/scord/scord.h +++ b/src/lib/scord/scord.h @@ -34,10 +34,10 @@ extern "C" { #endif -#define ADM_IOSCHED_API_VERSION "0.1.0" -#define ADM_IOSCHED_API_VERSION_MAJOR 0 -#define ADM_IOSCHED_API_VERSION_MINOR 1 -#define ADM_IOSCHED_API_VERSION_PATCH 0 +#define SCORD_API_VERSION "0.1.0" +#define SCORD_API_VERSION_MAJOR 0 +#define SCORD_API_VERSION_MINOR 1 +#define SCORD_API_VERSION_PATCH 0 /******************************************************************************/ -- GitLab