diff --git a/Online/FarmConfig/job/EBRdrAllen.sh b/Online/FarmConfig/job/EBRdrAllen.sh new file mode 100644 index 0000000000000000000000000000000000000000..10d8afd7dba4c9123ee4f5682fdb852156c76960 --- /dev/null +++ b/Online/FarmConfig/job/EBRdrAllen.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# ========================================================================= +# +# Default script to start the buffer manager on the HLT farm worker node +# +# Author M.Frank +# Version: 1.0 +# Date: 05/03/2021 +# +# ========================================================================= +# +if [[ "$UTGID" == *"${TASK_TYPE}_0"* ]]; then + export MBM_OUTPUT_BUFFER=Events_0; +elif [[ "$UTGID" == *"${TASK_TYPE}_1"* ]]; then + export MBM_OUTPUT_BUFFER=Events_1; +elif [[ "$UTGID" == *"${TASK_TYPE}_2"* ]]; then + export MBM_OUTPUT_BUFFER=Events_0; +elif [[ "$UTGID" == *"${TASK_TYPE}_3"* ]]; then + export MBM_OUTPUT_BUFFER=Events_1; +elif [[ "$UTGID" == *"${TASK_TYPE}_4"* ]]; then + export MBM_OUTPUT_BUFFER=Events_0; +else + export MBM_OUTPUT_BUFFER=Events_1; +fi; +export RUN_NUMBER_SERVICE=${PARTITION}/RunInfo/RunNumber; +# +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 32ada60867947e0196adb3e67b41ebe8979784a6..af9b99e183ff933571cc511a8bd7141ad55eba27 100755 --- a/Online/FarmConfig/job/EBStorage.sh +++ b/Online/FarmConfig/job/EBStorage.sh @@ -9,4 +9,6 @@ # # ========================================================================= # -execute `dataflow_task Class2` -opts=${STATIC_OPTS}/${TASK_TYPE}.opts ${AUTO_STARTUP} ${DEBUG_STARTUP}; +enable_testing; +# +execute `dataflow_task Class12` -opts=${STATIC_OPTS}/${TASK_TYPE}.opts ${AUTO_STARTUP} ${DEBUG_STARTUP}; diff --git a/Online/FarmConfig/job/runTask.sh b/Online/FarmConfig/job/runTask.sh index 968e03fba248ede78737dd8387d1c752f2647851..0e28c3ea310ced7bb6ad2d52962e61b2dc46099f 100755 --- a/Online/FarmConfig/job/runTask.sh +++ b/Online/FarmConfig/job/runTask.sh @@ -48,6 +48,13 @@ export MONITORING_DISTBOX=MON0101; # echo "[ERROR] INFO_OPTIONS=${INFO_OPTIONS}"; # PRINT_COMMAND_LINE=; ####YES; +enable_testing() +{ + export PATH=/group/online/dataflow/cmtuser/ONLINE_TEST/InstallArea/${CMTCONFIG}/bin:${PATH}; + export PYTHON_PATH=/group/online/dataflow/cmtuser/ONLINE_TEST/InstallArea/${CMTCONFIG}/bin:${PYTHON_PATH}; + export LD_LIBRARY_PATH=/group/online/dataflow/cmtuser/ONLINE_TEST/InstallArea/${CMTCONFIG}/lib:${LD_LIBRARY_PATH}; +} +# execute() { if test -n "${PRINT_COMMAND_LINE}"; then diff --git a/Online/FarmConfig/options/EBRdrAllen.opts b/Online/FarmConfig/options/EBRdrAllen.opts new file mode 100644 index 0000000000000000000000000000000000000000..095ae7ababf1c632079a53c1c340fa0c9463fc03 --- /dev/null +++ b/Online/FarmConfig/options/EBRdrAllen.opts @@ -0,0 +1,82 @@ +#pragma print off +#include "$INFO_OPTIONS" +#include "$FARMCONFIGROOT/options/Logging.opts" +#include "$FARMCONFIGROOT/options/Monitoring.opts" +Monitoring.CounterUpdateInterval = 3; +// +Manager.Services = {"Dataflow_MBMClient/MEPManager", + "Dataflow_DiskReader/Reader", +// "Dataflow_StorageReader/Reader", + "Dataflow_RunableWrapper/Wrap", + "Dataflow_UI/UI" + }; +Manager.Runable = "Wrap"; +Wrap.Callable = "Reader"; +Task.HavePause = true; +// +Reader.Buffer = "$MBM_OUTPUT_BUFFER"; +Reader.BrokenHosts = ""; +// +// Markus' data: +Reader.Directories = {"/group/online/dataflow/cmtuser/data/mdf" + ,"/group/online/dataflow/cmtuser/data/mep" + ,"/group/online/dataflow/cmtuser/data/tae" + }; +Reader.FilePrefix = "00"; +// +// June 2021 FEST data: Careful: crashes monitoring/HLT2 software +Reader.Directories = { "/daqarea1/fest/mep"}; +Reader.FilePrefix = "00135282"; +// +// October 2021 FEST data: +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.Directories = { "/daqarea1/fest/202110/mep/30000000_odin_v7" }; +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; +Reader.SaveRest = false; +Reader.PauseSleep = 2; // Optional wait time until 'Output' event queue is empty +Reader.InitialSleep = 0; +Reader.MaxPauseWait = 1; +Reader.GoService = ""; +Reader.Rescan = 1; +Reader.RequireConsumers = 0; +Reader.MMapFiles = 0; +Reader.ReuseFile = 0; +Reader.PackingFactor = 2000; +Reader.AllocationSizekB = 20000; +Reader.PatchOdin = 5000000; +Reader.RunNumberService = "$RUN_NUMBER_SERVICE"; +// +MEPManager.PartitionBuffers = true; +MEPManager.PartitionName = @OnlineEnv.PartitionName; +MEPManager.PartitionID = @OnlineEnv.PartitionID; +MEPManager.Buffers = {"$MBM_OUTPUT_BUFFER"}; + +/* +Reader.PartitionName = "LHCb"; +Reader.Directories = {""}; +Reader.FilePrefix = "file:/daqarea1/objects/nfs_data/${PARTITION}/HLT1/${RUN1000}/${RUN}/Run_"; +Reader.AllowedRuns = {"72908"}; +Reader.DataType = "posix"; +Reader.Server = "XXEB09.lbdaq.cern.ch:8000"; + + +Reader.DataType = "network"; +Reader.Server = "devbbdb01.lbdaq.cern.ch:4242"; +Reader.FDBVersion = 1; +Reader.PartitionName = "FEST"; +Reader.FilePrefix = "${PARTITION}/${RUN}/"; +Reader.AllowedRuns = { "219677","219679","219680","219681" }; +*/ diff --git a/Online/FarmConfig/options/EBReader.opts b/Online/FarmConfig/options/EBReader.opts index 0662ef49a6a3b86ec956b8c2cc52ab82b30cf8af..ceaf67bae610c9ec38314669cc58694eef68214f 100644 --- a/Online/FarmConfig/options/EBReader.opts +++ b/Online/FarmConfig/options/EBReader.opts @@ -38,8 +38,8 @@ Reader.Directories = { "/daqarea1/fest/202110/mep/sourceID-with-upper-f Reader.FilePrefix = "00146082_0000"; // // Signal: -Reader.Directories = { "/daqarea1/fest/202110/mep/sourceID-with-upper-five-bits/Retina_only/10000000" }; -Reader.FilePrefix = "00146080_0000"; +//Reader.Directories = { "/daqarea1/fest/202110/mep/sourceID-with-upper-five-bits/Retina_only/10000000" }; +//Reader.FilePrefix = "00146080_0000"; // Reader.AllowedRuns = {"*"}; Reader.MuDelay = 0; diff --git a/Online/GauchoAppl/src/AdderSys.cpp b/Online/GauchoAppl/src/AdderSys.cpp index a9053bb7ad58239bbd1f89cbdae45a34686725bf..8b0f26e2c9235e4f6981f814a13613265726c25a 100644 --- a/Online/GauchoAppl/src/AdderSys.cpp +++ b/Online/GauchoAppl/src/AdderSys.cpp @@ -289,7 +289,8 @@ void AdderSys::stop() { } std::shared_ptr<DimServerDns> AdderSys::getDNS(std::string &dns) { - std::string nam = /* "MON_"+ */ RTL::processName(); + int dns_id = ::dis_add_dns(dns.c_str(), ::dim_get_dns_port()); + std::string nam = dns_id == 0 ? RTL::processName() : "MON_"+ RTL::processName(); return this->getDNS(dns, nam); } @@ -298,7 +299,9 @@ std::shared_ptr<DimServerDns> AdderSys::getDNS(std::string &dns, std::string &na if (it != this->dnsMap.end()) return it->second; - std::string nam = /* "MON_" + */ RTL::processName(); + int dns_id = ::dis_add_dns(dns.c_str(), ::dim_get_dns_port()); + //std::string nam = "MON_" + RTL::processName(); + std::string nam = dns_id == 0 ? RTL::processName() : "MON_"+ RTL::processName(); if (this->servers.find(nam) != this->servers.end()) { nam = name; } diff --git a/Online/GaudiOnline/src/OnlineApplication.cpp b/Online/GaudiOnline/src/OnlineApplication.cpp index d9627ced90b4b4b0ecfc47afeed038dbb6ca963c..6659919cff4aa21850394ef117a6b8e23f34830f 100644 --- a/Online/GaudiOnline/src/OnlineApplication.cpp +++ b/Online/GaudiOnline/src/OnlineApplication.cpp @@ -339,9 +339,7 @@ int OnlineApplication::connectDIM(DimCommand* cmd) { m_service = new DimService(svcname.c_str(),(char*)m_stateName.c_str()); svcname = m_name+"/fsm_status"; m_fsmService = new DimService(svcname.c_str(),(char*)"L:2;I:1;C",&m_monitor,sizeof(m_monitor)); - std::string dns = ::getenv("DIM_DNS_NODE") ? ::getenv("DIM_DNS_NODE") : ""; - int dns_id = ::dis_add_dns(dns.c_str(), ::dim_get_dns_port()); - ::dis_start_serving_dns(dns_id, m_name.c_str()); + DimServer::start(m_name.c_str()); } return 1; } diff --git a/Online/dim/src/dic.c b/Online/dim/src/dic.c index 09a21552b802e5fee72843f469fb2529c201e2ad..22cff1df217d834772fda8013d6eacddcd7465e6 100755 --- a/Online/dim/src/dic.c +++ b/Online/dim/src/dic.c @@ -1587,6 +1587,8 @@ int request_dns_single_info( DIC_SERVICE *servp ) DIC_DNS_CONN *dnsp; extern int open_dns(); + if (servp->serv_id == 0) + return 0; dnsp = dic_find_dns(servp->dnsid); if (dnsp->dns_dic_conn_id <= 0) { diff --git a/Online/dim/src/dis.c b/Online/dim/src/dis.c index 84d56f59997b1276f6c96c249d12c7b7749fae7d..9ec873bb3870ba5f70e5e2e45daa272910cf471d 100755 --- a/Online/dim/src/dis.c +++ b/Online/dim/src/dis.c @@ -38,6 +38,7 @@ typedef struct dis_dns_ent { struct dis_dns_ent *prev; dim_long dnsid; char task_name[MAX_NAME]; + int task_name_modified; TIMR_ENT *dns_timr_ent; DIS_DNS_PACKET dis_dns_packet; int dis_n_services; @@ -1138,6 +1139,8 @@ static DIS_DNS_CONN *create_dns(dim_long dnsid) dnsp->dis_dns_packet.src_type = 0; dnsp->dis_dns_packet.node_name[0] = 0; dnsp->updating_service_list = 0; + dnsp->task_name[0] = 0; + dnsp->task_name_modified = 0; dnsp->dnsid = dnsid; dll_insert_queue( (DLL *) DNS_head, (DLL *) dnsp ); return dnsp; @@ -1210,12 +1213,27 @@ int dis_start_serving_dns(dim_long dnsid, char *task/*, int *idlist*/) } else if(!(dnsp = dis_find_dns(dnsid))) { +/* if((n = dis_find_dns_task(dnsid, task)) > 0) { sprintf(task_name, "%s-%i", task, n); } + printf("Found? %s, %xl, %s\n", task, dnsid, task_name); +*/ dnsp = create_dns(dnsid); } + if (dnsid != 0) + { + if (dnsp->task_name[0] == 0) + { + if ((n = dis_find_dns_task(dnsid, task)) > 0) + { + sprintf(task_name, "%s-%i", task, n); + dnsp->task_name_modified = n; + } +// printf("Found? %s, %xl, %s\n", task, dnsid, task_name); + } + } dnsp->serving = 1; Serving = 1; if(Dis_first_time) @@ -3490,13 +3508,21 @@ DIS_DNS_CONN *dis_find_dns(dim_long dnsid) int dis_find_dns_task(dim_long dnsid, char *task) { DIS_DNS_CONN *dnsp; + char aux_task[MAX_NAME], *ptr; int n = 0; if(dnsid){} dnsp = (DIS_DNS_CONN *) DNS_head; while ( (dnsp = (DIS_DNS_CONN *) dll_get_next( (DLL *) DNS_head, (DLL *) dnsp))) { - if(!strcmp(dnsp->task_name, task)) + strcpy(aux_task, dnsp->task_name); + if (dnsp->task_name_modified) + { + ptr = strrchr(aux_task, '-'); + if (ptr) + *ptr = '\0'; + } + if(!strcmp(aux_task, task)) n++; } return n; diff --git a/Online/dim/src/open_dns.c b/Online/dim/src/open_dns.c index 60b37bae86e2d41c51d032ec6806ab119593a40f..7831c3b791f2eeb06c978e76854b4a9f2cbd7f69 100755 --- a/Online/dim/src/open_dns.c +++ b/Online/dim/src/open_dns.c @@ -220,18 +220,27 @@ DNS_CONN *find_dns(char *node_name, int port_number, SRC_TYPES src_type) { DNS_CONN *connp; int port; + char addr1[64], addr2[64]; + int ret; + extern int get_node_ipaddr(); port = port_number; if (port == 0) port = DNS_PORT; connp = DNS_conn_head; + ret = get_node_ipaddr(node_name, addr1); + if(!ret) + return (DNS_CONN *)0; while( (connp = (DNS_CONN *)dll_get_next( (DLL *) DNS_conn_head, (DLL*) connp)) ) { if(connp->src_type == src_type) { - if((!strcmp(connp->node_name, node_name)) && + get_node_ipaddr(connp->node_name, addr2); + //printf("Comparing %s %s - %s %s\n", node_name, addr1, connp->node_name, addr2); +// if((!strcmp(connp->node_name, node_name)) && + if((!strcmp(addr1, addr2)) && (connp->port_number == port)) return connp; } diff --git a/Online/dim/src/utilities.c b/Online/dim/src/utilities.c index 99c705b4c609def50b43659a22445495c42e0c73..2e89cd7f64e8c7a21e55bb268e765ac14b393cda 100755 --- a/Online/dim/src/utilities.c +++ b/Online/dim/src/utilities.c @@ -158,6 +158,47 @@ char *ptr; #endif } +get_node_ipaddr(char *node_name, char *node_address) +{ +#ifndef VxWorks + struct hostent *host; +#endif + unsigned char node_addr[4]; + char *ptr; + int ret = 0; + +#ifdef WIN32 + init_sock(); +#endif +#ifndef VxWorks + if ((host = (struct hostent *)gethostbyname(node_name)) == (struct hostent *)0) + { + node_addr[0] = 0; + node_addr[1] = 0; + node_addr[2] = 0; + node_addr[3] = 0; + ret = 0; + } + else + { + ptr = (char *)host->h_addr; + node_addr[0] = *ptr++; + node_addr[1] = *ptr++; + node_addr[2] = *ptr++; + node_addr[3] = *ptr++; + ret = 1; + } +#else + node_addr[0] = 0; + node_addr[1] = 0; + node_addr[2] = 0; + node_addr[3] = 0; + ret = 0; +#endif + sprintf(node_address, "%d.%d.%d.%d", node_addr[0], node_addr[1], node_addr[2], node_addr[3]); + return ret; +} + void dim_print_date_time() { time_t t;