diff --git a/AllenOnline/CMakeLists.txt b/AllenOnline/CMakeLists.txt index 50dbf1e90858e7aa23356c106c53182c9bec601f..695783918ed7d326f3be13cc286962544ea429d2 100644 --- a/AllenOnline/CMakeLists.txt +++ b/AllenOnline/CMakeLists.txt @@ -19,7 +19,6 @@ gaudi_add_library(AllenOnlineLib src/TransposeMEP.cpp LINK PUBLIC Gaudi::GaudiKernel - cppgsl::cppgsl Online::EventBuildingLib Allen::AllenLib ) @@ -50,7 +49,6 @@ gaudi_add_module(AllenOnlineComp Online::OnlineBase Online::RPC Online::dim - cppgsl::cppgsl rt ) diff --git a/AllenOnline/application/MPISend.cpp b/AllenOnline/application/MPISend.cpp index 8a1dc9cbd37ad8c8b3676a67a3498e83e5c2c8c5..46f017f3ffe34b2c2e7b3e46ed7bf25cfa561975 100644 --- a/AllenOnline/application/MPISend.cpp +++ b/AllenOnline/application/MPISend.cpp @@ -77,13 +77,13 @@ int main( int argc, char* argv[] ) { std::vector requests( window_size ); // Read all files in connections - std::vector>> meps; + std::vector>> meps; std::cout << MPI::rank_str() << "Reading " << ( number_of_meps != 0 ? std::to_string( number_of_meps ) : std::string{"all"} ) << " meps from files\n"; std::vector data; - gsl::span mep_span; + std::span mep_span; size_t n_meps_read = 0; std::optional packing_factor = std::nullopt; @@ -115,7 +115,7 @@ int main( int argc, char* argv[] ) { std::copy_n( mep_span.data(), mep_span.size(), contents ); ++n_meps_read; - meps.emplace_back( mep, gsl::span{contents, mep_span.size()} ); + meps.emplace_back( mep, std::span{contents, mep_span.size()} ); } if ( n_meps_read >= number_of_meps && number_of_meps != 0 ) { input.close(); diff --git a/AllenOnline/application/bench_mep_offsets.cpp b/AllenOnline/application/bench_mep_offsets.cpp index 3ef6559c449de97de057ed039293977716e4971f..62460c68a91a8048204f5aee408f5e71262666ed 100644 --- a/AllenOnline/application/bench_mep_offsets.cpp +++ b/AllenOnline/application/bench_mep_offsets.cpp @@ -81,7 +81,7 @@ std::vector contiguous_mfps( Allen::Slice const& mep_data ) { auto const& mfps = mep_data.fragments; vector mep_fragments( mep_data.fragments_mem_size, '\0' ); char* destination = &mep_fragments[0]; - for ( gsl::span mfp : mfps ) { + for ( std::span mfp : mfps ) { ::memcpy( destination, mfp.data(), mfp.size_bytes() ); destination += mfp.size_bytes(); } diff --git a/AllenOnline/include/AllenOnline/ReadMEP.h b/AllenOnline/include/AllenOnline/ReadMEP.h index df6def1d5fb3f6e3ce6d0537e7339c2df0dc4570..f43eb1f2dc740e7c130c33c8d48294e737fb0b52 100644 --- a/AllenOnline/include/AllenOnline/ReadMEP.h +++ b/AllenOnline/include/AllenOnline/ReadMEP.h @@ -4,15 +4,14 @@ #pragma once #include +#include #include -#include - #include #include #include namespace MEP { - std::tuple> + std::tuple> read_mep( LHCb::StreamDescriptor::Access& input, std::vector& buffer, MsgStream& out_stream ); } diff --git a/AllenOnline/include/AllenOnline/TransposeMEP.h b/AllenOnline/include/AllenOnline/TransposeMEP.h index e89880eb2542329c2399474bc355a9ebff245a77..db90dc8a06f9e5123994321739deaf89a703190d 100644 --- a/AllenOnline/include/AllenOnline/TransposeMEP.h +++ b/AllenOnline/include/AllenOnline/TransposeMEP.h @@ -61,7 +61,7 @@ namespace MEP { struct Slice { EB::MEP const* mep = nullptr; - gsl::span mep_data; + std::span mep_data; unsigned packing_factor = 0u; Blocks blocks; SourceOffsets offsets; diff --git a/AllenOnline/src/AllenApplication.cpp b/AllenOnline/src/AllenApplication.cpp index a78430856d4be1d7122dee61ecd33146f95d4f8e..9fe43b54b036cddf537742911275415f072d909b 100644 --- a/AllenOnline/src/AllenApplication.cpp +++ b/AllenOnline/src/AllenApplication.cpp @@ -302,7 +302,7 @@ void AllenApplication::allenLoop( std::string_view config, std::string_view conf } } -void AllenApplication::update( gsl::span odin_data ) { +void AllenApplication::update( std::span odin_data ) { LHCb::ODIN odin{odin_data}; auto const run = odin.runNumber(); diff --git a/AllenOnline/src/AllenApplication.h b/AllenOnline/src/AllenApplication.h index 4c0f6c3bb95fdfefb85f2f6e36844cecf567a303..dd0d68e4701015d51b3e474d823149dbc4f5e20c 100644 --- a/AllenOnline/src/AllenApplication.h +++ b/AllenOnline/src/AllenApplication.h @@ -66,7 +66,7 @@ public: bool initMPI(); // Updater - void update( gsl::span odin_data ) override; + void update( std::span odin_data ) override; void registerConsumer( std::string const& id, std::unique_ptr c ) override; diff --git a/AllenOnline/src/MBMOutput.cpp b/AllenOnline/src/MBMOutput.cpp old mode 100755 new mode 100644 index 579b5abc5738d978ba231df2e4cf3e4d3c776dfd..aa943d3f9dae0fcc85af53464154c0b6fdbb39eb --- a/AllenOnline/src/MBMOutput.cpp +++ b/AllenOnline/src/MBMOutput.cpp @@ -38,7 +38,7 @@ namespace Allen { StatusCode start() override; protected: - gsl::span buffer( size_t thread_id, size_t buffer_size, size_t n_events ) override; + std::span buffer( size_t thread_id, size_t buffer_size, size_t n_events ) override; bool write_buffer( size_t thread_id ) override; @@ -49,7 +49,7 @@ namespace Allen { private: struct MBMSlot { BMID id = MBM_INV_DESC; - gsl::span buffer; + std::span buffer; size_t n_events = 0; }; @@ -94,7 +94,7 @@ Allen::MBMOutput::MBMOutput( std::string name, ISvcLocator* loc ) : Service{name int Allen::MBMOutput::spaceCallback( void* /* param */ ) { return MBM_NORMAL; } -gsl::span Allen::MBMOutput::buffer( size_t thread_id, size_t buffer_size, size_t n_events ) { +std::span Allen::MBMOutput::buffer( size_t thread_id, size_t buffer_size, size_t n_events ) { if ( m_cancelled ) { return {}; } auto& slot = m_buffers[thread_id]; @@ -187,7 +187,7 @@ StatusCode Allen::MBMOutput::start() { } else { bmID = mbm_connect( m_buffers[0].id, m_processName.c_str(), m_partitionID ); } - m_buffers.emplace_back( MBMSlot{bmID, gsl::span{}, 0u} ); + m_buffers.emplace_back( MBMSlot{bmID, std::span{}, 0u} ); if ( bmID == MBM_INV_DESC ) { error() << "MBMOutput: failed to connect to MBM buffer for thread " << id << " " << connection() << endmsg; diff --git a/AllenOnline/src/MEPProvider.cpp b/AllenOnline/src/MEPProvider.cpp old mode 100755 new mode 100644 index 9ab678f46a18e5abefe2229641a850517399e54b..cb51931334ce27936825096fec5c442d25993b2d --- a/AllenOnline/src/MEPProvider.cpp +++ b/AllenOnline/src/MEPProvider.cpp @@ -131,7 +131,7 @@ std::tuple MEPProvider::get_slice( s if ( !m_read_error && has_transposed() && ( !timeout || ( timeout && !timed_out ) ) ) { transposed = get_transposed(); if ( transposed->n_transposed && *( transposed->n_transposed ) > 0 ) { - odin_span = gsl::span{m_odins[transposed->slice_index]}; + odin_span = std::span{m_odins[transposed->slice_index]}; } } } @@ -227,7 +227,7 @@ void MEPProvider::slice_free( size_t slice_index ) { } } -void MEPProvider::event_sizes( size_t const slice_index, gsl::span const selected_events, +void MEPProvider::event_sizes( size_t const slice_index, std::span const selected_events, std::vector& sizes ) const { int i_buffer = 0; size_t interval_start = 0, interval_end = 0; @@ -243,7 +243,7 @@ void MEPProvider::event_sizes( size_t const slice_index, gsl::span buffer ) const { +void MEPProvider::copy_banks( size_t const slice_index, unsigned int const event, std::span buffer ) const { auto [i_buffer, interval_start, interval_end] = m_slice_to_buffer[slice_index]; const auto mep_event = interval_start + event; @@ -1228,7 +1228,7 @@ void MEPProvider::mpi_read() { break; } - slice.mep_data = gsl::span{contents, static_cast( slice.slice_size )}; + slice.mep_data = std::span{contents, static_cast( slice.slice_size )}; } // Number of full-size (MPI::mdf_chunk_size) messages @@ -1264,7 +1264,7 @@ void MEPProvider::mpi_read() { MPI_Waitall( n_sends, requests.data(), MPI_STATUSES_IGNORE ); slice.mep = reinterpret_cast( contents ); - slice.mep_data = gsl::span{contents, static_cast( mep_size )}; + slice.mep_data = std::span{contents, static_cast( mep_size )}; auto const* mep = slice.mep; auto const* mfp = mep->at( 0 ); diff --git a/AllenOnline/src/MEPProvider.h b/AllenOnline/src/MEPProvider.h index e127dc4da6a4a2717acbe9bfb80330a052df5448..5bf58655b01029f9e0501524d58b9bd54fb59d52 100644 --- a/AllenOnline/src/MEPProvider.h +++ b/AllenOnline/src/MEPProvider.h @@ -142,10 +142,10 @@ public: bool release_buffers() override; - void event_sizes( size_t const slice_index, gsl::span const selected_events, + void event_sizes( size_t const slice_index, std::span const selected_events, std::vector& sizes ) const override; - void copy_banks( size_t const slice_index, unsigned int const event, gsl::span buffer ) const override; + void copy_banks( size_t const slice_index, unsigned int const event, std::span buffer ) const override; StatusCode initialize() override; diff --git a/AllenOnline/src/ReadMEP.cpp b/AllenOnline/src/ReadMEP.cpp index da7334ce5ba16855a4330842c59e580cef6545c5..fb276d2ab6e3af7db767fd5578124bc341b84efa 100644 --- a/AllenOnline/src/ReadMEP.cpp +++ b/AllenOnline/src/ReadMEP.cpp @@ -10,10 +10,9 @@ #include #include #include +#include #include -#include - #include #include #include @@ -30,7 +29,7 @@ * * @return (eof, success, mep_header, span of mep data) */ -std::tuple> +std::tuple> MEP::read_mep( LHCb::StreamDescriptor::Access& input, std::vector& buffer, MsgStream& out_stream ) { // Allocate space for the first few words of the MEP header buffer.resize( sizeof( EB::MEP_header ) ); diff --git a/AllenOnline/src/TransposeMEP.cpp b/AllenOnline/src/TransposeMEP.cpp index cc65b14f97ecccee04ca46b242d7302819c2988d..054fdd304613093ec5faa80338dd34546df38182 100644 --- a/AllenOnline/src/TransposeMEP.cpp +++ b/AllenOnline/src/TransposeMEP.cpp @@ -12,7 +12,7 @@ namespace { template - T* event_entries( gsl::span offsets, unsigned const event ) { + T* event_entries( std::span offsets, unsigned const event ) { return reinterpret_cast( &offsets[0] ) + offsets[event]; } } // namespace diff --git a/cmake/MooreOnlineDependencies.cmake b/cmake/MooreOnlineDependencies.cmake index 6406337cd518f26b8ef1601adfc18ff96e697121..bf0011f2ffa476b3e36a0a6c558f81f0af02e88a 100644 --- a/cmake/MooreOnlineDependencies.cmake +++ b/cmake/MooreOnlineDependencies.cmake @@ -34,7 +34,6 @@ pkg_check_modules(sodium libsodium REQUIRED IMPORTED_TARGET) if(WITH_MooreOnline_PRIVATE_DEPENDENCIES) find_package(Python REQUIRED Interpreter) find_package(MPI QUIET COMPONENTS C CXX) - find_package(cppgsl REQUIRED) find_package(Boost REQUIRED program_options) pkg_check_modules(hwloc QUIET IMPORTED_TARGET hwloc)