use strict;
use warnings;
use XML::Twig;
-#use Data::Dumper;
+use Data::Dumper;
our $lbattr='http://egee.cesnet.cz/en/Schema/LB/Attributes';
our $jpsys='http://egee.cesnet.cz/en/Schema/JP/System';
our $jpwf='http://egee.cesnet.cz/en/Schema/JP/Workflow';
our $jplbtag='http://egee.cesnet.cz/en/WSDL/jp-lbtag';
-our @view_attributes=("$pch::jplbtag:IPAW_STAGE", "$pch::jplbtag:IPAW_PROGRAM", "$pch::jplbtag:IPAW_PARAM", "$pch::jplbtag:IPAW_INPUT", "$pch::jplbtag:IPAW_OUTPUT", "$pch::lbattr:CE", "$pch::lbattr:parent", "$pch::jpsys:regtime");
-#"$pch::lbattr:host", # TODO: to index server
+our @view_attributes=("$pch::jplbtag:IPAW_STAGE", "$pch::jplbtag:IPAW_PROGRAM", "$pch::jplbtag:IPAW_PARAM", "$pch::jplbtag:IPAW_INPUT", "$pch::jplbtag:IPAW_OUTPUT", "$pch::lbattr:CE", "$pch::lbattr:parent", "$pch::lbattr:host", "$pch::jpsys:regtime");
+
our $debug = 0;
our $err = 0;
$xmlattribute = $xmljobs->first_child('attributes');
while ($xmlattribute) {
+ my ($xmlname, $xmlvalue);
my @values = ();
- my ($xmlname, $xmlvalue, %attribute);
- %attribute = ();
+ my %attribute = ();
$xmlname = $xmlattribute->first_child('name');
die "No name on '".$xmlattribute->text."'" if (!$xmlname);
+#print $xmljobid->text.": ".$xmlname->text.":\n";
+ if (exists $attributes{$xmlname->text}) {
+ %attribute = %{$attributes{$xmlname->text}};
+ }
+#print " prev attr: ".Dumper(%attribute)."\n";
+ if (exists $attribute{value}) {
+ @values = @{$attribute{value}};
+ }
+#print " prev values: ".Dumper(@values)."\n";
$xmlvalue = $xmlattribute->first_child('value');
while ($xmlvalue) {
+#print " to add: ".$xmlvalue->text."\n";
push @values, $xmlvalue->text;
$xmlvalue = $xmlvalue->next_sibling('value');
}
- $attribute{value} = \@values;
+ @{$attribute{value}} = @values;
+#print " new values: ".Dumper($attribute{value})."\n";
$attribute{timestamp} = $xmlattribute->first_child('timestamp')->text;
$xmlattribute = $xmlattribute->next_sibling('attributes');
my $program_name='align_warp';
my $program_params='-m 12';
my $runday=1;
+#my $runday=4;
my @view_attributes = ("$pch::jplbtag:IPAW_STAGE", "$pch::jplbtag:IPAW_PROGRAM", "$pch::jplbtag:IPAW_PARAM", "$pch::jplbtag:IPAW_INPUT", "$pch::jplbtag:IPAW_OUTPUT", "$pch::lbattr:CE");
my @attributes = ("$pch::jpsys:jobId", "$pch::jpsys:regtime", @view_attributes);
my $is='https://skurut1.cesnet.cz:8902';
my $program_name='align_warp';
my $end_program_name='convert';
-my $atlas_image_program_name='convert';
my $header="GLOBAL_MAXIMUM=4095"; # test for exact equal (scripts already prepared it)
my @according_jobs = (); # sequencially jobid list
# debug calls
-$pch::debug = 1;
-my $debug = 1;
+$pch::debug = 0;
+my $debug = 0;
#
# find out processes with given name and parameters
my %attributes = %{$job{attributes}};
my $dagjobid = $attributes{"$pch::lbattr:parent"}{value}[0];
+ print "Consider DAG $dagjobid\n" if $debug;
if (!exists $according_jobs{$dagjobid}) {
%job = ();
push @according_jobs, $dagjobid;
my @value;
@value = pch::psquery($ps, $dagjobid, $attr);
- if (defined @value) { $job{attributes}{$attr} = \@value; }
+ if (defined @value) { @{$job{attributes}{$attr}{value}} = @value; }
}
$according_jobs{$dagjobid} = \%job;
+ print "Added DAG $dagjobid\n" if $debug;
}
}
undef @jobs;