IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37782


Ignore:
Timestamp:
Jan 5, 2015, 1:48:57 PM (12 years ago)
Author:
watersc1
Message:

CZW: commit from working copy of sc_remote scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_poll.pl

    r37492 r37782  
    107107    $poll_word  = "Completed";
    108108} 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);
    110114
    111115    if ($poll_response == -1) { # This job has an error
    112116        print "The job exited incorrectly: $remote_id $job_id $poll_word $poll_response.\n";
    113117        # warn("The job exited incorrectly: $remote_id $job_id $poll_word.");
     118        &my_die("problem with MOAB processing?", $remote_id, $PS_EXIT_SYS_ERROR);
    114119        exit (2);
    115120    }
     
    117122    if ($poll_response != 1) { # This job has NOT completed
    118123        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);
    120126    }
    121127}
     
    170176
    171177    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;
    175181    }
    176182#    print STDERR "stage_id : $stage_id, class_id: $class_id, \n";
    177183
    178184    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        }
    182188        $stage_pass{$stage_id} = 1;
    183189        $Npass ++;
     
    198204      my ($stage_id, $class_id) = get_stage_id_from_dbinfo ($file);
    199205      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;
    203209
    204210      }
     
    384390}
    385391
     392sub 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
    386418sub poll_job {
    387419    my $job_id = shift;
     
    472504    }
    473505    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/;
    476508    }
    477509
Note: See TracChangeset for help on using the changeset viewer.