Index: /tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_poll.pl
===================================================================
--- /tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_poll.pl	(revision 37781)
+++ /tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_poll.pl	(revision 37782)
@@ -107,9 +107,14 @@
     $poll_word  = "Completed";
 } else {
-    ($poll_response,$poll_word) = poll_job($job_id);
+
+    my $poll_file = "$remote_root/stask_logs/$runData->{stage}.$remote_id.out";
+    ($poll_response,$poll_word) = poll_job_alt($poll_file);
+
+    # ($poll_response,$poll_word) = poll_job($job_id);
 
     if ($poll_response == -1) { # This job has an error
         print "The job exited incorrectly: $remote_id $job_id $poll_word $poll_response.\n";
         # warn("The job exited incorrectly: $remote_id $job_id $poll_word.");
+        &my_die("problem with MOAB processing?", $remote_id, $PS_EXIT_SYS_ERROR);
         exit (2);
     }
@@ -117,5 +122,6 @@
     if ($poll_response != 1) { # This job has NOT completed
         print "The job has not exited at LANL: $remote_id $job_id $poll_word $poll_response.\n";
-        exit (2);
+        # NOTE: this should not be a failure condition
+        exit (0);
     }
 }
@@ -170,14 +176,14 @@
 
     my ($stage_id, $class_id, $component) = get_stage_id_from_filename ($words[0],$stage);
-    unless(defined($stage_id)) { 
-	print STDERR "Unable to convert file: $words[0]\n";
-	next;
+    unless(defined($stage_id)) {
+        print STDERR "Unable to convert file: $words[0]\n";
+        next;
     }
 #    print STDERR "stage_id : $stage_id, class_id: $class_id, \n";
 
     if ($words[1] eq "PASS") {
-	if ($line =~ /dbinfo/) {
-	    push @dbinfo_files, $words[0];
-	}
+        if ($line =~ /dbinfo/) {
+            push @dbinfo_files, $words[0];
+        }
         $stage_pass{$stage_id} = 1;
         $Npass ++;
@@ -198,7 +204,7 @@
       my ($stage_id, $class_id) = get_stage_id_from_dbinfo ($file);
       if (defined($stage_part{$stage_id})||
-	  defined($stage_fail{$stage_id})) { 
-	  print STDERR "Skipping $file as it is not complete: " . $stage_part{$stage_id} . " " . $stage_fail{$stage_id} . "\n";
-	  next;
+          defined($stage_fail{$stage_id})) {
+          print STDERR "Skipping $file as it is not complete: " . $stage_part{$stage_id} . " " . $stage_fail{$stage_id} . "\n";
+          next;
 
       }
@@ -384,4 +390,30 @@
 }
 
+sub poll_job_alt {
+    my $poll_file = shift;
+
+    my $response_array = ssh_exec_command("$remote_root/sc_checkjob.pl --poll_file $poll_file");
+    my $response = join "\n", @$response_array;
+
+    print STDERR "response: $response\n";
+
+    if ($response =~ /STATUS: RUNNING/) {
+        return(0,"Running");
+    }
+    elsif ($response =~ /STATUS: COMPLETED/) {
+        return(1,"Completed");
+    }
+    elsif ($response =~ /STATUS: PENDING/) {
+        return(-2,"Idle");
+    }
+    else {
+        my $response_word = $response;
+        $response_word =~ s/.*State: //;
+        $response_word =~ s/\n.*//;
+        return(-1,$response_word);
+    }
+}
+
+
 sub poll_job {
     my $job_id = shift;
@@ -472,6 +504,6 @@
     }
     elsif ($stage eq 'stack') {
-        $stage_id =~ s/^.*stk\.//;
-        $class_id = 0;
+        print STDERR "dbinfo: $file\n";
+        ($class_id, $stage_id) = $file =~ /(skycell.\d\d\d\d.\d\d\d).stk.(\d*).dbinfo/;
     }
 
