void UnicoreJob::UpdateUnicoreState( ClassAd *update_ad ) { const char *next_attr_name; ExprTree *next_expr; if ( update_ad == NULL ) { dprintf( D_ALWAYS, "(%d.%d) Received NULL unicore status ad\n", procID.cluster, procID.proc ); return; } update_ad->ResetName(); while ( ( next_attr_name = update_ad->NextNameOriginal() ) != NULL ) { if ( strcasecmp( next_attr_name, ATTR_MY_TYPE ) == 0 || strcasecmp( next_attr_name, ATTR_TARGET_TYPE ) == 0 || strcasecmp( next_attr_name, "UnicoreJobId" ) == 0 ) { continue; } if ( strcasecmp( next_attr_name, ATTR_JOB_STATUS ) == 0 ) { int status = 0; update_ad->LookupInteger( ATTR_JOB_STATUS, status ); unicoreState = status; SetRemoteJobStatus( getJobStatusString( unicoreState ) ); if ( unicoreState == RUNNING ) { JobRunning(); } if ( unicoreState == IDLE ) { JobIdle(); } } next_expr = update_ad->LookupExpr( next_attr_name ); ExprTree * pTree = next_expr->Copy(); jobAd->Insert( next_attr_name, pTree ); } }
void NordugridJob::NotifyNewRemoteStatus( const char *status ) { if ( SetRemoteJobStatus( status ) ) { remoteJobState = status; SetEvaluateState(); if ( condorState == IDLE && ( remoteJobState == REMOTE_STATE_INLRMS_R || remoteJobState == REMOTE_STATE_INLRMS_R2 || remoteJobState == REMOTE_STATE_INLRMS_E || remoteJobState == REMOTE_STATE_INLRMS_E2 || remoteJobState == REMOTE_STATE_EXECUTED || remoteJobState == REMOTE_STATE_FINISHING || remoteJobState == REMOTE_STATE_FINISHED || remoteJobState == REMOTE_STATE_FAILED ) ) { JobRunning(); } else if ( condorState == RUNNING && ( remoteJobState == REMOTE_STATE_INLRMS_Q || remoteJobState == REMOTE_STATE_INLRMS_Q2 || remoteJobState == REMOTE_STATE_INLRMS_S || remoteJobState == REMOTE_STATE_INLRMS_S2 ) ) { JobIdle(); } } if ( gmState == GM_RECOVER_QUERY ) { SetEvaluateState(); } }