Index: trunk/gridctl.php
===================================================================
--- trunk/gridctl.php	(revision 12)
+++ trunk/gridctl.php	(revision 14)
@@ -40,7 +40,25 @@
 }
 
+$me_devel  = preg_match( "/class_devel/", $class_dir );
+
 while ( list( $gfacID, $us3_db, $cluster, $status, $queue_msg, $time, $updateTime ) 
             = mysql_fetch_array( $result ) )
 {
+   // If this entry does not match class/class_devel, skip processing
+
+   if ( preg_match( "/US3-A/i", $gfacID ) )
+   {  // For thrift, job and gridctl must match
+      $job_devel = preg_match( "/US3-ADEV/i", $gfacID );
+      if ( (  $me_devel  &&  !$job_devel )  ||
+           ( !$me_devel  &&   $job_devel ) )
+      {  // If job not from appropriate Airavata server, skip processing
+         continue;
+      }
+   }
+   else if ( $me_devel )
+   {  // For non-thrift and development, skip
+      continue;
+   }
+
    // Checking we need to do for each entry
 echo "us3db=$us3_db  gfid=$gfacID\n";
@@ -63,4 +81,6 @@
    $gfacLabl = $awork[0] . "-" . $awork[1] . "-" . $awork[2];
    $loghdr   = $self . ":" . $gfacLabl . "...:";
+   $status_in = $status;
+   $status_gw = $status;
 
    // If entry is for Airvata/Thrift, get the true current status
@@ -182,5 +202,5 @@
       if ( ! in_array( $job_status, array( 'SUBMITTED', 'INITIALIZED', 'PENDING' ) ) )
       {
-write_log( "$loghdr submitted:job_status=$job_status" );
+//write_log( "$loghdr submitted:job_status=$job_status" );
          update_job_status( $job_status, $gfacID );
       }
@@ -217,4 +237,5 @@
    if ( ! in_array( $job_status, array( 'SUBMITTED', 'INITIALIZED', 'PENDING' ) ) )
    {
+//write_log( "$loghdr submit_timeout:job_status=$job_status" );
       update_job_status( $job_status, $gfacID );
       return;
@@ -260,5 +281,8 @@
 
       if ( ! in_array( $job_status, array( 'ACTIVE', 'RUNNING', 'STARTED' ) ) )
+      {
+//write_log( "$loghdr running:job_status=$job_status" );
          update_job_status( $job_status, $gfacID );
+      }
 
       return;
@@ -293,4 +317,5 @@
    if ( ! in_array( $job_status, array( 'ACTIVE', 'RUNNING', 'STARTED' ) ) )
    {
+//write_log( "$loghdr run_timeout:job_status=$job_status" );
       update_job_status( $job_status, $gfacID );
       return;
@@ -335,4 +360,5 @@
       if ( $job_status != 'DATA' )
       {
+//write_log( "$loghdr wait_data:job_status=$job_status" );
          update_job_status( $job_status, $gfacID );
          return;
@@ -379,4 +405,5 @@
    if ( $job_status != 'DATA' )
    {
+//write_log( "$loghdr data_timeout:job_status=$job_status" );
       update_job_status( $job_status, $gfacID );
       return;
@@ -455,7 +482,8 @@
    if ( $requestID == 0 ) return;
 
+   $me_devel  = preg_match( "/class_devel/", $class_dir );
+
    if ( preg_match( "/US3-A/i", $gfacID ) )
    {
-      $me_devel  = preg_match( "/class_devel/", $class_dir );
       $job_devel = preg_match( "/US3-ADEV/i", $gfacID );
       if ( ( !$me_devel  &&  !$job_devel )  ||
@@ -467,6 +495,7 @@
 //write_log( "$loghdr RTN FR aira_cleanup()" );
    }
-   else
-   {
+
+   else if ( ! $me_devel )
+   {  // If this is gridctl_pro and gfac (jureca), do GFAC cleanup
 //write_log( "$loghdr CALLING gfac_cleanup()" );
       gfac_cleanup( $us3_db, $requestID, $gLink );
@@ -487,8 +516,7 @@
     case 'SUBMITED'    :
     case 'INITIALIZED' :
-    case 'UPDATING'    :
-    case 'PENDING'     :
       $query   = "UPDATE analysis SET status='SUBMITTED' WHERE gfacID='$gfacID'";
-      $message = "Job status request reports job is SUBMITTED";
+      $message = "Job status request reports job is " . $job_status;
+//write_log( "$loghdr update_job_status(SUBM) job_status=$job_status" );
       break;
 
@@ -536,4 +564,9 @@
       $query   = "UPDATE analysis SET status='ERROR' WHERE gfacID='$gfacID'";
       $message = "Job status request reports job is not in the queue";
+      break;
+
+    case 'UPDATING'    :
+    case 'PENDING'     :
+      $message = "Job status request reports job is " . $job_status;
       break;
 
@@ -627,5 +660,5 @@
 
    if ( preg_match( "/US3-A/i", $gfacID )  &&
-        ! preg_match( "/juropa/i", $cluster ) )
+        ! preg_match( "/jur/i", $cluster ) )
    {
       // Then it's an Airavata/Thrift job
@@ -648,4 +681,5 @@
       $status_ex    = getExperimentStatus( $gfacID );
       $gfac_status  = standard_status( $status_ex );
+write_log( "$loghdr get_gfac_status: status_ex=$status_ex gfac_status=$gfac_status" );
       return $gfac_status;
    }
@@ -953,7 +987,4 @@
          break;
 
-         $status      = 'DATA';
-         break;
-
       case 'COMPLETED' :
       case 'completed' :
@@ -1056,5 +1087,6 @@
       }
 
-if(preg_match("/US3-ADEV/i",$gfacID))
+//if(preg_match("/US3-ADEV/i",$gfacID))
+if(preg_match("/US3-A/i",$gfacID))
 write_log( "$loghdr status/_in/_gw/_ex=$status/$status_in/$status_gw/$status_ex" );
 //write_log( "$loghdr status/_in/_gw/_ex=$status/$status_in/$status_gw/$status_ex" );
