diff --git a/Online/EventBuilding/include/buffer_interface.hpp b/Online/EventBuilding/include/buffer_interface.hpp index 728dd0a21d86f5c5b6864908c3009a44d1c045fd..17e27ab2673245dd681a99913e1863820acb4c89 100644 --- a/Online/EventBuilding/include/buffer_interface.hpp +++ b/Online/EventBuilding/include/buffer_interface.hpp @@ -53,8 +53,10 @@ namespace buffer_interface { } virtual void read_complete() = 0; - // The impletationd of cancel should not query any external proces or device + // The implementation of cancel should not query any external proces or device virtual void cancel() = 0; + // The src id should be set by an external device or in the constructor of the derived class + virtual int get_src_id() const = 0; }; template<class T> @@ -79,8 +81,10 @@ namespace buffer_interface { } virtual void write_complete() = 0; - // The impletationd of cancel should not query any external proces or device + // The implementation of cancel should not query any external proces or device virtual void cancel() = 0; + // The src id should be set by an external device or in the constructor of the derived class + virtual int get_src_id() const = 0; }; } // namespace buffer_interface diff --git a/Online/EventBuilding/include/circular_buffer_reader.hpp b/Online/EventBuilding/include/circular_buffer_reader.hpp index 4ab4f189511f5f7ae3246ac163bf38d127dcdc1d..83d43d771152598e91534f0652f65f3003fd0164 100644 --- a/Online/EventBuilding/include/circular_buffer_reader.hpp +++ b/Online/EventBuilding/include/circular_buffer_reader.hpp @@ -25,6 +25,8 @@ public: void read_complete() override; void cancel() override; + int get_src_id() const override; + protected: void update_local_status(); }; diff --git a/Online/EventBuilding/include/circular_buffer_reader_impl.hpp b/Online/EventBuilding/include/circular_buffer_reader_impl.hpp index 109c8a228a12aa724a85a1d120f4821f7420c6cd..ee6ac4f5f0d69ef701eed3c463dcdf2526c6a1bc 100644 --- a/Online/EventBuilding/include/circular_buffer_reader_impl.hpp +++ b/Online/EventBuilding/include/circular_buffer_reader_impl.hpp @@ -79,6 +79,12 @@ void Circular_buffer_reader<T, B>::read_complete() this->_backend._remote_buffer_status->read_stat = this->_backend._local_buffer_status.read_stat; } +template<class T, class B> +int Circular_buffer_reader<T, B>::get_src_id() const +{ + return this->_backend._local_buffer_status.id; +} + template<class T, class B> void Circular_buffer_reader<T, B>::cancel() { diff --git a/Online/EventBuilding/include/circular_buffer_status.hpp b/Online/EventBuilding/include/circular_buffer_status.hpp index f23b5867fa227f7c9c219d1e9e70a252449c57bc..dce294ab00e39509987a451a71a3868eb0d759f6 100644 --- a/Online/EventBuilding/include/circular_buffer_status.hpp +++ b/Online/EventBuilding/include/circular_buffer_status.hpp @@ -8,8 +8,9 @@ constexpr uint64_t ptr_mask = 0x7fffffffffffffff; constexpr uint64_t wrap_mask = ~ptr_mask; struct Circular_buffer_status { - Circular_buffer_status() : write_stat(0), read_stat(0), size(0), alignment(0) {} - Circular_buffer_status(size_t size, size_t alignment) : write_stat(0), read_stat(0), size(size), alignment(alignment) + Circular_buffer_status() : write_stat(0), read_stat(0), size(0), alignment(0), id(0) {} + Circular_buffer_status(size_t size, size_t alignment, int id) : + write_stat(0), read_stat(0), size(size), alignment(alignment), id(id) {} uint64_t write_stat; @@ -18,6 +19,7 @@ struct Circular_buffer_status { // size of the usable allocated area size_t size; size_t alignment; + int id; bool is_empty() const; bool is_full() const; diff --git a/Online/EventBuilding/include/circular_buffer_writer.hpp b/Online/EventBuilding/include/circular_buffer_writer.hpp index bbe559098159b5d8f50843a675acab68684cbe45..0d41685ba537c8d74f191fa4a5a81d2ec6453fa6 100644 --- a/Online/EventBuilding/include/circular_buffer_writer.hpp +++ b/Online/EventBuilding/include/circular_buffer_writer.hpp @@ -25,6 +25,8 @@ public: void write_complete() override; void cancel() override; + int get_src_id() const override; + size_t free_space(); protected: diff --git a/Online/EventBuilding/include/circular_buffer_writer_impl.hpp b/Online/EventBuilding/include/circular_buffer_writer_impl.hpp index a9aa52b9a221887708287e62082f252f4e28f46c..6fc5dae28d944df7f7bbed6e5b323bec964f0989 100644 --- a/Online/EventBuilding/include/circular_buffer_writer_impl.hpp +++ b/Online/EventBuilding/include/circular_buffer_writer_impl.hpp @@ -95,6 +95,12 @@ void Circular_buffer_writer<T, B>::update_local_status() this->_backend._local_buffer_status.read_stat = this->_backend._remote_buffer_status->read_stat; } +template<class T, class B> +int Circular_buffer_writer<T, B>::get_src_id() const +{ + return this->_backend._local_buffer_status.id; +} + template<class T, class B> size_t Circular_buffer_writer<T, B>::free_space() { diff --git a/Online/EventBuilding/include/dummy_mep_buffer_writer.hpp b/Online/EventBuilding/include/dummy_mep_buffer_writer.hpp index beebafc8a02bfa9fab332f40f5ded4855a69f03a..7d6cb055f99dc056d5af3162054a5350ffe40e27 100644 --- a/Online/EventBuilding/include/dummy_mep_buffer_writer.hpp +++ b/Online/EventBuilding/include/dummy_mep_buffer_writer.hpp @@ -20,6 +20,8 @@ public: void write_complete() override; void cancel() override; + int get_src_id() const override { return 0; } + private: typedef std::unique_ptr<void, std::function<void(void*)>> buffer_type; buffer_type _buffer; diff --git a/Online/EventBuilding/include/dummy_mfp_buffer.hpp b/Online/EventBuilding/include/dummy_mfp_buffer.hpp index cc2957659e9d7116d2d33e77fb67fb02a2c0432e..50fbecbb524c1f1e88ab9e3cf5d73749843b14f6 100644 --- a/Online/EventBuilding/include/dummy_mfp_buffer.hpp +++ b/Online/EventBuilding/include/dummy_mfp_buffer.hpp @@ -14,9 +14,9 @@ private: public: Dummy_MFP_buffer() = default; - Dummy_MFP_buffer(std::shared_ptr<char>& buffer, size_t buffer_size); + Dummy_MFP_buffer(std::shared_ptr<char>& buffer, size_t buffer_size, int src_id = 0); - void set_buffer(std::shared_ptr<char>& buffer, size_t buffer_size); + void set_buffer(std::shared_ptr<char>& buffer, size_t buffer_size, int src_id = 0); virtual MFP::MFP_header* try_get_element() override; @@ -27,6 +27,8 @@ public: virtual ~Dummy_MFP_buffer() = default; + int get_src_id() const override; + protected: size_t get_size_at(int MFP_number = 1); char* get_ptr_at(int MFP_number = 1); @@ -34,6 +36,8 @@ protected: std::tuple<char*, size_t> operator[](int MFP_number); void update_read_ptr(int MFP_number = 1); + + int _src_id; }; #endif // DUMMY_MFP_BUFFER_H \ No newline at end of file diff --git a/Online/EventBuilding/include/mbm_reader.hpp b/Online/EventBuilding/include/mbm_reader.hpp index 68dc3e21a9a93361e9b3d04fddbd486e45988e5a..a3d04e929019a0b5cc87f578083ce6627ccdcd98 100644 --- a/Online/EventBuilding/include/mbm_reader.hpp +++ b/Online/EventBuilding/include/mbm_reader.hpp @@ -21,20 +21,25 @@ public: // alignment is explesser in 2^alignment min value 1 Mbm_reader() : buffer_interface::Buffer_reader<T>() {} // Mbm_writer(MBM::Producer* producer, int facility = 0); - Mbm_reader(Online::DataflowComponent::Context& context, const std::string& instance, const std::string& name, const std::string& req ); + Mbm_reader( + Online::DataflowComponent::Context& context, + const std::string& instance, + const std::string& name, + const std::string& req); virtual ~Mbm_reader(); std::vector<std::tuple<void*, size_t>> get_full_buffer() override; T* try_get_element() override; void read_complete() override; void cancel() override; - + + int get_src_id() const override { return 0; } + protected: Online::DataflowComponent::Context* _context; std::unique_ptr<MBM::Consumer> _consumer; int _total_size = 0; std::string _m_req; MBM::Requirement _m_requirement; - }; #include "mbm_reader_impl.hpp" diff --git a/Online/EventBuilding/include/mbm_writer.hpp b/Online/EventBuilding/include/mbm_writer.hpp index b1152826f9acd35e8550b98a79acdd7ecd031d4e..8f900a64b793e763106178d4db1b2de147e22675 100644 --- a/Online/EventBuilding/include/mbm_writer.hpp +++ b/Online/EventBuilding/include/mbm_writer.hpp @@ -35,10 +35,11 @@ public: void reset(MBM::Producer* producer = NULL); + int get_src_id() const override { return 0; } + protected: Online::DataflowComponent::Context* _context; std::unique_ptr<MBM::Producer> _producer; - }; #include "mbm_writer_impl.hpp" diff --git a/Online/EventBuilding/include/pcie40_reader.hpp b/Online/EventBuilding/include/pcie40_reader.hpp index df8f73634d2b198a3ca746c1d6df7bc706fc0443..98ad1d4a87ad39d00b4f7bbd1758bb4291f46923 100644 --- a/Online/EventBuilding/include/pcie40_reader.hpp +++ b/Online/EventBuilding/include/pcie40_reader.hpp @@ -18,6 +18,13 @@ constexpr int default_PCIe40_frag_alignment = 5; // 32 B class PCIe40_reader { protected: + static constexpr int src_version_mask = 0xFF0000; + static constexpr int src_version_shift = 16; + static constexpr int src_subsystem_mask = 0xF800; + static constexpr int src_subsystem_shift = 11; + static constexpr int src_num_mask = 0x7FF; + static constexpr int src_num_shift = 0; + void* _buffer; ssize_t _buffer_size; @@ -64,6 +71,9 @@ public: void cancel_pending(); const std::string get_name() const; + + uint16_t _src_id; + uint8_t _block_version; }; class PCIe40_MFP_reader : public PCIe40_reader, public buffer_interface::Buffer_reader<MFP::MFP_header> { @@ -76,6 +86,8 @@ public: void read_complete() override; void cancel() override; + int get_src_id() const override; + std::vector<std::tuple<void*, size_t>> get_full_buffer() override; }; @@ -93,6 +105,8 @@ public: void read_complete() override; void cancel() override; + int get_src_id() const override; + void set_n_frags(int n_MFPs); int get_n_frags() const; diff --git a/Online/EventBuilding/include/shared_mem_buffer_backend.hpp b/Online/EventBuilding/include/shared_mem_buffer_backend.hpp index d076414e6390d38913a3b240f5c59d54b52b6178..5bf08c4fdfad3095364062c84786c9803adba4e1 100644 --- a/Online/EventBuilding/include/shared_mem_buffer_backend.hpp +++ b/Online/EventBuilding/include/shared_mem_buffer_backend.hpp @@ -20,7 +20,8 @@ public: bool allow_reconnect, bool allow_unlink, size_t size = 0, - size_t alignment = 12); + size_t alignment = 12, + int id = 0); Shared_mem_buffer_backend(Shared_mem_buffer_backend&& other); Shared_mem_buffer_backend& operator=(Shared_mem_buffer_backend&& other); @@ -54,7 +55,7 @@ private: void open_shmem(); void create_shmem(); void create_locks(); - void init_buffer(size_t size, size_t alignment); + void init_buffer(size_t size, size_t alignment, int id); void shm_map(); void close_shmem(); void destroy_shmem(); diff --git a/Online/EventBuilding/include/shared_ptr_buffer_backend.hpp b/Online/EventBuilding/include/shared_ptr_buffer_backend.hpp index cc943cf9cac6c0be6a15112c9a129cc9e06c6aff..c39e43befe23e0127b0850dceac1d08811e7b954 100644 --- a/Online/EventBuilding/include/shared_ptr_buffer_backend.hpp +++ b/Online/EventBuilding/include/shared_ptr_buffer_backend.hpp @@ -13,7 +13,7 @@ class Shared_ptr_buffer_backend { public: virtual ~Shared_ptr_buffer_backend(); Shared_ptr_buffer_backend(){}; - Shared_ptr_buffer_backend(size_t size, size_t alignment = 12); + Shared_ptr_buffer_backend(size_t size, size_t alignment = 12, int id = 0); std::tuple<void*, size_t> get_buffer(); bool is_set(); diff --git a/Online/EventBuilding/include/shmem_buffer_writer.hpp b/Online/EventBuilding/include/shmem_buffer_writer.hpp index dfb1a6b0bb4bdacc69bc08c769d6c3fb2d38c36f..3b1d59212b943130e614c24964030d82f37bb9aa 100644 --- a/Online/EventBuilding/include/shmem_buffer_writer.hpp +++ b/Online/EventBuilding/include/shmem_buffer_writer.hpp @@ -16,9 +16,9 @@ public: // alignment is explesser in 2^alignment min value 1 Shmem_buffer_writer() {} // Options for unlinking and reconnection are available via the full API of Shared_mem_buffer_backend - Shmem_buffer_writer(const std::string& shm_name, size_t size, uint8_t alignment = 12) : + Shmem_buffer_writer(const std::string& shm_name, size_t size, uint8_t alignment = 12, int id = 0) : Circular_buffer_writer<T, Shared_mem_buffer_backend>( - std::move(Shared_mem_buffer_backend(shm_name, true, true, true, size, alignment))) + std::move(Shared_mem_buffer_backend(shm_name, true, true, true, size, alignment, id))) {} virtual ~Shmem_buffer_writer() {} diff --git a/Online/EventBuilding/src/MFP_generator.cpp b/Online/EventBuilding/src/MFP_generator.cpp index aacfde3b72ba57cf82b11d71bb028fdb72436e2e..7afccd2b99e743472b0acae2a1a5b0694738e56a 100644 --- a/Online/EventBuilding/src/MFP_generator.cpp +++ b/Online/EventBuilding/src/MFP_generator.cpp @@ -84,7 +84,7 @@ int MFP_generator::initialize() try { logger.debug << "Opening shmem buffer " << _shmem_name << std::flush; _buffer.reset_backend( - std::move(Shared_mem_buffer_backend(_shmem_name.c_str(), true, _reconnect, true, _buffer_size))); + std::move(Shared_mem_buffer_backend(_shmem_name.c_str(), true, _reconnect, true, _buffer_size, _src_id))); } catch (const std::exception& e) { logger.error << __FUNCTION__ << " unable to configure the output buffer " << _shmem_name << " " << e.what() << std::flush; diff --git a/Online/EventBuilding/src/RU.cpp b/Online/EventBuilding/src/RU.cpp index 53f96c6c7bcee5f56b28be8047a88e9170aeb068..d10f4943ad2840dc0f94b51747c3792d59040948 100644 --- a/Online/EventBuilding/src/RU.cpp +++ b/Online/EventBuilding/src/RU.cpp @@ -76,11 +76,9 @@ int EB::RU::check_buffers() _buffer_type.resize(_ru_ranks.size(), default_RU_buffer_type); logger.warning << __FUNCTION__ << " no buffer types provided setting to default value " << EB::default_RU_buffer_type << std::flush; - } - else if (_buffer_type.size() == 1) { + } else if (_buffer_type.size() == 1) { _buffer_type.resize(_ru_ranks.size(), _buffer_type[0]); - logger.warning << __FUNCTION__ << " Single buffer type provided: " - << _buffer_type[0] << std::flush; + logger.warning << __FUNCTION__ << " Single buffer type provided: " << _buffer_type[0] << std::flush; } if (_buffer_type.size() != _ru_ranks.size()) { @@ -94,11 +92,9 @@ int EB::RU::check_buffers() _buffer_sizes.resize(_prefix_n_sources_per_ru[_ru_ranks.size()], default_RU_buffer_size); logger.warning << __FUNCTION__ << " no buffer sizes provided setting to default value " << EB::default_RU_buffer_size << std::flush; - } - else if (_buffer_sizes.size() == 1) { + } else if (_buffer_sizes.size() == 1) { _buffer_sizes.resize(_prefix_n_sources_per_ru[_ru_ranks.size()], _buffer_sizes[0]); - logger.warning << __FUNCTION__ << " Single buffer size provided: " - << _buffer_sizes[0] << std::flush; + logger.warning << __FUNCTION__ << " Single buffer size provided: " << _buffer_sizes[0] << std::flush; } if (_buffer_sizes.size() != _prefix_n_sources_per_ru[_ru_ranks.size()]) { @@ -287,7 +283,8 @@ void EB::RU::config_dummy() auto buffs = preloader.get_buffers(); for (int k = 0; k < _n_sources_per_ru[_my_idx]; k++) { - _buffers.emplace_back(new Dummy_MFP_buffer(std::get<0>(buffs)[k], std::get<2>(buffs)[k])); + _buffers.emplace_back(new Dummy_MFP_buffer( + std::get<0>(buffs)[k], std::get<2>(buffs)[k], _src_ids[_prefix_n_sources_per_ru[_my_idx] + k])); } } diff --git a/Online/EventBuilding/src/dummy_mfp_buffer.cpp b/Online/EventBuilding/src/dummy_mfp_buffer.cpp index 2c59772cf5c789170509c061e80d57feae8eae36..5120990f9c997143b6e2cbba45502afb684d975a 100644 --- a/Online/EventBuilding/src/dummy_mfp_buffer.cpp +++ b/Online/EventBuilding/src/dummy_mfp_buffer.cpp @@ -1,17 +1,19 @@ #include "dummy_mfp_buffer.hpp" #include <iostream> -Dummy_MFP_buffer::Dummy_MFP_buffer(std::shared_ptr<char>& buffer, size_t buffer_size) +Dummy_MFP_buffer::Dummy_MFP_buffer(std::shared_ptr<char>& buffer, size_t buffer_size, int src_id) { - set_buffer(buffer, buffer_size); + set_buffer(buffer, buffer_size, src_id); } -void Dummy_MFP_buffer::set_buffer(std::shared_ptr<char>& buffer, size_t buffer_size) +void Dummy_MFP_buffer::set_buffer(std::shared_ptr<char>& buffer, size_t buffer_size, int src_id) { _buffer = buffer; _buffer_size = buffer_size; _read_ptr = _buffer.get(); + + _src_id = src_id; } MFP::MFP_header* Dummy_MFP_buffer::try_get_element() @@ -36,6 +38,8 @@ void Dummy_MFP_buffer::read_complete() {} // This buffer implementation is 100% local so there is no remote IO to cancel, the buffer will reset the _read_ptr void Dummy_MFP_buffer::cancel() { _read_ptr = _buffer.get(); } +int Dummy_MFP_buffer::get_src_id() const { return _src_id; } + char* Dummy_MFP_buffer::get_ptr_at(int MFP_number) { std::uintptr_t offset = reinterpret_cast<std::uintptr_t>(_read_ptr) - reinterpret_cast<std::uintptr_t>(_buffer.get()); diff --git a/Online/EventBuilding/src/pcie40_reader.cpp b/Online/EventBuilding/src/pcie40_reader.cpp index 7edbfb8635a589891eed072f60987069681f156b..b567e86386c4d3c45638ff6a820cb4143edd78fb 100644 --- a/Online/EventBuilding/src/pcie40_reader.cpp +++ b/Online/EventBuilding/src/pcie40_reader.cpp @@ -141,6 +141,11 @@ int PCIe40_reader::open(int id) _name = name; + int vers_id = p40_id_get_source(_id_fd); + + _src_id = (vers_id & (src_num_mask | src_subsystem_mask)) >> src_num_shift; + _block_version = (vers_id & src_version_mask) >> src_version_shift; + return ret_val; } @@ -325,6 +330,8 @@ MFP::MFP_header* PCIe40_MFP_reader::try_get_element() void PCIe40_MFP_reader::read_complete() { ack_read(); } +int PCIe40_MFP_reader::get_src_id() const { return _src_id; } + void PCIe40_MFP_reader::cancel() { cancel_pending(); } PCIe40_MFP_reader::PCIe40_MFP_reader() : PCIe40_reader() {} @@ -452,23 +459,14 @@ int PCIe40_frag_reader::build_MFP() get_padding(_size_list.back(), 1 << _align); MFP::MFP_header* new_header = _internal_buffer_writer.try_write_next_element(MFP_size); if (new_header != NULL) { - if((_frag_list.size() != _type_list.size()) || (_frag_list.size() != _size_list.size())){ - bool flag = true; - while(flag){ - sleep(1); - } - } - new_header->magic = MFP::MFP_magic; new_header->n_banks = _frag_list.size(); new_header->packet_size = MFP_size; new_header->ev_id = _frag_list.front()->evid(); - // TODO src_id should by configure by the ECS - new_header->src_id = 1; + new_header->src_id = _pcie40_reader._src_id; new_header->align = _align; - // TODO check were to find the right version - new_header->block_version = 1; + new_header->block_version = _pcie40_reader._block_version; std::memcpy(new_header->bank_types(), _type_list.data(), _type_list.size() * sizeof(_type_list.front())); std::memcpy(new_header->bank_sizes(), _size_list.data(), _size_list.size() * sizeof(_size_list.front())); @@ -513,6 +511,8 @@ int PCIe40_frag_reader::build_MFP() void PCIe40_frag_reader::read_complete() { _internal_buffer_reader.read_complete(); } +int PCIe40_frag_reader::get_src_id() const { return _pcie40_reader._src_id; } + void PCIe40_frag_reader::cancel() { _frag_list.clear(); diff --git a/Online/EventBuilding/src/shared_mem_buffer_backend.cpp b/Online/EventBuilding/src/shared_mem_buffer_backend.cpp index dd67fadbe094eac9714810bc49526dda0ec9937b..88e178a8b03a78bd4553e57ea32a0376ce6ae573 100644 --- a/Online/EventBuilding/src/shared_mem_buffer_backend.cpp +++ b/Online/EventBuilding/src/shared_mem_buffer_backend.cpp @@ -46,7 +46,8 @@ Shared_mem_buffer_backend::Shared_mem_buffer_backend( bool allow_reconnect, bool allow_unlink, size_t size, - size_t alignment) : + size_t alignment, + int id) : _shmem_name(name), _is_writer(is_writer), _allow_unlink(allow_unlink) { @@ -76,7 +77,7 @@ Shared_mem_buffer_backend::Shared_mem_buffer_backend( try_lock_writer(); try_lock_reader(); create_shmem(); - init_buffer(size, alignment); + init_buffer(size, alignment, id); release_reader(); shm_map(); } catch (...) { @@ -150,7 +151,7 @@ void Shared_mem_buffer_backend::create_locks() } } -void Shared_mem_buffer_backend::init_buffer(size_t size, size_t alignment) +void Shared_mem_buffer_backend::init_buffer(size_t size, size_t alignment, int id) { // the max alignment size will be one page, because the memry mapped address is always page aligned it is not // possible to align to something bigger than a page, unless some offset is used @@ -170,11 +171,13 @@ void Shared_mem_buffer_backend::init_buffer(size_t size, size_t alignment) this->_local_buffer_status.set_read_ptr(0); this->_local_buffer_status.set_write_ptr(0); - // mmapped memory is always page aligned + this->_local_buffer_status.id = id; this->_local_buffer_status.size = size; this->_local_buffer_status.alignment = alignment; + // mmapped memory is always page aligned + size_t buffer_start = sizeof(Circular_buffer_status) + get_padding(sizeof(Circular_buffer_status), 1 << alignment); if ( diff --git a/Online/EventBuilding/src/shared_ptr_buffer_backend.cpp b/Online/EventBuilding/src/shared_ptr_buffer_backend.cpp index bf53a2177045f9e95d0c077801f0ba5200c4bf00..4c343d2484eae58be66e4cc0a27068d190c1da7e 100644 --- a/Online/EventBuilding/src/shared_ptr_buffer_backend.cpp +++ b/Online/EventBuilding/src/shared_ptr_buffer_backend.cpp @@ -2,9 +2,9 @@ #include <cstdlib> #include <sstream> -Shared_ptr_buffer_backend::Shared_ptr_buffer_backend(size_t size, size_t alignment) : +Shared_ptr_buffer_backend::Shared_ptr_buffer_backend(size_t size, size_t alignment, int id) : _buffer_ptr(aligned_alloc(1 << alignment, size), [](auto p) { free(p); }), - _remote_buffer_status(new Circular_buffer_status(size, alignment)), _local_buffer_status(size, alignment) + _remote_buffer_status(new Circular_buffer_status(size, alignment, id)), _local_buffer_status(size, alignment, id) { if (_buffer_ptr.get() == NULL) { throw std::bad_alloc{};