my %EB_Args;
my $EB_Args_href = \%EB_Args;
-my @EB_IP_list;
+#my @EB_IP_list;
#--- Loop over all EB processes
#print Dumper $eb_ids_gbe_href;
#exit;
- foreach my $ebproc ( sort keys %{$eb_ids_gbe_href} ){
-
+ #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";
}
- 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 );
+ #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);
my $procname = sprintf("EB_PROC_%d", 1+$ebproc);
# $rfio_iCopyMode = $temp_args_href->{$procname}->{'RFIO_iCopyMode'};
- $href->{$ebproc}->{'IP'} = $eb_ip;
+ #$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'};
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";
+ #print "numbuilders for $ebserver is $bnet_numbuilders \n";
if($totalbuilders < $maxbuilders)
{
if($localbuilders[$ebserver] < $bnet_numbuilders)
print "Looking for running IOCs...\n" if($opt_verb);
#--- Loop over server IPs
- foreach my $ip (@EB_IP_list){
+
+ #foreach my $ip (@EB_IP_list){
+ foreach my $ip (@bnetservers){
&findRunningIOC($ip, $ioc_href);
}
### just kill the remaining stuff
@process_list = ();
- foreach my $ip (@EB_IP_list){
+ #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 $ip (@EB_IP_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);
}
#print Dumper $tmp_href;
#- 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'};
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}->{'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]);
- }
+
+ }
+ }
}
#print Dumper $ports_href;