Queries on multiple program names (needed for data from Karma and for hybrids).
$xmlattribute = $xmljobs->first_child('attributes');
while ($xmlattribute) {
- my ($xmlname, $xmlvalue);
+ my ($xmlname, $xmlvalue, $xmlorigin);
my @values = ();
+ my @origins = ();
my %attribute = ();
+ my $nvalues = 0;
$xmlname = $xmlattribute->first_child('name');
die "No name on '".$xmlattribute->text."'" if (!$xmlname);
@values = @{$attribute{value}};
}
#print " prev values: ".Dumper(@values)."\n";
+ if (exists $attribute{origin}) {
+ @origins = @{$attribute{origin}};
+ }
+#print " prev origins: ".Dumper(@origins)."\n";
$xmlvalue = $xmlattribute->first_child('value');
while ($xmlvalue) {
#print " to add: ".$xmlvalue->text."\n";
push @values, $xmlvalue->text;
$xmlvalue = $xmlvalue->next_sibling('value');
+ $nvalues = $nvalues + 1;
}
@{$attribute{value}} = @values;
#print " new values: ".Dumper($attribute{value})."\n";
+ $xmlorigin = $xmlattribute->first_child('origin');
+ for ($nvalues..1) {
+ if ($xmlorigin and $xmlorigin->text) { push @origins, $xmlorigin->text; }
+ else { push @origins, undef; }
+ }
+ @{$attribute{origin}} = @origins;
+#print " new origins: ".Dumper($attribute{origin})."\n";
$attribute{timestamp} = $xmlattribute->first_child('timestamp')->text;
$xmlattribute = $xmlattribute->next_sibling('attributes');
my $ps=$pch::ps;
my $is=$pch::is;
-my $program_name = "softmean";
+my %program_names = (softmean => 1);
my @according_jobs = (); # sequencially jobid list
my %according_jobs = (); # hash jobid list
exit 1
}
$output = $ARGV[0];
-if ($#ARGV + 1 > 1) { $program_name = $ARGV[1]; }
+if ($#ARGV + 1 > 1) {
+ %program_names = ();
+ foreach (split(/ */,$ARGV[1])) {
+ $program_names{$_} = 1;
+ }
+}
# debug calls
$pch::debug = 0;
# stop on given program name
@program = pch::psquery($ps, $jobid, "$pch::jplbtag:IPAW_PROGRAM");
die "More program names of $jobid?" if ($#program > 0);
- if ($program[0] eq $program_name) {
- print "$jobid is $program_name, stop here\n" if $debug;
+ if (exists $program_names{$program[0]}) {
+ print "$jobid is $program[0], stop here\n" if $debug;
next;
}
my $ps=$pch::ps;
my $is=$pch::is;
-my $program_name='align_warp';
+my %program_names=(align_warp => 1);
my $program_params='-m 12';
my $runday=1;
#my $runday=4;
$pch::debug = 0;
my $debug = 0;
-if ($#ARGV + 1 > 1) { $program_name=$ARGV[0]; }
+if ($#ARGV + 1 > 1) {
+ %program_names = ();
+ foreach (split(/ */, $ARGV[1])) {
+ $program_names{$_} = 1;
+ }
+}
+
#
# find out processes with given name ant parameters
#
+my @query_programs = ();
+foreach (keys %program_names) {
+ my @qitem = ['EQUAL', "<string>$_</string>"];
+ push @query_programs, @qitem;
+}
my @jobs = pch::isquery($is, [
- ["$pch::jplbtag:IPAW_PROGRAM", ['EQUAL', "<string>$program_name</string>"]],
+ ["$pch::jplbtag:IPAW_PROGRAM", @query_programs],
["$pch::jplbtag:IPAW_PARAM", ['EQUAL', "<string>$program_params</string>"]],
], \@attributes);
print Dumper(@jobs) if ($debug);
$according_count = 0;
foreach my $job (@jobs) {
my %job = %$job;
- my @time;
+ my (@time, @timesep, @origin);
+ my $itime;
print "Handling $job{jobid} ($according_count.)\n" if ($debug);
- @time =@{ $job{attributes}{"$pch::jpsys:regtime"}{value}};
- my @timesep = gmtime($time[0]);
+ # search first regtime with origin USER,
+ # be satisfied with first regime too if no value has USER origin
+ @time = @{$job{attributes}{"$pch::jpsys:regtime"}{value}};
+ @origin = @{$job{attributes}{"$pch::jpsys:regtime"}{origin}};
+ @timesep = ();
+ foreach $itime (0..$#time) {
+#print "check ".$time[$itime]." ".$origin[$itime]."\n";
+ if ($origin[$itime] eq 'USER') {
+ @timesep = gmtime($time[$itime]);
+ last;
+ }
+ }
+ if ($#timesep == -1) { @timesep = gmtime($time[0]); }
+#print join(',', @timesep)."\n";
+
if ($timesep[6] == $runday) {
if (!exists $according_jobs{$job{jobid}}) {
$according_jobs{$job{jobid}} = \%job;
my $ps=$pch::ps;
my $is=$pch::is;
-my $program_name='align_warp';
-my $end_program_name='convert';
+my %program_names=(align_warp => 1);
+my %end_program_names=(convert => 1);
my $header="GLOBAL_MAXIMUM=4095"; # test for exact equal (scripts already prepared it)
my @according_jobs = (); # sequencially jobid list
$pch::debug = 0;
my $debug = 0;
-if ($#ARGV + 1 >= 1) { $program_name = $ARGV[0]; }
-if ($#ARGV + 1 >= 2) { $end_program_name = $ARGV[1]; }
+if ($#ARGV + 1 >= 1) {
+ %program_names = ();
+ foreach (split(/ */, $ARGV[0])) {
+ $program_names{$_} = 1;
+ }
+}
+if ($#ARGV + 1 >= 2) {
+ %end_program_names = ();
+ foreach (split(/ */, $ARGV[1])) {
+ $end_program_names{$_} = 1;
+ }
+}
#
# find out processes with given name and parameters
#
+my @query_programs = ();
+foreach (keys %program_names) {
+ my @qitem = ['EQUAL', "<string>$_</string>"];
+ push @query_programs, @qitem;
+}
my @jobs = pch::isquery($is, [
- ["$pch::jplbtag:IPAW_PROGRAM", ['EQUAL', "<string>$program_name</string>"]],
+ ["$pch::jplbtag:IPAW_PROGRAM", @query_programs],
["$pch::jplbtag:IPAW_HEADER", ['EQUAL', "<string>$header</string>"]],
], \@pch::view_attributes);
print Dumper(@jobs) if ($debug);
$according_count = 0;
foreach my $jobid (@according_jobs) {
my @succs;
+ my $pname;
print "Handling $jobid (position $according_count)\n" if ($debug);
- if ($according_jobs{$jobid}{attributes}{"$pch::IPAW_PROGRAM"}{value}[0] eq $end_program_name) {
- print "It's $end_program_name\n" if $debug;
+ $pname = $according_jobs{$jobid}{attributes}{"$pch::IPAW_PROGRAM"}{value}[0];
+ if (exists $end_program_names{$pname}) {
+ print "It's $pname\n" if $debug;
next;
}
my $ps=$pch::ps;
my $is=$pch::is;
-my $program_name='align_warp';
+my %program_names=(align_warp=>1);
my $program_param='-m 12';
-my $end_program_name='softmean';
+my %end_program_names=(softmean=>1);
#my %jobs = (); # just information cache
my @workflow_jobs = (); # sequencially jobid list
$pch::debug = 0;
my $debug = 0;
-if ($#ARGV + 1 >= 1) { $program_name = $ARGV[0]; }
-if ($#ARGV + 1 >= 2) { $end_program_name = $ARGV[1]; }
+if ($#ARGV + 1 >= 1) {
+ %program_names = ();
+ foreach (split(/ */, $ARGV[0])) {
+ $program_names{$_} = 1;
+ }
+}
+if ($#ARGV + 1 >= 2) {
+ %end_program_names = ();
+ foreach (split(/ */, $ARGV[1])) {
+ $end_program_names{$_} = 1;
+ }
+}
#
# find out processes with given name and parameters
#
+my @query_programs = ();
+foreach (keys %program_names) {
+ my @qitem = ['EQUAL', "<string>$_</string>"];
+ push @query_programs, @qitem;
+}
my @jobs = pch::isquery($is, [
- ["$pch::jplbtag:IPAW_PROGRAM", ['EQUAL', "<string>$program_name</string>"]],
+ ["$pch::jplbtag:IPAW_PROGRAM", @query_programs],
["$pch::jplbtag:IPAW_PARAM", ['EQUAL', "<string>$program_param</string>"]],
], ["$pch::jpwf:successor", @pch::view_attributes]);
print Dumper(@jobs) if ($debug);
$workflow_count = 0;
foreach my $jobid (@workflow_jobs) {
my @succs;
+ my $pname;
print "Handling $jobid (position $workflow_count)\n" if ($debug);
print " progname: ".$workflow_jobs{$jobid}{attributes}{"$pch::jplbtag:IPAW_PROGRAM"}{value}[0]."\n" if ($debug);
- if ($workflow_jobs{$jobid}{attributes}{"$pch::jplbtag:IPAW_PROGRAM"}{value}[0] eq $end_program_name) {
- print "It's $end_program_name, adding\n" if $debug;
+ $pname = $workflow_jobs{$jobid}{attributes}{"$pch::jplbtag:IPAW_PROGRAM"}{value}[0];
+ if (exists $end_program_names{$pname}) {
+ print "It's $pname, adding\n" if $debug;
$according_jobs{$jobid} = \%{$workflow_jobs{$jobid}};
next;
}