Changeset 37782
- Timestamp:
- Jan 5, 2015, 1:48:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_poll.pl
r37492 r37782 107 107 $poll_word = "Completed"; 108 108 } else { 109 ($poll_response,$poll_word) = poll_job($job_id); 109 110 my $poll_file = "$remote_root/stask_logs/$runData->{stage}.$remote_id.out"; 111 ($poll_response,$poll_word) = poll_job_alt($poll_file); 112 113 # ($poll_response,$poll_word) = poll_job($job_id); 110 114 111 115 if ($poll_response == -1) { # This job has an error 112 116 print "The job exited incorrectly: $remote_id $job_id $poll_word $poll_response.\n"; 113 117 # warn("The job exited incorrectly: $remote_id $job_id $poll_word."); 118 &my_die("problem with MOAB processing?", $remote_id, $PS_EXIT_SYS_ERROR); 114 119 exit (2); 115 120 } … … 117 122 if ($poll_response != 1) { # This job has NOT completed 118 123 print "The job has not exited at LANL: $remote_id $job_id $poll_word $poll_response.\n"; 119 exit (2); 124 # NOTE: this should not be a failure condition 125 exit (0); 120 126 } 121 127 } … … 170 176 171 177 my ($stage_id, $class_id, $component) = get_stage_id_from_filename ($words[0],$stage); 172 unless(defined($stage_id)) { 173 print STDERR "Unable to convert file: $words[0]\n";174 next;178 unless(defined($stage_id)) { 179 print STDERR "Unable to convert file: $words[0]\n"; 180 next; 175 181 } 176 182 # print STDERR "stage_id : $stage_id, class_id: $class_id, \n"; 177 183 178 184 if ($words[1] eq "PASS") { 179 if ($line =~ /dbinfo/) {180 push @dbinfo_files, $words[0];181 }185 if ($line =~ /dbinfo/) { 186 push @dbinfo_files, $words[0]; 187 } 182 188 $stage_pass{$stage_id} = 1; 183 189 $Npass ++; … … 198 204 my ($stage_id, $class_id) = get_stage_id_from_dbinfo ($file); 199 205 if (defined($stage_part{$stage_id})|| 200 defined($stage_fail{$stage_id})) { 201 print STDERR "Skipping $file as it is not complete: " . $stage_part{$stage_id} . " " . $stage_fail{$stage_id} . "\n";202 next;206 defined($stage_fail{$stage_id})) { 207 print STDERR "Skipping $file as it is not complete: " . $stage_part{$stage_id} . " " . $stage_fail{$stage_id} . "\n"; 208 next; 203 209 204 210 } … … 384 390 } 385 391 392 sub poll_job_alt { 393 my $poll_file = shift; 394 395 my $response_array = ssh_exec_command("$remote_root/sc_checkjob.pl --poll_file $poll_file"); 396 my $response = join "\n", @$response_array; 397 398 print STDERR "response: $response\n"; 399 400 if ($response =~ /STATUS: RUNNING/) { 401 return(0,"Running"); 402 } 403 elsif ($response =~ /STATUS: COMPLETED/) { 404 return(1,"Completed"); 405 } 406 elsif ($response =~ /STATUS: PENDING/) { 407 return(-2,"Idle"); 408 } 409 else { 410 my $response_word = $response; 411 $response_word =~ s/.*State: //; 412 $response_word =~ s/\n.*//; 413 return(-1,$response_word); 414 } 415 } 416 417 386 418 sub poll_job { 387 419 my $job_id = shift; … … 472 504 } 473 505 elsif ($stage eq 'stack') { 474 $stage_id =~ s/^.*stk\.//;475 $class_id = 0;506 print STDERR "dbinfo: $file\n"; 507 ($class_id, $stage_id) = $file =~ /(skycell.\d\d\d\d.\d\d\d).stk.(\d*).dbinfo/; 476 508 } 477 509
Note:
See TracChangeset
for help on using the changeset viewer.
