From: Joern Adamczewski-Musch Date: Fri, 11 Dec 2020 13:55:46 +0000 (+0100) Subject: changed EB setup for 5 build server machines. Modify operator gui for this. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=240e030d52e7ed45a304533690096ec418bc8d77;p=hadesdaq.git changed EB setup for 5 build server machines. Modify operator gui for this. Add data sources for fwdet-rpc and inner-tof. any other changes since last commit. --- diff --git a/control/gui/eb/73_Set_4_EB b/control/gui/eb/74_Set_5_EB similarity index 63% rename from control/gui/eb/73_Set_4_EB rename to control/gui/eb/74_Set_5_EB index bdad11f..2ecf860 100755 --- a/control/gui/eb/73_Set_4_EB +++ b/control/gui/eb/74_Set_5_EB @@ -2,19 +2,19 @@ # notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & -export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the EBs with 4 builder nodes") +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the EBs with 5 builder nodes") if [ $myvar == "256" ]; then exit; fi -$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being started with 4 builder nodes." "EB" & +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being started with 5 builder nodes." "EB" & xterm -geometry 80x24 -bg orange -fg black -e bash -c ' ssh -X hadaq@lxhadesdaqp " - echo "Starting Eventbuilders with 4 BNET builder nodes" + echo "Starting Eventbuilders with 5 BNET builder nodes" cd ~/trbsoft/hadesdaq/evtbuild/ - ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 4 + ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 5 sleep 2 " ' -$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 4 BNET builder nodes" "EB" & +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 5 BNET builder nodes" "EB" & diff --git a/control/gui/eb/75_Set_8_EB b/control/gui/eb/77_Set_10_EB similarity index 63% rename from control/gui/eb/75_Set_8_EB rename to control/gui/eb/77_Set_10_EB index 8176a47..936af40 100755 --- a/control/gui/eb/75_Set_8_EB +++ b/control/gui/eb/77_Set_10_EB @@ -2,19 +2,19 @@ # notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & -export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the EBs with 8 builder nodes") +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the EBs with 10 builder nodes") if [ $myvar == "256" ]; then exit; fi -$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being started with 8 builder nodes." "EB" & +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being started with 10 builder nodes." "EB" & xterm -geometry 80x24 -bg orange -fg black -e bash -c ' ssh -X hadaq@lxhadesdaqp " - echo "Starting Eventbuilders with 8 BNET builder nodes" + echo "Starting Eventbuilders with 10 BNET builder nodes" cd ~/trbsoft/hadesdaq/evtbuild/ - ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 8 + ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 10 sleep 2 " ' -$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 8 BNET builder nodes" "EB" & +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 10 BNET builder nodes" "EB" & diff --git a/control/gui/eb/76_Set_12_EB b/control/gui/eb/78_Set_15_EB similarity index 71% rename from control/gui/eb/76_Set_12_EB rename to control/gui/eb/78_Set_15_EB index c3de4cf..7063d43 100755 --- a/control/gui/eb/76_Set_12_EB +++ b/control/gui/eb/78_Set_15_EB @@ -2,20 +2,20 @@ # notifyall.sh "DAQ" " Eventbuilders are being restarted." "EB" & -export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the EBs with 12 builder nodes") +export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the EBs with 15 builder nodes") if [ $myvar == "256" ]; then exit; fi -$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being started with 12 builder nodes." "EB" & +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders are being started with 15 builder nodes." "EB" & xterm -geometry 80x24 -bg orange -fg black -e bash -c ' ssh -X hadaq@lxhadesdaqp " echo "Starting Eventbuilders with 12 BNET builder nodes" cd ~/trbsoft/hadesdaq/evtbuild/ - ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 12 + ./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 15 sleep 2 " ' -$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 12 BNET builder nodes" "EB" & +$HOME/trbsoft/hadesdaq/utils/notifyall.sh "DAQ" " Eventbuilders have been restarted using 15 BNET builder nodes" "EB" & diff --git a/evtbuild/eb_bnet_fsd_newservers.conf b/evtbuild/eb_bnet_fsd_newservers.conf index d9b3f36..923344e 100644 --- a/evtbuild/eb_bnet_fsd_newservers.conf +++ b/evtbuild/eb_bnet_fsd_newservers.conf @@ -75,7 +75,7 @@ BNETINP: 1 1 1 1 1 #BNETBLD: 3 3 3 0 ## below enough ltsm connections? default with new servers -BNETBLD: 3 3 3 3 +BNETBLD: 3 3 3 3 3 # JAM - do not modify this anymore, please use control button "Restart BNET 1 Builder" instead #BNETBLD: 1 0 0 0 @@ -145,8 +145,8 @@ LTSM: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 # LTSM default options for all EB processes #LTSM_PATH: /lustre/hades/raw/jun19test/default/tsm -LTSM_PATH: /lustre/hades/raw/sep20test -#LTSM_PATH: /hebetest/hades/raw/jun19test/ +LTSM_PATH: /lustre/hades/raw/feb21 +#LTSM_PATH: /hebetest/hades/raw/feb21/ #LTSM_Server: lxltsm01-tsm-server LTSM_Server: lxltsm01 @@ -161,17 +161,19 @@ LTSM_Passwd: wDhgcvFF7 LTSM_Filesystem: /lustre # following is for first FSD test setup JAM 4-2020: -#LTSM_Node: hadestest -#LTSM_Passwd: hadestest -#LTSM_Filesystem: /hebetest +# # LTSM_Node: hadestest +# # LTSM_Passwd: hadestest +# # LTSM_Filesystem: /lustre LTSM_USEFSD: 0 -# we need at least 4 entries here (number of eventbuilder servers) +# we need at least 5 entries here (number of eventbuilder servers) #LTSM_FSD_SERVERS: lxfsd01 lxfsd02-eth lxfsd03 lxfsd01 -LTSM_FSD_SERVERS: lxfsd01 lxfsd03 lxfsd01 lxfsd03 -LTSM_FSD_PORT: 7625 7625 7625 7625 +LTSM_FSD_SERVERS: lxfsd04-eth lxfsd07-eth lxfsd04-eth lxfsd07-eth lxfsd04-eth +#LTSM_FSD_SERVERS: lxfsd01-eth lxfsd02 lxfsd03-eth lxfsd01-eth lxfsd02 +#LTSM_FSD_SERVERS: lxfsd01-eth lxfsd03-eth lxfsd01-eth lxfsd03-eth lxfsd01-eth +LTSM_FSD_PORT: 7625 7625 7625 7625 7625 diff --git a/evtbuild/start_eb_gbe.sh b/evtbuild/start_eb_gbe.sh index 1b3e9d1..c45cfe6 100755 --- a/evtbuild/start_eb_gbe.sh +++ b/evtbuild/start_eb_gbe.sh @@ -1 +1 @@ -./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 4; +./start_eb_gbe.pl -e restart -n 1-16 -d on -p te -b 1; diff --git a/evtbuild/start_eb_gbe_newservers_fsd.pl b/evtbuild/start_eb_gbe_newservers_fsd.pl index 1c54483..dfe3ca0 100755 --- a/evtbuild/start_eb_gbe_newservers_fsd.pl +++ b/evtbuild/start_eb_gbe_newservers_fsd.pl @@ -38,12 +38,12 @@ GetOptions ('h|help' => \$opt_help, 'r|rfio=s' => \$opt_rfio, 'p|prefix=s' => \$opt_prefix, 'o|online=s' => \$opt_online, - 'b|bnet=s' => \$opt_bnet, + 'b|bnet=s' => \$opt_bnet, 'v|verb' => \$opt_verb); -if( $opt_help ) { - &help(); - exit(0); +if ( $opt_help ) { + &help(); + exit(0); } #- List of EBs provided via command line options @@ -59,7 +59,7 @@ my $log_path = "/tmp/log"; my %temp_args; my $temp_args_href = \%temp_args; read_config $opt_ebconf => %$temp_args_href; -#rint Dumper $temp_args_href; +#print Dumper $temp_args_href; #exit; @@ -81,22 +81,22 @@ my @bnetservers = ("192.168.100.8","192.168.100.9","192.168.100.10","192.168.105 # '192.168.105.12' => '140.181.83.168', # '192.168.105.13' => '140.181.83.176' # ); - - - my %IP_GSI_lookup = ( - '192.168.100.15' => 'lxhadeb05', - '192.168.100.12' => 'lxhadeb02', - '192.168.100.13' => 'lxhadeb03', - '192.168.100.14' => 'lxhadeb04', - '192.168.100.8' => 'lxhadeb08', - '192.168.100.9' => 'lxhadeb09', - '192.168.100.10' => 'lxhadeb10', - '192.168.105.11' => 'lxhadeb11', - '192.168.105.12' => 'lxhadeb12', - '192.168.105.13' => 'lxhadeb13' - ); - - + + +my %IP_GSI_lookup = ( + '192.168.100.15' => 'lxhadeb05', + '192.168.100.12' => 'lxhadeb02', + '192.168.100.13' => 'lxhadeb03', + '192.168.100.14' => 'lxhadeb04', + '192.168.100.8' => 'lxhadeb08', + '192.168.100.9' => 'lxhadeb09', + '192.168.100.10' => 'lxhadeb10', + '192.168.105.11' => 'lxhadeb11', + '192.168.105.12' => 'lxhadeb12', + '192.168.105.13' => 'lxhadeb13' + ); + + my $IP_GSI_href = \%IP_GSI_lookup; @@ -110,35 +110,30 @@ my $EB_Args_href = \%EB_Args; &getEBArgs( $EB_Args_href ); -if($opt_ioc eq "start"){ - &killIOC(); - &startIOC(); -} -elsif($opt_ioc eq "stop"){ - &killIOC(); -} -elsif($opt_eb eq "start"){ - &writeArgs2file(); - &startEvtBuilders(); -} -elsif($opt_eb eq "stop"){ - &stopEvtBuilders(); -} -elsif($opt_eb eq "restart"){ - &stopEvtBuilders(); - sleep 1; - &writeArgs2file(); - &startEvtBuilders(); +if ($opt_ioc eq "start") { + &killIOC(); + &startIOC(); +} elsif ($opt_ioc eq "stop") { + &killIOC(); +} elsif ($opt_eb eq "start") { + &writeArgs2file(); + &startEvtBuilders(); +} elsif ($opt_eb eq "stop") { + &stopEvtBuilders(); +} elsif ($opt_eb eq "restart") { + &stopEvtBuilders(); + sleep 1; + &writeArgs2file(); + &startEvtBuilders(); } exit(0); ################### END OF MAIN #################### -sub help() -{ - print "\n"; - print << 'EOF'; +sub help() { + print "\n"; + print << 'EOF'; start_eb_gbe.pl This script starts parallel Event Building processes. @@ -171,1304 +166,1208 @@ Examples: EOF } -sub init_CPU_status() -{ - - -# JAM 17-oct-2018 - for BNET this cpu reservation is deprecated TODO: remove it - my ($EB_CPU_status_href) = @_; - - # CPU affinity with 'taskset' - # - # CPU dec bin hex - # 0 1 1 - # 1 10 2 - # 2 100 4 - # 3 1000 8 - # 4 10000 10 - - #cores 0/1 reserved for system 02-05 - #cores 2/3 reserved for interrupts on 02-05 - -#lxhadeb01 is gone -# foreach my $core (0..7){ -# if($core == 1){ -# $EB_CPU_status_href->{'192.168.100.11'}->{$core} = "res"; #reserved -# } -# else{ -# $EB_CPU_status_href->{'192.168.100.11'}->{$core} = "free"; -# } -# } - -#JAM adjust this to actual affinities for eth0 settings TODO -# eth0 interrupts are above core 8 now -# -# -# foreach my $core (0..11){ -# if(($core < 2) || ($core> 8 ) ){ -# $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "res"; #reserved -# $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "res"; #reserved -# $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "res"; #reserved -# } -# else{ -# $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "free"; -# $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "free"; -# $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "free"; -# } -# } -# -## after upgrade to debian 7: ethernet reserved cores are below 6 - foreach my $core (0..11){ - if(($core < 6) ){ - $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "res"; #reserved - $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "res"; #reserved - $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "res"; #reserved - } - else{ - $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "free"; - $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "free"; - $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "free"; - - } +sub init_CPU_status() { + + # JAM 17-oct-2018 - for BNET this cpu reservation is deprecated TODO: remove it + my ($EB_CPU_status_href) = @_; + + # CPU affinity with 'taskset' + # + # CPU dec bin hex + # 0 1 1 + # 1 10 2 + # 2 100 4 + # 3 1000 8 + # 4 10000 10 + + #cores 0/1 reserved for system 02-05 + #cores 2/3 reserved for interrupts on 02-05 + + #lxhadeb01 is gone + # foreach my $core (0..7){ + # if($core == 1){ + # $EB_CPU_status_href->{'192.168.100.11'}->{$core} = "res"; #reserved + # } + # else{ + # $EB_CPU_status_href->{'192.168.100.11'}->{$core} = "free"; + # } + # } + + #JAM adjust this to actual affinities for eth0 settings TODO + # eth0 interrupts are above core 8 now + # + # + # foreach my $core (0..11){ + # if(($core < 2) || ($core> 8 ) ){ + # $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "res"; #reserved + # $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "res"; #reserved + # $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "res"; #reserved + # } + # else{ + # $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "free"; + # $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "free"; + # $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "free"; + # } + # } + # + ## after upgrade to debian 7: ethernet reserved cores are below 6 + foreach my $core (0..11) { + if (($core < 6) ) { + $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "res"; #reserved + $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "res"; #reserved + $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "res"; #reserved + } else { + $EB_CPU_status_href->{'192.168.100.12'}->{$core} = "free"; + $EB_CPU_status_href->{'192.168.100.13'}->{$core} = "free"; + $EB_CPU_status_href->{'192.168.100.14'}->{$core} = "free"; } - -# eth0 ir is set above core 11 - foreach my $core (0..23){ - if( ($core < 2) ||( $core > 11) ){ - $EB_CPU_status_href->{'192.168.100.15'}->{$core} = "res"; #reserved - } - else{ - $EB_CPU_status_href->{'192.168.100.15'}->{$core} = "free"; - } + } + + # eth0 ir is set above core 11 + foreach my $core (0..23) { + if ( ($core < 2) ||( $core > 11) ) { + $EB_CPU_status_href->{'192.168.100.15'}->{$core} = "res"; #reserved + } else { + $EB_CPU_status_href->{'192.168.100.15'}->{$core} = "free"; } - - # add cores for new EB servers JAM2018 - foreach my $core (0..63){ - if( ($core < 2) ||( $core > 60) ){ - $EB_CPU_status_href->{'192.168.100.8'}->{$core} = "res"; #reserved - $EB_CPU_status_href->{'192.168.100.9'}->{$core} = "res"; #reserved - $EB_CPU_status_href->{'192.168.100.10'}->{$core} = "res"; #reserved - $EB_CPU_status_href->{'192.168.105.11'}->{$core} = "res"; #reserved - $EB_CPU_status_href->{'192.168.105.12'}->{$core} = "res"; #reserved - } - else{ - $EB_CPU_status_href->{'192.168.100.8'}->{$core} = "free"; - $EB_CPU_status_href->{'192.168.100.9'}->{$core} = "free"; - $EB_CPU_status_href->{'192.168.100.10'}->{$core} = "free"; - $EB_CPU_status_href->{'192.168.105.11'}->{$core} = "free"; - $EB_CPU_status_href->{'192.168.105.12'}->{$core} = "free"; - - } - } - # alternative setup: specifiy cpu bitmasks for different roles: - - $EB_CPU_status_href->{'192.168.100.15'}->{'input'} = "2-23"; - $EB_CPU_status_href->{'192.168.100.15'}->{'build'} = "2-23"; - - # JAM12-2018: reserve lower 32 cpus for network interrupts - $EB_CPU_status_href->{'192.168.100.8'}->{'input'} = "32-47"; - $EB_CPU_status_href->{'192.168.100.8'}->{'build'} = "48-63"; - $EB_CPU_status_href->{'192.168.100.9'}->{'input'} = "32-47"; - $EB_CPU_status_href->{'192.168.100.9'}->{'build'} = "48-63"; - $EB_CPU_status_href->{'192.168.100.10'}->{'input'} = "32-47"; - $EB_CPU_status_href->{'192.168.100.10'}->{'build'} = "48-63"; - $EB_CPU_status_href->{'192.168.105.11'}->{'input'} = "32-47"; - $EB_CPU_status_href->{'192.168.105.11'}->{'build'} = "48-63"; - $EB_CPU_status_href->{'192.168.105.12'}->{'input'} = "32-47"; - $EB_CPU_status_href->{'192.168.105.12'}->{'build'} = "48-63"; - + } + + # add cores for new EB servers JAM2018 +# foreach my $core (0..63) { +# if ( ($core < 2) ||( $core > 60) ) { +# $EB_CPU_status_href->{'192.168.100.8'}->{$core} = "res"; #reserved +# $EB_CPU_status_href->{'192.168.100.9'}->{$core} = "res"; #reserved +# $EB_CPU_status_href->{'192.168.100.10'}->{$core} = "res"; #reserved +# $EB_CPU_status_href->{'192.168.105.11'}->{$core} = "res"; #reserved +# $EB_CPU_status_href->{'192.168.105.12'}->{$core} = "res"; #reserved +# } else { +# $EB_CPU_status_href->{'192.168.100.8'}->{$core} = "free"; +# $EB_CPU_status_href->{'192.168.100.9'}->{$core} = "free"; +# $EB_CPU_status_href->{'192.168.100.10'}->{$core} = "free"; +# $EB_CPU_status_href->{'192.168.105.11'}->{$core} = "free"; +# $EB_CPU_status_href->{'192.168.105.12'}->{$core} = "free"; +# } +# } + + # MT: no multithreading -> only 32 cores + foreach my $core (0..31) { + if ( ($core < 10) ||( $core > 31) ) { + $EB_CPU_status_href->{'192.168.100.8'}->{$core} = "res"; #reserved + $EB_CPU_status_href->{'192.168.100.9'}->{$core} = "res"; #reserved + $EB_CPU_status_href->{'192.168.100.10'}->{$core} = "res"; #reserved + $EB_CPU_status_href->{'192.168.105.11'}->{$core} = "res"; #reserved + $EB_CPU_status_href->{'192.168.105.12'}->{$core} = "res"; #reserved + } else { + $EB_CPU_status_href->{'192.168.100.8'}->{$core} = "free"; + $EB_CPU_status_href->{'192.168.100.9'}->{$core} = "free"; + $EB_CPU_status_href->{'192.168.100.10'}->{$core} = "free"; + $EB_CPU_status_href->{'192.168.105.11'}->{$core} = "free"; + $EB_CPU_status_href->{'192.168.105.12'}->{$core} = "free"; + + } + } + + + + # alternative setup: specifiy cpu bitmasks for different roles: + + $EB_CPU_status_href->{'192.168.100.15'}->{'input'} = "2-23"; + $EB_CPU_status_href->{'192.168.100.15'}->{'build'} = "2-23"; + + # JAM12-2018: reserve lower 32 cpus for network interrupts +# $EB_CPU_status_href->{'192.168.100.8'}->{'input'} = "32-47"; +# $EB_CPU_status_href->{'192.168.100.8'}->{'build'} = "48-63"; +# $EB_CPU_status_href->{'192.168.100.9'}->{'input'} = "32-47"; +# $EB_CPU_status_href->{'192.168.100.9'}->{'build'} = "48-63"; +# $EB_CPU_status_href->{'192.168.100.10'}->{'input'} = "32-47"; +# $EB_CPU_status_href->{'192.168.100.10'}->{'build'} = "48-63"; +# $EB_CPU_status_href->{'192.168.105.11'}->{'input'} = "32-47"; +# $EB_CPU_status_href->{'192.168.105.11'}->{'build'} = "48-63"; +# $EB_CPU_status_href->{'192.168.105.12'}->{'input'} = "32-47"; +# $EB_CPU_status_href->{'192.168.105.12'}->{'build'} = "48-63"; + + + + # MT 2020-12: reserve lower 16 cpus for network interrupts + $EB_CPU_status_href->{'192.168.100.8'}->{'input'} = "10-25"; + $EB_CPU_status_href->{'192.168.100.8'}->{'build'} = "26-31"; + $EB_CPU_status_href->{'192.168.100.9'}->{'input'} = "10-25"; + $EB_CPU_status_href->{'192.168.100.9'}->{'build'} = "26-31"; + $EB_CPU_status_href->{'192.168.100.10'}->{'input'} = "10-25"; + $EB_CPU_status_href->{'192.168.100.10'}->{'build'} = "26-31"; + $EB_CPU_status_href->{'192.168.105.11'}->{'input'} = "10-25"; + $EB_CPU_status_href->{'192.168.105.11'}->{'build'} = "26-31"; + $EB_CPU_status_href->{'192.168.105.12'}->{'input'} = "10-25"; + $EB_CPU_status_href->{'192.168.105.12'}->{'build'} = "26-31"; + + + # MT, separate scheme, doesn't do so well + #$EB_CPU_status_href->{'192.168.105.12'}->{'input'} = "16-23"; + #$EB_CPU_status_href->{'192.168.105.12'}->{'build'} = "24-31"; + + } -sub getCoreNr() -{ - #my ($ip) = @_; - my ($ip, $role) = @_; - my $core_nr; - if(defined $role) - { - - $core_nr = $EB_CPU_status_href->{$ip}->{$role} - +sub getCoreNr() { + #my ($ip) = @_; + my ($ip, $role) = @_; + my $core_nr; + if (defined $role) { + $core_nr = $EB_CPU_status_href->{$ip}->{$role} + } else { + ################### begin old + + foreach my $eb_ip (sort keys %$EB_CPU_status_href) { + next unless($ip eq $eb_ip); + + foreach my $core ( sort {$a <=> $b} keys %{$EB_CPU_status_href->{$eb_ip}} ) { + my $core_status = $EB_CPU_status_href->{$eb_ip}->{$core}; + + next unless(lc($core_status) eq "free"); + + $core_nr = $core; + $EB_CPU_status_href->{$eb_ip}->{$core} = "busy"; + last; + } } - else - { - ################### begin old - foreach my $eb_ip (sort keys %$EB_CPU_status_href){ + #- If no free cores left - take reserved cores + unless( defined $core_nr ){ + foreach my $eb_ip (sort keys %$EB_CPU_status_href) { next unless($ip eq $eb_ip); - - foreach my $core ( sort {$a <=> $b} keys %{$EB_CPU_status_href->{$eb_ip}} ){ - my $core_status = $EB_CPU_status_href->{$eb_ip}->{$core}; - - next unless(lc($core_status) eq "free"); - + foreach my $core ( sort {$a <=> $b} keys %{$EB_CPU_status_href->{$eb_ip}} ) { + my $core_status = $EB_CPU_status_href->{$eb_ip}->{$core}; + if (lc($core_status) eq "res") { $core_nr = $core; $EB_CPU_status_href->{$eb_ip}->{$core} = "busy"; last; + } } + } } - #- If no free cores left - take reserved cores - unless( defined $core_nr ){ - foreach my $eb_ip (sort keys %$EB_CPU_status_href){ - next unless($ip eq $eb_ip); - - foreach my $core ( sort {$a <=> $b} keys %{$EB_CPU_status_href->{$eb_ip}} ){ - my $core_status = $EB_CPU_status_href->{$eb_ip}->{$core}; - - if(lc($core_status) eq "res"){ - $core_nr = $core; - $EB_CPU_status_href->{$eb_ip}->{$core} = "busy"; - last; - } - } - } - } - -################### end old -} - unless( defined $core_nr ){ - print "No free cores left on CPU $ip. Exit.\n"; - exit(0); - } + ################### end old + } + unless( defined $core_nr ){ + print "No free cores left on CPU $ip. Exit.\n"; + exit(0); + } - print "found core numbers $core_nr for node $ip, role $role\n"; - return $core_nr; + print "found core numbers $core_nr for node $ip, role $role\n"; + return $core_nr; } -sub setArgs() -{ - my @active_EBs; - - if(@opt_ebrange){ - foreach my $range (@opt_ebrange){ - if($range =~ /(\d+)-(\d+)/){ - my $max = $1; - my $min = $2; - - foreach my $eb ($max..$min){ - #- 1 must be subtracted to match - # EB numbering in the register_configgbe_ip.db - # which starts from zero - &checkEB_nr($eb); - push(@active_EBs, $eb-1); - } - } - elsif($range =~ /(\d+)/){ - &checkEB_nr($1); - push(@active_EBs, $1-1); - } +sub setArgs() { + my @active_EBs; + + if (@opt_ebrange) { + foreach my $range (@opt_ebrange) { + if ($range =~ /(\d+)-(\d+)/) { + my $max = $1; + my $min = $2; + + foreach my $eb ($max..$min) { + #- 1 must be subtracted to match + # EB numbering in the register_configgbe_ip.db + # which starts from zero + &checkEB_nr($eb); + push(@active_EBs, $eb-1); } + } elsif ($range =~ /(\d+)/) { + &checkEB_nr($1); + push(@active_EBs, $1-1); + } } + } - return \@active_EBs; + return \@active_EBs; } -sub checkEB_nr() -{ - my ($eb_nr) = @_; +sub checkEB_nr() { + my ($eb_nr) = @_; - if( $eb_nr < 1 || $eb_nr > 16 ){ - print "ERROR: EB number should be in the range 1-16. Exit."; - exit(0); - } + if ( $eb_nr < 1 || $eb_nr > 16 ) { + print "ERROR: EB number should be in the range 1-16. Exit."; + exit(0); + } } -sub getEBArgs() -{ - my ($href) = @_; +sub getEBArgs() { + my ($href) = @_; - my $prefix = $temp_args_href->{'Main'}->{'EB_EXT'}; - $prefix = $opt_prefix if( defined $opt_prefix ); - my $filesize = $temp_args_href->{'Main'}->{'EB_FSIZE'}; + my $prefix = $temp_args_href->{'Main'}->{'EB_EXT'}; + $prefix = $opt_prefix if( defined $opt_prefix ); + my $filesize = $temp_args_href->{'Main'}->{'EB_FSIZE'}; - my $base_port = $temp_args_href->{'Parallel'}->{'BASE_PORT'}; - my $shift_port = $temp_args_href->{'Parallel'}->{'SHIFT_PORT'}; - my $source_num = $temp_args_href->{'Parallel'}->{'NUM_OF_SOURCES'}; - my $queuesize = $temp_args_href->{'Parallel'}->{'QUEUESIZE'}; + my $base_port = $temp_args_href->{'Parallel'}->{'BASE_PORT'}; + my $shift_port = $temp_args_href->{'Parallel'}->{'SHIFT_PORT'}; + my $source_num = $temp_args_href->{'Parallel'}->{'NUM_OF_SOURCES'}; + my $queuesize = $temp_args_href->{'Parallel'}->{'QUEUESIZE'}; - my $multidisk = $temp_args_href->{'Parallel'}->{'MULTIDISK'}; + my $multidisk = $temp_args_href->{'Parallel'}->{'MULTIDISK'}; - #- Number of EB process - my $ebproc = 0; + #- Number of EB process + my $ebproc = 0; - #- List of BEs - my $listOfEBs = $temp_args_href->{'Parallel'}->{'EB_LIST'}; - my @eb_list = split(/\s+/, $listOfEBs); + #- List of BEs + my $listOfEBs = $temp_args_href->{'Parallel'}->{'EB_LIST'}; + my @eb_list = split(/\s+/, $listOfEBs); - #- DABC mode selection - my $listOfDABC = $temp_args_href->{'Parallel'}->{'DABC'}; - my @dabc_list = split(/\s+/, $listOfDABC); - - - # BNET setup: - my $listOfBnetInputs = $temp_args_href->{'Parallel'}->{'BNETINP'}; - my @bnet_in_list = split(/\s+/, $listOfBnetInputs); - - my $listOfBnetBuilders = $temp_args_href->{'Parallel'}->{'BNETBLD'}; - my @bnet_bld_list = split(/\s+/, $listOfBnetBuilders); - #print Dumper @bnet_bld_list; - - - #- Default RFIO settings - my $rfio = $temp_args_href->{'Parallel'}->{'RFIO'}; - my $rfio_path = $temp_args_href->{'Parallel'}->{'RFIO_PATH'}; - my $rfio_pcOptions = $temp_args_href->{'Parallel'}->{'RFIO_pcOptions'}; - my $rfio_iCopyMode = $temp_args_href->{'Parallel'}->{'RFIO_iCopyMode'}; - my $rfio_pcCopyPath = $temp_args_href->{'Parallel'}->{'RFIO_pcCopyPath'}; - my $rfio_iCopyFrac = $temp_args_href->{'Parallel'}->{'RFIO_iCopyFraction'}; - my $rfio_iMaxFile = $temp_args_href->{'Parallel'}->{'RFIO_iMaxFile'}; - my $rfio_iPathConv = $temp_args_href->{'Parallel'}->{'RFIO_iPathConvention'}; - - my @rfio_list = split(/\s+/, $rfio); - - - - #- LTSM settings - my $listOfLTSM = $temp_args_href->{'Parallel'}->{'LTSM'}; - my @ltsm_list = split(/\s+/, $listOfLTSM); - - my $ltsm_path = $temp_args_href->{'Parallel'}->{'LTSM_PATH'}; - my $ltsm_server = $temp_args_href->{'Parallel'}->{'LTSM_Server'}; - my $ltsm_node = $temp_args_href->{'Parallel'}->{'LTSM_Node'}; - my $ltsm_passwd = $temp_args_href->{'Parallel'}->{'LTSM_Passwd'}; - my $ltsm_filesys = $temp_args_href->{'Parallel'}->{'LTSM_Filesystem'}; - - my $ltsm_usefsd = $temp_args_href->{'Parallel'}->{'LTSM_USEFSD'}; - my $ltsm_fsd_servers = $temp_args_href->{'Parallel'}->{'LTSM_FSD_SERVERS'}; - my @ltsm_fsd_server_list = split(/\s+/, $ltsm_fsd_servers); - my $ltsm_fsd_ports = $temp_args_href->{'Parallel'}->{'LTSM_FSD_PORT'}; - my @ltsm_fsd_port_list = split(/\s+/, $ltsm_fsd_ports); - - #my $ltsm_fsd_port = $temp_args_href->{'Parallel'}->{'LTSM_FSD_PORT'}; - - - #- EPICS Controled - my $epics_ctrl = $temp_args_href->{'Parallel'}->{'EPICS_CTRL'}; + #- DABC mode selection + my $listOfDABC = $temp_args_href->{'Parallel'}->{'DABC'}; + my @dabc_list = split(/\s+/, $listOfDABC); - my @epics_list = split(/\s+/, $epics_ctrl); - #- Logging the output of EBs - my $eb_log = $temp_args_href->{'Parallel'}->{'EB_LOG'}; - my $eb_debug = $temp_args_href->{'Parallel'}->{'EB_DEBUG'}; - my $nm_log = $temp_args_href->{'Parallel'}->{'NM_LOG'}; - my @eblog_list = split(/\s+/, $eb_log); - my @ebdbg_list = split(/\s+/, $eb_debug); - my @nmlog_list = split(/\s+/, $nm_log); + # BNET setup: + my $listOfBnetInputs = $temp_args_href->{'Parallel'}->{'BNETINP'}; + my @bnet_in_list = split(/\s+/, $listOfBnetInputs); - - #- Write to disk - my $write2disk = $temp_args_href->{'Parallel'}->{'WRITE_TO_DISK'}; - my @write2disk_list = split(/\s+/, $write2disk); + my $listOfBnetBuilders = $temp_args_href->{'Parallel'}->{'BNETBLD'}; + my @bnet_bld_list = split(/\s+/, $listOfBnetBuilders); + #print Dumper @bnet_bld_list; + + + #- Default RFIO settings + my $rfio = $temp_args_href->{'Parallel'}->{'RFIO'}; + my $rfio_path = $temp_args_href->{'Parallel'}->{'RFIO_PATH'}; + my $rfio_pcOptions = $temp_args_href->{'Parallel'}->{'RFIO_pcOptions'}; + my $rfio_iCopyMode = $temp_args_href->{'Parallel'}->{'RFIO_iCopyMode'}; + my $rfio_pcCopyPath = $temp_args_href->{'Parallel'}->{'RFIO_pcCopyPath'}; + my $rfio_iCopyFrac = $temp_args_href->{'Parallel'}->{'RFIO_iCopyFraction'}; + my $rfio_iMaxFile = $temp_args_href->{'Parallel'}->{'RFIO_iMaxFile'}; + my $rfio_iPathConv = $temp_args_href->{'Parallel'}->{'RFIO_iPathConvention'}; + + my @rfio_list = split(/\s+/, $rfio); + + + + #- LTSM settings + my $listOfLTSM = $temp_args_href->{'Parallel'}->{'LTSM'}; + my @ltsm_list = split(/\s+/, $listOfLTSM); + + my $ltsm_path = $temp_args_href->{'Parallel'}->{'LTSM_PATH'}; + my $ltsm_server = $temp_args_href->{'Parallel'}->{'LTSM_Server'}; + my $ltsm_node = $temp_args_href->{'Parallel'}->{'LTSM_Node'}; + my $ltsm_passwd = $temp_args_href->{'Parallel'}->{'LTSM_Passwd'}; + my $ltsm_filesys = $temp_args_href->{'Parallel'}->{'LTSM_Filesystem'}; + + my $ltsm_usefsd = $temp_args_href->{'Parallel'}->{'LTSM_USEFSD'}; + my $ltsm_fsd_servers = $temp_args_href->{'Parallel'}->{'LTSM_FSD_SERVERS'}; + my @ltsm_fsd_server_list = split(/\s+/, $ltsm_fsd_servers); + my $ltsm_fsd_ports = $temp_args_href->{'Parallel'}->{'LTSM_FSD_PORT'}; + my @ltsm_fsd_port_list = split(/\s+/, $ltsm_fsd_ports); - #--- Read GbE configuration - my %eb_ids_gbe_hash; - my $eb_ids_gbe_href = \%eb_ids_gbe_hash; + #my $ltsm_fsd_port = $temp_args_href->{'Parallel'}->{'LTSM_FSD_PORT'}; - &getGbEconfig($eb_ids_gbe_href); - #--- Loop over all EB processes - #print Dumper $eb_ids_gbe_href; - #exit; - #foreach my $ebproc ( sort keys %{$eb_ids_gbe_href} ){ - foreach my $ebproc ( 0 .. $#bnetservers){ + #- EPICS Controled + my $epics_ctrl = $temp_args_href->{'Parallel'}->{'EPICS_CTRL'}; + + my @epics_list = split(/\s+/, $epics_ctrl); + + #- Logging the output of EBs + my $eb_log = $temp_args_href->{'Parallel'}->{'EB_LOG'}; + my $eb_debug = $temp_args_href->{'Parallel'}->{'EB_DEBUG'}; + my $nm_log = $temp_args_href->{'Parallel'}->{'NM_LOG'}; + my @eblog_list = split(/\s+/, $eb_log); + my @ebdbg_list = split(/\s+/, $eb_debug); + my @nmlog_list = split(/\s+/, $nm_log); + - #- If there was a list of EBs provided via command line options - # go to the next $ebproc if the current $ebproc is not in this list. - #print "active EBs:\n"; - #print Dumper $active_EBs_aref; + #- Write to disk + my $write2disk = $temp_args_href->{'Parallel'}->{'WRITE_TO_DISK'}; + my @write2disk_list = split(/\s+/, $write2disk); + + #--- Read GbE configuration + my %eb_ids_gbe_hash; + my $eb_ids_gbe_href = \%eb_ids_gbe_hash; + + &getGbEconfig($eb_ids_gbe_href); + + #--- Loop over all EB processes + #print Dumper $eb_ids_gbe_href; + #exit; + #foreach my $ebproc ( sort keys %{$eb_ids_gbe_href} ){ + foreach my $ebproc ( 0 .. $#bnetservers) { + + #- If there was a list of EBs provided via command line options + # go to the next $ebproc if the current $ebproc is not in this list. + #print "active EBs:\n"; + #print Dumper $active_EBs_aref; + + if (@$active_EBs_aref) { + next unless( any {$_ == $ebproc} @$active_EBs_aref ); #from command line args + } else { + next unless( $eb_list[$ebproc] ); #from eb.conf + } - if(@$active_EBs_aref){ - next unless( any {$_ == $ebproc} @$active_EBs_aref ); #from command line args - } - else{ - next unless( $eb_list[$ebproc] ); #from eb.conf - } + #my $eb_ip = $eb_ids_gbe_href->{$ebproc}->{'IP'}; - #my $eb_ip = $eb_ids_gbe_href->{$ebproc}->{'IP'}; + #- Save IP needed by other function to stop EBs. + #push(@EB_IP_list, $eb_ip) unless( any {$_ eq $eb_ip} @EB_IP_list ); - #- Save IP needed by other function to stop EBs. - #push(@EB_IP_list, $eb_ip) unless( any {$_ eq $eb_ip} @EB_IP_list ); + #- Some checks on number of EB processes + die "Number of EB processes exceeds the number in RFIO setting! Exit." if($ebproc > $#rfio_list); + die "Number of EB processes exceeds the number in EPICS_CTRL setting! Exit." if($ebproc > $#epics_list); + #- Here we can overwrite default rfio settings with individual settings per EB processes + my $procname = sprintf("EB_PROC_%d", 1+$ebproc); + # $rfio_iCopyMode = $temp_args_href->{$procname}->{'RFIO_iCopyMode'}; - #- Some checks on number of EB processes - die "Number of EB processes exceeds the number in RFIO setting! Exit." if($ebproc > $#rfio_list); - die "Number of EB processes exceeds the number in EPICS_CTRL setting! Exit." if($ebproc > $#epics_list); - - #- Here we can overwrite default rfio settings with individual settings per EB processes - my $procname = sprintf("EB_PROC_%d", 1+$ebproc); - # $rfio_iCopyMode = $temp_args_href->{$procname}->{'RFIO_iCopyMode'}; - - #$href->{$ebproc}->{'IP'} = $eb_ip; - $href->{$ebproc}->{'IP'} = $bnetservers[$ebproc]; - $href->{$ebproc}->{'EBNUM'} = $ebproc+1; - $href->{$ebproc}->{'BASEPORT'} = $base_port; - $href->{$ebproc}->{'PORT_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'port_list'}; - $href->{$ebproc}->{'SOURCENUM'} = scalar @{$eb_ids_gbe_href->{$ebproc}->{'port_list'}}; - - # JAM2016: bnet requieres udp destination nodes in a list like the ports: - $href->{$ebproc}->{'IP_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'ip_list'}; - - # JAM2018: bnet requieres calibration modes in a list like the ports: - $href->{$ebproc}->{'CALIB_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'calib_list'}; - - # JAM2018: bnet requires hub addresses/subevents in a list like the ports: - $href->{$ebproc}->{'HUB_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'addr_list'}; - - - $href->{$ebproc}->{'BUFSIZE_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'bufsize_list'}; - $href->{$ebproc}->{'PREFIX'} = $prefix; - $href->{$ebproc}->{'QUEUESIZE'} = $queuesize; - $href->{$ebproc}->{'MULTIDISK'} = $multidisk; - $href->{$ebproc}->{'FILESIZE'} = $filesize; - - if( defined $temp_args_href->{$procname}->{'MULTIDISK'} ){ - $href->{$ebproc}->{'MULTIDISK'} = $temp_args_href->{$procname}->{'MULTIDISK'}; - } - elsif($multidisk){ - $href->{$ebproc}->{'MULTIDISK'} = $href->{$ebproc}->{'EBNUM'}; - } - else{ - $href->{$ebproc}->{'MULTIDISK'} = $multidisk; - } + #$href->{$ebproc}->{'IP'} = $eb_ip; + $href->{$ebproc}->{'IP'} = $bnetservers[$ebproc]; + $href->{$ebproc}->{'EBNUM'} = $ebproc+1; + $href->{$ebproc}->{'BASEPORT'} = $base_port; + $href->{$ebproc}->{'PORT_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'port_list'}; + $href->{$ebproc}->{'SOURCENUM'} = scalar @{$eb_ids_gbe_href->{$ebproc}->{'port_list'}}; - if( defined $temp_args_href->{$procname}->{'RESDOWNSCALE'} ){ - $href->{$ebproc}->{'RESDOWNSCALE'} = $temp_args_href->{$procname}->{'RESDOWNSCALE'}; - $href->{$ebproc}->{'RESNUMEVENTS'} = $temp_args_href->{$procname}->{'RESNUMEVENTS'}; - $href->{$ebproc}->{'RESPATH'} = $temp_args_href->{$procname}->{'RESPATH'}; - $href->{$ebproc}->{'RESSIZELIMIT'} = $temp_args_href->{$procname}->{'RESSIZELIMIT'}; - } + # JAM2016: bnet requieres udp destination nodes in a list like the ports: + $href->{$ebproc}->{'IP_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'ip_list'}; - if( defined $temp_args_href->{$procname}->{'ONLINESERVER'} ){ - if($opt_online eq "on"){ - $href->{$ebproc}->{'ONLINESERVER'} = "on"; - } - elsif($opt_online eq "off"){ - $href->{$ebproc}->{'ONLINESERVER'} = "off"; - } - else{ - $href->{$ebproc}->{'ONLINESERVER'} = $temp_args_href->{$procname}->{'ONLINESERVER'}; - } - } - else{ - $href->{$ebproc}->{'ONLINESERVER'} = "off"; - } + # JAM2018: bnet requieres calibration modes in a list like the ports: + $href->{$ebproc}->{'CALIB_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'calib_list'}; - $href->{$ebproc}->{'RFIO'} = $rfio_list[$ebproc] if(lc($opt_rfio) eq 'undef'); # 0|1 - $href->{$ebproc}->{'RFIO'} = 1 if(lc($opt_rfio) eq 'on'); # 0|1 - $href->{$ebproc}->{'RFIO'} = 0 if(lc($opt_rfio) eq 'off'); # 0|1 - $href->{$ebproc}->{'RFIO_PATH'} = $rfio_path; - $href->{$ebproc}->{'RFIO_pcOptions'} = $rfio_pcOptions; - $href->{$ebproc}->{'RFIO_iCopyMode'} = $rfio_iCopyMode; - $href->{$ebproc}->{'RFIO_pcCopyPath'} = $rfio_pcCopyPath; - $href->{$ebproc}->{'RFIO_iCopyFrac'} = $rfio_iCopyFrac; - $href->{$ebproc}->{'RFIO_iMaxFile'} = $rfio_iMaxFile; - $href->{$ebproc}->{'RFIO_iPathConv'} = $rfio_iPathConv; - - - - $href->{$ebproc}->{'LTSM'} = $ltsm_list[$ebproc]; # 0|1 - $href->{$ebproc}->{'LTSM_PATH'} = $ltsm_path; - $href->{$ebproc}->{'LTSM_Server'} = $ltsm_server; - $href->{$ebproc}->{'LTSM_Node'} = $ltsm_node; - $href->{$ebproc}->{'LTSM_Passwd'} = $ltsm_passwd; - $href->{$ebproc}->{'LTSM_Filesystem'} = $ltsm_filesys; - - $href->{$ebproc}->{'LTSM_USEFSD'} = $ltsm_usefsd; - #$href->{$ebproc}->{'LTSM_FSD_PORT'} = $ltsm_fsd_port; - $href->{$ebproc}->{'LTSM_FSD_PORT'} = $ltsm_fsd_port_list[$ebproc]; - $href->{$ebproc}->{'LTSM_FSD_SERVER'} = $ltsm_fsd_server_list[$ebproc]; - - + # JAM2018: bnet requires hub addresses/subevents in a list like the ports: + $href->{$ebproc}->{'HUB_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'addr_list'}; - $href->{$ebproc}->{'EPICS_CTRL'} = $epics_list[$ebproc]; # 0|1 + $href->{$ebproc}->{'BUFSIZE_LIST'} = $eb_ids_gbe_href->{$ebproc}->{'bufsize_list'}; + $href->{$ebproc}->{'PREFIX'} = $prefix; + $href->{$ebproc}->{'QUEUESIZE'} = $queuesize; + $href->{$ebproc}->{'MULTIDISK'} = $multidisk; + $href->{$ebproc}->{'FILESIZE'} = $filesize; - $href->{$ebproc}->{'DABC'} = $dabc_list[$ebproc]; # 0|1 + if ( defined $temp_args_href->{$procname}->{'MULTIDISK'} ) { + $href->{$ebproc}->{'MULTIDISK'} = $temp_args_href->{$procname}->{'MULTIDISK'}; + } elsif ($multidisk) { + $href->{$ebproc}->{'MULTIDISK'} = $href->{$ebproc}->{'EBNUM'}; + } else { + $href->{$ebproc}->{'MULTIDISK'} = $multidisk; + } - $href->{$ebproc}->{'EB_DEBUG'} = $ebdbg_list[$ebproc]; # 0|1 + if ( defined $temp_args_href->{$procname}->{'RESDOWNSCALE'} ) { + $href->{$ebproc}->{'RESDOWNSCALE'} = $temp_args_href->{$procname}->{'RESDOWNSCALE'}; + $href->{$ebproc}->{'RESNUMEVENTS'} = $temp_args_href->{$procname}->{'RESNUMEVENTS'}; + $href->{$ebproc}->{'RESPATH'} = $temp_args_href->{$procname}->{'RESPATH'}; + $href->{$ebproc}->{'RESSIZELIMIT'} = $temp_args_href->{$procname}->{'RESSIZELIMIT'}; + } - $href->{$ebproc}->{'EB_LOG'} = $eblog_list[$ebproc]; # 0|1 - $href->{$ebproc}->{'NM_LOG'} = $nmlog_list[$ebproc]; # 0|1 - - - if($ebproc<5) - { - # note that for bnet setup, index does not mean eb number, but machine number! - # we misuse this here to save complexity of setup - $href->{$ebproc}->{'BNET_INP'} = $bnet_in_list[$ebproc]; # 0|1|2... - $href->{$ebproc}->{'BNET_BLD'} = $bnet_bld_list[$ebproc]; # 0|1|2|3 - #print "dump bnet_bld\n"; - #print Dumper \$bnet_bld_list[$ebproc]; - } - - - if( $write2disk_list[$ebproc] && lc($opt_disk) eq 'undef' ){ - if(&isVarDefined($temp_args_href->{$procname}->{'OUTDIR'}, "OUTDIR for $procname")){ - $href->{$ebproc}->{'OUTDIR'} = $temp_args_href->{$procname}->{'OUTDIR'}; - } - } - elsif( lc($opt_disk) eq 'on' ){ - if(&isVarDefined($temp_args_href->{$procname}->{'OUTDIR'}, "OUTDIR for $procname")){ - $href->{$ebproc}->{'OUTDIR'} = $temp_args_href->{$procname}->{'OUTDIR'}; - } - } - elsif( lc($opt_disk) eq 'off' ){ - #- do not do anything. If $href->{$ebproc}->{'OUTDIR'} is undefined, - # the data will go to /dev/null - } - } + if ( defined $temp_args_href->{$procname}->{'ONLINESERVER'} ) { + if ($opt_online eq "on") { + $href->{$ebproc}->{'ONLINESERVER'} = "on"; + } elsif ($opt_online eq "off") { + $href->{$ebproc}->{'ONLINESERVER'} = "off"; + } else { + $href->{$ebproc}->{'ONLINESERVER'} = $temp_args_href->{$procname}->{'ONLINESERVER'}; + } + } else { + $href->{$ebproc}->{'ONLINESERVER'} = "off"; + } + + $href->{$ebproc}->{'RFIO'} = $rfio_list[$ebproc] if(lc($opt_rfio) eq 'undef'); # 0|1 + $href->{$ebproc}->{'RFIO'} = 1 if(lc($opt_rfio) eq 'on'); # 0|1 + $href->{$ebproc}->{'RFIO'} = 0 if(lc($opt_rfio) eq 'off'); # 0|1 + $href->{$ebproc}->{'RFIO_PATH'} = $rfio_path; + $href->{$ebproc}->{'RFIO_pcOptions'} = $rfio_pcOptions; + $href->{$ebproc}->{'RFIO_iCopyMode'} = $rfio_iCopyMode; + $href->{$ebproc}->{'RFIO_pcCopyPath'} = $rfio_pcCopyPath; + $href->{$ebproc}->{'RFIO_iCopyFrac'} = $rfio_iCopyFrac; + $href->{$ebproc}->{'RFIO_iMaxFile'} = $rfio_iMaxFile; + $href->{$ebproc}->{'RFIO_iPathConv'} = $rfio_iPathConv; + + $href->{$ebproc}->{'LTSM'} = $ltsm_list[$ebproc]; # 0|1 + $href->{$ebproc}->{'LTSM_PATH'} = $ltsm_path; + $href->{$ebproc}->{'LTSM_Server'} = $ltsm_server; + $href->{$ebproc}->{'LTSM_Node'} = $ltsm_node; + $href->{$ebproc}->{'LTSM_Passwd'} = $ltsm_passwd; + $href->{$ebproc}->{'LTSM_Filesystem'} = $ltsm_filesys; + + $href->{$ebproc}->{'LTSM_USEFSD'} = $ltsm_usefsd; + #$href->{$ebproc}->{'LTSM_FSD_PORT'} = $ltsm_fsd_port; + $href->{$ebproc}->{'LTSM_FSD_PORT'} = $ltsm_fsd_port_list[$ebproc]; + $href->{$ebproc}->{'LTSM_FSD_SERVER'} = $ltsm_fsd_server_list[$ebproc]; + + $href->{$ebproc}->{'EPICS_CTRL'} = $epics_list[$ebproc]; # 0|1 + + $href->{$ebproc}->{'DABC'} = $dabc_list[$ebproc]; # 0|1 + + $href->{$ebproc}->{'EB_DEBUG'} = $ebdbg_list[$ebproc]; # 0|1 + + $href->{$ebproc}->{'EB_LOG'} = $eblog_list[$ebproc]; # 0|1 + $href->{$ebproc}->{'NM_LOG'} = $nmlog_list[$ebproc]; # 0|1 + + if ($ebproc<5) { + # note that for bnet setup, index does not mean eb number, but machine number! + # we misuse this here to save complexity of setup + $href->{$ebproc}->{'BNET_INP'} = $bnet_in_list[$ebproc]; # 0|1|2... + $href->{$ebproc}->{'BNET_BLD'} = $bnet_bld_list[$ebproc]; # 0|1|2|3 + #print "dump bnet_bld\n"; + #print Dumper \$bnet_bld_list[$ebproc]; + } + + if ( $write2disk_list[$ebproc] && lc($opt_disk) eq 'undef' ) { + if (&isVarDefined($temp_args_href->{$procname}->{'OUTDIR'}, "OUTDIR for $procname")) { + $href->{$ebproc}->{'OUTDIR'} = $temp_args_href->{$procname}->{'OUTDIR'}; + } + } elsif ( lc($opt_disk) eq 'on' ) { + if (&isVarDefined($temp_args_href->{$procname}->{'OUTDIR'}, "OUTDIR for $procname")) { + $href->{$ebproc}->{'OUTDIR'} = $temp_args_href->{$procname}->{'OUTDIR'}; + } + } elsif ( lc($opt_disk) eq 'off' ) { + #- do not do anything. If $href->{$ebproc}->{'OUTDIR'} is undefined, + # the data will go to /dev/null + } + } - $numOfEBProcs = $ebproc; - #print "result\n"; - #print Dumper $ebproc; - # exit; + $numOfEBProcs = $ebproc; + #print "result\n"; + #print Dumper $ebproc; + # exit; } -sub isVarDefined() -{ - my ($var, $msg) = @_; +sub isVarDefined() { + my ($var, $msg) = @_; - my $retval = 1; + my $retval = 1; - unless( defined $var ){ - print "Undefined variable found: $msg\n"; - $retval = 0; - } - - return $retval; + unless( defined $var ){ + print "Undefined variable found: $msg\n"; + $retval = 0; + } + return $retval; } -sub getVarSizeArg() -{ - my ($ebproc) = @_; - - my $i = 0; - my $arg = " "; +sub getVarSizeArg() { + my ($ebproc) = @_; - foreach my $size (@{$EB_Args_href->{$ebproc}->{'BUFSIZE_LIST'}}){ + my $i = 0; + my $arg = " "; - if($EB_Args_href->{$ebproc}->{'BUFSIZE_LIST'}->[$i] == - $EB_Args_href->{$ebproc}->{'QUEUESIZE'}){ - $i++; - next; - } + foreach my $size (@{$EB_Args_href->{$ebproc}->{'BUFSIZE_LIST'}}) { - $arg = $arg . " -Q " . $i . ":" . $EB_Args_href->{$ebproc}->{'BUFSIZE_LIST'}->[$i]; - $i++; + if ($EB_Args_href->{$ebproc}->{'BUFSIZE_LIST'}->[$i] == + $EB_Args_href->{$ebproc}->{'QUEUESIZE'}) { + $i++; + next; } - return $arg; + $arg = $arg . " -Q " . $i . ":" . $EB_Args_href->{$ebproc}->{'BUFSIZE_LIST'}->[$i]; + $i++; + } + + return $arg; } -sub startBnet() -{ -# here we launch the dabc bnet. -# parameters in eb.conf can specify how many input and builder processes run on each node. -# we misuse daq gbe setup for EB 15 to specify ports and destination nodes. -my (@process_list); -# setup for first EB -my $ebproc =0; # setup for first EB will define the BNET +sub startBnet() { + # here we launch the dabc bnet. + # parameters in eb.conf can specify how many input and builder processes run on each node. + # we misuse daq gbe setup for EB 15 to specify ports and destination nodes. + my (@process_list); + # setup for first EB + my $ebproc =0; # setup for first EB will define the BNET my $username = "hadaq"; my $cdworkdir = "cd /home/hadaq/oper;"; - + # here the default installation. always the most recent... my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin.head; "; my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe.head "; -# my $cmd_dabc = "/usr/bin/gdb -x /home/hadaq/soft/dabc/head/base/run/gdbcmd.txt --args /home/hadaq/soft/dabc/bin/dabc_exe.head "; + # my $cmd_dabc = "/usr/bin/gdb -x /home/hadaq/soft/dabc/head/base/run/gdbcmd.txt --args /home/hadaq/soft/dabc/bin/dabc_exe.head "; my $conf_bnet_inp = " BnetInputHades.head.xml"; #my $conf_bnet_bld = " BnetBuilderHades.head.xml"; my $conf_bnet_bld = " BnetBuilderHadesFSD.head.xml"; - - # JAM2020- enable this to switch different dabc version: -# my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin.jun20; "; -# my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe.jun20 "; -# my $conf_bnet_inp = " BnetInputHades.jun20.xml"; -# my $conf_bnet_bld = " BnetBuilderHadesFSD.jun20.xml"; - - -# my @bnetservers = ("192.168.100.8","192.168.100.9","192.168.100.10","192.168.105.11", "192.168.105.12"); + + # JAM2020- enable this to switch different dabc version: + # my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin.jun20; "; + # my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe.jun20 "; + # my $conf_bnet_inp = " BnetInputHades.jun20.xml"; + # my $conf_bnet_bld = " BnetBuilderHadesFSD.jun20.xml"; + + # my @bnetservers = ("192.168.100.8","192.168.100.9","192.168.100.10","192.168.105.11", "192.168.105.12"); # variable master node now: my $bnetmaster = "lxhadeb07"; #lxhadeb12"; - -# before we start inidividual bnet processes, need to evaluate list of ports and nodes: -# BNETSENDERS=[localhost:12501,localhost:12502] -# BNETRECEIVERS= [localhost:12101,localhost:12102] -# HADAQPORTS =[50000,50001,50002] - -my $bnetsenders = "["; -my $bnetrcvs = "["; -my @bnet_port_list = (); -my @bnet_calib_list = (); -my @bnet_subevt_list = (); -my $firstsnd = 1; -my $firstrcv = 1; - - my $maxbuildservers = 4; #exclude lxhadeb12 from data writing - my $maxbuilders=1; - if ($opt_bnet>0 && $opt_bnet <16) { - $maxbuilders=$opt_bnet; - } - - print "Using $maxbuilders event builder nodes from option -b $opt_bnet\n"; -my $totalbuilders=0; -my @localbuilders = (0,0,0,0,0); -while($totalbuilders < $maxbuilders) -{ - my $lasttotalbuilders=$totalbuilders; - for ( my $ebserver=0; $ebserver<$maxbuildservers; $ebserver=$ebserver+1){ - my $bnet_numbuilders = $EB_Args_href->{$ebserver}->{'BNET_BLD'}; - #print "numbuilders for $ebserver is $bnet_numbuilders \n"; - if($totalbuilders < $maxbuilders) - { - if($localbuilders[$ebserver] < $bnet_numbuilders) - { - $localbuilders[$ebserver]++; - $totalbuilders++; - # print "Added 1 builder on EB server: $ebserver\n"; - } - } - } - if ($totalbuilders==$lasttotalbuilders){ last;} # more ebs demanded than configured -} - - for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1){ - print "Found $localbuilders[$ebserver] builders on EB server: $ebserver\n"; - } - -my $rcvport = 12100; -for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1){ - print "Gathering processes at EB server: $ebserver\n"; - my $sendport = 12501; - my $ip = $bnetservers[$ebserver]; - - # JAM2018 - need to transform HADES VLAN IPs into GSI VLAN for BNET! - my $gsi_ip = getIP_hades2gsi($ip); - - # array of BNET values is already indexed with server id: - my $bnet_numsenders = $EB_Args_href->{$ebserver}->{'BNET_INP'}; - - for (my $six=0; $six<$bnet_numsenders; $six=$six+1) - { - $bnetsenders=$bnetsenders . "," unless ($firstsnd>0); - $bnetsenders=$bnetsenders . $gsi_ip.":". $sendport; - $sendport=$sendport+1; - $firstsnd=0 if($firstsnd>0); + # before we start inidividual bnet processes, need to evaluate list of ports and nodes: + # BNETSENDERS=[localhost:12501,localhost:12502] + # BNETRECEIVERS= [localhost:12101,localhost:12102] + # HADAQPORTS =[50000,50001,50002] + + my $bnetsenders = "["; + my $bnetrcvs = "["; + my @bnet_port_list = (); + my @bnet_calib_list = (); + my @bnet_subevt_list = (); + my $firstsnd = 1; + my $firstrcv = 1; + + #my $maxbuildservers = 4; #exclude lxhadeb12 from data writing + my $maxbuildservers = 5; #include lxhadeb12 from data writing, MT + my $maxbuilders=1; + if ($opt_bnet>0 && $opt_bnet <16) { + $maxbuilders=$opt_bnet; + } + + print "Using $maxbuilders event builder nodes from option -b $opt_bnet\n"; + my $totalbuilders=0; + my @localbuilders = (0,0,0,0,0); + while ($totalbuilders < $maxbuilders) { + my $lasttotalbuilders=$totalbuilders; + for ( my $ebserver=0; $ebserver<$maxbuildservers; $ebserver=$ebserver+1) { + my $bnet_numbuilders = $EB_Args_href->{$ebserver}->{'BNET_BLD'}; + print "numbuilders for $ebserver is $bnet_numbuilders \n"; + if ($totalbuilders < $maxbuilders) { + if ($localbuilders[$ebserver] < $bnet_numbuilders) { + $localbuilders[$ebserver]++; + $totalbuilders++; + print "Added 1 builder on EB server: $ebserver\n"; + } } - - - for (my $rix=0; $rix<$localbuilders[$ebserver]; $rix=$rix+1) - { - $bnetrcvs=$bnetrcvs . "," unless ($firstrcv>0); - $bnetrcvs=$bnetrcvs . $gsi_ip.":". $rcvport; - $rcvport=$rcvport+1; - $firstrcv=0 if($firstrcv>0); - } - my $hadaqports = "["; - my $calibflags = "["; - my $subevents = "["; - my $firstport = 1; - - - #- add ports: note that we only use eb 1 setup and do check which ports belong to our eb server: - my $ix =0; - foreach my $port (@{$EB_Args_href->{$ebproc}->{'PORT_LIST'}}){ - # here we only gather such ports that are assigned to our node: - # todo: how to distribute the ports to more than one bnet input process per server? - my $cflag = $EB_Args_href->{$ebproc}->{'CALIB_LIST'}[$ix]; - my $hub = $EB_Args_href->{$ebproc}->{'HUB_LIST'}[$ix]; - #print "ip" . $ip . " with port:" . $port ." index:" . $ix . " ip: ". $EB_Args_href->{$ebproc}->{'IP_LIST'}[$ix] . " calib: ". $cflag ." hub: ". $hub ."\n" ; - if($ip eq $EB_Args_href->{$ebproc}->{'IP_LIST'}[$ix]) - { - $hadaqports=$hadaqports . "," unless ($firstport>0); - $hadaqports = $hadaqports . $port; - $calibflags=$calibflags . "," unless ($firstport>0); - $calibflags = $calibflags . $cflag; - $subevents=$subevents . "," unless ($firstport>0); - $subevents = $subevents . $hub; - $firstport=0 if($firstport>0); - } - $ix++; - } - $hadaqports=$hadaqports . "]"; + if ($totalbuilders==$lasttotalbuilders) { + last; + } # more ebs demanded than configured + } + + for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1) { + print "Found $localbuilders[$ebserver] builders on EB server: $ebserver\n"; + } + + my $rcvport = 12100; + for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1) { + print "Gathering processes at EB server: $ebserver\n"; + my $sendport = 12501; + my $ip = $bnetservers[$ebserver]; + + # JAM2018 - need to transform HADES VLAN IPs into GSI VLAN for BNET! + my $gsi_ip = getIP_hades2gsi($ip); + # array of BNET values is already indexed with server id: + my $bnet_numsenders = $EB_Args_href->{$ebserver}->{'BNET_INP'}; + for (my $six=0; $six<$bnet_numsenders; $six=$six+1) { + $bnetsenders=$bnetsenders . "," unless ($firstsnd>0); + $bnetsenders=$bnetsenders . $gsi_ip.":". $sendport; + $sendport=$sendport+1; + $firstsnd=0 if($firstsnd>0); + } + for (my $rix=0; $rix<$localbuilders[$ebserver]; $rix=$rix+1) { + $bnetrcvs=$bnetrcvs . "," unless ($firstrcv>0); + $bnetrcvs=$bnetrcvs . $gsi_ip.":". $rcvport; + $rcvport=$rcvport+1; + $firstrcv=0 if($firstrcv>0); + } + my $hadaqports = "["; + my $calibflags = "["; + my $subevents = "["; + my $firstport = 1; + + #- add ports: note that we only use eb 1 setup and do check which ports belong to our eb server: + my $ix =0; + foreach my $port (@{$EB_Args_href->{$ebproc}->{'PORT_LIST'}}) { + # here we only gather such ports that are assigned to our node: + # todo: how to distribute the ports to more than one bnet input process per server? + my $cflag = $EB_Args_href->{$ebproc}->{'CALIB_LIST'}[$ix]; + my $hub = $EB_Args_href->{$ebproc}->{'HUB_LIST'}[$ix]; + #print "ip" . $ip . " with port:" . $port ." index:" . $ix . " ip: ". $EB_Args_href->{$ebproc}->{'IP_LIST'}[$ix] . " calib: ". $cflag ." hub: ". $hub ."\n" ; + if ($ip eq $EB_Args_href->{$ebproc}->{'IP_LIST'}[$ix]) { + $hadaqports=$hadaqports . "," unless ($firstport>0); + $hadaqports = $hadaqports . $port; + $calibflags=$calibflags . "," unless ($firstport>0); + $calibflags = $calibflags . $cflag; + $subevents=$subevents . "," unless ($firstport>0); + $subevents = $subevents . $hub; + $firstport=0 if($firstport>0); + } + $ix++; + } + $hadaqports=$hadaqports . "]"; push(@bnet_port_list, $hadaqports); # ports are per server - - $calibflags=$calibflags . "]"; + $calibflags=$calibflags . "]"; push(@bnet_calib_list, $calibflags); # flags per server - - $subevents=$subevents . "]"; + $subevents=$subevents . "]"; push(@bnet_subevt_list, $subevents); # flags per server - - - - # print "node ". $gsi_ip . " uses ports ".$hadaqports . ", calibflags " .$calibflags . " hubs: ". $subevents ."\n"; -} -$bnetsenders = $bnetsenders . "]"; -$bnetrcvs = $bnetrcvs . "]"; + # print "node ". $gsi_ip . " uses ports ".$hadaqports . ", calibflags " .$calibflags . " hubs: ". $subevents ."\n"; + } + $bnetsenders = $bnetsenders . "]"; + $bnetrcvs = $bnetrcvs . "]"; -print "bnetsenders: ". $bnetsenders ."\n"; -print "bnetreceivers: ". $bnetrcvs ."\n"; + print "bnetsenders: ". $bnetsenders ."\n"; + print "bnetreceivers: ". $bnetrcvs ."\n"; - my $portid=0; # + my $portid=0; # my $sendid=0; - - my $bnebport=12100; -for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1){ - print "Starting input processes on EB server: $ebserver\n"; - my $ebid=$ebserver + 1; # still need unique eventbuilder ids on cluster because of epics! - - my $cpu = $bnetservers[$ebserver]; - - my $gsi_cpu = getIP_hades2gsi($cpu); - # in the following, the port and ip setup of the bnet is taken from ebproc 15 or 0 only! - - my $bnet_numsenders = $EB_Args_href->{$ebserver}->{'BNET_INP'}; - #my $bnet_numbuilders = $EB_Args_href->{$ebserver}->{'BNET_BLD'}; - print "found $bnet_numsenders senders on node $cpu \n"; - - - - my $bninpport=12501; - - # loop over senders on this node and start them: - for(my $sender=0; $sender<$bnet_numsenders; $sender=$sender+1) - { - - #my $sendnum= $sender + 1; - - my $exports = " export MYHOST=" . $gsi_cpu . ";" . - " export BNETMASTER=" . $bnetmaster . ";" . - #" export BNINPNUM=" . $sendnum . ";" . # need to use different sender numbers on differentnodes - " export BNINPNUM=" . $ebid . ";" . # todo: extend if more than one sender per node - " export BNINPID=" . $sendid . "; " . - " export BNINPPORT=" . $bninpport . "; " . - " export BNETSENDERS=" . $bnetsenders . ";" . - " export BNETRECEIVERS=" . $bnetrcvs . ";" . - " export HADAQPORTS=" . $bnet_port_list[$ebserver] .";" . - " export SUBEVENTS=" . $bnet_subevt_list[$ebserver] .";" . - " export CALIBFLAGS=" . $bnet_calib_list[$ebserver] .";"; - - # todo: how to configure situation with more than one bnet input per node? hadaqports must be distributed on them... - # - - #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); - my $core_nr = &getCoreNr($cpu, 'input'); - my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_inp 1senderlog_$cpu.log 2>&1 &\""; - - - my $log = $log_path . "/log_" . $ebserver . "_" . "startBnetInp_". $sender. ".txt"; - #my $log = "/dev/null 2>&1"; - - print "Forking:" . $exe_dabc ."\n"; - forkMe($exe_dabc, $log, \@process_list) unless($opt_test); - - $sendid = $sendid +1; - $bninpport = $bninpport +1; - - } # bnet sender/input processes - - } # end senders - # todo: loop over builders - - for ( my $ebserver=0; $ebserver<4; $ebserver=$ebserver+1){ - print "Starting builder processes on EB server: $ebserver\n"; - my $ebid=$ebserver + 1; # still need unique eventbuilder ids on cluster because of epics! - - my $cpu = $bnetservers[$ebserver]; - my $gsi_cpu = getIP_hades2gsi($cpu); - # in the following, the port and ip setup of the bnet is taken from ebproc 15 or 0 only! - - #my $bnet_numbuilders = $EB_Args_href->{$ebserver}->{'BNET_BLD'}; - - print "start $localbuilders[$ebserver] builders on node $cpu \n"; - - - - for(my $builder=0; $builder<$localbuilders[$ebserver]; $builder=$builder+1) - { - - my $exports = " export MYHOST=" . $gsi_cpu . ";" . - " export BNETMASTER=" . $bnetmaster . ";" . - " export BNEBNUM=" . $ebid . ";" . - " export BNEBID=" . $portid . "; " . - " export BNEBPORT=" . $bnebport . "; " . - # ignore prefix at startup. always start without files and show it: - #" export PREFIX=" . $EB_Args_href->{$ebproc}->{'PREFIX'}. "; " . - " export PREFIX=--;" . - " export BNETSENDERS=" . $bnetsenders . ";" . - " export BNETRECEIVERS=" . $bnetrcvs . ";" . - " export HADAQPORTS=" . $bnet_port_list[$ebserver]. "; " ; - - -# - - - - if($EB_Args_href->{$ebproc}->{'OUTDIR'} ){ - # no daqdisk demon anymore for raid6- - $exports = $exports . "export DAQDISK=0; export OUTDIR=/data01/data; "; - -# if($EB_Args_href->{$ebproc}->{'MULTIDISK'}){ -# $exports = $exports . "export DAQDISK=1; export OUTDIR=/data01; "; -# } -# else{ -# $exports = $exports . "export DAQDISK=0; export OUTDIR=" . $EB_Args_href->{$ebproc}->{'OUTDIR'} .";"; -# } - - - - -# } - if( $EB_Args_href->{$ebproc}->{'LTSM'} ){ - - # switch on by number of outputs - $exports = $exports . " export FILEOUTPUTS=3;"; - # additional exports for LTSM - - $exports = $exports . " export LTSMPATH=". $EB_Args_href->{$ebproc}->{'LTSM_PATH'} . ";"; - $exports = $exports . " export LTSMSERVER=". $EB_Args_href->{$ebproc}->{'LTSM_Server'} . ";"; - $exports = $exports . " export LTSMNODE=". $EB_Args_href->{$ebproc}->{'LTSM_Node'} . ";"; - $exports = $exports . " export LTSMPASSWD=". $EB_Args_href->{$ebproc}->{'LTSM_Passwd'} . ";"; - $exports = $exports . " export LTSMFSNAME=". $EB_Args_href->{$ebproc}->{'LTSM_Filesystem'} . ";"; - $exports = $exports . " export DSM_LOG=/home/hadaq/oper/ltsm". $ebid .".log;"; - - # new for file system daemon JAM2020: - if ($EB_Args_href->{$ebproc}->{'LTSM_USEFSD'}){ - $exports = $exports . " export USEFSD=true;"; - $exports = $exports . " export LTSMSESSIONFILES=999999;"; - # increase number of session files if fsd is used: - } - else - { - $exports = $exports . " export USEFSD=false;"; - $exports = $exports . " export LTSMSESSIONFILES=10;" - } - -# $exports = $exports . " export FSDPORT=". $EB_Args_href->{$ebproc}->{'LTSM_FSD_PORT'} . ";"; -# $exports = $exports . " export FSDSERVER=". $EB_Args_href->{$ebproc}->{'LTSM_FSD_SERVER'} . ";"; - - my $fsdix=$ebserver % 3; # number of FSD servers used TODO get from configuration - # in this case, server 4 will use first fsd - $exports = $exports . " export FSDPORT=". $EB_Args_href->{$fsdix}->{'LTSM_FSD_PORT'} . ";"; - $exports = $exports . " export FSDSERVER=". $EB_Args_href->{$fsdix}->{'LTSM_FSD_SERVER'} . ";"; - - - } - - else - { - # no rfio, just local file - $exports = $exports . " export FILEOUTPUTS=2;"; - } - - - - - } #outdir - else{ - $exports = $exports . " export FILEOUTPUTS=1;"; - # no output except for the stream server... - } - - #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); - my $core_nr = &getCoreNr($cpu, 'build'); - - my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_bld 1builderlog_$cpu.log 2>&1 &\""; - - - my $log = $log_path . "/log_" . $ebserver . "_" . "startBnetBld_". $builder . ".txt"; - #my $log = "/dev/null 2>&1"; - - print "Forking:" . $exe_dabc ."\n"; - forkMe($exe_dabc, $log, \@process_list) unless($opt_test); - - $ebid = $ebid + 4 ; # increment ebnum by 4 per ebserver to re-use EPICS iocs - $portid = $portid + 1; - $bnebport = $bnebport +1; - # + + my $bnebport=12100; + for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1) { + print "Starting input processes on EB server: $ebserver\n"; + my $ebid=$ebserver + 1; # still need unique eventbuilder ids on cluster because of epics! + my $cpu = $bnetservers[$ebserver]; + + my $gsi_cpu = getIP_hades2gsi($cpu); + # in the following, the port and ip setup of the bnet is taken from ebproc 15 or 0 only! + my $bnet_numsenders = $EB_Args_href->{$ebserver}->{'BNET_INP'}; + #my $bnet_numbuilders = $EB_Args_href->{$ebserver}->{'BNET_BLD'}; + print "found $bnet_numsenders senders on node $cpu \n"; + + my $bninpport=12501; + # loop over senders on this node and start them: + for (my $sender=0; $sender<$bnet_numsenders; $sender=$sender+1) { + #my $sendnum= $sender + 1; + my $exports = " export MYHOST=" . $gsi_cpu . ";" . + " export BNETMASTER=" . $bnetmaster . ";" . + #" export BNINPNUM=" . $sendnum . ";" . # need to use different sender numbers on differentnodes + " export BNINPNUM=" . $ebid . ";" . # todo: extend if more than one sender per node + " export BNINPID=" . $sendid . "; " . + " export BNINPPORT=" . $bninpport . "; " . + " export BNETSENDERS=" . $bnetsenders . ";" . + " export BNETRECEIVERS=" . $bnetrcvs . ";" . + " export HADAQPORTS=" . $bnet_port_list[$ebserver] .";" . + " export SUBEVENTS=" . $bnet_subevt_list[$ebserver] .";" . + " export CALIBFLAGS=" . $bnet_calib_list[$ebserver] .";"; + # todo: how to configure situation with more than one bnet input per node? hadaqports must be distributed on them... + # + #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); + my $core_nr = &getCoreNr($cpu, 'input'); + my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_inp 1senderlog_$cpu.log 2>&1 &\""; + + + my $log = $log_path . "/log_" . $ebserver . "_" . "startBnetInp_". $sender. ".txt"; + #my $log = "/dev/null 2>&1"; + + print "Forking:" . $exe_dabc ."\n"; + forkMe($exe_dabc, $log, \@process_list) unless($opt_test); + + $sendid = $sendid +1; + $bninpport = $bninpport +1; + } # bnet sender/input processes + } # end senders + # todo: loop over builders + + for ( my $ebserver=0; $ebserver<5; $ebserver=$ebserver+1) { + print "Starting builder processes on EB server: $ebserver\n"; + my $ebid=$ebserver + 1; # still need unique eventbuilder ids on cluster because of epics! + my $cpu = $bnetservers[$ebserver]; + my $gsi_cpu = getIP_hades2gsi($cpu); + # in the following, the port and ip setup of the bnet is taken from ebproc 15 or 0 only! + #my $bnet_numbuilders = $EB_Args_href->{$ebserver}->{'BNET_BLD'}; + print "start $localbuilders[$ebserver] builders on node $cpu \n"; + + for (my $builder=0; $builder<$localbuilders[$ebserver]; $builder=$builder+1) { + my $exports = " export MYHOST=" . $gsi_cpu . ";" . + " export BNETMASTER=" . $bnetmaster . ";" . + " export BNEBNUM=" . $ebid . ";" . + " export BNEBID=" . $portid . "; " . + " export BNEBPORT=" . $bnebport . "; " . + # ignore prefix at startup. always start without files and show it: + #" export PREFIX=" . $EB_Args_href->{$ebproc}->{'PREFIX'}. "; " . + " export PREFIX=--;" . + " export BNETSENDERS=" . $bnetsenders . ";" . + " export BNETRECEIVERS=" . $bnetrcvs . ";" . + " export HADAQPORTS=" . $bnet_port_list[$ebserver]. "; " ; + + if ($EB_Args_href->{$ebproc}->{'OUTDIR'} ) { + # no daqdisk demon anymore for raid6- + $exports = $exports . "export DAQDISK=0; export OUTDIR=/data01/data; "; + # if($EB_Args_href->{$ebproc}->{'MULTIDISK'}){ + # $exports = $exports . "export DAQDISK=1; export OUTDIR=/data01; "; + # } + # else{ + # $exports = $exports . "export DAQDISK=0; export OUTDIR=" . $EB_Args_href->{$ebproc}->{'OUTDIR'} .";"; + # } + + # } + if ( $EB_Args_href->{$ebproc}->{'LTSM'} ) { + + # switch on by number of outputs + $exports = $exports . " export FILEOUTPUTS=3;"; + # additional exports for LTSM + + $exports = $exports . " export LTSMPATH=". $EB_Args_href->{$ebproc}->{'LTSM_PATH'} . ";"; + $exports = $exports . " export LTSMSERVER=". $EB_Args_href->{$ebproc}->{'LTSM_Server'} . ";"; + $exports = $exports . " export LTSMNODE=". $EB_Args_href->{$ebproc}->{'LTSM_Node'} . ";"; + $exports = $exports . " export LTSMPASSWD=". $EB_Args_href->{$ebproc}->{'LTSM_Passwd'} . ";"; + $exports = $exports . " export LTSMFSNAME=". $EB_Args_href->{$ebproc}->{'LTSM_Filesystem'} . ";"; + $exports = $exports . " export DSM_LOG=/home/hadaq/oper/ltsm". $ebid .".log;"; + + # new for file system daemon JAM2020: + if ($EB_Args_href->{$ebproc}->{'LTSM_USEFSD'}) { + $exports = $exports . " export USEFSD=true;"; + $exports = $exports . " export LTSMSESSIONFILES=999999;"; + # increase number of session files if fsd is used: + } else { + $exports = $exports . " export USEFSD=false;"; + $exports = $exports . " export LTSMSESSIONFILES=10;" + } + # $exports = $exports . " export FSDPORT=". $EB_Args_href->{$ebproc}->{'LTSM_FSD_PORT'} . ";"; + # $exports = $exports . " export FSDSERVER=". $EB_Args_href->{$ebproc}->{'LTSM_FSD_SERVER'} . ";"; + my $fsdix=$ebserver % 3; # number of FSD servers used TODO get from configuration + # in this case, server 4 will use first fsd + $exports = $exports . " export FSDPORT=". $EB_Args_href->{$fsdix}->{'LTSM_FSD_PORT'} . ";"; + $exports = $exports . " export FSDSERVER=". $EB_Args_href->{$fsdix}->{'LTSM_FSD_SERVER'} . ";"; + } else { + # no rfio, just local file + $exports = $exports . " export FILEOUTPUTS=2;"; + } + + } #outdir + else { + $exports = $exports . " export FILEOUTPUTS=1;"; + # no output except for the stream server... + } + #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); + my $core_nr = &getCoreNr($cpu, 'build'); + my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_bnet_bld 1builderlog_$cpu.log 2>&1 &\""; + + + my $log = $log_path . "/log_" . $ebserver . "_" . "startBnetBld_". $builder . ".txt"; + #my $log = "/dev/null 2>&1"; + print "Forking:" . $exe_dabc ."\n"; + forkMe($exe_dabc, $log, \@process_list) unless($opt_test); + + $ebid = $ebid + 5 ; # increment ebnum by 5 (JAM2020) per ebserver to re-use EPICS iocs + $portid = $portid + 1; + $bnebport = $bnebport +1; + # } # builder processes - - } # servers - - # finally, we need to set eb lut on cts for setup of EB1 => bnet distribution - #trbcmd w 0x0003 0xa0f0 0x8000`; - #`trbcmd w 0x0003 0xa0f0 0x1`; - `trbcmd setbit 0x0003 0xa0f0 0x1`; - # use EB1 as pseude for BNET now - # all calibration triggers also assigned to pseudo EB1=> bnet distribution for the moment - #trbcmd w 0x0003 0xa0f3 0xfff`; - # `trbcmd w 0x0003 0xa0f3 0xff0`; - `trbcmd setbit 0x0003 0xa0f3 0xff0`; - # use EB1 as pseudo receiver for calib triggers - -sleep (5); # seems also to be fine: michael, 2019-02-18 - -# sleep (20) # old # need to wait until forking is done, otherwise it does not work via gui control xterm + } # servers + + # finally, we need to set eb lut on cts for setup of EB1 => bnet distribution + #trbcmd w 0x0003 0xa0f0 0x8000`; + #`trbcmd w 0x0003 0xa0f0 0x1`; + `trbcmd setbit 0x0003 0xa0f0 0x1`; + # use EB1 as pseude for BNET now + # all calibration triggers also assigned to pseudo EB1=> bnet distribution for the moment + #trbcmd w 0x0003 0xa0f3 0xfff`; + # `trbcmd w 0x0003 0xa0f3 0xff0`; + `trbcmd setbit 0x0003 0xa0f3 0xff0`; + # use EB1 as pseudo receiver for calib triggers + + sleep (5); # seems also to be fine: michael, 2019-02-18 + + # sleep (20) # old # need to wait until forking is done, otherwise it does not work via gui control xterm } -sub startEvtBuilders() -{ - if( $EB_Args_href->{0}->{'BNET_INP'} ){ +sub startEvtBuilders() { + if ( $EB_Args_href->{0}->{'BNET_INP'} ) { print "Starting Builder network...\n"; - startBnet(); - return; - } + startBnet(); + return; + } -# print "DISABLING regular eventbuilder start for testing!\n"; -# return; -######################################## - my $username = "hadaq"; + # print "DISABLING regular eventbuilder start for testing!\n"; + # return; + ######################################## + my $username = "hadaq"; - my (@process_list); + my (@process_list); - foreach my $ebproc (sort {$a <=> $b} keys %$EB_Args_href){ + foreach my $ebproc (sort {$a <=> $b} keys %$EB_Args_href) { + + my $ebnum2print = $ebproc+1; + print "EB process: $ebnum2print\n"; - my $ebnum2print = $ebproc+1; - print "EB process: $ebnum2print\n"; + if ($ebproc==15) { + print "Ignore eventbuilder 16, setup is reserved for BNET. \n"; + return; + } + # JAM first test if we should activate dabc eventbuilder or old one + + if ( $EB_Args_href->{$ebproc}->{'DABC'} ) { + print "Starting DABC process..\n"; + + #". /home/joern/dabcwork/head/dabclogin;cd /home/joern/dabcwork/head/plugins/hadaq/app; export EBNUM=1; export STREAMS=5; export UDP00=10101; export UDP01=10102; export UDP02=10103; export UDP03=10104; export UDP04=10105 export PREFIX=be; /home/joern/dabcwork/head/bin/dabc_exe EventBuilderHades.xml &" > /dev/null 2>&1 & + + my $cpu = $EB_Args_href->{$ebproc}->{'IP'}; + # JAM old, direct to version + #my $dabclogin = ". /home/hadaq/soft/dabc/head/dabclogin;"; + # JAM default: + #my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin;";# + #my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin.275;"; + my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin.head; "; + # here test special installations: + my $cdworkdir = "cd /home/hadaq/oper;"; + + # JAM old, direct to version + #my $cmd_dabc = "/home/hadaq/soft/dabc/head/bin/dabc_exe "; + # JAM default: + #my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe "; + # here test special installations: + # my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe.275 "; + my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe.head "; + + # my $conf_dabc = " EventBuilderHades.xml"; + # my $conf_dabc = " EventBuilderHades.275.xml"; + my $conf_dabc = " EventBuilderHades.head.xml"; + + my $exports = " export LC_ALL=C;" . + " export EBNUM=" . $EB_Args_href->{$ebproc}->{'EBNUM'} . "; " . + " export STREAMS=" . $EB_Args_href->{$ebproc}->{'SOURCENUM'} . "; " . + " export PREFIX=" . $EB_Args_href->{$ebproc}->{'PREFIX'}. "; " ; + + my @port_list = (); + + #- add ports + my $ix =0; + foreach my $port (@{$EB_Args_href->{$ebproc}->{'PORT_LIST'}}) { + #$cmd_nm = $cmd_nm . " -i UDP:0.0.0.0:" . $port; + my $index=sprintf("%02d", $ix++); + $exports = $exports . " export UDP". $index. "=" . $port . "; "; + push(@port_list, $port); + } + &cpPortList2EB(\@port_list, $EB_Args_href->{$ebproc}->{'EBNUM'}, $cpu); -if($ebproc==15) -{ - print "Ignore eventbuilder 16, setup is reserved for BNET. \n"; - return; -} - - -# JAM first test if we should activate dabc eventbuilder or old one - if( $EB_Args_href->{$ebproc}->{'DABC'} ){ - print "Starting DABC process..\n"; + # MULTIDISK -#". /home/joern/dabcwork/head/dabclogin;cd /home/joern/dabcwork/head/plugins/hadaq/app; export EBNUM=1; export STREAMS=5; export UDP00=10101; export UDP01=10102; export UDP02=10103; export UDP03=10104; export UDP04=10105 export PREFIX=be; /home/joern/dabcwork/head/bin/dabc_exe EventBuilderHades.xml &" > /dev/null 2>&1 & + #- add output type - my $cpu = $EB_Args_href->{$ebproc}->{'IP'}; -# JAM old, direct to version - #my $dabclogin = ". /home/hadaq/soft/dabc/head/dabclogin;"; -# JAM default: -#my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin;";# -#my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin.275;"; - my $dabclogin = ". /home/hadaq/soft/dabc/bin/dabclogin.head; "; -# here test special installations: - my $cdworkdir = "cd //home/hadaq/oper;"; - -# JAM old, direct to version -#my $cmd_dabc = "/home/hadaq/soft/dabc/head/bin/dabc_exe "; -# JAM default: -#my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe "; -# here test special installations: -# my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe.275 "; -my $cmd_dabc = "/home/hadaq/soft/dabc/bin/dabc_exe.head "; - -# my $conf_dabc = " EventBuilderHades.xml"; -# my $conf_dabc = " EventBuilderHades.275.xml"; - my $conf_dabc = " EventBuilderHades.head.xml"; - - my $exports = " export LC_ALL=C;" . - " export EBNUM=" . $EB_Args_href->{$ebproc}->{'EBNUM'} . "; " . - " export STREAMS=" . $EB_Args_href->{$ebproc}->{'SOURCENUM'} . "; " . - " export PREFIX=" . $EB_Args_href->{$ebproc}->{'PREFIX'}. "; " ; - - my @port_list = (); - - #- add ports - my $ix =0; - foreach my $port (@{$EB_Args_href->{$ebproc}->{'PORT_LIST'}}){ - #$cmd_nm = $cmd_nm . " -i UDP:0.0.0.0:" . $port; - my $index=sprintf("%02d", $ix++); - $exports = $exports . " export UDP". $index. "=" . $port . "; "; - push(@port_list, $port); - } - &cpPortList2EB(\@port_list, $EB_Args_href->{$ebproc}->{'EBNUM'}, $cpu); - - - - - - -# MULTIDISK - -#- add output type - - if($EB_Args_href->{$ebproc}->{'OUTDIR'} ){ - if($EB_Args_href->{$ebproc}->{'MULTIDISK'}){ - $exports = $exports . "export DAQDISK=1; export OUTDIR=/data01; "; - } - else{ - $exports = $exports . "export DAQDISK=0; export OUTDIR=" . $EB_Args_href->{$ebproc}->{'OUTDIR'} .";"; - } - - if( $EB_Args_href->{$ebproc}->{'LTSM'} ){ - - $exports = $exports . " export FILEOUTPUTS=3;"; - # additional exports for LTSM - - $exports = $exports . " export LTSMPATH=". $EB_Args_href->{$ebproc}->{'LTSM_PATH'} . ";"; - $exports = $exports . " export LTSMSERVER=". $EB_Args_href->{$ebproc}->{'LTSM_Server'} . ";"; - $exports = $exports . " export LTSMNODE=". $EB_Args_href->{$ebproc}->{'LTSM_Node'} . ";"; - $exports = $exports . " export LTSMPASSWD=". $EB_Args_href->{$ebproc}->{'LTSM_Passwd'} . ";"; - $exports = $exports . " export LTSMFSNAME=". $EB_Args_href->{$ebproc}->{'LTSM_Filesystem'} . ";"; - -# switch on by number of outputs - } -################## deprecated, keep code for optional testing? -# JAM 5-2017 - we never run rfio and ltsm in parallel. -# if( $EB_Args_href->{$ebproc}->{'RFIO'} ){ -# -# $exports = $exports . " export FILEOUTPUTS=3;"; -# # additional exports for RFIO -# -# $exports = $exports . " export RFIOPATH=". $EB_Args_href->{$ebproc}->{'RFIO_PATH'} . ";"; -# $exports = $exports . " export RFIOLUSTREPATH=". $EB_Args_href->{$ebproc}->{'RFIO_pcCopyPath'} . ";"; -# $exports = $exports . " export RFIOCOPYMODE=". $EB_Args_href->{$ebproc}->{'RFIO_iCopyMode'} . ";"; -# $exports = $exports . " export RFIOCOPYFRAC=". $EB_Args_href->{$ebproc}->{'RFIO_iCopyFrac'} . ";"; -# $exports = $exports . " export RFIOMAXFILE=". $EB_Args_href->{$ebproc}->{'RFIO_iMaxFile'} . ";"; -# $exports = $exports . " export RFIOPATHCONV=". $EB_Args_href->{$ebproc}->{'RFIO_iPathConv'} . ";"; -# -# # switch on by number of outputs -# } -####################################### - else - { - # no rfio, just local file - $exports = $exports . " export FILEOUTPUTS=2;"; - } - - - - - } #outdir - else{ - $exports = $exports . " export FILEOUTPUTS=1;"; - # no output except for the stream server... - } - - + if ($EB_Args_href->{$ebproc}->{'OUTDIR'} ) { + if ($EB_Args_href->{$ebproc}->{'MULTIDISK'}) { + $exports = $exports . "export DAQDISK=1; export OUTDIR=/data01; "; + } else { + $exports = $exports . "export DAQDISK=0; export OUTDIR=" . $EB_Args_href->{$ebproc}->{'OUTDIR'} .";"; + } + if ( $EB_Args_href->{$ebproc}->{'LTSM'} ) { + $exports = $exports . " export FILEOUTPUTS=3;"; + # additional exports for LTSM + + $exports = $exports . " export LTSMPATH=". $EB_Args_href->{$ebproc}->{'LTSM_PATH'} . ";"; + $exports = $exports . " export LTSMSERVER=". $EB_Args_href->{$ebproc}->{'LTSM_Server'} . ";"; + $exports = $exports . " export LTSMNODE=". $EB_Args_href->{$ebproc}->{'LTSM_Node'} . ";"; + $exports = $exports . " export LTSMPASSWD=". $EB_Args_href->{$ebproc}->{'LTSM_Passwd'} . ";"; + $exports = $exports . " export LTSMFSNAME=". $EB_Args_href->{$ebproc}->{'LTSM_Filesystem'} . ";"; + # switch on by number of outputs + } + ################## deprecated, keep code for optional testing? + # JAM 5-2017 - we never run rfio and ltsm in parallel. + # if( $EB_Args_href->{$ebproc}->{'RFIO'} ){ + # + # $exports = $exports . " export FILEOUTPUTS=3;"; + # # additional exports for RFIO + # + # $exports = $exports . " export RFIOPATH=". $EB_Args_href->{$ebproc}->{'RFIO_PATH'} . ";"; + # $exports = $exports . " export RFIOLUSTREPATH=". $EB_Args_href->{$ebproc}->{'RFIO_pcCopyPath'} . ";"; + # $exports = $exports . " export RFIOCOPYMODE=". $EB_Args_href->{$ebproc}->{'RFIO_iCopyMode'} . ";"; + # $exports = $exports . " export RFIOCOPYFRAC=". $EB_Args_href->{$ebproc}->{'RFIO_iCopyFrac'} . ";"; + # $exports = $exports . " export RFIOMAXFILE=". $EB_Args_href->{$ebproc}->{'RFIO_iMaxFile'} . ";"; + # $exports = $exports . " export RFIOPATHCONV=". $EB_Args_href->{$ebproc}->{'RFIO_iPathConv'} . ";"; + # + # # switch on by number of outputs + # } + ####################################### + else { + # no rfio, just local file + $exports = $exports . " export FILEOUTPUTS=2;"; + } - + } #outdir + else { + $exports = $exports . " export FILEOUTPUTS=1;"; + # no output except for the stream server... + } + # EPICSCONTROL ? always enabled for production + # SMALLFILES for online monitoring node + + # Jul14 beamtime setup 3 cores for dabc + #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu) . "," . &getCoreNr($cpu); + + # try 2 cores each dabc for more dabc nodes: + my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); + # my $core_nr = &getCoreNr($cpu); + # dabc is set to 3 cores + # JAM use fixed core number for kp1pc092 tests: + # my $core_nr = 1; + my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_dabc 1{$ebproc}->{'SOURCENUM'} . + " -q " . $EB_Args_href->{$ebproc}->{'QUEUESIZE'} . + " -S " . $EB_Args_href->{$ebproc}->{'EBNUM'} . + " --ebnum " . $EB_Args_href->{$ebproc}->{'EBNUM'} . + " -x " . $EB_Args_href->{$ebproc}->{'PREFIX'}; + + #- add queue variable size args + my $varsize_arg = &getVarSizeArg($ebproc); + $cmd_eb = $cmd_eb . $varsize_arg; + + #- add output type + if ( defined $EB_Args_href->{$ebproc}->{'OUTDIR'} ) { + if ($EB_Args_href->{$ebproc}->{'MULTIDISK'}) { + $cmd_eb = $cmd_eb . " -d file -o " . "/data01/data"; + } else { + $cmd_eb = $cmd_eb . " -d file -o " . $EB_Args_href->{$ebproc}->{'OUTDIR'}; + } + } else { + $cmd_eb = $cmd_eb . " -d null"; + } + #- add file size + $cmd_eb = $cmd_eb . " --filesize " . $EB_Args_href->{$ebproc}->{'FILESIZE'}; + #- add second output with small hdl files + if ( defined $EB_Args_href->{$ebproc}->{'RESDOWNSCALE'} ) { + $cmd_eb = $cmd_eb . " --resdownscale " . $EB_Args_href->{$ebproc}->{'RESDOWNSCALE'} . + " --resnumevents " . $EB_Args_href->{$ebproc}->{'RESNUMEVENTS'} . + " --respath " . $EB_Args_href->{$ebproc}->{'RESPATH'} . + " --ressizelimit " . $EB_Args_href->{$ebproc}->{'RESSIZELIMIT'}; + } -# EPICSCONTROL ? always enabled for production -# SMALLFILES for online monitoring node + my $cpu = $EB_Args_href->{$ebproc}->{'IP'}; + + #- add rfio args + my $rfio; + if ( $EB_Args_href->{$ebproc}->{'RFIO'} ) { + $rfio = " --rfio rfiodaq:gstore:" . $EB_Args_href->{$ebproc}->{'RFIO_PATH'} . + " --rfiolustre " . $EB_Args_href->{$ebproc}->{'RFIO_pcCopyPath'} . + " --rfio_pcoption " . $EB_Args_href->{$ebproc}->{'RFIO_pcOptions'} . + " --rfio_icopymode " . $EB_Args_href->{$ebproc}->{'RFIO_iCopyMode'} . + " --rfio_icopyfrac " . $EB_Args_href->{$ebproc}->{'RFIO_iCopyFrac'} . + " --rfio_imaxfile " . $EB_Args_href->{$ebproc}->{'RFIO_iMaxFile'} . + " --rfio_ipathconv " . $EB_Args_href->{$ebproc}->{'RFIO_iPathConv'}; + } -# Jul14 beamtime setup 3 cores for dabc - #my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu) . "," . &getCoreNr($cpu); + $cmd_eb = $cmd_eb . $rfio if( defined $rfio ); -# try 2 cores each dabc for more dabc nodes: - my $core_nr = &getCoreNr($cpu) . "," . &getCoreNr($cpu); -# my $core_nr = &getCoreNr($cpu); -# dabc is set to 3 cores - -# JAM use fixed core number for kp1pc092 tests: -# my $core_nr = 1; - my $exe_dabc = "ssh -n $cpu -l $username \"$dabclogin $cdworkdir $exports taskset -c $core_nr $cmd_dabc $conf_dabc 1{$ebproc}->{'MULTIDISK'} && + defined $EB_Args_href->{$ebproc}->{'OUTDIR'}) { + $cmd_eb = $cmd_eb . " --multidisk " . $EB_Args_href->{$ebproc}->{'MULTIDISK'}; + } + #- add online RPC server + if ( $EB_Args_href->{$ebproc}->{'ONLINESERVER'} eq "on" ) { + $cmd_eb = $cmd_eb . " --online"; + } - my $log = $log_path . "/log_" . $ebproc . "_" . "startEB.txt"; - #my $log = "/dev/null 2>&1"; - - print "Forking:" . $exe_dabc ."\n"; - forkMe($exe_dabc, $log, \@process_list) unless($opt_test); + #- add epics controlled + $cmd_eb = $cmd_eb . " --epicsctrl " if( $EB_Args_href->{$ebproc}->{'EPICS_CTRL'} ); -} + # switch on debug output + $cmd_eb = $cmd_eb . " --debug trignr --debug errbit --debug word " if( $EB_Args_href->{$ebproc}->{'EB_DEBUG'} ); -else -{ -# the standard EB processes mode: - print "Starting evtbuild/netmem processes..\n"; - - #--- Prepare execution of daq_evtbuild - my $cmd_eb = "/home/hadaq/bin/daq_evtbuild" . - " -m " . $EB_Args_href->{$ebproc}->{'SOURCENUM'} . - " -q " . $EB_Args_href->{$ebproc}->{'QUEUESIZE'} . - " -S " . $EB_Args_href->{$ebproc}->{'EBNUM'} . - " --ebnum " . $EB_Args_href->{$ebproc}->{'EBNUM'} . - " -x " . $EB_Args_href->{$ebproc}->{'PREFIX'}; - - #- add queue variable size args - my $varsize_arg = &getVarSizeArg($ebproc); - $cmd_eb = $cmd_eb . $varsize_arg; - - #- add output type - if( defined $EB_Args_href->{$ebproc}->{'OUTDIR'} ){ - if($EB_Args_href->{$ebproc}->{'MULTIDISK'}){ - $cmd_eb = $cmd_eb . " -d file -o " . "/data01/data"; - } - else{ - $cmd_eb = $cmd_eb . " -d file -o " . $EB_Args_href->{$ebproc}->{'OUTDIR'}; - } - } - else{ - $cmd_eb = $cmd_eb . " -d null"; - } - #- add file size - $cmd_eb = $cmd_eb . " --filesize " . $EB_Args_href->{$ebproc}->{'FILESIZE'}; + + #- logging the output + my $eblog_file = "/tmp/log_eb_" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".txt"; + my $eb_log = "1>$eblog_file 2>$eblog_file"; + $eb_log = "1>/dev/null 2>/dev/null" unless( $EB_Args_href->{$ebproc}->{'EB_LOG'} ); - #- add second output with small hdl files - if( defined $EB_Args_href->{$ebproc}->{'RESDOWNSCALE'} ){ - $cmd_eb = $cmd_eb . " --resdownscale " . $EB_Args_href->{$ebproc}->{'RESDOWNSCALE'} . - " --resnumevents " . $EB_Args_href->{$ebproc}->{'RESNUMEVENTS'} . - " --respath " . $EB_Args_href->{$ebproc}->{'RESPATH'} . - " --ressizelimit " . $EB_Args_href->{$ebproc}->{'RESSIZELIMIT'}; - } + my $time = 1. * $ebproc; + my $sleep_cmd = "sleep " . $time; - my $cpu = $EB_Args_href->{$ebproc}->{'IP'}; - - #- add rfio args - my $rfio; - if( $EB_Args_href->{$ebproc}->{'RFIO'} ){ - $rfio = " --rfio rfiodaq:gstore:" . $EB_Args_href->{$ebproc}->{'RFIO_PATH'} . - " --rfiolustre " . $EB_Args_href->{$ebproc}->{'RFIO_pcCopyPath'} . - " --rfio_pcoption " . $EB_Args_href->{$ebproc}->{'RFIO_pcOptions'} . - " --rfio_icopymode " . $EB_Args_href->{$ebproc}->{'RFIO_iCopyMode'} . - " --rfio_icopyfrac " . $EB_Args_href->{$ebproc}->{'RFIO_iCopyFrac'} . - " --rfio_imaxfile " . $EB_Args_href->{$ebproc}->{'RFIO_iMaxFile'} . - " --rfio_ipathconv " . $EB_Args_href->{$ebproc}->{'RFIO_iPathConv'}; - } + my $core_nr = &getCoreNr($cpu); - $cmd_eb = $cmd_eb . $rfio if( defined $rfio ); + my $exe_eb = "ssh -n $cpu -l $username \"cd /home/hadaq/oper; export DAQ_SETUP=/home/hadaq/oper/eb; taskset -c $core_nr $cmd_eb $eb_log &\""; - #- add multiple disk arg (ctrl via daq_disks) - if($EB_Args_href->{$ebproc}->{'MULTIDISK'} && - defined $EB_Args_href->{$ebproc}->{'OUTDIR'}){ - $cmd_eb = $cmd_eb . " --multidisk " . $EB_Args_href->{$ebproc}->{'MULTIDISK'}; - } + #print "exec: $exe_eb\n"; - #- add online RPC server - if( $EB_Args_href->{$ebproc}->{'ONLINESERVER'} eq "on" ){ - $cmd_eb = $cmd_eb . " --online"; - } + #--- Prepare execution of daq_netmem + my $cmd_nm = "/home/hadaq/bin/daq_netmem" . + " -m " . $EB_Args_href->{$ebproc}->{'SOURCENUM'} . + " -q " . $EB_Args_href->{$ebproc}->{'QUEUESIZE'} . + " -S " . $EB_Args_href->{$ebproc}->{'EBNUM'}; - #- add epics controlled - $cmd_eb = $cmd_eb . " --epicsctrl " if( $EB_Args_href->{$ebproc}->{'EPICS_CTRL'} ); + #- add queue variable size args + $cmd_nm = $cmd_nm . $varsize_arg; - # switch on debug output - $cmd_eb = $cmd_eb . " --debug trignr --debug errbit --debug word " if( $EB_Args_href->{$ebproc}->{'EB_DEBUG'} ); + my @port_list = (); + #- add ports + foreach my $port (@{$EB_Args_href->{$ebproc}->{'PORT_LIST'}}) { + #$cmd_nm = $cmd_nm . " -i UDP:0.0.0.0:" . $port; + $cmd_nm = $cmd_nm . " -i " . $port; - - #- logging the output - my $eblog_file = "/tmp/log_eb_" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".txt"; - my $eb_log = "1>$eblog_file 2>$eblog_file"; - $eb_log = "1>/dev/null 2>/dev/null" unless( $EB_Args_href->{$ebproc}->{'EB_LOG'} ); + push(@port_list, $port); + } - my $time = 1. * $ebproc; - my $sleep_cmd = "sleep " . $time; + &cpPortList2EB(\@port_list, $EB_Args_href->{$ebproc}->{'EBNUM'}, $cpu); - my $core_nr = &getCoreNr($cpu); + #- logging the output + my $nmlog_file = "/tmp/log_nm_" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".txt"; + my $nm_log = "1>$nmlog_file 2>$nmlog_file"; + $nm_log = "1>/dev/null 2>/dev/null" unless( $EB_Args_href->{$ebproc}->{'NM_LOG'} ); - my $exe_eb = "ssh -n $cpu -l $username \"cd /home/hadaq/oper; export DAQ_SETUP=/home/hadaq/oper/eb; taskset -c $core_nr $cmd_eb $eb_log &\""; + $core_nr = &getCoreNr($cpu); - #print "exec: $exe_eb\n"; + my $exe_nm = "ssh -n $cpu -l $username \"cd /home/hadaq/oper; export DAQ_SETUP=/home/hadaq/oper/eb; taskset -c $core_nr $cmd_nm $nm_log &\""; - #--- Prepare execution of daq_netmem - my $cmd_nm = "/home/hadaq/bin/daq_netmem" . - " -m " . $EB_Args_href->{$ebproc}->{'SOURCENUM'} . - " -q " . $EB_Args_href->{$ebproc}->{'QUEUESIZE'} . - " -S " . $EB_Args_href->{$ebproc}->{'EBNUM'}; + #print "exec: $exe_nm\n"; - #- add queue variable size args - $cmd_nm = $cmd_nm . $varsize_arg; + #--- Open permissions for shared memory + my $eb_shmem = "daq_evtbuild" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".shm"; + my $nm_shmem = "daq_netmem" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".shm"; + my $exe_open_eb = "ssh -n $cpu -l $username \"chmod 775 /dev/shm/$eb_shmem\""; + my $exe_open_nm = "ssh -n $cpu -l $username \"chmod 775 /dev/shm/$nm_shmem\""; - my @port_list = (); + &forkEB($exe_eb, $exe_nm, $exe_open_eb, $exe_open_nm, \@process_list); + } - #- add ports - foreach my $port (@{$EB_Args_href->{$ebproc}->{'PORT_LIST'}}){ - #$cmd_nm = $cmd_nm . " -i UDP:0.0.0.0:" . $port; - $cmd_nm = $cmd_nm . " -i " . $port; + } + # if dabc - push(@port_list, $port); - } + #- Wait for children + foreach my $cur_child_pid (@process_list) { + waitpid($cur_child_pid,0); + } - &cpPortList2EB(\@port_list, $EB_Args_href->{$ebproc}->{'EBNUM'}, $cpu); +} +# foreach - #- logging the output - my $nmlog_file = "/tmp/log_nm_" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".txt"; - my $nm_log = "1>$nmlog_file 2>$nmlog_file"; - $nm_log = "1>/dev/null 2>/dev/null" unless( $EB_Args_href->{$ebproc}->{'NM_LOG'} ); +sub stopEvtBuilders() { + my $username = "hadaq"; - $core_nr = &getCoreNr($cpu); + my @process_list = (); - my $exe_nm = "ssh -n $cpu -l $username \"cd /home/hadaq/oper; export DAQ_SETUP=/home/hadaq/oper/eb; taskset -c $core_nr $cmd_nm $nm_log &\""; + #--- Loop over server IPs + # foreach my $ip (@EB_IP_list){ + foreach my $ip (@bnetservers) { - #print "exec: $exe_nm\n"; + my $exe = "ssh -n $ip -l $username \"/home/hadaq/bin/cleanup_evtbuild.pl; /home/hadaq/bin/ipcrm.pl\""; - #--- Open permissions for shared memory - my $eb_shmem = "daq_evtbuild" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".shm"; - my $nm_shmem = "daq_netmem" . $EB_Args_href->{$ebproc}->{'EBNUM'} . ".shm"; - my $exe_open_eb = "ssh -n $cpu -l $username \"chmod 775 /dev/shm/$eb_shmem\""; - my $exe_open_nm = "ssh -n $cpu -l $username \"chmod 775 /dev/shm/$nm_shmem\""; - - &forkEB($exe_eb, $exe_nm, $exe_open_eb, $exe_open_nm, \@process_list); + if ($opt_verb) { + print "Killing running EBs...\n"; + print "Exec: $exe\n"; } -} -# if dabc + my $log = $log_path . "/log_" . $ip . "_" . "stopEB.txt"; - #- Wait for children - foreach my $cur_child_pid (@process_list) { - waitpid($cur_child_pid,0); - } + forkMe($exe, $log, \@process_list) unless($opt_test); + } -} -# foreach + #- Wait for children + foreach my $cur_child_pid (@process_list) { + print "wait for $cur_child_pid\n"; + waitpid($cur_child_pid,0); + } +} -sub stopEvtBuilders() -{ - my $username = "hadaq"; +sub cpPortList2EB() { + my ($port_list_aref, $ebnr, $cpu) = @_; - my @process_list = (); + my $tmpfile = "/tmp/eb" . $ebnr . "_" . $cpu . ".txt"; - #--- Loop over server IPs - # foreach my $ip (@EB_IP_list){ -foreach my $ip (@bnetservers){ - - my $exe = "ssh -n $ip -l $username \"/home/hadaq/bin/cleanup_evtbuild.pl; /home/hadaq/bin/ipcrm.pl\""; + #- First write ports to tmp file + my $fh = new FileHandle(">$tmpfile"); - if($opt_verb){ - print "Killing running EBs...\n"; - print "Exec: $exe\n"; - } + if (!$fh) { + my $txt = "\nError! Could not open file \"$tmpfile\" for output. Exit.\n"; + print STDERR $txt; + print $txt; + exit(128); + } - my $log = $log_path . "/log_" . $ip . "_" . "stopEB.txt"; + foreach my $port (@$port_list_aref) { + print $fh "$port\n"; + } - forkMe($exe, $log, \@process_list) unless($opt_test); - } + $fh->close(); - #- Wait for children - foreach my $cur_child_pid (@process_list) { - print "wait for $cur_child_pid\n"; - waitpid($cur_child_pid,0); - } + #- Copy this tmp file to EB + my $exe_cp = "scp $tmpfile hadaq\@$cpu:/tmp/ 1>/dev/null 2>/dev/null"; + system($exe_cp); } -sub cpPortList2EB() -{ - my ($port_list_aref, $ebnr, $cpu) = @_; +sub startIOC() { + my $ioc_dir = "/home/scs/ebctrl/ioc/iocBoot/iocebctrl"; - my $tmpfile = "/tmp/eb" . $ebnr . "_" . $cpu . ".txt"; + &writeIOC_stcmd( $ioc_dir ); - #- First write ports to tmp file - my $fh = new FileHandle(">$tmpfile"); + print "Starting IOCs...\n" if($opt_verb); - if(!$fh) { - my $txt = "\nError! Could not open file \"$tmpfile\" for output. Exit.\n"; - print STDERR $txt; - print $txt; - exit(128); - } - - foreach my $port (@$port_list_aref){ - print $fh "$port\n"; - } + foreach my $ebproc (keys %$EB_Args_href) { - $fh->close(); + my $stcmd = sprintf("st_eb%02d.cmd", 1 + $ebproc); + my $screen_name = sprintf("ioc_eb%02d", 1 + $ebproc); - #- Copy this tmp file to EB - my $exe_cp = "scp $tmpfile hadaq\@$cpu:/tmp/ 1>/dev/null 2>/dev/null"; - system($exe_cp); -} - -sub startIOC() -{ - my $ioc_dir = "/home/scs/ebctrl/ioc/iocBoot/iocebctrl"; - - &writeIOC_stcmd( $ioc_dir ); - - print "Starting IOCs...\n" if($opt_verb); - - foreach my $ebproc (keys %$EB_Args_href){ - - my $stcmd = sprintf("st_eb%02d.cmd", 1 + $ebproc); - my $screen_name = sprintf("ioc_eb%02d", 1 + $ebproc); - - my $cmd = "bash; . /home/scs/.bashrc; export HOSTNAME=\\\$(hostname); cd $ioc_dir; screen -dmS $screen_name ../../bin/linux-x86_64/ebctrl $stcmd"; - my $cpu = $EB_Args_href->{$ebproc}->{'IP'}; - # JAM2016: this is kludge for bnet: - # first IP in hub configuration of pseude EB15 might be set differently - # we always reset it to match lxhadeb05 where epics for builder should belong - if($ebproc == 15) - { - $cpu='192.168.100.15'; - } - #another dirty workaround for bnet at eb0: - if ($ebproc == 0) { - $cpu = '192.168.100.8'; - } - # end bnet kludge - my $exe = "ssh -n $cpu -l scs \"$cmd\""; - - print "Exec: $exe\n" if($opt_verb); - system($exe) unless($opt_test); + my $cmd = "bash; . /home/scs/.bashrc; export HOSTNAME=\\\$(hostname); cd $ioc_dir; screen -dmS $screen_name ../../bin/linux-x86_64/ebctrl $stcmd"; + my $cpu = $EB_Args_href->{$ebproc}->{'IP'}; + # JAM2016: this is kludge for bnet: + # first IP in hub configuration of pseude EB15 might be set differently + # we always reset it to match lxhadeb05 where epics for builder should belong + if ($ebproc == 15) { + $cpu='192.168.100.15'; } + #another dirty workaround for bnet at eb0: + if ($ebproc == 0) { + $cpu = '192.168.100.8'; + } + # end bnet kludge + my $exe = "ssh -n $cpu -l scs \"$cmd\""; + + print "Exec: $exe\n" if($opt_verb); + system($exe) unless($opt_test); + } } -sub smallestEBProcNum() -{ - my $smallest = 1000; +sub smallestEBProcNum() { + my $smallest = 1000; - foreach my $ebproc (keys %$EB_Args_href){ - $smallest = $ebproc if($smallest > $ebproc); - } + foreach my $ebproc (keys %$EB_Args_href) { + $smallest = $ebproc if($smallest > $ebproc); + } - return $smallest; + return $smallest; } -sub writeIOC_stcmd() -{ - my ($ioc_dir) = @_; +sub writeIOC_stcmd() { + my ($ioc_dir) = @_; - # JAM first evaluate ports for ca list - my $epicscalist = "192.168.111.255"; - foreach my $ebproc (keys %$EB_Args_href){ - $epicscalist=sprintf("%s 192.168.111.255:%d", $epicscalist, 10001 + $ebproc); - } - - print "Copying st.cmd files to servers...\n" if($opt_verb); + # JAM first evaluate ports for ca list + my $epicscalist = "192.168.111.255"; + foreach my $ebproc (keys %$EB_Args_href) { + $epicscalist=sprintf("%s 192.168.111.255:%d", $epicscalist, 10001 + $ebproc); + } - my $smallest_ebproc = &smallestEBProcNum(); - - foreach my $ebproc (keys %$EB_Args_href){ - - my $ebNr = 1 + $ebproc; - my $ebnum = sprintf("eb%02d", $ebNr); - my $serverport = 10001+ $ebproc; - - - #- in MBytes - my $maxFileSize = $EB_Args_href->{$ebproc}->{'FILESIZE'}; - - my $ebtype = "slave"; - my $comment_genrunid = "#"; - my $comment_totalevt = "#"; - - if($ebproc == $smallest_ebproc){ - $ebtype = "master"; - $comment_genrunid = ""; - $comment_totalevt = ""; - } + print "Copying st.cmd files to servers...\n" if($opt_verb); + + my $smallest_ebproc = &smallestEBProcNum(); + + foreach my $ebproc (keys %$EB_Args_href) { + + my $ebNr = 1 + $ebproc; + my $ebnum = sprintf("eb%02d", $ebNr); + my $serverport = 10001+ $ebproc; + + #- in MBytes + my $maxFileSize = $EB_Args_href->{$ebproc}->{'FILESIZE'}; + + my $ebtype = "slave"; + my $comment_genrunid = "#"; + my $comment_totalevt = "#"; + + if ($ebproc == $smallest_ebproc) { + $ebtype = "master"; + $comment_genrunid = ""; + $comment_totalevt = ""; + } -# if($ebNr == 1){ -# $comment_totalevt = ""; -# } + # if($ebNr == 1){ + # $comment_totalevt = ""; + # } - my $ioc_stcmd = < \${TOP}/iocBoot/\${IOC}/$ebnum.dbl EOF - my $outfile = "/tmp/st_" . $ebnum . ".cmd"; - my $fh = new FileHandle(">$outfile"); + my $outfile = "/tmp/st_" . $ebnum . ".cmd"; + my $fh = new FileHandle(">$outfile"); - if(!$fh) { - my $txt = "\nError! Could not open file \"$outfile\" for output. Exit.\n"; - print STDERR $txt; - print $txt; - exit(128); - } + if (!$fh) { + my $txt = "\nError! Could not open file \"$outfile\" for output. Exit.\n"; + print STDERR $txt; + print $txt; + exit(128); + } - print $fh $ioc_stcmd; - $fh->close(); + print $fh $ioc_stcmd; + $fh->close(); - my $ip = $EB_Args_href->{$ebproc}->{'IP'}; - my $cmd = "scp $outfile scs\@$ip:$ioc_dir/."; - - print "Exec: $cmd\n" if($opt_verb); - system($cmd) unless($opt_test); - } + my $ip = $EB_Args_href->{$ebproc}->{'IP'}; + my $cmd = "scp $outfile scs\@$ip:$ioc_dir/."; + + print "Exec: $cmd\n" if($opt_verb); + system($cmd) unless($opt_test); + } } -sub killIOC() -{ - my %ioc; - my $ioc_href = \%ioc; +sub killIOC() { + my %ioc; + my $ioc_href = \%ioc; - print "Looking for running IOCs...\n" if($opt_verb); + print "Looking for running IOCs...\n" if($opt_verb); - #--- Loop over server IPs - - #foreach my $ip (@EB_IP_list){ - foreach my $ip (@bnetservers){ + #--- Loop over server IPs - &findRunningIOC($ip, $ioc_href); - } + #foreach my $ip (@EB_IP_list){ + foreach my $ip (@bnetservers) { - #print Dumper \%$ioc_href; + &findRunningIOC($ip, $ioc_href); + } - &writeExpectIOC() if(%$ioc_href); + #print Dumper \%$ioc_href; - if($opt_verb){ - print "Killing running IOCs...\n"; - print "No IOCs found - nothing to kill, continue...\n" unless(%$ioc_href); - } + &writeExpectIOC() if(%$ioc_href); - my (@process_list); + if ($opt_verb) { + print "Killing running IOCs...\n"; + print "No IOCs found - nothing to kill, continue...\n" unless(%$ioc_href); + } - foreach my $ip ( %$ioc_href ){ - foreach my $ioc ( @{$ioc_href->{$ip}} ){ - - my $cmd = $expect_ioc_script . " " . $ip . " " . $ioc; - my $log = $log_path . "/log_" . $ip . "_" . $ioc . ".txt"; - print "cmd: $cmd\n" if($opt_verb); - &forkMe($cmd, $log, \@process_list); - } + my (@process_list); + + foreach my $ip ( %$ioc_href ) { + foreach my $ioc ( @{$ioc_href->{$ip}} ) { + + my $cmd = $expect_ioc_script . " " . $ip . " " . $ioc; + my $log = $log_path . "/log_" . $ip . "_" . $ioc . ".txt"; + print "cmd: $cmd\n" if($opt_verb); + &forkMe($cmd, $log, \@process_list); } + } - - #- Wait for children - foreach my $cur_child_pid (@process_list) { - waitpid($cur_child_pid,0); - } - ### just kill the remaining stuff - @process_list = (); + #- Wait for children + foreach my $cur_child_pid (@process_list) { + waitpid($cur_child_pid,0); + } - #foreach my $ip (@EB_IP_list){ - foreach my $ip (@bnetservers){ - my $cmd = qq|ssh scs\@$ip "/usr/bin/pkill -f \\"SCREEN -dmS ioc_eb\\""|; - print $cmd; - &forkMe($cmd, "/tmp/ioc_kill_$ip", \@process_list); - } + ### just kill the remaining stuff + @process_list = (); - foreach my $cur_child_pid (@process_list) { - waitpid($cur_child_pid,0); - } + #foreach my $ip (@EB_IP_list){ + foreach my $ip (@bnetservers) { + my $cmd = qq|ssh scs\@$ip "/usr/bin/pkill -f \\"SCREEN -dmS ioc_eb\\""|; + print $cmd; + &forkMe($cmd, "/tmp/ioc_kill_$ip", \@process_list); + } - #sleep 1; + foreach my $cur_child_pid (@process_list) { + waitpid($cur_child_pid,0); + } - ### just kill the remaining stuff - @process_list = (); - #foreach my $ip (@EB_IP_list){ - foreach my $ip (@bnetservers){ - my $cmd = qq|ssh scs\@$ip "/usr/bin/pkill -9 -f \\"SCREEN -dmS ioc_eb\\""|; - &forkMe($cmd, "/tmp/ioc_kill2_$ip", \@process_list); - } + #sleep 1; - foreach my $cur_child_pid (@process_list) { - waitpid($cur_child_pid,0); - } + ### just kill the remaining stuff + @process_list = (); + #foreach my $ip (@EB_IP_list){ + foreach my $ip (@bnetservers) { + my $cmd = qq|ssh scs\@$ip "/usr/bin/pkill -9 -f \\"SCREEN -dmS ioc_eb\\""|; + &forkMe($cmd, "/tmp/ioc_kill2_$ip", \@process_list); + } + + foreach my $cur_child_pid (@process_list) { + waitpid($cur_child_pid,0); + } } -sub forkMe() -{ - my ($cmd, $log, $proc_list) = @_; +sub forkMe() { + my ($cmd, $log, $proc_list) = @_; - my $child = fork(); + my $child = fork(); - if( $child ){ # parent - push( @$proc_list, $child ); - } - elsif( $child == 0 ) { # child - system("$cmd >$log 2>&1 "); - exit(0); - } - else{ - print "Could not fork: $!\n"; - exit(1); - } + if ( $child ) { # parent + push( @$proc_list, $child ); + } elsif ( $child == 0 ) { # child + system("$cmd >$log 2>&1 "); + exit(0); + } else { + print "Could not fork: $!\n"; + exit(1); + } } -sub forkEB() -{ - my ($exe_eb, $exe_nm, $exe_open_eb, $exe_open_nm, $proc_list) = @_; +sub forkEB() { + my ($exe_eb, $exe_nm, $exe_open_eb, $exe_open_nm, $proc_list) = @_; - my $child = fork(); + my $child = fork(); - if( $child ){ # parent - push( @$proc_list, $child ); - } - elsif( $child == 0 ) { # child - #--- Execute Event Builder - print "Exec: $exe_eb\n" if($opt_verb); - system($exe_eb) unless($opt_test); + if ( $child ) { # parent + push( @$proc_list, $child ); + } elsif ( $child == 0 ) { # child + #--- Execute Event Builder + print "Exec: $exe_eb\n" if($opt_verb); + system($exe_eb) unless($opt_test); - #sleep(1); + #sleep(1); - #--- Open permissions for EB shared memory - # ! Permissions should be opened by EB process - #print "Exec: $exe_open_eb\n" if($opt_verb); - #system($exe_open_eb) unless($opt_test); + #--- Open permissions for EB shared memory + # ! Permissions should be opened by EB process + #print "Exec: $exe_open_eb\n" if($opt_verb); + #system($exe_open_eb) unless($opt_test); - #sleep(2); + #sleep(2); - #--- Execute Net-2-Memory - print "Exec: $exe_nm\n" if($opt_verb); - system($exe_nm) unless($opt_test); + #--- Execute Net-2-Memory + print "Exec: $exe_nm\n" if($opt_verb); + system($exe_nm) unless($opt_test); - #sleep(1); + #sleep(1); - #--- Open permissions for NM shared memory - # ! Permissions should be opened by EB process - #print "Exec: $exe_open_nm\n" if($opt_verb); - #system($exe_open_nm) unless($opt_test); + #--- Open permissions for NM shared memory + # ! Permissions should be opened by EB process + #print "Exec: $exe_open_nm\n" if($opt_verb); + #system($exe_open_nm) unless($opt_test); - exit(0); - } - else{ - print "Could not fork: $!\n"; - exit(1); - } + exit(0); + } else { + print "Could not fork: $!\n"; + exit(1); + } } -sub findRunningIOC() -{ - my ($cpu, $ioc_href) = @_; +sub findRunningIOC() { + my ($cpu, $ioc_href) = @_; - `ssh -n $cpu -l scs \"screen -wipe\"`; - my $exe = "ssh -n $cpu -l scs \"screen -ls\""; + `ssh -n $cpu -l scs \"screen -wipe\"`; + my $exe = "ssh -n $cpu -l scs \"screen -ls\""; - my @output = `$exe`; + my @output = `$exe`; - foreach my $line (@output){ - if($line =~ /\d+\.(ioc_eb\d{2})\s+/){ - my $name = $1; - push( @{$ioc_href->{$cpu}}, $name ); - print "Found IOC: $name on $cpu\n" if($opt_verb); - } + foreach my $line (@output) { + if ($line =~ /\d+\.(ioc_eb\d{2})\s+/) { + my $name = $1; + push( @{$ioc_href->{$cpu}}, $name ); + print "Found IOC: $name on $cpu\n" if($opt_verb); } + } } -sub writeExpectIOC() -{ - # This expect script can be executed to exit IOC. +sub writeExpectIOC() { + # This expect script can be executed to exit IOC. - #! Look if /tmp dir exists - my $tmp_dir = dirname("/tmp"); - if ( !(-d $tmp_dir) ){ - print "\nCannot access /tmp directory!\nExit.\n"; - exit(1); - } + #! Look if /tmp dir exists + my $tmp_dir = dirname("/tmp"); + if ( !(-d $tmp_dir) ) { + print "\nCannot access /tmp directory!\nExit.\n"; + exit(1); + } - my $expect_script_my = <$expect_ioc_script"); + my $fh = new FileHandle(">$expect_ioc_script"); - if(!$fh) { - my $txt = "\nError! Could not open file \"$expect_ioc_script\" for output. Exit.\n"; - print STDERR $txt; - print $txt; - exit(128); - } + if (!$fh) { + my $txt = "\nError! Could not open file \"$expect_ioc_script\" for output. Exit.\n"; + print STDERR $txt; + print $txt; + exit(128); + } - print $fh $expect_script_my; - $fh->close(); + print $fh $expect_script_my; + $fh->close(); - #- open permissions - system("chmod 755 $expect_ioc_script"); + #- open permissions + system("chmod 755 $expect_ioc_script"); } -sub getGbEconfig() -{ - # - # Read DB configurations of GbE and CTS, - # look for active data sources as well as - # for EB IPs and ports. - # +sub getGbEconfig() { + # + # Read DB configurations of GbE and CTS, + # look for active data sources as well as + # for EB IPs and ports. + # - my ($eb_ids_href) = @_; + my ($eb_ids_href) = @_; - my $data_sources = $temp_args_href->{'Parallel'}->{'DATA_SOURCES'}; - my $gbe_conf = $temp_args_href->{'Parallel'}->{'GBE_CONF'}; - #my $cts_conf = $temp_args_href->{'Parallel'}->{'CTS_CONF'}; + my $data_sources = $temp_args_href->{'Parallel'}->{'DATA_SOURCES'}; + my $gbe_conf = $temp_args_href->{'Parallel'}->{'GBE_CONF'}; + #my $cts_conf = $temp_args_href->{'Parallel'}->{'CTS_CONF'}; - my %activeSources_hash; - my $activeSources_href = \%activeSources_hash; + my %activeSources_hash; + my $activeSources_href = \%activeSources_hash; - &readActiveSources($data_sources, $activeSources_href); + &readActiveSources($data_sources, $activeSources_href); - my @id_list; - my $id_list_aref = \@id_list; + my @id_list; + my $id_list_aref = \@id_list; - #&readEBids($cts_conf, $id_list_aref); + #&readEBids($cts_conf, $id_list_aref); - #- Overwrite array with EB numbers - @id_list = (0 .. 15); - #print Dumper $id_list_aref; + #- Overwrite array with EB numbers + @id_list = (0 .. 15); + #print Dumper $id_list_aref; - &readEBports($gbe_conf, $activeSources_href, $id_list_aref, $eb_ids_href); + &readEBports($gbe_conf, $activeSources_href, $id_list_aref, $eb_ids_href); } -sub readEBids() -{ - # - # Read EB Ids - # +sub readEBids() { + # + # Read EB Ids + # - my ($file, $id_list_aref) = @_; + my ($file, $id_list_aref) = @_; - my $nnn_table = 0; - my $val_table = 0; + my $nnn_table = 0; + my $val_table = 0; - my $SPACE = ""; + my $SPACE = ""; - my $fh = new FileHandle("$file", "r"); + my $fh = new FileHandle("$file", "r"); - while(<$fh>){ + while (<$fh>) { - #- Remove all comments - $_ =~ s{ # Substitue... - \# # ...a literal octothorpe - [^\n]* # ...followed by any number of non-newlines - } - {$SPACE}gxms; # Raplace it with a single space - - #- Skip line if it contains only whitespaces - next unless(/\S/); - - if(/^(\s+)?!Value\stable/){ - $val_table = 1; - $nnn_table = 0; - next; - } - elsif(/^(\s+)?!\w+/){ - $val_table = 0; - $nnn_table = 1; - } + #- Remove all comments + $_ =~ s{ # Substitue... + \# # ...a literal octothorpe + [^\n]* # ...followed by any number of non-newlines + } + { +$SPACE}gxms; # Raplace it with a single space + + #- Skip line if it contains only whitespaces + next unless(/\S/); + + if (/^(\s+)?!Value\stable/) { + $val_table = 1; + $nnn_table = 0; + next; + } elsif (/^(\s+)?!\w+/) { + $val_table = 0; + $nnn_table = 1; + } - if($val_table){ - my (@vals) = split(" ", $_); - my @id_list1 = split("", $vals[12]); - my @id_list2 = split("", $vals[13]); - foreach my $id (@id_list1){ - push(@$id_list_aref, hex($id)); - } - foreach my $id (@id_list2){ - push(@$id_list_aref, hex($id)); - } - } - elsif($nnn_table){ - } + if ($val_table) { + my (@vals) = split(" ", $_); + my @id_list1 = split("", $vals[12]); + my @id_list2 = split("", $vals[13]); + foreach my $id (@id_list1) { + push(@$id_list_aref, hex($id)); + } + foreach my $id (@id_list2) { + push(@$id_list_aref, hex($id)); + } + } elsif ($nnn_table) { } + } - $fh->close; + $fh->close; } -sub readEBports() -{ - # - # Read EB IPs and ports accoring to EB Id (type) - # and TRB-Net addresses of active data sources. - # +sub readEBports() { + # + # Read EB IPs and ports accoring to EB Id (type) + # and TRB-Net addresses of active data sources. + # - my ($file, $activeSources_href, $id_list_aref, $ports_href) = @_; + my ($file, $activeSources_href, $id_list_aref, $ports_href) = @_; - my $nnn_table = 0; - my $val_table = 0; + my $nnn_table = 0; + my $val_table = 0; - my $fh = new FileHandle("$file", "r"); + my $fh = new FileHandle("$file", "r"); - &isFileDefined($fh, $file); + &isFileDefined($fh, $file); - my %tmp; - my $tmp_href = \%tmp; + my %tmp; + my $tmp_href = \%tmp; - my $SPACE = ""; + my $SPACE = ""; - while(<$fh>){ + while (<$fh>) { - #print $_; - #- Remove all comments - $_ =~ s{ # Substitue... - \# # ...a literal octothorpe - [^\n]* # ...followed by any number of non-newlines - } - {$SPACE}gxms; # Raplace it with a single space + #print $_; + #- Remove all comments + $_ =~ s{ # Substitue... + \# # ...a literal octothorpe + [^\n]* # ...followed by any number of non-newlines + } + { +$SPACE}gxms; # Raplace it with a single space + + #- Skip line if it contains only whitespaces + next unless(/\S/); + + #print $_; + if (/^(\s+)?!Value\stable/) { + $val_table = 1; + $nnn_table = 0; + next; + } elsif (/^(\s+)?!\w+/) { + $nnn_table = 1; + $val_table = 0; + } - #- Skip line if it contains only whitespaces - next unless(/\S/); + if ($val_table) { + my (@vals) = split(" ", $_); + my $id = $vals[1]; - #print $_; - if(/^(\s+)?!Value\stable/){ - $val_table = 1; - $nnn_table = 0; - next; - } - elsif(/^(\s+)?!\w+/){ - $nnn_table = 1; - $val_table = 0; - } + #if($id <0 or $id >15) { + # print "error: in $file there is a line with an eventbuilder number different than 0..15, the number given in the file is $id. please correct the config file.\n"; + # exit(128); + #} - if($val_table){ - my (@vals) = split(" ", $_); - my $id = $vals[1]; - - #if($id <0 or $id >15) { - # print "error: in $file there is a line with an eventbuilder number different than 0..15, the number given in the file is $id. please correct the config file.\n"; - # exit(128); - #} - - - #- Accept only EB Ids from CTS config file - #print "value: $_"; - next unless( any {$_ eq $id} @$id_list_aref ); - - #print Dumper \@vals; - #print "active sources: "; print Dumper $activeSources_href->{'addr_list'}; - #exit; - - my $ip = &getIP_hex2dec($vals[6]); - my $port = &getPort_hex2dec($vals[2]); - my $addr = $vals[0]; - my $calib = $vals[7]; # jam2018 - add list of trb3 tdc calibration modes - - # print "got: ip: $ip, port: $port, addr: $addr\n"; - #- Accept only sources from active source list - if( any {hex($_) == hex($addr)} @{$activeSources_href->{'addr_list'}} ){ - $tmp_href->{$id}->{'IP'} = $ip; - push( @{$tmp_href->{$id}->{'port_list'}}, $port ); - push( @{$tmp_href->{$id}->{'addr_list'}}, $addr ); - push( @{$tmp_href->{$id}->{'calib_list'}}, $calib ); - - # JAM2016: for bnet we need the receiver nodes per port as list also: - push( @{$tmp_href->{$id}->{'ip_list'}}, $ip ); - - } - } - } - $fh->close; + #- Accept only EB Ids from CTS config file + #print "value: $_"; + next unless( any {$_ eq $id} @$id_list_aref ); - # print Dumper $tmp_href; + #print Dumper \@vals; + #print "active sources: "; print Dumper $activeSources_href->{'addr_list'}; + #exit; - #- Sort hash according to active data source list - my $numids= scalar keys %tmp; - #print "number of ids: $numids \n"; - foreach my $id (keys %tmp){ - $ports_href->{$id}->{'IP'} = $tmp_href->{$id}->{'IP'}; - - foreach my $addr (@{$activeSources_href->{'addr_list'}}){ - - my $ind1 = first_index {$_ eq $addr} @{$tmp_href->{$id}->{'addr_list'}}; - my $ind2 = first_index {$_ eq $addr} @{$activeSources_href->{'addr_list'}}; - - next if($ind1 == -1); - -# push( @{$ports_href->{$id}->{'port_list'}}, $tmp_href->{$id}->{'port_list'}->[$ind1]); -# # added for bnet JAM: -# push( @{$ports_href->{$id}->{'ip_list'}}, $tmp_href->{$id}->{'ip_list'}->[$ind1]); -# push( @{$ports_href->{$id}->{'calib_list'}}, $tmp_href->{$id}->{'calib_list'}->[$ind1]); -# -# push( @{$ports_href->{$id}->{'addr_list'}}, $addr); -# push( @{$ports_href->{$id}->{'bufsize_list'}}, $activeSources_href->{'bufsize_list'}->[$ind2]); - - - if($id == 0 && $numids==1){ - # fill all ids of active inputs with setup for id 0 of bnet - foreach my $bid (0 .. $#bnetservers){ - push( @{$ports_href->{$bid}->{'port_list'}}, $tmp_href->{$id}->{'port_list'}->[$ind1]); - push( @{$ports_href->{$bid}->{'ip_list'}}, $tmp_href->{$id}->{'ip_list'}->[$ind1]); - push( @{$ports_href->{$bid}->{'calib_list'}}, $tmp_href->{$id}->{'calib_list'}->[$ind1]); - push( @{$ports_href->{$bid}->{'addr_list'}}, $addr); - push( @{$ports_href->{$bid}->{'bufsize_list'}}, $activeSources_href->{'bufsize_list'}->[$ind2]); - } - } - else - { - #old EB mode/no bnet: config file defines all. DO WE NEED THIS STILL? - push( @{$ports_href->{$id}->{'port_list'}}, $tmp_href->{$id}->{'port_list'}->[$ind1]); - # added for bnet JAM: - #push( @{$ports_href->{$id}->{'ip_list'}}, $tmp_href->{$id}->{'ip_list'}->[$ind1]); - #push( @{$ports_href->{$id}->{'calib_list'}}, $tmp_href->{$id}->{'calib_list'}->[$ind1]); - push( @{$ports_href->{$id}->{'addr_list'}}, $addr); - push( @{$ports_href->{$id}->{'bufsize_list'}}, $activeSources_href->{'bufsize_list'}->[$ind2]); - - } - } - } + my $ip = &getIP_hex2dec($vals[6]); + my $port = &getPort_hex2dec($vals[2]); + my $addr = $vals[0]; + my $calib = $vals[7]; # jam2018 - add list of trb3 tdc calibration modes - # print Dumper $ports_href; -} + # print "got: ip: $ip, port: $port, addr: $addr\n"; + #- Accept only sources from active source list + if ( any {hex($_) == hex($addr)} @{$activeSources_href->{'addr_list'}} ) { + $tmp_href->{$id}->{'IP'} = $ip; + push( @{$tmp_href->{$id}->{'port_list'}}, $port ); + push( @{$tmp_href->{$id}->{'addr_list'}}, $addr ); + push( @{$tmp_href->{$id}->{'calib_list'}}, $calib ); -sub readActiveSources() -{ - # - # Read TRB-Net addresses of active data sources - # + # JAM2016: for bnet we need the receiver nodes per port as list also: + push( @{$tmp_href->{$id}->{'ip_list'}}, $ip ); - my ($file, $activeSources_href) = @_; + } + } + } - my $fh = new FileHandle("$file", "r"); + $fh->close; - &isFileDefined($fh, $file); + # print Dumper $tmp_href; - my $SPACE = ""; - - # this one contains list of deactivated data sources - my $log="/home/hadaq/trbsoft/hadesdaq/evtbuild/tmp/EB_NotActiveSources.txt"; - system("truncate -s 0 $log ;"); - while(<$fh>){ - - #- Remove all comments - $_ =~ s{ # Substitue... - \# # ...a literal octothorpe - [^\n]* # ...followed by any number of non-newlines - } - {$SPACE}gxms; # Raplace it with a single space + #- Sort hash according to active data source list + my $numids= scalar keys %tmp; + #print "number of ids: $numids \n"; + foreach my $id (keys %tmp) { + $ports_href->{$id}->{'IP'} = $tmp_href->{$id}->{'IP'}; + + foreach my $addr (@{$activeSources_href->{'addr_list'}}) { + + my $ind1 = first_index {$_ eq $addr} @{$tmp_href->{$id}->{'addr_list'}}; + my $ind2 = first_index {$_ eq $addr} @{$activeSources_href->{'addr_list'}}; - #- Skip line if it contains only whitespaces - next unless(/\S/); + next if($ind1 == -1); - my ($addr, $astat, $sys, $size) = split(" ", $_); + # push( @{$ports_href->{$id}->{'port_list'}}, $tmp_href->{$id}->{'port_list'}->[$ind1]); + # # added for bnet JAM: + # push( @{$ports_href->{$id}->{'ip_list'}}, $tmp_href->{$id}->{'ip_list'}->[$ind1]); + # push( @{$ports_href->{$id}->{'calib_list'}}, $tmp_href->{$id}->{'calib_list'}->[$ind1]); + # + # push( @{$ports_href->{$id}->{'addr_list'}}, $addr); + # push( @{$ports_href->{$id}->{'bufsize_list'}}, $activeSources_href->{'bufsize_list'}->[$ind2]); - if($astat == 0){ - system("echo $addr >> $log 2>&1;"); - next; + if ($id == 0 && $numids==1) { + # fill all ids of active inputs with setup for id 0 of bnet + foreach my $bid (0 .. $#bnetservers) { + push( @{$ports_href->{$bid}->{'port_list'}}, $tmp_href->{$id}->{'port_list'}->[$ind1]); + push( @{$ports_href->{$bid}->{'ip_list'}}, $tmp_href->{$id}->{'ip_list'}->[$ind1]); + push( @{$ports_href->{$bid}->{'calib_list'}}, $tmp_href->{$id}->{'calib_list'}->[$ind1]); + push( @{$ports_href->{$bid}->{'addr_list'}}, $addr); + push( @{$ports_href->{$bid}->{'bufsize_list'}}, $activeSources_href->{'bufsize_list'}->[$ind2]); } - push( @{$activeSources_href->{'addr_list'}}, $addr); - push( @{$activeSources_href->{'bufsize_list'}}, &getBufSize($size)); + } else { + #old EB mode/no bnet: config file defines all. DO WE NEED THIS STILL? + push( @{$ports_href->{$id}->{'port_list'}}, $tmp_href->{$id}->{'port_list'}->[$ind1]); + # added for bnet JAM: + #push( @{$ports_href->{$id}->{'ip_list'}}, $tmp_href->{$id}->{'ip_list'}->[$ind1]); + #push( @{$ports_href->{$id}->{'calib_list'}}, $tmp_href->{$id}->{'calib_list'}->[$ind1]); + push( @{$ports_href->{$id}->{'addr_list'}}, $addr); + push( @{$ports_href->{$id}->{'bufsize_list'}}, $activeSources_href->{'bufsize_list'}->[$ind2]); + } } + } - $fh->close; + # print Dumper $ports_href; } -sub getBufSize() -{ - my ($bufSize) = @_; +sub readActiveSources() { + # + # Read TRB-Net addresses of active data sources + # - if(lc($bufSize) eq "low"){ - return $temp_args_href->{'Main'}->{'BUF_SIZE_LOW'}; - } - elsif(lc($bufSize) eq "mid"){ - return $temp_args_href->{'Main'}->{'BUF_SIZE_MID'}; - } - elsif(lc($bufSize) eq "high"){ - return $temp_args_href->{'Main'}->{'BUF_SIZE_HIGH'}; - } - else{ - print "Cannot understand $bufSize from data_sources.db.\n"; - exit(0); + my ($file, $activeSources_href) = @_; + + my $fh = new FileHandle("$file", "r"); + + &isFileDefined($fh, $file); + + my $SPACE = ""; + + # this one contains list of deactivated data sources + my $log="/home/hadaq/trbsoft/hadesdaq/evtbuild/tmp/EB_NotActiveSources.txt"; + system("truncate -s 0 $log ;"); + while (<$fh>) { + #- Remove all comments + $_ =~ s{ # Substitue... + \# # ...a literal octothorpe + [^\n]* # ...followed by any number of non-newlines + } + { +$SPACE}gxms; # Raplace it with a single space + + #- Skip line if it contains only whitespaces + next unless(/\S/); + + my ($addr, $astat, $sys, $size) = split(" ", $_); + + if ($astat == 0) { + system("echo $addr >> $log 2>&1;"); + next; } + push( @{$activeSources_href->{'addr_list'}}, $addr); + push( @{$activeSources_href->{'bufsize_list'}}, &getBufSize($size)); + } + + $fh->close; } -sub getIP_hex2dec() -{ - my ($ip_hex) = @_; +sub getBufSize() { + my ($bufSize) = @_; + + if (lc($bufSize) eq "low") { + return $temp_args_href->{'Main'}->{'BUF_SIZE_LOW'}; + } elsif (lc($bufSize) eq "mid") { + return $temp_args_href->{'Main'}->{'BUF_SIZE_MID'}; + } elsif (lc($bufSize) eq "high") { + return $temp_args_href->{'Main'}->{'BUF_SIZE_HIGH'}; + } else { + print "Cannot understand $bufSize from data_sources.db.\n"; + exit(0); + } +} - my $ip_dec; +sub getIP_hex2dec() { + my ($ip_hex) = @_; - if( $ip_hex =~ /0x(\w{2})(\w{2})(\w{2})(\w{2})/ ){ - $ip_dec = hex($1) . "." . hex($2) . "." . hex($3) . "." . hex($4); - } - else{ - print "getIP_hex2dec(): cannot extract ip address because of diferent format! Exit."; - exit(0); - } + my $ip_dec; + + if ( $ip_hex =~ /0x(\w{2})(\w{2})(\w{2})(\w{2})/ ) { + $ip_dec = hex($1) . "." . hex($2) . "." . hex($3) . "." . hex($4); + } else { + print "getIP_hex2dec(): cannot extract ip address because of diferent format! Exit."; + exit(0); + } - return $ip_dec; + return $ip_dec; } -sub getPort_hex2dec() -{ - my ($port_hex) = @_; +sub getPort_hex2dec() { + my ($port_hex) = @_; - my $port_dec; + my $port_dec; - if( $port_hex =~ /0x(\w+)/ ){ - $port_dec = hex($1); - } - else{ - print "getPort_hex2dec(): cannot extract port number because of diferent format! Exit."; - exit(0); - } + if ( $port_hex =~ /0x(\w+)/ ) { + $port_dec = hex($1); + } else { + print "getPort_hex2dec(): cannot extract port number because of diferent format! Exit."; + exit(0); + } - return $port_dec; + return $port_dec; } -sub getIP_hades2gsi() -{ - my ($ip_hades) = @_; - my $ip_gsi = ""; - if (exists $IP_GSI_href->{$ip_hades}){ - $ip_gsi = $IP_GSI_href->{$ip_hades}; - } - else { - print "getIP_hades2gsi(): WARNING - unknown hades ip $ip_hades"; - } - return $ip_gsi; +sub getIP_hades2gsi() { + my ($ip_hades) = @_; + my $ip_gsi = ""; + if (exists $IP_GSI_href->{$ip_hades}) { + $ip_gsi = $IP_GSI_href->{$ip_hades}; + } else { + print "getIP_hades2gsi(): WARNING - unknown hades ip $ip_hades"; + } + return $ip_gsi; } -sub isFileDefined() -{ - my ($fh, $name) = @_; +sub isFileDefined() { + my ($fh, $name) = @_; - if(!$fh) { - my $txt = "\nError! Could not open file \'$name\'. Exit.\n"; - print STDERR $txt; - print $txt; - exit(128); - } + if (!$fh) { + my $txt = "\nError! Could not open file \'$name\'. Exit.\n"; + print STDERR $txt; + print $txt; + exit(128); + } - return 0; + return 0; } -sub writeArgs2file() -{ - my $fileName = $0; +sub writeArgs2file() { + my $fileName = $0; - #- Replace .pl with .sh - $fileName =~ s/\.pl/\.sh/; + #- Replace .pl with .sh + $fileName =~ s/\.pl/\.sh/; - my $fh = new FileHandle(">./$fileName"); - if(!$fh) { - my $txt = "\nError! Could not open file \"$fileName\" for output. Exit.\n"; - print STDERR $txt; - print $txt; - exit(128); - } + my $fh = new FileHandle(">./$fileName"); + if (!$fh) { + my $txt = "\nError! Could not open file \"$fileName\" for output. Exit.\n"; + print STDERR $txt; + print $txt; + exit(128); + } - my $current_dir = cwd(); - my $ptogName = $0; + my $current_dir = cwd(); + my $ptogName = $0; - #- Write to the file the script name itself - print $fh $0; + #- Write to the file the script name itself + print $fh $0; - #- Write to the file the arguments - foreach my $arg (@arg_list){ - print $fh " $arg"; - } - print $fh ";\n"; - - ## do not start te files by default. user should actively restart the file JAM 29-06-2018 - # here put command to start the correct file prefix in bnet builders: - #my $prefix=$EB_Args_href->{0}->{'PREFIX'}; - #print $fh "/usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=$prefix&oninit=10\"\n"; - - - $fh->close(); + #- Write to the file the arguments + foreach my $arg (@arg_list) { + print $fh " $arg"; + } + print $fh ";\n"; + ## do not start te files by default. user should actively restart the file JAM 29-06-2018 + # here put command to start the correct file prefix in bnet builders: + #my $prefix=$EB_Args_href->{0}->{'PREFIX'}; + #print $fh "/usr/bin/wget -a /tmp/EB_filestart.log -O /tmp/EB_fileres.txt \"http://lxhadeb03:8090/Master/BNET/StartRun/execute?prefix=$prefix&oninit=10\"\n"; + $fh->close(); - system("chmod 755 ./$fileName"); + system("chmod 755 ./$fileName"); } diff --git a/hmon/QA.pm b/hmon/QA.pm index 4efde56..e181173 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -113,8 +113,8 @@ our @TdcCalibrationTemperature = (5,7,10); our @PionLvCurrLimits = (4,5,6); -our $PadiwaECalNumber = 84; -our @PadiwaEcalLimits = (36, 37, 39); +our $PadiwaECalNumber = 105; +our @PadiwaEcalLimits = (5, 10, 20); our @LimitTriggerPerSpill = (1000, 0, 0); our $AcceleratorCycle = 7; diff --git a/hmon/hmon_endpoints.pl b/hmon/hmon_endpoints.pl index ec7b02f..4ebdb98 100755 --- a/hmon/hmon_endpoints.pl +++ b/hmon/hmon_endpoints.pl @@ -136,12 +136,12 @@ while(1) { 0x7070,0x7071,0x7080,0x7081,0x7090,0x7091, ); -#TOF -> is TOF, RPC,FW +#TOF -> is TOF, RPC, fRPC my @tof_boards =( 0x86c0,0x5c00,0x5c01,0x5c02,0x5c03, 0x86c1,0x5c10,0x5c11,0x5c12,0x5c13, 0x86c2,0x5c20,0x5c21,0x5c22,0x5c23, - 0x86c3,0x5c30,0x5c31,0x5c32,0x5c33, +0x86c3,0x5c30,0x5c31,0x5c32,0x5c33, 0x86c4,0x5c40,0x5c41,0x5c42,0x5c43, 0x86c5,0x5c50,0x5c51,0x5c52,0x5c53, #0x86c6,0x5c60,0x5c61,0x5c62,0x5c63, @@ -155,7 +155,7 @@ while(1) { 0x5850,0x5851,0x5852,0x5853,0x5854,0x5855,0x5856,0x5857,0x5858, ); -#RPC -> is ECAL +#RPC -> is ECAL, STS my @rpc_boards = ( 0x8a00,0x8a01,0x8a02,0x8a03,0x8a04,0x8a05, # 0x6000,0x6001,0x6002,0x6003,0x6004,0x6005,0x6006, @@ -165,6 +165,13 @@ while(1) { 0x6040,0x6041,0x6042,0x6043,0x6044,0x6045,0x6046, 0x6050,0x6051,0x6052,0x6053,0x6054,0x6055,0x6056, +#STT1 + 0x8b00, 0x8b01, 0x8b02, 0x8b03, + 0x6400, 0x6401, 0x6402, 0x6403, + 0x6410, 0x6411, 0x6412, 0x6413, + 0x6420, 0x6421, 0x6422, 0x6423, + 0x6430, 0x6431, 0x6432, 0x6433, + #STT2 0x8b10, 0x8b11, 0x8b12, 0x8b13, 0x8b14, 0x8b15, 0x6440, 0x6441, 0x6442, 0x6443, 0x6444, 0x6445, @@ -180,15 +187,17 @@ while(1) { #central hub 0x8000,0x8011,0x8012,0x8013,0x8014,0x8800, 0x8810, #start/veto -# 0x4000, - #Pion +# + #innerTOF +# +# #Pion # 0x8900,0x3800,0x3801, # 0x8910,0x3810,0x3811, - #Start TRB3 +# #Start TRB3 # 0x8880,0x5000,0x5002,0x5003, #Hodo TRB3 -# 0x8890,0x5010,0x5011,0x5012,0x5013 - 0x0100,0x0110 #trigger etc. + 0x8890,0x5010,0x5011,0x5012, + 0x0100,0x0110,0x0120 #trigger etc. ); ###strip the register value @@ -217,7 +226,7 @@ while(1) { my $title = "MDC"; my $value = "OK ".(scalar @mdc_boards - scalar @QA::mdc_boards_removed); - if ($num_mdc_missing > 0) {$value = "$num_mdc_missing missing";} + if ($num_mdc_missing > 0) {$value = "$num_mdc_missing / ".(scalar @mdc_boards - scalar @QA::mdc_boards_removed)." miss";} if ($num_mdc_mistake > 0) {$value = "Check Script";} my $longtext = (scalar @mdc_boards). " boards. ".(scalar @QA::mdc_boards_removed)." removed"; if ($num_mdc_missing > 0) {$longtext = "Endp @sorted_mdc_results missing"}; @@ -249,7 +258,7 @@ while(1) { my $rich_title = "RICH"; my $rich_value = "OK ".(scalar @rich_boards); - if ($num_rich_missing > 0) {$rich_value = "$num_rich_missing missing";} + if ($num_rich_missing > 0) {$rich_value = "$num_rich_missing / ".(scalar @rich_boards)." miss";} if ($num_rich_mistake > 0) {$rich_value = "Check Script";} my $rich_longtext = (scalar @rich_boards). " boards. "; if ($num_rich_missing > 0) {$rich_longtext = "Endp @sorted_rich_results missing"}; @@ -268,7 +277,7 @@ while(1) { Hmon::Speak('richmiss',"$num_rich_missing Rich Frontends missing") if($qastate >= QA::ERROR ); - if($num_rich_missing > 20) {$rich_longtext = $num_rich_missing." boards missing";} + if($num_rich_missing > 200) {$rich_longtext = $num_rich_missing." boards missing";} QA::WriteQALog($flog,"endp","rich",$waittime,$qastate, $rich_title,$rich_value,$rich_longtext); @@ -289,7 +298,7 @@ while(1) { my $tof_title = "TOF/RPC/FW"; my $tof_value = "OK ".(scalar @tof_boards); - if ($num_tof_missing > 0) {$tof_value = "$num_tof_missing missing";} + if ($num_tof_missing > 0) {$tof_value = "$num_tof_missing / ".(scalar @tof_boards)." miss";} if ($num_tof_mistake > 0) {$tof_value = "Check Script";} my $tof_longtext = (scalar @tof_boards). " boards. "; #if ($num_tof_missing > 0) {$tof_longtext = "Endp @{$tof_results[2]} missing"}; @@ -323,7 +332,7 @@ while(1) { my $rpc_title = "ECal/STT/fRPC"; my $rpc_value = "OK ".(scalar @rpc_boards); - if ($num_rpc_missing > 0) {$rpc_value = "$num_rpc_missing missing";} + if ($num_rpc_missing > 0) {$rpc_value = "$num_rpc_missing / ".(scalar @rpc_boards)." miss";} if ($num_rpc_mistake > 0) {$rpc_value = "Check Script";} my $rpc_longtext = (scalar @rpc_boards). " boards. "; if ($num_rpc_missing > 0) {$rpc_longtext = "Endp @sorted_rpc_results missing"}; @@ -354,7 +363,7 @@ while(1) { my $other_title = "Hub/St/CTS"; my $other_value = "OK ".(scalar @other_boards); - if ($num_other_missing > 0) {$other_value = "$num_other_missing missing";} + if ($num_other_missing > 0) {$other_value = "$num_other_missing / ".(scalar @other_boards)." miss";} if ($num_other_mistake > 0) {$other_value = "Check Script";} my $other_longtext = (scalar @other_boards). " boards. "; if ($num_other_missing > 0) {$other_longtext = "Endp @sorted_other_results missing"}; diff --git a/hmon/hmon_hodo.pl b/hmon/hmon_hodo.pl index 27c219f..c0683d6 100644 --- a/hmon/hmon_hodo.pl +++ b/hmon/hmon_hodo.pl @@ -15,7 +15,7 @@ use List::Util qw[min max]; my $plot2 = (); $plot2->{name} = "HodoRate"; $plot2->{file} = "files/HodoRate"; -$plot2->{entries} = 2; +$plot2->{entries} = 4; $plot2->{curves} = 16; $plot2->{type} = HPlot::TYPE_HEATMAP; $plot2->{output} = HPlot::OUT_PNG; @@ -25,7 +25,7 @@ $plot2->{sizey} = 360; $plot2->{nokey} = 1; $plot2->{buffer} = 1; $plot2->{xmin} = -0.5; -$plot2->{xmax} = 1.5; +$plot2->{xmax} = 3.5; $plot2->{ymin} = 15.5; $plot2->{ymax} = -0.5; $plot2->{cbmax} = "100<*"; @@ -36,7 +36,7 @@ my $plot = (); $plot->{name} = "HodoRatePlot"; $plot->{file} = "files/HodoRatePlot"; $plot->{entries} = 16; -$plot->{curves} = 2; +$plot->{curves} = 4; $plot->{style} = 'dots'; $plot->{curvewidth} = 1; $plot->{type} = HPlot::TYPE_BARGRAPH; @@ -76,30 +76,28 @@ trb_init_ports() or die trb_strerror(); while (1) { my $o; - foreach my $b (0x5010,0x5011,0x5012,0x5013) { + foreach my $b (0x5010,0x5011) { my $t = trb_register_read_mem($b,0xc000,0,33); $o->{$b} = $t->{$b}; } if (defined $old) { foreach my $b (keys %$o) { - for my $v (0..7) { + for my $v (0..31) { my $tdiff = time() - $oldtime; - my $vdiff = ($o->{$b}->[$v*4+1]&0xffffff) - ($old->{$b}->[$v*4+1]&0xffffff); + my $vdiff = ($o->{$b}->[$v+1]&0xffffff) - ($old->{$b}->[$v+1]&0xffffff); if ($vdiff < 0) { $vdiff += 2**24;} - $diff->{$b}->[$v*4+1] = $vdiff/($tdiff|1); + $diff->{$b}->[$v+1] = $vdiff/($tdiff|1); } } - for my $bar (0..3) { - for my $x (0..1) { - HPlot::PlotFill('HodoRate', $diff->{0x5013}->[$bar*4+1+$x*16],$x,$bar); - HPlot::PlotFill('HodoRatePlot',$diff->{0x5013}->[$bar*4+1+$x*16],$bar,$x); - HPlot::PlotFill('HodoRate', $diff->{0x5012}->[$bar*4+1+$x*16],$x,$bar+4); - HPlot::PlotFill('HodoRatePlot',$diff->{0x5012}->[$bar*4+1+$x*16],$bar+4,$x); - HPlot::PlotFill('HodoRate', $diff->{0x5011}->[$bar*4+1+$x*16],$x,$bar+8); - HPlot::PlotFill('HodoRatePlot',$diff->{0x5011}->[$bar*4+1+$x*16],$bar+8,$x); - HPlot::PlotFill('HodoRate', $diff->{0x5010}->[$bar*4+1+$x*16],$x,$bar+12); - HPlot::PlotFill('HodoRatePlot',$diff->{0x5010}->[$bar*4+1+$x*16],$bar+12,$x); + for my $side (0..15) { + for my $dir (0..1) { + HPlot::PlotFill('HodoRate', $diff->{0x5011}->[$dir*16+$side+1],$dir+2,$side); + HPlot::PlotFill('HodoRatePlot',$diff->{0x5011}->[$dir*16+$side+1],$side,$dir+2); + + HPlot::PlotFill('HodoRate', $diff->{0x5010}->[$dir*16+$side+1],$dir,$side); + HPlot::PlotFill('HodoRatePlot',$diff->{0x5010}->[$dir*16+$side+1],$side,$dir); + } } HPlot::PlotDraw('HodoRate'); diff --git a/hmon/hmon_onlineqa.pl b/hmon/hmon_onlineqa.pl index ab93187..8def793 100755 --- a/hmon/hmon_onlineqa.pl +++ b/hmon/hmon_onlineqa.pl @@ -16,8 +16,8 @@ while (1) { my $longmsg = "The QA server process is running."; my $msg = ""; - - my $cmd = "ssh lxhadeb06 'pgrep -fl \"hadesonlineserver.exe .* 9876\"' {0xa02c}); - $longtext = sprintf("Trigger Rate from Start: %i Hz / %i Hz after offset correction",$store{0xa02c}, -getCorrectedValue($store{0xa009},$offset->{0xa02c})); - if(getCorrectedValue($store{0xa009},$offset->{0xa02c}) < 100 && - getCorrectedValue($store{0xa029},$offset->{0xa029}) > 1000) { - $starterrorcnt+=3; - if($starterrorcnt >= 15) { - $state = QA::ERROR; - $longtext .= "
Something seems to be wrong with the trigger signal from Start"; - } - } - else { - $starterrorcnt = max($starterrorcnt-1,0); - } - QA::WriteQALog($fqa, "rate", "start", 10, - $state, 'Start Rate', $shorttext, $longtext); - - $state = QA::OK; - $shorttext = sprintf('%.2f',getCorrectedValue($store{0xa02c},$offset->{0xa02c})/(getCorrectedValue($store{0xa026},$offset->{0xa026})||1)); - $longtext = "Trigger Rate from PT3 vs. Start: ".$shorttext; - QA::WriteQALog($fqa, "trg", "pt1rate", 10, - $state, 'Start/PT3', $shorttext, $longtext); +# $state = QA::OK; +# $shorttext = QA::SciNotation($store{0xa02c})." / ".getCorrected($store{0xa02c},$offset->{0xa02c}); +# $longtext = sprintf("Trigger Rate from Start: %i Hz / %i Hz after offset correction",$store{0xa02c}, +#getCorrectedValue($store{0xa009},$offset->{0xa02c})); +# if(getCorrectedValue($store{0xa009},$offset->{0xa02c}) < 100 && +# getCorrectedValue($store{0xa029},$offset->{0xa029}) > 1000) { +# $starterrorcnt+=3; +# if($starterrorcnt >= 15) { +# $state = QA::ERROR; +# $longtext .= "
Something seems to be wrong with the trigger signal from Start"; +# } +# } +# else { +# $starterrorcnt = max($starterrorcnt-1,0); +# } +# QA::WriteQALog($fqa, "rate", "start", 10, +# $state, 'Start Rate', $shorttext, $longtext); + +# $state = QA::OK; +# $shorttext = sprintf('%.2f',getCorrectedValue($store{0xa02c},$offset->{0xa02c})/(getCorrectedValue($store{0xa026},$offset->{0xa026})||1)); +# $longtext = "Trigger Rate from PT3 vs. Start: ".$shorttext; +# QA::WriteQALog($fqa, "trg", "pt1rate", 10, +# $state, 'Start/PT3', $shorttext, $longtext); sleep 1; } diff --git a/hmon/hmon_rich_temp_backplane.pl b/hmon/hmon_rich_temp_backplane.pl index 559587f..17618c7 100755 --- a/hmon/hmon_rich_temp_backplane.pl +++ b/hmon/hmon_rich_temp_backplane.pl @@ -28,7 +28,7 @@ my $raw = {}; my $val; my $mailerrstatecnt = 0; my ($max,$min,$avg,$sum,$count); -my $interlockTemperature = 37.0; #Interlock value !!! +my $interlockTemperature = 36.0; #Interlock value !!! trb_init_ports() or die trb_strerror(); @@ -86,7 +86,7 @@ while (1) { if ($max > $interlockTemperature ) { - my $s = sprintf("HAD:RICH:PS:17:SETONOFF"); + my $s = sprintf("HAD:RICH:PS:24:SETONOFF"); Perl2Epics::Connect("PS_RICH_3_3V",$s); Perl2Epics::Put("PS_RICH_3_3V",1); $InterlockActive = "Shutting down RICH ..."; diff --git a/hmon/hmon_startrate.pl b/hmon/hmon_startrate.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_stsrate.pl b/hmon/hmon_stsrate.pl index d73685e..56442be 100755 --- a/hmon/hmon_stsrate.pl +++ b/hmon/hmon_stsrate.pl @@ -73,6 +73,7 @@ while(1) { my $xpos = (($b>>4)&0xF)*10 + ($b&0xF); for my $v (0..47) { + last if $v == 32 && ($b&0xF)==3 && $b < 0x6440; my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff); if ($vdiff < 0) { $vdiff += 2**28;} diff --git a/hmon/hmon_trgsource.pl b/hmon/hmon_trgsource.pl index 3fcdcfa..09a52e6 100755 --- a/hmon/hmon_trgsource.pl +++ b/hmon/hmon_trgsource.pl @@ -24,8 +24,8 @@ my @lnames= qw(SectorwiseMult1 SectorwiseMult2 SectorwiseMult3 SectorwiseMult4 SectorwiseMult5 SectorwiseMult6 SectorwiseMult2NoNeighbour SectorwiseMult3NoNeighbour SectorwiseMult2Opposite); -my @ptnames= qw(M2 M5 M16 PT4 PT5 Ri FW EC); -my @ptlnames= qw(PT1/M2 PT2/M5 PT3/M20 PT4 PT5 PT6/Ri PT7/FW PT8/EC); +my @ptnames= qw(PT1 PT2 PT3 PT4 PT5 Ri FW EC); +my @ptlnames= qw(PT1 PT2 PT3 PT4 PT5 PT6/Ri PT7/FW PT8/EC); my $lastlongmsg = ""; my $spillsum = 0; @@ -232,7 +232,7 @@ my $longmsgcheck = $longmsg; $ptmsg = sprintf("%s/s / %1.2f%%",QA::SciNotation($rStat->{3}->[0x24]),$ptoverStattart) if $ptoverStattart<=10; $ptmsg = sprintf("%i/s / %1.1f%%",$rStat->{3}->[0x26],$ptoverStattart) if $ptoverStattart> 10; my $ptlongmsg = sprintf("PT1 counts per second: %i - PT1 / Start: %1.2f%%", $rStat->{3}->[0x24], $ptoverStattart); - QA::WriteQALog($fqa, "trg", "ptrate", 10, $qastatept, "PT1 / Start", $ptmsg, $ptlongmsg); +# QA::WriteQALog($fqa, "trg", "ptrate", 10, $qastatept, "PT1 / Start", $ptmsg, $ptlongmsg); my $startsum = 0; @@ -262,7 +262,7 @@ my $longmsgcheck = $longmsg; } $startmsg = sprintf("%s / %s",QA::SciNotation($startsum),QA::SciNotation($lastspillsum)); $startlongmsg = sprintf("counts per second %s/s - counts per spill %s",QA::SciNotation($startsum),QA::SciNotation($lastspillsum)); - QA::WriteQALog($fqa, "trg", "start", 10, $qastatstart, "Start Count", $startmsg, $startlongmsg); +# QA::WriteQALog($fqa, "trg", "start", 10, $qastatstart, "Start Count", $startmsg, $startlongmsg); diff --git a/hmon/hmon_vetohist.pl b/hmon/hmon_vetohist.pl old mode 100755 new mode 100644 diff --git a/hmon/index.cgi b/hmon/index.cgi index 4a72032..74520ca 100755 --- a/hmon/index.cgi +++ b/hmon/index.cgi @@ -33,7 +33,7 @@ function openwin(url) {
  • Chat Log
  • Web Tools (daqtools)
  • Eventbuilder Monitor
  • -
  • Raw Data Monitor
  • +
  • Raw Data Monitor
  • Accumulated Run Statistics @@ -49,8 +49,8 @@ function openwin(url) { @@ -76,7 +76,7 @@ function openwin(url) {
  • Eventrate histogram (10s)
  • Eventrate histogram (60s)
  • Eventrate histogram (10m)
  • -
  • Start counts per spill
  • +
  • Start counts per spill
  • Ratio of accepted PT3 per spill
  • Recorded events per spill
  • @@ -101,13 +101,13 @@ function openwin(url) { -->