diff --git a/CMakeLists.txt b/CMakeLists.txt index 118eb4d99446df54746f814fa82db313a184bc71..d5bcd247bf63012b3684464fcf46872f9c9d5ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,7 @@ lhcb_add_subdirectories( Online/DataflowExample Online/Gaucho Online/DefHLTUtils -# Online/EventBuilding + Online/EventBuilding Online/EventData Online/FarmConfig Online/GaudiOnline @@ -87,6 +87,7 @@ lhcb_add_subdirectories( Online/Presenter Online/PresenterDoc Online/TestBeam +# Online/YAML ) gaudi_install(CMAKE diff --git a/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_01_save.qmt b/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_01_save.qmt index c1d41069f0c030a1f8690aabb9dff0941b7ffb92..e778362023c69b2885dc90a35b95b21e0680360f 100644 --- a/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_01_save.qmt +++ b/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_01_save.qmt @@ -13,7 +13,7 @@ <text>i686.*</text> <text>win.*</text> <text>slc4_ia32.*</text> - <text>x86_64-centos7-gcc.*san</text> + <text>x86_64_v2-centos7-gcc.*san</text> </set></argument> <!-- <argument name="reference"><text>../refs/chkpt_01_save.ref</text></argument> diff --git a/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_02_restore.qmt b/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_02_restore.qmt index aa3e7b0a5e8748145f36cb539dbb9775ac083f1c..fd92ba7629338bcf15f4c8de135f37568d6be9c6 100644 --- a/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_02_restore.qmt +++ b/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_02_restore.qmt @@ -14,7 +14,7 @@ <text>i686.*</text> <text>win.*</text> <text>slc4_ia32.*</text> - <text>x86_64-centos7-gcc.*san</text> + <text>x86_64_v2-centos7-gcc.*san</text> </set></argument> <!-- <argument name="reference"><text>../refs/chkpt_02_restore.ref</text></argument> diff --git a/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_03_restore.qmt b/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_03_restore.qmt index 218a758e57a789fa5d3eeebd95de0bf74e675628..9a00543460ad79e505640f2de586d6332d39d810 100644 --- a/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_03_restore.qmt +++ b/Online/Checkpointing/tests/qmtest/checkpointing.qms/chkpt_03_restore.qmt @@ -15,7 +15,7 @@ <text>i686.*</text> <text>win.*</text> <text>slc4_ia32.*</text> - <text>x86_64-centos7-gcc.*san</text> + <text>x86_64_v2-centos7-gcc.*san</text> </set></argument> <!-- <argument name="reference"><text>../refs/chkpt_03_restore.ref</text></argument> diff --git a/Online/Dataflow/include/Dataflow/MBMClient.h b/Online/Dataflow/include/Dataflow/MBMClient.h index 303a664482f080909cdfb89a1f838bac9aa040f0..966b9abf3129302a61442b861fbfea8c3e61b0e7 100755 --- a/Online/Dataflow/include/Dataflow/MBMClient.h +++ b/Online/Dataflow/include/Dataflow/MBMClient.h @@ -57,6 +57,8 @@ namespace Online { std::string m_partitionName {}; /// Property: Allows to choose if the buffers should be connected on "initialize" or "start" std::string m_connectWhen {}; + /// Property: Allows to choose if the buffers should be disconnected on "finalize" or "stop" + std::string m_disconnectWhen {}; /// Property: Buffer manager communication type (FIFO or ASIO) std::string m_communication {}; /// Property: Container of buffer names to connect on initialize diff --git a/Online/Dataflow/src/Storage/StorageWriter.cpp b/Online/Dataflow/src/Storage/StorageWriter.cpp index bb9258a3c65ef254752850e018dfb09d616d2dbe..62a38a663fbae7df5cb4f2946314f77eddfce6a5 100644 --- a/Online/Dataflow/src/Storage/StorageWriter.cpp +++ b/Online/Dataflow/src/Storage/StorageWriter.cpp @@ -477,7 +477,12 @@ int StorageWriter::save_mdf_buffer(Buffer& buff, const uint8_t* start, int64_t l /// Data processing overload: Write the data record to disk int StorageWriter::execute(const Context::EventData& event) { int status = DF_SUCCESS; - if ( this->m_enableWriting ) { + /// Extend idle time if there are still events coming + if ( this->m_cancelled > 0 ) { + this->m_cancelled = ::time(0); + ++this->m_eventsDROP; + } + else if ( this->m_enableWriting ) { try { size_t len = event.length; auto* start = (uint8_t*)event.data; @@ -491,7 +496,9 @@ int StorageWriter::execute(const Context::EventData& event) { } /// Extend idle time if there are still events coming - if ( this->m_cancelled > 0 ) this->m_cancelled = ::time(0); + if ( this->m_cancelled > 0 ) { + this->m_cancelled = ::time(0); + } /// Auto detect data type: first check for PCIE40 MEP format auto* mep_hdr = (pcie40::mep_header_t*)start; diff --git a/Online/Dataflow/src/framework/MBMClient.cpp b/Online/Dataflow/src/framework/MBMClient.cpp index 40921d7aa96bb6af8f52d5ac666e04638ab16e60..f5559f880d64aa25ea90b9fa72361cec390f7753 100755 --- a/Online/Dataflow/src/framework/MBMClient.cpp +++ b/Online/Dataflow/src/framework/MBMClient.cpp @@ -41,6 +41,7 @@ MBMClient::MBMClient(const std::string& nam, Context& ctxt) declareProperty("PartitionName", m_partitionName = ""); declareProperty("PartitionBuffers", m_partitionBuffers = false); declareProperty("ConnectWhen", m_connectWhen = "initialize"); + declareProperty("DisconnectWhen", m_disconnectWhen = ""); declareProperty("Communication", m_communication = "FIFO"); declareProperty("EnableProcessing", m_enabled = true); declareProperty("InhibitCancel", m_inhibitCancel = false); @@ -75,13 +76,23 @@ int MBMClient::start() { /// Finalize the MBM client int MBMClient::finalize() { - if (context.mbm && m_connectWhen == "initialize") i_fini(); + if (context.mbm ) { + if ( !m_disconnectWhen.empty() ) { + i_fini(); // Do it unconditionally here if it has not been done at stop! + } + else if ( m_connectWhen == "initialize") i_fini(); + } return Component::finalize(); } /// Stop MEP manager service int MBMClient::stop() { - if (context.mbm && m_connectWhen == "start") i_fini(); + if (context.mbm ) { + if ( !m_disconnectWhen.empty() ) { + if ( m_disconnectWhen == "stop") i_fini(); + } + else if ( m_connectWhen == "start") i_fini(); + } return Component::finalize(); } diff --git a/Online/FarmConfig/job/EBReader.sh b/Online/FarmConfig/job/EBReader.sh index d16c15c62fde9694ef105589555719fa981c8ef3..10d8afd7dba4c9123ee4f5682fdb852156c76960 100644 --- a/Online/FarmConfig/job/EBReader.sh +++ b/Online/FarmConfig/job/EBReader.sh @@ -24,4 +24,4 @@ else fi; export RUN_NUMBER_SERVICE=${PARTITION}/RunInfo/RunNumber; # -execute `dataflow_task Class1` -opts=${STATIC_OPTS}/${TASK_TYPE}.opts ${AUTO_STARTUP} ${DEBUG_STARTUP}; +execute `dataflow_task Class2` -opts=${STATIC_OPTS}/${TASK_TYPE}.opts ${AUTO_STARTUP} ${DEBUG_STARTUP}; diff --git a/Online/FarmConfig/job/EBStorage.sh b/Online/FarmConfig/job/EBStorage.sh index bdf20c369289cc2ee35268b0052274161c8582da..32ada60867947e0196adb3e67b41ebe8979784a6 100755 --- a/Online/FarmConfig/job/EBStorage.sh +++ b/Online/FarmConfig/job/EBStorage.sh @@ -9,4 +9,4 @@ # # ========================================================================= # -execute `dataflow_task Class1` -opts=${STATIC_OPTS}/${TASK_TYPE}.opts ${AUTO_STARTUP} ${DEBUG_STARTUP}; +execute `dataflow_task Class2` -opts=${STATIC_OPTS}/${TASK_TYPE}.opts ${AUTO_STARTUP} ${DEBUG_STARTUP}; diff --git a/Online/FarmConfig/options/EBReader.opts b/Online/FarmConfig/options/EBReader.opts index 9f53bd4dddd99533d88dae3b50727ec003a68c50..0662ef49a6a3b86ec956b8c2cc52ab82b30cf8af 100644 --- a/Online/FarmConfig/options/EBReader.opts +++ b/Online/FarmConfig/options/EBReader.opts @@ -29,16 +29,18 @@ Reader.Directories = { "/daqarea1/fest/mep"}; Reader.FilePrefix = "00135282"; // // October 2021 FEST data: -//Reader.Directories = { "/daqarea1/fest/202110/mep/30000000" }; -//Reader.Directories = { "/daqarea1/fest/202110/mdf/30000000"}; -//Reader.Directories = { "/daqarea1/fest/202110/mep/30000000.1" }; -//Reader.FilePrefix = "00146082"; Reader.Directories = { "/daqarea1/fest/202110/mdf_hlt1/30000000"}; +Reader.Directories = { "/daqarea1/fest/202110/mdf_hlt1/10000000"}; Reader.FilePrefix = "hlt1_00146082"; // +// Min Bias: Reader.Directories = { "/daqarea1/fest/202110/mep/sourceID-with-upper-five-bits/Retina_only/30000000" }; Reader.FilePrefix = "00146082_0000"; // +// Signal: +Reader.Directories = { "/daqarea1/fest/202110/mep/sourceID-with-upper-five-bits/Retina_only/10000000" }; +Reader.FilePrefix = "00146080_0000"; +// Reader.AllowedRuns = {"*"}; Reader.MuDelay = 0; Reader.DeleteFiles = false; diff --git a/Online/FarmConfig/options/StorageWriter.opts b/Online/FarmConfig/options/StorageWriter.opts index bdb8aaecc9cfa2a684c2121f4f1bfe871988f82c..b4f215ccaecb7de65f327c54df6562464d70aa6b 100644 --- a/Online/FarmConfig/options/StorageWriter.opts +++ b/Online/FarmConfig/options/StorageWriter.opts @@ -8,8 +8,8 @@ Monitoring.CounterUpdateInterval = 5; Monitoring.DimUpdateInterval = 20; // Manager.Services = {"Dataflow_UI/UI", - "Dataflow_MBMClient/MBM", "Dataflow_MBMSelector/EventProc", + "Dataflow_MBMClient/MBM", "Dataflow_RunableWrapper/Wrap" }; Manager.Algorithms = {"Dataflow_EmptyProcessor/Empty"}; diff --git a/Online/GaudiOnline/src/OnlineApplication.cpp b/Online/GaudiOnline/src/OnlineApplication.cpp index d29149079a5184b8372f602479d3ed6b36dd652d..9619d0706f6c89503e7b255ed9ccc3c4aef6c901 100644 --- a/Online/GaudiOnline/src/OnlineApplication.cpp +++ b/Online/GaudiOnline/src/OnlineApplication.cpp @@ -138,6 +138,10 @@ namespace { m_target->enableUI(); return; } + else if ( cmd == "!state" ) { + m_target->declareStateByName(m_target->stateName()); + return; + } else if ( ::strncmp(cmd.c_str(),"incident__",10) == 0 ) { IOCSENSOR.send(m_target, Target::FIRE_INCIDENT, new std::string(cmd.c_str()+10)); return; diff --git a/Online/Storage/src/client/fdb_client.cpp b/Online/Storage/src/client/fdb_client.cpp index 6789941511fd69b2be634094c2fcd190d4215031..2e3c144d5bcc9e2a65ec3f6f15595ba1f27ffec4 100644 --- a/Online/Storage/src/client/fdb_client.cpp +++ b/Online/Storage/src/client/fdb_client.cpp @@ -18,6 +18,7 @@ // C/C++ include files #include <ctime> +#include <cstring> #include <stdexcept> using namespace std; @@ -35,7 +36,7 @@ reply_t fdb_client::get_object(const string& location, time_t& date, size_t& len if ( reply.status == reply_t::temp_redirect || reply.status == reply_t::permanent_redirect ) { reply.status = reply_t::permanent_redirect; for ( const auto& h : reply.headers ) { - if ( h.name == http::constants::location ) { + if ( ::strcasecmp(h.name.c_str(),http::constants::location) == 0 ) { uri_t u(h.value); unique_ptr<client> cl(create_client(u.host, u.port, dataTMO, this->debug)); if ( error_code_ok(cl->open(), this->debug) ) { @@ -66,7 +67,7 @@ reply_t fdb_client::delete_object(const string& location, time_t& date, size_t& if ( reply.status == reply_t::temp_redirect || reply.status == reply_t::permanent_redirect ) { reply.status = reply_t::not_found; for ( const auto& h : reply.headers ) { - if ( h.name == http::constants::location ) { + if ( ::strcasecmp(h.name.c_str(),http::constants::location) == 0 ) { uri_t u(h.value); unique_ptr<client> cl(create_client(u.host, u.port, dataTMO, this->debug)); if ( error_code_ok(cl->open(), this->debug) ) { @@ -99,7 +100,7 @@ reply_t fdb_client::next_object_get(string& prefix, time_t& date, size_t& length if ( reply.status == reply_t::temp_redirect || reply.status == reply_t::permanent_redirect ) { reply.status = reply_t::not_found; for ( const auto& h : reply.headers ) { - if ( h.name == http::constants::location ) { + if ( ::strcasecmp(h.name.c_str(),http::constants::location) == 0 ) { uri_t u(h.value); unique_ptr<client> cl(create_client(u.host, u.port, dataTMO, this->debug)); if ( error_code_ok(cl->open(), this->debug) ) { @@ -134,7 +135,7 @@ reply_t fdb_client::next_object_delete(string& prefix, time_t& date, size_t& len if ( reply.status == reply_t::temp_redirect || reply.status == reply_t::permanent_redirect ) { reply.status = reply_t::not_found; for ( const auto& h : reply.headers ) { - if ( h.name == http::constants::location ) { + if ( ::strcasecmp(h.name.c_str(),http::constants::location) == 0 ) { uri_t u(h.value); unique_ptr<client> cl(create_client(u.host, u.port, dataTMO, this->debug)); if ( error_code_ok(cl->open(), this->debug) ) { @@ -186,7 +187,7 @@ reply_t fdb_client::save_object_record(const string& location, string& url, size if ( reply.status == reply_t::temp_redirect || reply.status == reply_t::permanent_redirect ) { reply.status = reply_t::permanent_redirect; for ( const auto& h : reply.headers ) { - if ( h.name == http::constants::location ) { + if ( ::strcasecmp(h.name.c_str(),http::constants::location) == 0 ) { url = h.value; return reply; }