Changeset 14 for trunk


Ignore:
Timestamp:
Jun 29, 2015, 1:39:50 PM (10 years ago)
Author:
gegorbet
Message:

fix to skip all processing where task/job devel/prod do not match

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cluster_status.php

    r12 r14  
    172172   {
    173173      $a      = Array();
    174 /**
    175       if ( $clname == "alamo" )
    176       {
    177          $qstat  = `ssh $clname '/usr/bin/qstat -B 2>&1|tail -1'`;
    178 
    179          $sparts = preg_split( '/\s+/', $qstat );
    180          $que    = $sparts[ 3 ];
    181          $run    = $sparts[ 4 ];
    182          $sta    = $sparts[ 10 ];
    183       }
    184       else 
    185       {
    186          $qstat  = `ssh $clname '/opt/torque/bin/qstat -B 2>&1|tail -1'`;
    187 
    188          $sparts = preg_split( '/\s+/', $qstat );
    189          $que    = $sparts[ 3 ];
    190          $run    = $sparts[ 4 ];
    191          $sta    = $sparts[ 9 ];
    192       }
    193 
    194 //echo "$self: cln que run sta   $clname $que $run $sta \n";
    195 
    196       if ( $sta == "Active" )
    197       {
    198          $sta    = "up";
    199       }
    200       else
    201       {
    202          $sta    = "down";
    203          $que    = "0";
    204          $run    = "0";
    205       }
    206  *a*/
    207174      switch( $clname )
    208175      {
     
    298265         case 'jureca':
    299266         {
    300             $host   = "swus1@jureca.fz-juelich.de";
     267            //$host   = "swus1@jureca.fz-juelich.de";
     268            $host   = "swus1@juropatest2.fz-juelich.de";
    301269            $qstat  = `ssh $host '/usr/bin/sinfo -s -p batch -o "%a %F" 2>&1|tail -1'`;
    302270            $sparts = preg_split( '/\s+/', $qstat );
  • trunk/gridctl.php

    r12 r14  
    4040}
    4141
     42$me_devel  = preg_match( "/class_devel/", $class_dir );
     43
    4244while ( list( $gfacID, $us3_db, $cluster, $status, $queue_msg, $time, $updateTime )
    4345            = mysql_fetch_array( $result ) )
    4446{
     47   // If this entry does not match class/class_devel, skip processing
     48
     49   if ( preg_match( "/US3-A/i", $gfacID ) )
     50   {  // For thrift, job and gridctl must match
     51      $job_devel = preg_match( "/US3-ADEV/i", $gfacID );
     52      if ( (  $me_devel  &&  !$job_devel )  ||
     53           ( !$me_devel  &&   $job_devel ) )
     54      {  // If job not from appropriate Airavata server, skip processing
     55         continue;
     56      }
     57   }
     58   else if ( $me_devel )
     59   {  // For non-thrift and development, skip
     60      continue;
     61   }
     62
    4563   // Checking we need to do for each entry
    4664echo "us3db=$us3_db  gfid=$gfacID\n";
     
    6381   $gfacLabl = $awork[0] . "-" . $awork[1] . "-" . $awork[2];
    6482   $loghdr   = $self . ":" . $gfacLabl . "...:";
     83   $status_in = $status;
     84   $status_gw = $status;
    6585
    6686   // If entry is for Airvata/Thrift, get the true current status
     
    182202      if ( ! in_array( $job_status, array( 'SUBMITTED', 'INITIALIZED', 'PENDING' ) ) )
    183203      {
    184 write_log( "$loghdr submitted:job_status=$job_status" );
     204//write_log( "$loghdr submitted:job_status=$job_status" );
    185205         update_job_status( $job_status, $gfacID );
    186206      }
     
    217237   if ( ! in_array( $job_status, array( 'SUBMITTED', 'INITIALIZED', 'PENDING' ) ) )
    218238   {
     239//write_log( "$loghdr submit_timeout:job_status=$job_status" );
    219240      update_job_status( $job_status, $gfacID );
    220241      return;
     
    260281
    261282      if ( ! in_array( $job_status, array( 'ACTIVE', 'RUNNING', 'STARTED' ) ) )
     283      {
     284//write_log( "$loghdr running:job_status=$job_status" );
    262285         update_job_status( $job_status, $gfacID );
     286      }
    263287
    264288      return;
     
    293317   if ( ! in_array( $job_status, array( 'ACTIVE', 'RUNNING', 'STARTED' ) ) )
    294318   {
     319//write_log( "$loghdr run_timeout:job_status=$job_status" );
    295320      update_job_status( $job_status, $gfacID );
    296321      return;
     
    335360      if ( $job_status != 'DATA' )
    336361      {
     362//write_log( "$loghdr wait_data:job_status=$job_status" );
    337363         update_job_status( $job_status, $gfacID );
    338364         return;
     
    379405   if ( $job_status != 'DATA' )
    380406   {
     407//write_log( "$loghdr data_timeout:job_status=$job_status" );
    381408      update_job_status( $job_status, $gfacID );
    382409      return;
     
    455482   if ( $requestID == 0 ) return;
    456483
     484   $me_devel  = preg_match( "/class_devel/", $class_dir );
     485
    457486   if ( preg_match( "/US3-A/i", $gfacID ) )
    458487   {
    459       $me_devel  = preg_match( "/class_devel/", $class_dir );
    460488      $job_devel = preg_match( "/US3-ADEV/i", $gfacID );
    461489      if ( ( !$me_devel  &&  !$job_devel )  ||
     
    467495//write_log( "$loghdr RTN FR aira_cleanup()" );
    468496   }
    469    else
    470    {
     497
     498   else if ( ! $me_devel )
     499   {  // If this is gridctl_pro and gfac (jureca), do GFAC cleanup
    471500//write_log( "$loghdr CALLING gfac_cleanup()" );
    472501      gfac_cleanup( $us3_db, $requestID, $gLink );
     
    487516    case 'SUBMITED'    :
    488517    case 'INITIALIZED' :
    489     case 'UPDATING'    :
    490     case 'PENDING'     :
    491518      $query   = "UPDATE analysis SET status='SUBMITTED' WHERE gfacID='$gfacID'";
    492       $message = "Job status request reports job is SUBMITTED";
     519      $message = "Job status request reports job is " . $job_status;
     520//write_log( "$loghdr update_job_status(SUBM) job_status=$job_status" );
    493521      break;
    494522
     
    536564      $query   = "UPDATE analysis SET status='ERROR' WHERE gfacID='$gfacID'";
    537565      $message = "Job status request reports job is not in the queue";
     566      break;
     567
     568    case 'UPDATING'    :
     569    case 'PENDING'     :
     570      $message = "Job status request reports job is " . $job_status;
    538571      break;
    539572
     
    627660
    628661   if ( preg_match( "/US3-A/i", $gfacID )  &&
    629         ! preg_match( "/juropa/i", $cluster ) )
     662        ! preg_match( "/jur/i", $cluster ) )
    630663   {
    631664      // Then it's an Airavata/Thrift job
     
    648681      $status_ex    = getExperimentStatus( $gfacID );
    649682      $gfac_status  = standard_status( $status_ex );
     683write_log( "$loghdr get_gfac_status: status_ex=$status_ex gfac_status=$gfac_status" );
    650684      return $gfac_status;
    651685   }
     
    953987         break;
    954988
    955          $status      = 'DATA';
    956          break;
    957 
    958989      case 'COMPLETED' :
    959990      case 'completed' :
     
    10561087      }
    10571088
    1058 if(preg_match("/US3-ADEV/i",$gfacID))
     1089//if(preg_match("/US3-ADEV/i",$gfacID))
     1090if(preg_match("/US3-A/i",$gfacID))
    10591091write_log( "$loghdr status/_in/_gw/_ex=$status/$status_in/$status_gw/$status_ex" );
    10601092//write_log( "$loghdr status/_in/_gw/_ex=$status/$status_in/$status_gw/$status_ex" );
Note: See TracChangeset for help on using the changeset viewer.