From ba3a8069d10b3c70d94806627adf64ca562b8eff Mon Sep 17 00:00:00 2001 From: Hadaq Hades Date: Wed, 19 Mar 2014 12:00:59 +0100 Subject: [PATCH] JAM: expanded eventbuilder start script for dabc test mode eb.conf setup for may2014 with 4 dabc nodes, 8 regular nodes --- evtbuild/eb.conf | 2 +- evtbuild/start_eb_gbe.pl | 158 +++++++++++++++++++++++++++++++++++---- 2 files changed, 143 insertions(+), 17 deletions(-) diff --git a/evtbuild/eb.conf b/evtbuild/eb.conf index 38b7df8..d3d7e02 120000 --- a/evtbuild/eb.conf +++ b/evtbuild/eb.conf @@ -1 +1 @@ -eb.conf.oct12_noRFIO \ No newline at end of file +eb.conf.mai14_withRFIO \ No newline at end of file diff --git a/evtbuild/start_eb_gbe.pl b/evtbuild/start_eb_gbe.pl index 87d9565..13dd817 100755 --- a/evtbuild/start_eb_gbe.pl +++ b/evtbuild/start_eb_gbe.pl @@ -16,7 +16,7 @@ my @arg_list = @ARGV; #- the command line option flags my $opt_help = 0; -my $opt_ebconf = "/home/hadaq/trbsoft/daq/evtbuild/eb.conf"; +my $opt_ebconf = "/home/hadaq/trbsoft/hadesdaq/evtbuild/eb.conf.withdabc"; my $opt_ioc = ""; my $opt_test = 0; my $opt_verb = 0; @@ -144,18 +144,21 @@ sub init_CPU_status() #cores 0/1 reserved for system 02-05 #cores 2/3 reserved for interrupts on 02-05 - - 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"; - } - } + +#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 foreach my $core (0..11){ - if($core < 4){ + if($core < 4 ){ $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 @@ -168,13 +171,14 @@ sub init_CPU_status() } foreach my $core (0..23){ - if($core < 4){ + if($core < 4 ){ $EB_CPU_status_href->{'192.168.100.15'}->{$core} = "res"; #reserved } else{ $EB_CPU_status_href->{'192.168.100.15'}->{$core} = "free"; } } + } sub getCoreNr() @@ -282,6 +286,11 @@ sub getEBArgs() 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); + + #- Default RFIO settings my $rfio = $temp_args_href->{'Parallel'}->{'RFIO'}; my $rfio_path = $temp_args_href->{'Parallel'}->{'RFIO_PATH'}; @@ -402,6 +411,9 @@ sub getEBArgs() $href->{$ebproc}->{'EPICS_CTRL'} = $epics_list[$ebproc]; # 0|1 + $href->{$ebproc}->{'DABC'} = $dabc_list[$ebproc]; # 0|1 + + $href->{$ebproc}->{'EB_LOG'} = $eblog_list[$ebproc]; # 0|1 $href->{$ebproc}->{'NM_LOG'} = $nmlog_list[$ebproc]; # 0|1 @@ -472,6 +484,115 @@ sub startEvtBuilders() my $ebnum2print = $ebproc+1; print "EB process: $ebnum2print\n"; + +# JAM first test if we should activate dabc eventbuilder or old one + + if( $EB_Args_href->{$ebproc}->{'DABC'} ){ + print "Starting DABC process..\n"; +# TODO: here evaluate parameters and code into dabc command execution + +#". /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'}; + my $dabclogin = ". /home/hadaq/soft/dabc/head/dabclogin;"; + my $cdworkdir = "cd //home/hadaq/oper;"; + + my $cmd_dabc = "/home/hadaq/soft/dabc/head/bin/dabc_exe "; + my $conf_dabc = " EventBuilderHades.xml"; + my $exports = " 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'} ){ + $exports = $exports . " export FILEOUTPUTS=2;"; + 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'} .";"; + } + } + else{ + $exports = $exports . " export FILEOUTPUTS=1;"; + # no output except for the stream server... + } + + +# 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'} . ";"; + + +if( $EB_Args_href->{$ebproc}->{'RFIO'} ){ + $exports = $exports . " export FILEOUTPUTS=3;"; + +# switch on by number of outputs +} + + +# my $rfio; +# if( $EB_Args_href->{$ebproc}->{'RFIO'} ){ +# $rfio = " --rfio " . $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'}; +# } + + +# EPICSCONTROL ? always enabled for production +# SMALLFILES for online monitoring node + + + my $core_nr = &getCoreNr($cpu); + +# 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 &\""; + + + + 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); + +} + +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'} . @@ -513,7 +634,7 @@ sub startEvtBuilders() #- add rfio args my $rfio; if( $EB_Args_href->{$ebproc}->{'RFIO'} ){ - $rfio = " --rfio " . $EB_Args_href->{$ebproc}->{'RFIO_PATH'} . + $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'} . @@ -593,11 +714,16 @@ sub startEvtBuilders() &forkEB($exe_eb, $exe_nm, $exe_open_eb, $exe_open_nm, \@process_list); } +} +# if dabc + #- Wait for children foreach my $cur_child_pid (@process_list) { waitpid($cur_child_pid,0); } -} + +} +# foreach sub stopEvtBuilders() { @@ -741,7 +867,7 @@ dbLoadDatabase("dbd/ebctrl.dbd") ebctrl_registerRecordDeviceDriver(pdbbase) ## Load record instances -dbLoadRecords("db/stats.db", "PREFIX=HAD:IOC:,IOC=\${HOSTNAME}") +dbLoadRecords("db/stats.db", "PREFIX=HAD:IOC:,IOC=$ebnum") dbLoadRecords("db/evtbuild.db","eb=$ebnum") dbLoadRecords("db/netmem.db","eb=$ebnum") dbLoadRecords("db/errbit1.db","eb=$ebnum") @@ -996,7 +1122,7 @@ sub getGbEconfig() 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 $cts_conf = $temp_args_href->{'Parallel'}->{'CTS_CONF'}; my %activeSources_hash; my $activeSources_href = \%activeSources_hash; -- 2.43.0