From f27b8acbb5e5bcf0123cd68a194d7676471d5d71 Mon Sep 17 00:00:00 2001 From: Weijia Song Date: Sat, 27 Apr 2024 23:33:02 -0400 Subject: [PATCH 1/5] Removing a copy on appending log to Persistent. TODO:The copy for delta should also be avoided. --- .../persistent/detail/FilePersistLog.hpp | 3 ++ .../derecho/persistent/detail/PersistLog.hpp | 37 ++++++++++++++----- .../persistent/detail/Persistent_impl.hpp | 11 +++--- .../simple_replicated_objects_overlap.cpp | 4 ++ src/persistent/FilePersistLog.cpp | 11 +++++- 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/include/derecho/persistent/detail/FilePersistLog.hpp b/include/derecho/persistent/detail/FilePersistLog.hpp index d708ac24..bff2726b 100644 --- a/include/derecho/persistent/detail/FilePersistLog.hpp +++ b/include/derecho/persistent/detail/FilePersistLog.hpp @@ -187,6 +187,9 @@ class FilePersistLog : public PersistLog { virtual void append(const void* pdata, uint64_t size, version_t ver, const HLC& mhlc) override; + virtual void append(const std::function& blob_generator, + uint64_t size, version_t ver, + const HLC& mhlc) override; virtual void advanceVersion(int64_t ver) override; virtual int64_t getLength() override; virtual int64_t getEarliestIndex() override; diff --git a/include/derecho/persistent/detail/PersistLog.hpp b/include/derecho/persistent/detail/PersistLog.hpp index 1847fb04..f3ab38d2 100644 --- a/include/derecho/persistent/detail/PersistLog.hpp +++ b/include/derecho/persistent/detail/PersistLog.hpp @@ -89,21 +89,38 @@ class PersistLog { */ PersistLog(const std::string& name, bool enable_signatures); virtual ~PersistLog() noexcept(true); - /** Persistent Append - * @param pdata - serialized data to be append - * @param size - length of the data - * @param ver - version of the data, the implementation is responsible for - * making sure it grows monotonically. - * @param mhlc - the hlc clock of the data, the implementation is - * responsible for making sure it grows monotonically. + /** + * @fn void append(const void*, uint64_t, version_t, const HLC&) + * @brief append to persistent log. * Note that the entry appended can only become persistent till the persist() * is called on that entry. + * + * @param[in] pdata Serialized data to be append + * @param[in] size Length of the data + * @param[in] ver Version of the data, the implementation is responsible for + * making sure it grows monotonically. + * @param[in] mhlc The hlc clock of the data, the implementation is + * responsible for making sure it grows monotonically. */ virtual void append(const void* pdata, uint64_t size, version_t ver, - const HLC& mhlc) - = 0; - + const HLC& mhlc) = 0; + /** + * @fn void append(const std::function&,uint64_t,version_t,const HLC&) + * @brief append to persistent log in a zero-copy fashion. + * Note that the entry appended can only become persistent till the persist() is + * called on that entry. + * + * @param[in] blob_generator The lambda that generator the data. + * @param[in] size The size of the data being generated. + * @param[in] ver Version of the data, the implementation is responsible + * for making sure it grows monotonically. + * @param[in] mhlc The hlc clock of the data, the implementation is + * responsible for making sure it grows monotonically. + */ + virtual void append(const std::function& blob_generator, + uint64_t size, version_t ver, + const HLC& mhlc) = 0; /** * Advance the version number without appending a log. This is useful * to create gap between versions. diff --git a/include/derecho/persistent/detail/Persistent_impl.hpp b/include/derecho/persistent/detail/Persistent_impl.hpp index c7df2491..fa2a8ef8 100644 --- a/include/derecho/persistent/detail/Persistent_impl.hpp +++ b/include/derecho/persistent/detail/Persistent_impl.hpp @@ -550,12 +550,11 @@ void Persistent::set(ObjectType& v, version_t ver, cons }); } else { // ObjectType does not support Delta, logging the whole current state. - auto size = mutils::bytes_size(v); - uint8_t* buf = new uint8_t[size]; - memset(buf, 0, size); - mutils::to_bytes(v, buf); - this->m_pLog->append((void*)buf, size, ver, mhlc); - delete[] buf; + this->m_pLog->append([&v](void* buf,uint64_t buf_size){ + if (mutils::bytes_size(v) <= buf_size) { + mutils::to_bytes(v,static_cast(buf)); + } + },mutils::bytes_size(v),ver,mhlc); } } diff --git a/src/applications/demos/simple_replicated_objects_overlap.cpp b/src/applications/demos/simple_replicated_objects_overlap.cpp index 72a3961e..dfa9080e 100644 --- a/src/applications/demos/simple_replicated_objects_overlap.cpp +++ b/src/applications/demos/simple_replicated_objects_overlap.cpp @@ -45,14 +45,18 @@ int main(int argc, char** argv) { std::vector bar_members = group.get_subgroup_members(0)[0]; auto find_in_foo_results = std::find(foo_members.begin(), foo_members.end(), my_id); if(find_in_foo_results != foo_members.end()) { +#ifndef NOLOG uint32_t rank_in_foo = std::distance(foo_members.begin(), find_in_foo_results); +#endif//NOLOG // Replicated& foo_rpc_handle = group.get_subgroup(); dbg_default_crit("Here is FOO {}!", rank_in_foo); dbg_default_crit("I see members of my shard: {}", foo_members); } auto find_in_bar_results = std::find(bar_members.begin(), bar_members.end(), my_id); if(find_in_bar_results != bar_members.end()) { +#ifndef NOLOG uint32_t rank_in_bar = derecho::index_of(bar_members, my_id); +#endif//NOLOG // Replicated& bar_rpc_handle = group.get_subgroup(); dbg_default_crit("Here is BAR {}!", rank_in_bar); dbg_default_crit("I see members of my shard: {}", bar_members); diff --git a/src/persistent/FilePersistLog.cpp b/src/persistent/FilePersistLog.cpp index 9b2d02b6..9d3b0c46 100644 --- a/src/persistent/FilePersistLog.cpp +++ b/src/persistent/FilePersistLog.cpp @@ -246,6 +246,13 @@ inline void FilePersistLog::do_append_validation(const uint64_t size, const int6 } void FilePersistLog::append(const void* pdat, uint64_t size, version_t ver, const HLC& mhlc) { + this->append([pdat,size](void* buf,uint64_t bfsz) { + memcpy(buf,pdat,std::min(size,bfsz)); + },size,ver,mhlc); +} + +void FilePersistLog::append(const std::function& blob_generator, + uint64_t size, version_t ver, const HLC& mhlc) { dbg_trace(m_logger, "{0} append event ({1},{2})", this->m_sName, mhlc.m_rtc_us, mhlc.m_logic); FPL_RDLOCK; @@ -258,9 +265,9 @@ void FilePersistLog::append(const void* pdat, uint64_t size, version_t ver, cons do_append_validation(size, ver); dbg_trace(m_logger, "{0} append:validate check2 Finished.", this->m_sName); - // copy data + // generate data. // we reserve the first 'signature_size' bytes at the beginning of NEXT_DATA. - memcpy(reinterpret_cast(reinterpret_cast(NEXT_DATA) + signature_size), pdat, size); + blob_generator(reinterpret_cast(reinterpret_cast(NEXT_DATA) + signature_size), size); dbg_trace(m_logger, "{0} append:data ({1} bytes) is copied to log.", this->m_sName, size); // fill the log entry From e73c752357f9db284c6bfc138321cbd397ffe79c Mon Sep 17 00:00:00 2001 From: Weijia Song Date: Mon, 29 Apr 2024 22:27:29 -0400 Subject: [PATCH 2/5] Removed another copy on appending delta to Persistent Important: this is not a compatible change. Cascade needs to change accordingly. --- include/derecho/persistent/Persistent.hpp | 35 ++++++++++++------- .../persistent/detail/Persistent_impl.hpp | 16 ++++----- .../unit_tests/mixed_persistence_test.cpp | 23 +++++++----- .../tests/unit_tests/signed_log_test.cpp | 24 +++++++------ .../tests/unit_tests/signed_log_test.hpp | 9 ++--- src/persistent/test.cpp | 16 ++++++--- 6 files changed, 75 insertions(+), 48 deletions(-) diff --git a/include/derecho/persistent/Persistent.hpp b/include/derecho/persistent/Persistent.hpp index 15884012..38030ed3 100644 --- a/include/derecho/persistent/Persistent.hpp +++ b/include/derecho/persistent/Persistent.hpp @@ -339,22 +339,13 @@ class PersistentRegistry : public mutils::RemoteDeserializationContext { // the log entries are applied in order. TODO: use checkpointing to accelerate it! // // There are three methods included in this interface: -// - 'finalizeCurrentDelta' This method is called when Persistent wants to -// make a version. Its argument is a DeltaFinalizer function; T should invoke this -// function to give Persistent the Delta data. +// - 'currentDeltaToBytes' This method is called when Persistent wants to +// make a version. It serialize the current Delta to the given buffer. // - 'applyDelta' This method is called on object construction from the disk. Its argument // is a single Delta data buffer that should be applied. // - 'create' This static method is used to create an empty object from a deserialization // manager. -/** - * Type of a function that receives a Delta data buffer from an object with Delta support, - * for the purpose of writing the Delta to a persistent log. - * @param arg1 a pointer to the buffer - * @param arg2 the buffer's size - */ -using DeltaFinalizer = std::function; - template class IDeltaObjectFactory { public: @@ -366,8 +357,26 @@ class IDeltaObjectFactory { template class IDeltaSupport : public IDeltaObjectFactory { public: - virtual void finalizeCurrentDelta(const DeltaFinalizer&) = 0; - virtual void applyDelta(uint8_t const* const) = 0; + /** + * @fn size_t currentDeltaToBytes(uint8_t* const) + * @brief serialize the current delta to buffer. + * @param[in] buf buffer + * @param[in] buf_size size of the given buffer + * @return number of size used. + */ + virtual size_t currentDeltaToBytes(uint8_t* const buf, size_t buf_size) = 0; + /** + * @fn size_t currentDeltaSize() + * @brief get the serialized size of the current delta. + * @return size. + */ + virtual size_t currentDeltaSize() = 0; + /** + * @fn applyDelta(uint8_t const* const) + * @brief apply the delta to current state. + * @param[in] buf The buffer for serialized data. + */ + virtual void applyDelta(uint8_t const* const buf) = 0; }; // _NameMaker is a tool makeing the name for the log corresponding to a diff --git a/include/derecho/persistent/detail/Persistent_impl.hpp b/include/derecho/persistent/detail/Persistent_impl.hpp index fa2a8ef8..580bfc11 100644 --- a/include/derecho/persistent/detail/Persistent_impl.hpp +++ b/include/derecho/persistent/detail/Persistent_impl.hpp @@ -539,15 +539,13 @@ template ::set(ObjectType& v, version_t ver, const HLC& mhlc) { dbg_trace(m_logger, "append to log with ver({}),hlc({},{})", ver, mhlc.m_rtc_us, mhlc.m_logic); if constexpr(std::is_base_of, ObjectType>::value) { - v.finalizeCurrentDelta([&](uint8_t const* const buf, size_t len) { - // Don't create a log entry for versions without data change. - if (len > 0) { - this->m_pLog->append((const void* const)buf, len, ver, mhlc); - } else { - // Advance the log's version so it still reports the correct "current version" - this->m_pLog->advanceVersion(ver); - } - }); + if (v.currentDeltaSize() > 0) { + this->m_pLog->append([&v](void* buf, uint64_t buf_size){ + v.currentDeltaToBytes(static_cast(buf),static_cast(buf_size)); + },v.currentDeltaSize(),ver,mhlc); + } else { + this->m_pLog->advanceVersion(ver); + } } else { // ObjectType does not support Delta, logging the whole current state. this->m_pLog->append([&v](void* buf,uint64_t buf_size){ diff --git a/src/applications/tests/unit_tests/mixed_persistence_test.cpp b/src/applications/tests/unit_tests/mixed_persistence_test.cpp index 807d0e57..b6fc1233 100644 --- a/src/applications/tests/unit_tests/mixed_persistence_test.cpp +++ b/src/applications/tests/unit_tests/mixed_persistence_test.cpp @@ -24,16 +24,23 @@ class IntegerWithDelta : public mutils::ByteRepresentable, persistent::IDeltaSup } // Unlike the one in test.cpp, this finalizeCurrentDelta only writes any data if delta is nonzero // This simulates a more advanced object like CascadeStoreCore - virtual void finalizeCurrentDelta(const persistent::DeltaFinalizer& finalizer) { - if(delta != 0) { - finalizer(reinterpret_cast(&delta), sizeof(delta)); + virtual size_t currentDeltaToBytes(uint8_t * const buf, size_t buf_size) override { + if (delta == 0) { + return 0; } else { - finalizer(nullptr, 0); + if (buf_size < sizeof(delta)) { + dbg_default_error("{} failed because buffer ({}) is smaller than needed ({}).\n", + __func__,buf_size,sizeof(delta)); + return 0; + } + memcpy(static_cast(buf),static_cast(&delta),sizeof(delta)); + return sizeof(delta); } - // clear delta after writing - this->delta = 0; } - virtual void applyDelta(uint8_t const* const pdat) { + virtual size_t currentDeltaSize() override { + return delta==0?0:sizeof(delta); + } + virtual void applyDelta(uint8_t const* const pdat) override { this->value += *reinterpret_cast(pdat); } static std::unique_ptr create(mutils::DeserializationManager* dm) { @@ -143,4 +150,4 @@ int main(int argc, char** argv) { std::cin.get(); group.barrier_sync(); group.leave(true); -} \ No newline at end of file +} diff --git a/src/applications/tests/unit_tests/signed_log_test.cpp b/src/applications/tests/unit_tests/signed_log_test.cpp index a4dc7778..79ef060b 100644 --- a/src/applications/tests/unit_tests/signed_log_test.cpp +++ b/src/applications/tests/unit_tests/signed_log_test.cpp @@ -76,18 +76,22 @@ std::string StringWithDelta::get_current_state() const { return current_state; } -void StringWithDelta::finalizeCurrentDelta(const persistent::DeltaFinalizer& finalizer) { - if(delta.size() == 0) { - dbg_default_trace("StringWithDelta: Calling finalizer with null buffer"); - finalizer(nullptr, 0); +size_t StringWithDelta::currentDeltaSize() { + return delta.size(); +} + +size_t StringWithDelta::currentDeltaToBytes(uint8_t * const buf, size_t buf_size) { + if (delta.size() == 0) { + dbg_default_trace("StringWithDelta: Calling currentDeltaToBytes with null buffer\n"); + return 0; + } else if (buf_size < delta.size()) { + dbg_default_error("{} failed because the buffer({}) given is smaller than needed({}).\n", + __func__,buf_size,delta.size()); + return 0; } else { - // Serialize the string to a byte buffer and give that buffer to the DeltaFinalizer - // (this will create an unnecessary extra copy of the string, but efficiency isn't important here) - std::vector delta_buffer(mutils::bytes_size(delta)); - dbg_default_trace("StringWithDelta: Serializing delta string to a buffer of size {}", delta_buffer.size()); - mutils::to_bytes(delta, delta_buffer.data()); - finalizer(delta_buffer.data(), delta_buffer.size()); + size_t nbytes = mutils::to_bytes(delta,buf); delta.clear(); + return nbytes; } } diff --git a/src/applications/tests/unit_tests/signed_log_test.hpp b/src/applications/tests/unit_tests/signed_log_test.hpp index 9fb1e348..a0a426ce 100644 --- a/src/applications/tests/unit_tests/signed_log_test.hpp +++ b/src/applications/tests/unit_tests/signed_log_test.hpp @@ -37,11 +37,11 @@ struct TestState : public derecho::DeserializationContext { /** * A simple Delta-supporting object that stores a string and has a method that - * appends to the string. All data appended since the last call to finalizeCurrentDelta + * appends to the string. All data appended since the last call to currentDeltaToBytes * is stored in the delta, and applyDelta appends the delta to the current string. * (There's no way to delete or truncate the string since this is just for test * purposes). Note that if append() has not been called since the last call to - * finalizeCurrentDelta, the delta entry will be empty. + * currentDeltaToBytes, the delta entry will be empty. */ class StringWithDelta : public mutils::ByteRepresentable, public persistent::IDeltaSupport { @@ -53,8 +53,9 @@ class StringWithDelta : public mutils::ByteRepresentable, StringWithDelta(const std::string& init_string); void append(const std::string& str_val); std::string get_current_state() const; - virtual void finalizeCurrentDelta(const persistent::DeltaFinalizer& finalizer); - virtual void applyDelta(uint8_t const* const data); + virtual size_t currentDeltaSize() override; + virtual size_t currentDeltaToBytes(uint8_t * const buf, size_t buf_size) override; + virtual void applyDelta(uint8_t const* const data) override; static std::unique_ptr create(mutils::DeserializationManager* dm); DEFAULT_SERIALIZATION_SUPPORT(StringWithDelta, current_state); }; diff --git a/src/persistent/test.cpp b/src/persistent/test.cpp index 22129267..eed48784 100644 --- a/src/persistent/test.cpp +++ b/src/persistent/test.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -102,11 +103,18 @@ class IntegerWithDelta : public ByteRepresentable, IDeltaSupportdelta -= op; return this->value; } - virtual void finalizeCurrentDelta(const DeltaFinalizer& dp) { - // finalize current delta - dp((uint8_t const* const) & (this->delta), sizeof(this->delta)); - // clear delta + virtual size_t currentDeltaToBytes(uint8_t* const buf, size_t buf_size) override { + if (buf_size < sizeof(delta)) { + dbg_default_warn("currentDeltaToBytes received a buffer {} smaller than needed: {}.\n", + buf_size,sizeof(delta)); + return 0; + } + memcpy(static_cast(buf),static_cast(&delta),sizeof(delta)); this->delta = 0; + return sizeof(delta); + } + virtual size_t currentDeltaSize() override { + return (this->delta == 0)?0:sizeof(delta); } virtual void applyDelta(uint8_t const* const pdat) { // apply delta From f291affdd369e1ba13943218f3f9bf6c60947e76 Mon Sep 17 00:00:00 2001 From: Weijia Song Date: Fri, 3 May 2024 02:01:18 -0400 Subject: [PATCH 3/5] introducing configuration header file: derecho/config.h to control feature selection. Also: using <> instead of double quote if the header is not on relative path. --- CMakeLists.txt | 30 +++++++--- config.h.in | 3 + include/derecho/conf/conf.hpp | 2 + include/derecho/core/bytes_object.hpp | 3 +- include/derecho/core/derecho.hpp | 1 + include/derecho/core/derecho_exception.hpp | 3 +- .../derecho/core/derecho_type_definitions.hpp | 1 + .../core/detail/connection_manager.hpp | 3 +- include/derecho/core/detail/derecho_sst.hpp | 3 +- .../core/detail/external_group_impl.hpp | 1 + include/derecho/core/detail/group_impl.hpp | 8 +-- include/derecho/core/detail/make_kind_map.hpp | 1 + .../derecho/core/detail/multicast_group.hpp | 11 ++-- .../derecho/core/detail/p2p_connection.hpp | 5 +- .../core/detail/p2p_connection_manager.hpp | 7 ++- .../core/detail/persistence_manager.hpp | 7 ++- .../derecho/core/detail/public_key_store.hpp | 3 +- .../derecho/core/detail/remote_invocable.hpp | 7 ++- .../derecho/core/detail/replicated_impl.hpp | 3 +- .../core/detail/replicated_interface.hpp | 5 +- include/derecho/core/detail/restart_state.hpp | 3 +- include/derecho/core/detail/rpc_manager.hpp | 7 ++- include/derecho/core/detail/rpc_utils.hpp | 5 +- include/derecho/core/detail/view_manager.hpp | 5 +- include/derecho/core/external_group.hpp | 3 +- include/derecho/core/group.hpp | 5 +- include/derecho/core/notification.hpp | 5 +- .../derecho/core/register_rpc_functions.hpp | 3 +- include/derecho/core/replicated.hpp | 5 +- include/derecho/core/subgroup_functions.hpp | 3 +- include/derecho/core/subgroup_info.hpp | 1 + include/derecho/core/view.hpp | 7 ++- .../derecho/mutils-serialization/Bytes.hpp | 55 ++++++++++--------- .../SerializationSupport.hpp | 1 + .../mutils-serialization/context_ptr.hpp | 26 +++++---- include/derecho/openssl/hash.hpp | 1 + include/derecho/openssl/openssl_exception.hpp | 3 +- include/derecho/openssl/pointers.hpp | 3 +- include/derecho/openssl/signature.hpp | 1 + include/derecho/persistent/HLC.hpp | 2 + .../derecho/persistent/PersistException.hpp | 2 + include/derecho/persistent/PersistNoLog.hpp | 4 +- .../persistent/PersistentInterface.hpp | 3 +- .../persistent/detail/FilePersistLog.hpp | 4 +- .../derecho/persistent/detail/PersistLog.hpp | 2 + .../persistent/detail/PersistNoLog_impl.hpp | 2 + .../persistent/detail/Persistent_impl.hpp | 7 ++- include/derecho/persistent/detail/logger.hpp | 5 +- include/derecho/persistent/detail/util.hpp | 4 +- include/derecho/rdmc/detail/lf_helper.hpp | 2 + include/derecho/rdmc/detail/message.hpp | 2 + include/derecho/rdmc/detail/schedule.hpp | 2 + include/derecho/rdmc/detail/util.hpp | 2 + include/derecho/rdmc/detail/verbs_helper.hpp | 2 + include/derecho/rdmc/group_send.hpp | 2 + include/derecho/rdmc/rdmc.hpp | 3 +- include/derecho/sst/detail/lf.hpp | 8 +-- include/derecho/sst/detail/poll_utils.hpp | 1 + include/derecho/sst/detail/sst_impl.hpp | 3 +- include/derecho/sst/detail/verbs.hpp | 4 +- include/derecho/sst/predicates.hpp | 1 + include/derecho/sst/sst.hpp | 5 +- include/derecho/tcp/tcp.hpp | 1 + include/derecho/utils/container_ostreams.hpp | 1 + .../utils/container_template_functions.hpp | 1 + include/derecho/utils/logger.hpp | 2 + include/derecho/utils/time.h | 2 + src/sst/lf.cpp | 8 +++ 68 files changed, 221 insertions(+), 115 deletions(-) create mode 100644 config.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index c4654052..fc5c95c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,6 @@ set(derecho_VERSION 2.4) set(derecho_build_VERSION 2.4.0) set(CMAKE_CXX_STANDARD 17) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -if (${USE_VERBS_API}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_VERBS_API") -endif() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDERECHO_DEBUG -O0 -Wall -ggdb -gdwarf-3") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall") set(CMAKE_CXX_FLAGS_BENCHMARK "${CMAKE_CXX_FLAGS_RELEASE} -Wall -DNOLOG -Ofast -march=native") @@ -62,6 +59,25 @@ find_package(nlohmann_json 3.9.0 REQUIRED) # Target: Doxygen find_package(Doxygen) + +# Source code configurations go to config.h +# Shift to verbs API. We use libfabric by default. +if (${USE_VERBS_API}) +set(USE_VERBS_API 1) +else() +set(USE_VERBS_API 0) +endif() +# Enable High memory registration (for device memory like GPU memory.) +# Important: this does not work with libfabric provider like tcp and socket because they cannot +# RDMA to device memory. +if (${ENABLE_HMEM}) +set(ENABLE_HMEM 1) +else() +set(ENABLE_HMEM 0) +endif() +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/derecho/config.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) + add_subdirectory(src/mutils-serialization) add_subdirectory(src/conf) add_subdirectory(src/utils) @@ -112,14 +128,14 @@ add_dependencies(derecho # Setup for make install # Declare that we will install the targets built by "derecho" -install(TARGETS derecho - EXPORT derechoTargets +install(TARGETS derecho EXPORT derechoTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Declare that we will install the "include/" directory as a standard include directory install(DIRECTORY - include/ - TYPE INCLUDE) + ${CMAKE_CURRENT_SOURCE_DIR}/include/derecho + ${CMAKE_CURRENT_BINARY_DIR}/include/derecho + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Use CMakePackageConfigHelpers to create a package version file and config file include(CMakePackageConfigHelpers) diff --git a/config.h.in b/config.h.in new file mode 100644 index 00000000..67e77313 --- /dev/null +++ b/config.h.in @@ -0,0 +1,3 @@ +#pragma once +#cmakedefine USE_VERBS_API +#cmakedefine ENABLE_HMEM diff --git a/include/derecho/conf/conf.hpp b/include/derecho/conf/conf.hpp index 8ddfdf6a..f4a9d388 100644 --- a/include/derecho/conf/conf.hpp +++ b/include/derecho/conf/conf.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef CONF_HPP #define CONF_HPP +#include #include "getpot/GetPot" #include #include diff --git a/include/derecho/core/bytes_object.hpp b/include/derecho/core/bytes_object.hpp index a29d223e..fba66ccd 100644 --- a/include/derecho/core/bytes_object.hpp +++ b/include/derecho/core/bytes_object.hpp @@ -1,6 +1,7 @@ #pragma once -#include "derecho/mutils-serialization/SerializationSupport.hpp" +#include +#include #include #include diff --git a/include/derecho/core/derecho.hpp b/include/derecho/core/derecho.hpp index e4d19c8b..d2466baf 100644 --- a/include/derecho/core/derecho.hpp +++ b/include/derecho/core/derecho.hpp @@ -5,6 +5,7 @@ * @brief This file includes the essential core headers. */ +#include #include "derecho_exception.hpp" #include "detail/derecho_internal.hpp" #include "derecho_type_definitions.hpp" diff --git a/include/derecho/core/derecho_exception.hpp b/include/derecho/core/derecho_exception.hpp index 2cb6267c..8f6f7921 100644 --- a/include/derecho/core/derecho_exception.hpp +++ b/include/derecho/core/derecho_exception.hpp @@ -5,7 +5,8 @@ #pragma once -#include "derecho/core/git_version.hpp" +#include +#include "git_version.hpp" #include #include diff --git a/include/derecho/core/derecho_type_definitions.hpp b/include/derecho/core/derecho_type_definitions.hpp index 5a7e4e43..a5877f8b 100644 --- a/include/derecho/core/derecho_type_definitions.hpp +++ b/include/derecho/core/derecho_type_definitions.hpp @@ -2,6 +2,7 @@ #include #include +#include namespace derecho { diff --git a/include/derecho/core/detail/connection_manager.hpp b/include/derecho/core/detail/connection_manager.hpp index cc83b814..34d8ef30 100644 --- a/include/derecho/core/detail/connection_manager.hpp +++ b/include/derecho/core/detail/connection_manager.hpp @@ -1,7 +1,8 @@ #pragma once +#include #include "../derecho_type_definitions.hpp" -#include "derecho/tcp/tcp.hpp" +#include #include "locked_reference.hpp" #include diff --git a/include/derecho/core/detail/derecho_sst.hpp b/include/derecho/core/detail/derecho_sst.hpp index 109376d8..a578e645 100644 --- a/include/derecho/core/detail/derecho_sst.hpp +++ b/include/derecho/core/detail/derecho_sst.hpp @@ -1,7 +1,8 @@ #pragma once +#include #include "../derecho_type_definitions.hpp" -#include "derecho/sst/sst.hpp" +#include #include "derecho_internal.hpp" #include diff --git a/include/derecho/core/detail/external_group_impl.hpp b/include/derecho/core/detail/external_group_impl.hpp index f3fa126c..e772df04 100644 --- a/include/derecho/core/detail/external_group_impl.hpp +++ b/include/derecho/core/detail/external_group_impl.hpp @@ -1,3 +1,4 @@ +#include #include "../external_group.hpp" #include "version_code.hpp" diff --git a/include/derecho/core/detail/group_impl.hpp b/include/derecho/core/detail/group_impl.hpp index 74c5aa7b..20daf9cc 100644 --- a/include/derecho/core/detail/group_impl.hpp +++ b/include/derecho/core/detail/group_impl.hpp @@ -2,11 +2,11 @@ * @file group_impl.hpp * @date Apr 22, 2016 */ - +#include #include "../group.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" -#include "derecho/utils/container_template_functions.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include #include "derecho_internal.hpp" #include "make_kind_map.hpp" diff --git a/include/derecho/core/detail/make_kind_map.hpp b/include/derecho/core/detail/make_kind_map.hpp index 4b9f5aed..9fecc3f0 100644 --- a/include/derecho/core/detail/make_kind_map.hpp +++ b/include/derecho/core/detail/make_kind_map.hpp @@ -8,6 +8,7 @@ #pragma once +#include #include "derecho_internal.hpp" #include diff --git a/include/derecho/core/detail/multicast_group.hpp b/include/derecho/core/detail/multicast_group.hpp index 489c1e70..84f4b59e 100644 --- a/include/derecho/core/detail/multicast_group.hpp +++ b/include/derecho/core/detail/multicast_group.hpp @@ -1,14 +1,15 @@ #pragma once +#include #include "../derecho_modes.hpp" #include "../subgroup_info.hpp" #include "connection_manager.hpp" #include "derecho/conf/conf.hpp" -#include "derecho/mutils-serialization/SerializationMacros.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" -#include "derecho/rdmc/rdmc.hpp" -#include "derecho/sst/multicast.hpp" -#include "derecho/sst/sst.hpp" +#include +#include +#include +#include +#include #include "derecho_internal.hpp" #include "derecho_sst.hpp" #include "persistence_manager.hpp" diff --git a/include/derecho/core/detail/p2p_connection.hpp b/include/derecho/core/detail/p2p_connection.hpp index 4f87633b..5fd7bf15 100644 --- a/include/derecho/core/detail/p2p_connection.hpp +++ b/include/derecho/core/detail/p2p_connection.hpp @@ -1,9 +1,10 @@ #pragma once +#include #ifdef USE_VERBS_API -#include "derecho/sst/detail/verbs.hpp" +#include #else -#include "derecho/sst/detail/lf.hpp" +#include #endif #include diff --git a/include/derecho/core/detail/p2p_connection_manager.hpp b/include/derecho/core/detail/p2p_connection_manager.hpp index fab303a1..30b5ac14 100644 --- a/include/derecho/core/detail/p2p_connection_manager.hpp +++ b/include/derecho/core/detail/p2p_connection_manager.hpp @@ -1,12 +1,13 @@ #pragma once +#include #include "p2p_connection.hpp" #ifdef USE_VERBS_API -#include "derecho/sst/detail/verbs.hpp" +#include #else -#include "derecho/sst/detail/lf.hpp" +#include #endif -#include "derecho/utils/logger.hpp" +#include #include #include diff --git a/include/derecho/core/detail/persistence_manager.hpp b/include/derecho/core/detail/persistence_manager.hpp index 71372708..e4e5fbd7 100644 --- a/include/derecho/core/detail/persistence_manager.hpp +++ b/include/derecho/core/detail/persistence_manager.hpp @@ -5,9 +5,10 @@ */ #pragma once -#include "derecho/openssl/signature.hpp" -#include "derecho/persistent/PersistentInterface.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include +#include #include "derecho_internal.hpp" #include "replicated_interface.hpp" diff --git a/include/derecho/core/detail/public_key_store.hpp b/include/derecho/core/detail/public_key_store.hpp index bef74900..4ea10651 100644 --- a/include/derecho/core/detail/public_key_store.hpp +++ b/include/derecho/core/detail/public_key_store.hpp @@ -3,8 +3,9 @@ */ #pragma once +#include #include "../derecho_exception.hpp" -#include "derecho/openssl/signature.hpp" +#include #include "derecho_internal.hpp" #include diff --git a/include/derecho/core/detail/remote_invocable.hpp b/include/derecho/core/detail/remote_invocable.hpp index 103fe250..536fb649 100644 --- a/include/derecho/core/detail/remote_invocable.hpp +++ b/include/derecho/core/detail/remote_invocable.hpp @@ -6,9 +6,10 @@ #pragma once -#include "derecho/conf/conf.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include +#include #include "rpc_utils.hpp" #include diff --git a/include/derecho/core/detail/replicated_impl.hpp b/include/derecho/core/detail/replicated_impl.hpp index 21525291..5bf0b106 100644 --- a/include/derecho/core/detail/replicated_impl.hpp +++ b/include/derecho/core/detail/replicated_impl.hpp @@ -1,9 +1,10 @@ #pragma once +#include #include "../replicated.hpp" #include "view_manager.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" +#include #include #include diff --git a/include/derecho/core/detail/replicated_interface.hpp b/include/derecho/core/detail/replicated_interface.hpp index 8ef2afd1..b40059cb 100644 --- a/include/derecho/core/detail/replicated_interface.hpp +++ b/include/derecho/core/detail/replicated_interface.hpp @@ -1,7 +1,8 @@ #pragma once -#include "derecho/openssl/signature.hpp" -#include "derecho/tcp/tcp.hpp" +#include +#include +#include #include "derecho_internal.hpp" #include diff --git a/include/derecho/core/detail/restart_state.hpp b/include/derecho/core/detail/restart_state.hpp index 66f80c43..3a3ce394 100644 --- a/include/derecho/core/detail/restart_state.hpp +++ b/include/derecho/core/detail/restart_state.hpp @@ -1,9 +1,10 @@ #pragma once +#include #include "../subgroup_info.hpp" #include "../view.hpp" #include "derecho_internal.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" +#include #include diff --git a/include/derecho/core/detail/rpc_manager.hpp b/include/derecho/core/detail/rpc_manager.hpp index 2f338bbe..7f6cb8d6 100644 --- a/include/derecho/core/detail/rpc_manager.hpp +++ b/include/derecho/core/detail/rpc_manager.hpp @@ -6,11 +6,12 @@ #pragma once +#include #include "../derecho_type_definitions.hpp" #include "../view.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" -#include "derecho/persistent/Persistent.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include #include "derecho_internal.hpp" #include "p2p_connection_manager.hpp" #include "remote_invocable.hpp" diff --git a/include/derecho/core/detail/rpc_utils.hpp b/include/derecho/core/detail/rpc_utils.hpp index ebe74e8e..310b5f97 100644 --- a/include/derecho/core/detail/rpc_utils.hpp +++ b/include/derecho/core/detail/rpc_utils.hpp @@ -6,10 +6,11 @@ #pragma once +#include #include "../derecho_exception.hpp" #include "../derecho_type_definitions.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" -#include "derecho/utils/logger.hpp" +#include +#include #include "derecho_internal.hpp" #include diff --git a/include/derecho/core/detail/view_manager.hpp b/include/derecho/core/detail/view_manager.hpp index 23f7343b..eeaf6f8f 100644 --- a/include/derecho/core/detail/view_manager.hpp +++ b/include/derecho/core/detail/view_manager.hpp @@ -5,10 +5,11 @@ */ #pragma once +#include #include "../subgroup_info.hpp" #include "../view.hpp" -#include "derecho/conf/conf.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" +#include +#include #include "derecho_internal.hpp" #include "locked_reference.hpp" #include "multicast_group.hpp" diff --git a/include/derecho/core/external_group.hpp b/include/derecho/core/external_group.hpp index 552d907b..f4f58bea 100644 --- a/include/derecho/core/external_group.hpp +++ b/include/derecho/core/external_group.hpp @@ -5,7 +5,8 @@ * @brief This file contains the APIs for external clients. */ -#include "derecho/conf/conf.hpp" +#include +#include #include "detail/connection_manager.hpp" #include "detail/p2p_connection_manager.hpp" #include "group.hpp" diff --git a/include/derecho/core/group.hpp b/include/derecho/core/group.hpp index a6c1ade2..2d7bc882 100644 --- a/include/derecho/core/group.hpp +++ b/include/derecho/core/group.hpp @@ -5,8 +5,9 @@ * @brief Declaration of the `Group<>` class template. */ -#include "derecho/conf/conf.hpp" -#include "derecho/tcp/tcp.hpp" +#include +#include +#include #include "derecho_exception.hpp" #include "detail/derecho_internal.hpp" #include "detail/persistence_manager.hpp" diff --git a/include/derecho/core/notification.hpp b/include/derecho/core/notification.hpp index f89600cd..ef9bc562 100644 --- a/include/derecho/core/notification.hpp +++ b/include/derecho/core/notification.hpp @@ -5,8 +5,9 @@ * @brief This file include the declarations of types for the notification API. */ -#include "derecho/mutils-serialization/SerializationMacros.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" +#include +#include +#include #include "register_rpc_functions.hpp" #include diff --git a/include/derecho/core/register_rpc_functions.hpp b/include/derecho/core/register_rpc_functions.hpp index 93dc0913..30335cc0 100644 --- a/include/derecho/core/register_rpc_functions.hpp +++ b/include/derecho/core/register_rpc_functions.hpp @@ -1,5 +1,6 @@ #pragma once -#include "derecho/utils/map_macro.hpp" +#include +#include #include "detail/rpc_utils.hpp" #define make_p2p_tagger_expr(x) derecho::rpc::tag_p2p(&classname::x) diff --git a/include/derecho/core/replicated.hpp b/include/derecho/core/replicated.hpp index ef44ce9b..b216f424 100644 --- a/include/derecho/core/replicated.hpp +++ b/include/derecho/core/replicated.hpp @@ -5,8 +5,9 @@ #pragma once -#include "derecho/persistent/Persistent.hpp" -#include "derecho/tcp/tcp.hpp" +#include +#include +#include #include "derecho_exception.hpp" #include "detail/derecho_internal.hpp" #include "detail/remote_invocable.hpp" diff --git a/include/derecho/core/subgroup_functions.hpp b/include/derecho/core/subgroup_functions.hpp index ec8a2c5e..367cf2fe 100644 --- a/include/derecho/core/subgroup_functions.hpp +++ b/include/derecho/core/subgroup_functions.hpp @@ -4,7 +4,8 @@ #pragma once -#include "derecho/utils/logger.hpp" +#include +#include #include "derecho_exception.hpp" #include "derecho_modes.hpp" #include "detail/derecho_internal.hpp" diff --git a/include/derecho/core/subgroup_info.hpp b/include/derecho/core/subgroup_info.hpp index 20fb30f1..1f7f40b5 100644 --- a/include/derecho/core/subgroup_info.hpp +++ b/include/derecho/core/subgroup_info.hpp @@ -6,6 +6,7 @@ #pragma once +#include #include "derecho_exception.hpp" #include diff --git a/include/derecho/core/view.hpp b/include/derecho/core/view.hpp index 5e980078..8c29fb4d 100644 --- a/include/derecho/core/view.hpp +++ b/include/derecho/core/view.hpp @@ -5,13 +5,14 @@ #pragma once +#include #include "derecho_modes.hpp" #include "detail/derecho_internal.hpp" #include "detail/derecho_sst.hpp" #include "detail/multicast_group.hpp" -#include "derecho/mutils-serialization/SerializationMacros.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" -#include "derecho/sst/sst.hpp" +#include +#include +#include #include #include diff --git a/include/derecho/mutils-serialization/Bytes.hpp b/include/derecho/mutils-serialization/Bytes.hpp index 91e4d462..2c402443 100644 --- a/include/derecho/mutils-serialization/Bytes.hpp +++ b/include/derecho/mutils-serialization/Bytes.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include "SerializationSupport.hpp" #include "../mutils-networking/connection.hpp" @@ -9,40 +10,40 @@ namespace mutils{ must ensure underlying array is not freed while Bytes lives, and is responsible for freeing underlying array when Bytes is destroyed. */ - struct Bytes : public ByteRepresentable{ + struct Bytes : public ByteRepresentable{ - uint8_t const * const bytes; - const std::size_t size; + uint8_t const * const bytes; + const std::size_t size; - Bytes(decltype(bytes) b, decltype(size) s) - :bytes(b),size(s){} + Bytes(decltype(bytes) b, decltype(size) s) + :bytes(b),size(s){} - std::size_t to_bytes(uint8_t* v) const{ - ((std::size_t*)(v))[0] = size; - memcpy(v + sizeof(size),bytes,size); - return size + sizeof(size); - } + std::size_t to_bytes(uint8_t* v) const{ + ((std::size_t*)(v))[0] = size; + memcpy(v + sizeof(size),bytes,size); + return size + sizeof(size); + } - std::size_t bytes_size() const { - return size + sizeof(size); - } + std::size_t bytes_size() const { + return size + sizeof(size); + } - void post_object(const std::function& f) const{ - f((uint8_t*)&size,sizeof(size)); - f(bytes,size); - } + void post_object(const std::function& f) const{ + f((uint8_t*)&size,sizeof(size)); + f(bytes,size); + } - void ensure_registered(DeserializationManager&){} + void ensure_registered(DeserializationManager&){} - //from_bytes is disabled in this implementation, because it's intended only for nocopy-aware scenarios - template - static std::unique_ptr from_bytes(T*, V*){ - static_assert(std::is_same::value,"Error: from_bytes disabled for mutils::Bytes. See comment in source."); - } + //from_bytes is disabled in this implementation, because it's intended only for nocopy-aware scenarios + template + static std::unique_ptr from_bytes(T*, V*){ + static_assert(std::is_same::value,"Error: from_bytes disabled for mutils::Bytes. See comment in source."); + } - static context_ptr from_bytes_noalloc(DeserializationManager *, uint8_t const * const v) { - return context_ptr{new Bytes(v + sizeof(std::size_t),((std::size_t*)(v))[0])}; - } + static context_ptr from_bytes_noalloc(DeserializationManager *, uint8_t const * const v) { + return context_ptr{new Bytes(v + sizeof(std::size_t),((std::size_t*)(v))[0])}; + } - }; + }; } diff --git a/include/derecho/mutils-serialization/SerializationSupport.hpp b/include/derecho/mutils-serialization/SerializationSupport.hpp index a8acbc22..77994b8a 100644 --- a/include/derecho/mutils-serialization/SerializationSupport.hpp +++ b/include/derecho/mutils-serialization/SerializationSupport.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include "SerializationMacros.hpp" #include "context_ptr.hpp" #include diff --git a/include/derecho/mutils-serialization/context_ptr.hpp b/include/derecho/mutils-serialization/context_ptr.hpp index ab306c8d..8c861158 100644 --- a/include/derecho/mutils-serialization/context_ptr.hpp +++ b/include/derecho/mutils-serialization/context_ptr.hpp @@ -1,22 +1,24 @@ #pragma once + +#include #include #include namespace mutils{ - template - struct ContextDeleter : public std::conditional_t::value, - ContextDeleter, - std::default_delete > { - }; + template + struct ContextDeleter : public std::conditional_t::value, + ContextDeleter, + std::default_delete > { + }; - template<> - struct ContextDeleter { - void operator()(...){} - }; + template<> + struct ContextDeleter { + void operator()(...){} + }; - - template - using context_ptr = std::unique_ptr >; + + template + using context_ptr = std::unique_ptr >; } diff --git a/include/derecho/openssl/hash.hpp b/include/derecho/openssl/hash.hpp index 1d7cfe0d..d2eccf30 100644 --- a/include/derecho/openssl/hash.hpp +++ b/include/derecho/openssl/hash.hpp @@ -5,6 +5,7 @@ */ #pragma once +#include #include "openssl_exception.hpp" #include "pointers.hpp" diff --git a/include/derecho/openssl/openssl_exception.hpp b/include/derecho/openssl/openssl_exception.hpp index 9c88f27b..71f5f9fc 100644 --- a/include/derecho/openssl/openssl_exception.hpp +++ b/include/derecho/openssl/openssl_exception.hpp @@ -6,6 +6,7 @@ */ #pragma once +#include #include #include #include @@ -93,4 +94,4 @@ struct permission_denied : public file_error { : file_error(errno_value, "Error opening file " + filename + ": permission denied.") {} }; -} // namespace openssl \ No newline at end of file +} // namespace openssl diff --git a/include/derecho/openssl/pointers.hpp b/include/derecho/openssl/pointers.hpp index 925765f7..1d903a6a 100644 --- a/include/derecho/openssl/pointers.hpp +++ b/include/derecho/openssl/pointers.hpp @@ -6,6 +6,7 @@ #pragma once +#include #include #include #include @@ -30,4 +31,4 @@ struct DeleterFor { void operator()(BIO* p) { BIO_free_all(p); } }; -} // namespace openssl \ No newline at end of file +} // namespace openssl diff --git a/include/derecho/openssl/signature.hpp b/include/derecho/openssl/signature.hpp index 0b1440e4..fff4ba86 100644 --- a/include/derecho/openssl/signature.hpp +++ b/include/derecho/openssl/signature.hpp @@ -6,6 +6,7 @@ */ #pragma once +#include #include "hash.hpp" #include "openssl_exception.hpp" #include "pointers.hpp" diff --git a/include/derecho/persistent/HLC.hpp b/include/derecho/persistent/HLC.hpp index cb97a2e6..3bf26d0f 100644 --- a/include/derecho/persistent/HLC.hpp +++ b/include/derecho/persistent/HLC.hpp @@ -1,5 +1,7 @@ +#pragma once #ifndef HLC_HPP #define HLC_HPP +#include #include #include #include diff --git a/include/derecho/persistent/PersistException.hpp b/include/derecho/persistent/PersistException.hpp index a6aee4b1..dc01026b 100644 --- a/include/derecho/persistent/PersistException.hpp +++ b/include/derecho/persistent/PersistException.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef PERSISTENT_EXCEPTION_HPP #define PERSISTENT_EXCEPTION_HPP +#include #include #include #include diff --git a/include/derecho/persistent/PersistNoLog.hpp b/include/derecho/persistent/PersistNoLog.hpp index f536bb16..3b209248 100644 --- a/include/derecho/persistent/PersistNoLog.hpp +++ b/include/derecho/persistent/PersistNoLog.hpp @@ -1,3 +1,4 @@ +#pragma once #ifndef PERSIST_NO_LOG_HPP #define PERSIST_NO_LOG_HPP @@ -5,9 +6,10 @@ #error PersistLog.hpp only works with clang and gnu compilers #endif +#include #include "detail/PersistLog.hpp" #include "detail/util.hpp" -#include "derecho/mutils-serialization/SerializationSupport.hpp" +#include #include #include #include diff --git a/include/derecho/persistent/PersistentInterface.hpp b/include/derecho/persistent/PersistentInterface.hpp index 9ebbf93c..273a9d6c 100644 --- a/include/derecho/persistent/PersistentInterface.hpp +++ b/include/derecho/persistent/PersistentInterface.hpp @@ -1,6 +1,7 @@ #pragma once -#include "../openssl/signature.hpp" +#include +#include #include "HLC.hpp" #include diff --git a/include/derecho/persistent/detail/FilePersistLog.hpp b/include/derecho/persistent/detail/FilePersistLog.hpp index bff2726b..22728b23 100644 --- a/include/derecho/persistent/detail/FilePersistLog.hpp +++ b/include/derecho/persistent/detail/FilePersistLog.hpp @@ -1,9 +1,11 @@ +#pragma once #ifndef FILE_PERSIST_LOG_HPP #define FILE_PERSIST_LOG_HPP +#include #include "PersistLog.hpp" #include "util.hpp" -#include "derecho/utils/logger.hpp" +#include #include #include diff --git a/include/derecho/persistent/detail/PersistLog.hpp b/include/derecho/persistent/detail/PersistLog.hpp index f3ab38d2..093a9e06 100644 --- a/include/derecho/persistent/detail/PersistLog.hpp +++ b/include/derecho/persistent/detail/PersistLog.hpp @@ -1,3 +1,4 @@ +#pragma once #ifndef PERSIST_LOG_HPP #define PERSIST_LOG_HPP @@ -5,6 +6,7 @@ #error PersistLog.hpp only works with clang and gnu compilers #endif +#include #include "../HLC.hpp" #include "../PersistException.hpp" #include "../PersistentInterface.hpp" diff --git a/include/derecho/persistent/detail/PersistNoLog_impl.hpp b/include/derecho/persistent/detail/PersistNoLog_impl.hpp index fbc03cb7..fe889347 100644 --- a/include/derecho/persistent/detail/PersistNoLog_impl.hpp +++ b/include/derecho/persistent/detail/PersistNoLog_impl.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef PERSIST_NO_LOG_IMPL_HPP #define PERSIST_NO_LOG_IMPL_HPP +#include #include "../PersistNoLog.hpp" #define _NOLOG_OBJECT_DIR_ ((storageType == ST_MEM) ? getPersRamdiskPath().c_str() : getPersFilePath().c_str()) diff --git a/include/derecho/persistent/detail/Persistent_impl.hpp b/include/derecho/persistent/detail/Persistent_impl.hpp index 580bfc11..dfb0fd53 100644 --- a/include/derecho/persistent/detail/Persistent_impl.hpp +++ b/include/derecho/persistent/detail/Persistent_impl.hpp @@ -1,9 +1,10 @@ +#pragma once #ifndef PERSISTENT_IMPL_HPP #define PERSISTENT_IMPL_HPP -#include "derecho/persistent/Persistent.hpp" - -#include "derecho/openssl/hash.hpp" +#include +#include +#include #include diff --git a/include/derecho/persistent/detail/logger.hpp b/include/derecho/persistent/detail/logger.hpp index 487d8373..338e46ac 100644 --- a/include/derecho/persistent/detail/logger.hpp +++ b/include/derecho/persistent/detail/logger.hpp @@ -1,6 +1,7 @@ #pragma once -#include "derecho/utils/logger.hpp" +#include +#include #include #include @@ -21,4 +22,4 @@ class PersistLogger { }; -} \ No newline at end of file +} diff --git a/include/derecho/persistent/detail/util.hpp b/include/derecho/persistent/detail/util.hpp index 75741e23..4756abed 100644 --- a/include/derecho/persistent/detail/util.hpp +++ b/include/derecho/persistent/detail/util.hpp @@ -1,8 +1,10 @@ +#pragma once #ifndef PERSISTENT_UTIL_HPP #define PERSISTENT_UTIL_HPP +#include #include "../PersistException.hpp" -#include "derecho/conf/conf.hpp" +#include #include #include #include diff --git a/include/derecho/rdmc/detail/lf_helper.hpp b/include/derecho/rdmc/detail/lf_helper.hpp index c40742af..f346a1df 100644 --- a/include/derecho/rdmc/detail/lf_helper.hpp +++ b/include/derecho/rdmc/detail/lf_helper.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef LF_HELPER_HPP #define LF_HELPER_HPP +#include #include #include #include diff --git a/include/derecho/rdmc/detail/message.hpp b/include/derecho/rdmc/detail/message.hpp index 3ec9ff9c..672becb2 100644 --- a/include/derecho/rdmc/detail/message.hpp +++ b/include/derecho/rdmc/detail/message.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef MESSAGE_HPP #define MESSAGE_HPP +#include #include #include diff --git a/include/derecho/rdmc/detail/schedule.hpp b/include/derecho/rdmc/detail/schedule.hpp index d9c94446..f2160a07 100644 --- a/include/derecho/rdmc/detail/schedule.hpp +++ b/include/derecho/rdmc/detail/schedule.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef SCHEDULE_HPP #define SCHEDULE_HPP +#include #include #include #include diff --git a/include/derecho/rdmc/detail/util.hpp b/include/derecho/rdmc/detail/util.hpp index 3ade9613..6b9534d2 100644 --- a/include/derecho/rdmc/detail/util.hpp +++ b/include/derecho/rdmc/detail/util.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef RDMC_UTIL_HPP #define RDMC_UTIL_HPP +#include #include #include diff --git a/include/derecho/rdmc/detail/verbs_helper.hpp b/include/derecho/rdmc/detail/verbs_helper.hpp index 7fd17aa4..aea0fade 100644 --- a/include/derecho/rdmc/detail/verbs_helper.hpp +++ b/include/derecho/rdmc/detail/verbs_helper.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef VERBS_HELPER_HPP #define VERBS_HELPER_HPP +#include #include #include #include diff --git a/include/derecho/rdmc/group_send.hpp b/include/derecho/rdmc/group_send.hpp index 4455b5b7..efc97fbd 100644 --- a/include/derecho/rdmc/group_send.hpp +++ b/include/derecho/rdmc/group_send.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef GROUP_SEND_HPP #define GROUP_SEND_HPP +#include #include #include "detail/schedule.hpp" diff --git a/include/derecho/rdmc/rdmc.hpp b/include/derecho/rdmc/rdmc.hpp index 35c9cdcd..91f115d3 100644 --- a/include/derecho/rdmc/rdmc.hpp +++ b/include/derecho/rdmc/rdmc.hpp @@ -1,7 +1,8 @@ - +#pragma once #ifndef RDMC_HPP #define RDMC_HPP +#include #ifdef USE_VERBS_API #include "detail/verbs_helper.hpp" #else diff --git a/include/derecho/sst/detail/lf.hpp b/include/derecho/sst/detail/lf.hpp index db7b5d06..3abdffa3 100644 --- a/include/derecho/sst/detail/lf.hpp +++ b/include/derecho/sst/detail/lf.hpp @@ -6,10 +6,10 @@ * Contains declarations needed for working with RDMA using LibFabric libraries, * including the Resources class and global setup functions. */ - -#include "derecho/core/derecho_type_definitions.hpp" -#include "derecho/core/detail/connection_manager.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include +#include #include #include diff --git a/include/derecho/sst/detail/poll_utils.hpp b/include/derecho/sst/detail/poll_utils.hpp index fd778ece..829bffa2 100644 --- a/include/derecho/sst/detail/poll_utils.hpp +++ b/include/derecho/sst/detail/poll_utils.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include diff --git a/include/derecho/sst/detail/sst_impl.hpp b/include/derecho/sst/detail/sst_impl.hpp index 4d61f518..26fa1307 100644 --- a/include/derecho/sst/detail/sst_impl.hpp +++ b/include/derecho/sst/detail/sst_impl.hpp @@ -6,10 +6,11 @@ #pragma once +#include #include "../sst.hpp" #include "../predicates.hpp" -#include "derecho/utils/time.h" +#include #include "poll_utils.hpp" #include #include diff --git a/include/derecho/sst/detail/verbs.hpp b/include/derecho/sst/detail/verbs.hpp index a78fbeaa..8911373c 100644 --- a/include/derecho/sst/detail/verbs.hpp +++ b/include/derecho/sst/detail/verbs.hpp @@ -6,8 +6,8 @@ * Contains declarations needed for working with RDMA using InfiniBand Verbs, * including the Resources class and global setup functions. */ - -#include "derecho/core/derecho_type_definitions.hpp" +#include +#include #include #include diff --git a/include/derecho/sst/predicates.hpp b/include/derecho/sst/predicates.hpp index 88c2e86d..9d074e56 100644 --- a/include/derecho/sst/predicates.hpp +++ b/include/derecho/sst/predicates.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include diff --git a/include/derecho/sst/sst.hpp b/include/derecho/sst/sst.hpp index 986d886c..a9287da9 100644 --- a/include/derecho/sst/sst.hpp +++ b/include/derecho/sst/sst.hpp @@ -1,7 +1,8 @@ #pragma once -#include "derecho/conf/conf.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include #include "predicates.hpp" #ifdef USE_VERBS_API diff --git a/include/derecho/tcp/tcp.hpp b/include/derecho/tcp/tcp.hpp index 453c7611..1762fcdd 100644 --- a/include/derecho/tcp/tcp.hpp +++ b/include/derecho/tcp/tcp.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include diff --git a/include/derecho/utils/container_ostreams.hpp b/include/derecho/utils/container_ostreams.hpp index 2c41398e..3f8e2bdc 100644 --- a/include/derecho/utils/container_ostreams.hpp +++ b/include/derecho/utils/container_ostreams.hpp @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include diff --git a/include/derecho/utils/container_template_functions.hpp b/include/derecho/utils/container_template_functions.hpp index 682c4664..2f26d7c3 100644 --- a/include/derecho/utils/container_template_functions.hpp +++ b/include/derecho/utils/container_template_functions.hpp @@ -6,6 +6,7 @@ */ #pragma once +#include #include #include #include diff --git a/include/derecho/utils/logger.hpp b/include/derecho/utils/logger.hpp index f3124e07..c6919c03 100644 --- a/include/derecho/utils/logger.hpp +++ b/include/derecho/utils/logger.hpp @@ -1,6 +1,8 @@ +#pragma once #ifndef LOGGER_HPP #define LOGGER_HPP +#include #include "container_ostreams.hpp" #include diff --git a/include/derecho/utils/time.h b/include/derecho/utils/time.h index 3ec6293d..15df852c 100644 --- a/include/derecho/utils/time.h +++ b/include/derecho/utils/time.h @@ -1,7 +1,9 @@ +#pragma once #ifndef TIME_TIME_H #define TIME_TIME_H +#include #include #include #include diff --git a/src/sst/lf.cpp b/src/sst/lf.cpp index 1a567cb9..9db1aef3 100644 --- a/src/sst/lf.cpp +++ b/src/sst/lf.cpp @@ -123,7 +123,11 @@ static void default_context() { memset((void*)&g_ctxt, 0, sizeof(lf_ctxt)); g_ctxt.hints = crash_if_nullptr("Fail to allocate fi hints", fi_allocinfo); //defaults the hints: +#ifdef ENABLE_HMEM g_ctxt.hints->caps = FI_MSG | FI_RMA | FI_READ | FI_WRITE | FI_REMOTE_READ | FI_REMOTE_WRITE | FI_HMEM; +#else + g_ctxt.hints->caps = FI_MSG | FI_RMA | FI_READ | FI_WRITE | FI_REMOTE_READ | FI_REMOTE_WRITE; +#endif//ENABLE_HMEM g_ctxt.hints->ep_attr->type = FI_EP_MSG; // use connection based endpoint by default. g_ctxt.hints->mode = ~0; // all modes @@ -155,7 +159,11 @@ static void load_configuration() { if((strcmp(g_ctxt.hints->fabric_attr->prov_name, "sockets") == 0) || (strcmp(g_ctxt.hints->fabric_attr->prov_name, "tcp") == 0)) { g_ctxt.hints->domain_attr->mr_mode = FI_MR_BASIC; } else { // default +#ifdef ENABLE_HMEM g_ctxt.hints->domain_attr->mr_mode = FI_MR_LOCAL | FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_VIRT_ADDR | FI_MR_HMEM; +#else + g_ctxt.hints->domain_attr->mr_mode = FI_MR_LOCAL | FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_VIRT_ADDR; +#endif//ENABLE_HMEM } // scatter/gather batch size From 1703b6903f941371d0532f2303240d96c66f6911 Mon Sep 17 00:00:00 2001 From: Weijia Song Date: Sun, 5 May 2024 23:07:07 -0400 Subject: [PATCH 4/5] include ""-->include <> in the source code. --- scripts/build/build.sh | 6 +++--- src/conf/conf.cpp | 2 +- src/core/bytes_object.cpp | 2 +- src/core/connection_manager.cpp | 2 +- src/core/derecho_sst.cpp | 2 +- src/core/git_version.cpp | 2 +- src/core/multicast_group.cpp | 18 +++++++++--------- src/core/notification.cpp | 2 +- src/core/p2p_connection.cpp | 9 ++++----- src/core/p2p_connection_manager.cpp | 10 +++++----- src/core/persistence_manager.cpp | 8 ++++---- src/core/public_key_store.cpp | 4 ++-- src/core/restart_state.cpp | 12 ++++++------ src/core/rpc_manager.cpp | 4 ++-- src/core/rpc_utils.cpp | 4 ++-- src/core/subgroup_functions.cpp | 12 ++++++------ src/core/version_code.cpp | 4 ++-- src/core/view.cpp | 4 ++-- src/core/view_manager.cpp | 20 ++++++++++---------- src/openssl/hash.cpp | 4 ++-- src/openssl/openssl_exception.cpp | 2 +- src/openssl/signature.cpp | 2 +- src/persistent/FilePersistLog.cpp | 10 +++++----- src/persistent/HLC.cpp | 2 +- src/persistent/PersistLog.cpp | 8 ++++---- src/persistent/Persistent.cpp | 8 ++++---- src/persistent/logger.cpp | 4 ++-- src/rdmc/group_send.cpp | 10 +++++----- src/rdmc/lf_helper.cpp | 12 ++++++------ src/rdmc/rdmc.cpp | 16 ++++++++-------- src/rdmc/schedule.cpp | 2 +- src/rdmc/util.cpp | 2 +- src/rdmc/verbs_helper.cpp | 12 ++++++------ src/sst/lf.cpp | 20 ++++++++++---------- src/sst/poll_utils.cpp | 2 +- src/sst/verbs.cpp | 16 ++++++++-------- src/tcp/tcp.cpp | 2 +- src/utils/logger.cpp | 4 ++-- 38 files changed, 132 insertions(+), 133 deletions(-) diff --git a/scripts/build/build.sh b/scripts/build/build.sh index aa5cd611..d2bb48e6 100755 --- a/scripts/build/build.sh +++ b/scripts/build/build.sh @@ -81,9 +81,9 @@ if [[ $2 == "USE_VERBS_API" ]]; then fi # clear existing installed -rm -rf ${install_prefix}/lib/libderecho* -rm -rf ${install_prefix}/lib/cmake/derecho -rm -rf ${install_prefix}/include/derecho +# rm -rf ${install_prefix}/lib/libderecho* +# rm -rf ${install_prefix}/lib/cmake/derecho +# rm -rf ${install_prefix}/include/derecho # begin building... rm -rf ${build_path} 2>/dev/null diff --git a/src/conf/conf.cpp b/src/conf/conf.cpp index bfc259dc..53f0caf7 100644 --- a/src/conf/conf.cpp +++ b/src/conf/conf.cpp @@ -1,4 +1,4 @@ -#include "derecho/conf/conf.hpp" +#include #include diff --git a/src/core/bytes_object.cpp b/src/core/bytes_object.cpp index dbfa4460..6e62e5b3 100644 --- a/src/core/bytes_object.cpp +++ b/src/core/bytes_object.cpp @@ -1,4 +1,4 @@ -#include "derecho/core/bytes_object.hpp" +#include #include diff --git a/src/core/connection_manager.cpp b/src/core/connection_manager.cpp index d6026ef0..bc18a73d 100644 --- a/src/core/connection_manager.cpp +++ b/src/core/connection_manager.cpp @@ -1,4 +1,4 @@ -#include "derecho/core/detail/connection_manager.hpp" +#include #include #include diff --git a/src/core/derecho_sst.cpp b/src/core/derecho_sst.cpp index 1d1ed913..6f0170bb 100644 --- a/src/core/derecho_sst.cpp +++ b/src/core/derecho_sst.cpp @@ -1,4 +1,4 @@ -#include "derecho/core/detail/derecho_sst.hpp" +#include #include #include diff --git a/src/core/git_version.cpp b/src/core/git_version.cpp index 9eb1f032..20fe30e4 100644 --- a/src/core/git_version.cpp +++ b/src/core/git_version.cpp @@ -6,7 +6,7 @@ * local repository's .git/hooks/ directory. */ -#include "derecho/core/git_version.hpp" +#include namespace derecho { diff --git a/src/core/multicast_group.cpp b/src/core/multicast_group.cpp index bfac9cb1..4081fa7f 100644 --- a/src/core/multicast_group.cpp +++ b/src/core/multicast_group.cpp @@ -1,12 +1,12 @@ -#include "derecho/core/detail/multicast_group.hpp" - -#include "derecho/core/detail/derecho_internal.hpp" -#include "derecho/persistent/Persistent.hpp" -#include "derecho/persistent/PersistentInterface.hpp" -#include "derecho/persistent/detail/PersistLog.hpp" -#include "derecho/rdmc/detail/util.hpp" -#include "derecho/utils/logger.hpp" -#include "derecho/utils/time.h" +#include + +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/core/notification.cpp b/src/core/notification.cpp index 1b6601b2..4b5ade86 100644 --- a/src/core/notification.cpp +++ b/src/core/notification.cpp @@ -1,4 +1,4 @@ -#include "derecho/core/notification.hpp" +#include #include #include diff --git a/src/core/p2p_connection.cpp b/src/core/p2p_connection.cpp index fa540711..a6f0cd35 100644 --- a/src/core/p2p_connection.cpp +++ b/src/core/p2p_connection.cpp @@ -1,8 +1,7 @@ -#include "derecho/core/detail/p2p_connection.hpp" - -#include "derecho/conf/conf.hpp" -#include "derecho/core/detail/rpc_utils.hpp" -#include "derecho/sst/detail/poll_utils.hpp" +#include +#include +#include +#include #include #include diff --git a/src/core/p2p_connection_manager.cpp b/src/core/p2p_connection_manager.cpp index 810e9949..b5621cee 100644 --- a/src/core/p2p_connection_manager.cpp +++ b/src/core/p2p_connection_manager.cpp @@ -1,9 +1,9 @@ -#include "derecho/core/detail/p2p_connection_manager.hpp" +#include -#include "derecho/core/derecho_exception.hpp" -#include "derecho/conf/conf.hpp" -#include "derecho/sst/detail/poll_utils.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include +#include #include #include diff --git a/src/core/persistence_manager.cpp b/src/core/persistence_manager.cpp index 2a71b5eb..f147725c 100644 --- a/src/core/persistence_manager.cpp +++ b/src/core/persistence_manager.cpp @@ -1,11 +1,11 @@ /** * @date Jun 20, 2017 */ -#include "derecho/core/detail/persistence_manager.hpp" +#include -#include "derecho/core/detail/view_manager.hpp" -#include "derecho/openssl/signature.hpp" -#include "derecho/persistent/detail/logger.hpp" +#include +#include +#include #include #include diff --git a/src/core/public_key_store.cpp b/src/core/public_key_store.cpp index 96a70fcf..0ac5bf4f 100644 --- a/src/core/public_key_store.cpp +++ b/src/core/public_key_store.cpp @@ -1,8 +1,8 @@ /** * @file public_key_store.cpp */ -#include "derecho/core/detail/public_key_store.hpp" -#include "derecho/persistent/detail/util.hpp" +#include +#include #include #include diff --git a/src/core/restart_state.cpp b/src/core/restart_state.cpp index d9875a4a..13d95dcb 100644 --- a/src/core/restart_state.cpp +++ b/src/core/restart_state.cpp @@ -1,11 +1,11 @@ -#include "derecho/core/detail/restart_state.hpp" +#include -#include "derecho/core/detail/version_code.hpp" -#include "derecho/utils/container_template_functions.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include //This code needs access to ViewManager's static methods -#include "derecho/core/detail/view_manager.hpp" -#include "derecho/persistent/Persistent.hpp" +#include +#include #include #include diff --git a/src/core/rpc_manager.cpp b/src/core/rpc_manager.cpp index 4c698c85..08fa147e 100644 --- a/src/core/rpc_manager.cpp +++ b/src/core/rpc_manager.cpp @@ -4,8 +4,8 @@ * @date Feb 7, 2017 */ -#include "derecho/core/detail/rpc_manager.hpp" -#include "derecho/core/detail/view_manager.hpp" +#include +#include #include #include diff --git a/src/core/rpc_utils.cpp b/src/core/rpc_utils.cpp index 6afcf99f..fb8eecfe 100644 --- a/src/core/rpc_utils.cpp +++ b/src/core/rpc_utils.cpp @@ -1,5 +1,5 @@ -#include "derecho/core/detail/rpc_utils.hpp" -#include "derecho/utils/logger.hpp" +#include +#include namespace derecho { namespace rpc { diff --git a/src/core/subgroup_functions.cpp b/src/core/subgroup_functions.cpp index aa25177c..c9cc7dd4 100644 --- a/src/core/subgroup_functions.cpp +++ b/src/core/subgroup_functions.cpp @@ -2,13 +2,13 @@ * @file subgroup_functions.cpp */ -#include "derecho/core/subgroup_functions.hpp" +#include -#include "derecho/core/derecho_modes.hpp" -#include "derecho/core/detail/derecho_internal.hpp" -#include "derecho/core/view.hpp" -#include "derecho/utils/container_template_functions.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include +#include +#include #include #include diff --git a/src/core/version_code.cpp b/src/core/version_code.cpp index aca82454..5d1542e4 100644 --- a/src/core/version_code.cpp +++ b/src/core/version_code.cpp @@ -1,6 +1,6 @@ -#include "derecho/core/detail/version_code.hpp" +#include -#include "derecho/core/git_version.hpp" +#include #include #include diff --git a/src/core/view.cpp b/src/core/view.cpp index 3e7cbf39..64d286cd 100644 --- a/src/core/view.cpp +++ b/src/core/view.cpp @@ -1,5 +1,5 @@ -#include "derecho/core/view.hpp" -#include "derecho/utils/container_ostreams.hpp" +#include +#include #include #include diff --git a/src/core/view_manager.cpp b/src/core/view_manager.cpp index 1eaf167b..26832d94 100644 --- a/src/core/view_manager.cpp +++ b/src/core/view_manager.cpp @@ -2,16 +2,16 @@ * @date Feb 6, 2017 */ -#include "derecho/core/detail/view_manager.hpp" - -#include "derecho/core/derecho_exception.hpp" -#include "derecho/core/detail/public_key_store.hpp" -#include "derecho/core/detail/version_code.hpp" -#include "derecho/core/git_version.hpp" -#include "derecho/core/replicated.hpp" -#include "derecho/persistent/Persistent.hpp" -#include "derecho/utils/container_template_functions.hpp" -#include "derecho/utils/logger.hpp" +#include + +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/openssl/hash.cpp b/src/openssl/hash.cpp index aa3b0ace..a0d8d52d 100644 --- a/src/openssl/hash.cpp +++ b/src/openssl/hash.cpp @@ -1,6 +1,6 @@ -#include "derecho/openssl/hash.hpp" +#include -#include "derecho/openssl/openssl_exception.hpp" +#include #include diff --git a/src/openssl/openssl_exception.cpp b/src/openssl/openssl_exception.cpp index ff5dd560..eadaaed7 100644 --- a/src/openssl/openssl_exception.cpp +++ b/src/openssl/openssl_exception.cpp @@ -3,7 +3,7 @@ * */ -#include "derecho/openssl/openssl_exception.hpp" +#include namespace openssl { diff --git a/src/openssl/signature.cpp b/src/openssl/signature.cpp index ea16c9d7..5b6d7995 100644 --- a/src/openssl/signature.cpp +++ b/src/openssl/signature.cpp @@ -1,4 +1,4 @@ -#include "derecho/openssl/signature.hpp" +#include #include #include diff --git a/src/persistent/FilePersistLog.cpp b/src/persistent/FilePersistLog.cpp index 9d3b0c46..8e473463 100644 --- a/src/persistent/FilePersistLog.cpp +++ b/src/persistent/FilePersistLog.cpp @@ -1,9 +1,9 @@ -#include "derecho/persistent/detail/FilePersistLog.hpp" +#include -#include "derecho/conf/conf.hpp" -#include "derecho/persistent/detail/util.hpp" -#include "derecho/persistent/detail/logger.hpp" -#include "derecho/persistent/PersistException.hpp" +#include +#include +#include +#include #include #include diff --git a/src/persistent/HLC.cpp b/src/persistent/HLC.cpp index 807e2d23..6d043692 100644 --- a/src/persistent/HLC.cpp +++ b/src/persistent/HLC.cpp @@ -1,4 +1,4 @@ -#include "derecho/persistent/HLC.hpp" +#include #include #include diff --git a/src/persistent/PersistLog.cpp b/src/persistent/PersistLog.cpp index db6870dc..90760fa6 100644 --- a/src/persistent/PersistLog.cpp +++ b/src/persistent/PersistLog.cpp @@ -1,8 +1,8 @@ -#include "derecho/persistent/detail/PersistLog.hpp" +#include -#include "derecho/openssl/signature.hpp" -#include "derecho/persistent/detail/util.hpp" -#include "derecho/persistent/detail/logger.hpp" +#include +#include +#include namespace persistent { diff --git a/src/persistent/Persistent.cpp b/src/persistent/Persistent.cpp index b88c80e4..44ca9847 100644 --- a/src/persistent/Persistent.cpp +++ b/src/persistent/Persistent.cpp @@ -1,8 +1,8 @@ -#include "derecho/persistent/Persistent.hpp" +#include -#include "derecho/persistent/detail/logger.hpp" -#include "derecho/openssl/hash.hpp" -#include "derecho/openssl/signature.hpp" +#include +#include +#include #include #include diff --git a/src/persistent/logger.cpp b/src/persistent/logger.cpp index 5faf9894..aec472e0 100644 --- a/src/persistent/logger.cpp +++ b/src/persistent/logger.cpp @@ -1,5 +1,5 @@ -#include "derecho/persistent/detail/logger.hpp" -#include "derecho/conf/conf.hpp" +#include +#include #include #include diff --git a/src/rdmc/group_send.cpp b/src/rdmc/group_send.cpp index 50e8f680..57ddab29 100644 --- a/src/rdmc/group_send.cpp +++ b/src/rdmc/group_send.cpp @@ -1,11 +1,11 @@ -#include "derecho/rdmc/group_send.hpp" -#include "derecho/rdmc/detail/message.hpp" -#include "derecho/rdmc/detail/util.hpp" +#include +#include +#include #ifdef USE_VERBS_API - #include "derecho/rdmc/detail/verbs_helper.hpp" +#include #else - #include "derecho/rdmc/detail/lf_helper.hpp" +#include #endif #include diff --git a/src/rdmc/lf_helper.cpp b/src/rdmc/lf_helper.cpp index 9be78110..033aa04c 100644 --- a/src/rdmc/lf_helper.cpp +++ b/src/rdmc/lf_helper.cpp @@ -1,10 +1,10 @@ -#include "derecho/rdmc/detail/lf_helper.hpp" +#include -#include "derecho/conf/conf.hpp" -#include "derecho/core/detail/connection_manager.hpp" -#include "derecho/rdmc/detail/util.hpp" -#include "derecho/tcp/tcp.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include +#include +#include #include #include diff --git a/src/rdmc/rdmc.cpp b/src/rdmc/rdmc.cpp index eababc50..88f051b5 100644 --- a/src/rdmc/rdmc.cpp +++ b/src/rdmc/rdmc.cpp @@ -1,15 +1,15 @@ -#include "derecho/rdmc/rdmc.hpp" -#include "derecho/rdmc/group_send.hpp" -#include "derecho/rdmc/detail/message.hpp" -#include "derecho/rdmc/detail/schedule.hpp" -#include "derecho/rdmc/detail/util.hpp" +#include +#include +#include +#include +#include #ifdef USE_VERBS_API - #include "derecho/rdmc/detail/verbs_helper.hpp" +#include #else - #include "derecho/rdmc/detail/lf_helper.hpp" +#include #endif -#include "derecho/core/derecho_type_definitions.hpp" +#include #include #include diff --git a/src/rdmc/schedule.cpp b/src/rdmc/schedule.cpp index 1aecc40c..b2e0ab2a 100644 --- a/src/rdmc/schedule.cpp +++ b/src/rdmc/schedule.cpp @@ -1,4 +1,4 @@ -#include "derecho/rdmc/detail/schedule.hpp" +#include #include #include diff --git a/src/rdmc/util.cpp b/src/rdmc/util.cpp index 0b28b745..f36a1ad7 100644 --- a/src/rdmc/util.cpp +++ b/src/rdmc/util.cpp @@ -1,4 +1,4 @@ -#include "derecho/rdmc/detail/util.hpp" +#include #include #include diff --git a/src/rdmc/verbs_helper.cpp b/src/rdmc/verbs_helper.cpp index 5dc6b0c7..70376b6c 100644 --- a/src/rdmc/verbs_helper.cpp +++ b/src/rdmc/verbs_helper.cpp @@ -1,10 +1,10 @@ -#include "derecho/rdmc/detail/verbs_helper.hpp" +#include -#include "derecho/conf/conf.hpp" -#include "derecho/core/detail/connection_manager.hpp" -#include "derecho/rdmc/detail/util.hpp" -#include "derecho/tcp/tcp.hpp" -#include "derecho/utils/logger.hpp" +#include +#include +#include +#include +#include #include #include diff --git a/src/sst/lf.cpp b/src/sst/lf.cpp index 9db1aef3..8dfc739b 100644 --- a/src/sst/lf.cpp +++ b/src/sst/lf.cpp @@ -4,16 +4,16 @@ * Implementation of RDMA interface defined in lf.h. */ -#include "derecho/sst/detail/lf.hpp" - -#include "derecho/conf/conf.hpp" -#include "derecho/core/detail/connection_manager.hpp" -#include "derecho/sst/detail/poll_utils.hpp" -#include "derecho/sst/detail/sst_impl.hpp" -#include "derecho/tcp/tcp.hpp" -#include "derecho/utils/logger.hpp" -#include "derecho/utils/time.h" -#include "derecho/core/derecho_exception.hpp" +#include + +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/sst/poll_utils.cpp b/src/sst/poll_utils.cpp index 90043cec..c92806ae 100644 --- a/src/sst/poll_utils.cpp +++ b/src/sst/poll_utils.cpp @@ -1,4 +1,4 @@ -#include "derecho/sst/detail/poll_utils.hpp" +#include #include #include diff --git a/src/sst/verbs.cpp b/src/sst/verbs.cpp index 61b6f67b..1f94827a 100644 --- a/src/sst/verbs.cpp +++ b/src/sst/verbs.cpp @@ -2,14 +2,14 @@ * @file verbs.cpp * Contains the implementation of the IB Verbs adapter layer of %SST. */ -#include "derecho/sst/detail/verbs.hpp" - -#include "derecho/conf/conf.hpp" -#include "derecho/core/detail/connection_manager.hpp" -#include "derecho/sst/detail/poll_utils.hpp" -#include "derecho/sst/detail/sst_impl.hpp" -#include "derecho/tcp/tcp.hpp" -#include "derecho/utils/logger.hpp" +#include + +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/tcp/tcp.cpp b/src/tcp/tcp.cpp index a2b3aa0e..9a211f43 100644 --- a/src/tcp/tcp.cpp +++ b/src/tcp/tcp.cpp @@ -1,4 +1,4 @@ -#include "derecho/tcp/tcp.hpp" +#include #include #include diff --git a/src/utils/logger.cpp b/src/utils/logger.cpp index bd256dba..6fbb2d37 100644 --- a/src/utils/logger.cpp +++ b/src/utils/logger.cpp @@ -1,6 +1,6 @@ -#include "derecho/utils/logger.hpp" +#include -#include "derecho/conf/conf.hpp" +#include #include #include From 774fc18e1a8b95453d5f1733d6af93f0aa76d945 Mon Sep 17 00:00:00 2001 From: Weijia Song Date: Thu, 9 May 2024 17:56:02 -0400 Subject: [PATCH 5/5] minor bugfix: signed_log_test byte size. --- src/applications/tests/unit_tests/signed_log_test.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/applications/tests/unit_tests/signed_log_test.cpp b/src/applications/tests/unit_tests/signed_log_test.cpp index 79ef060b..853bea45 100644 --- a/src/applications/tests/unit_tests/signed_log_test.cpp +++ b/src/applications/tests/unit_tests/signed_log_test.cpp @@ -77,14 +77,18 @@ std::string StringWithDelta::get_current_state() const { } size_t StringWithDelta::currentDeltaSize() { - return delta.size(); + if (delta.size()==0) { + return 0; + } else { + return mutils::bytes_size(delta); + } } size_t StringWithDelta::currentDeltaToBytes(uint8_t * const buf, size_t buf_size) { if (delta.size() == 0) { dbg_default_trace("StringWithDelta: Calling currentDeltaToBytes with null buffer\n"); return 0; - } else if (buf_size < delta.size()) { + } else if (buf_size < mutils::bytes_size(delta)) { dbg_default_error("{} failed because the buffer({}) given is smaller than needed({}).\n", __func__,buf_size,delta.size()); return 0;