Changeset 33 for trunk/pbs_drmaa


Ignore:
Timestamp:
10/27/11 14:10:01 (12 years ago)
Author:
mmamonski
Message:

PBS DRMAA log reader - on site fixes

Location:
trunk/pbs_drmaa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/job.c

    r29 r33  
    438438        pbsdrmaa_session_t *pbssession = (pbsdrmaa_session_t*)self->session; 
    439439 
    440         if( pbssession->pbs_home == NULL || pbssession->super.wait_thread_started ) 
     440        if( pbssession->pbs_home != NULL && pbssession->super.wait_thread_started ) 
     441                fsd_log_debug(("Job on missing but WT is running. Skipping...")); /* TODO: try to provide implementation that uses accounting/server log files */ 
     442        else 
    441443                pbsdrmaa_job_on_missing_standard( self );        
    442         else 
    443                 pbsdrmaa_job_on_missing_standard( self ); /* TODO: try to provide implementation that uses accounting/server log files */ 
    444444} 
    445445 
  • trunk/pbs_drmaa/log_reader.c

    r32 r33  
    321321                                                         } 
    322322#ifndef PBS_PBS_PROFESSIONAL 
    323                                                         else if (event_type == pbsdrmaa_event_0008 && strncmp(msg, "Job deleted", 11)) 
     323                                                        else if (event_type == pbsdrmaa_event_0008 && strncmp(msg, "Job deleted", 11) == 0) 
    324324#else 
    325                                                         else if (event_type == pbsdrmaa_event_0008 && strncmp(msg, "Job to be deleted", 17)) 
     325                                                        else if (event_type == pbsdrmaa_event_0008 && strncmp(msg, "Job to be deleted", 17) == 0) 
    326326#endif 
    327327                                                         { 
     
    338338                                                                if (job->state < DRMAA_PS_RUNNING) 
    339339                                                                 { 
    340                                                                         fsd_log_info(("Job %s killed before entering running state (%d).", job->job_id, job->state)); 
     340                                                                        fsd_log_info(("WT - Job %s killed before entering running state (%d).", job->job_id, job->state)); 
    341341                                                                        attribs = pbsdrmaa_add_attr(attribs, PBSDRMAA_JOB_STATE, "C"); 
    342342                                                                        attribs = pbsdrmaa_add_attr(attribs, PBSDRMAA_MTIME, timestamp_unix); 
     
    368368                                                                         { 
    369369                                                                                token[11] = '\0'; 
    370                                                                                 attribs = pbsdrmaa_add_attr(attribs, token, token + 12); 
     370                                                                                attribs = pbsdrmaa_add_attr(attribs, PBSDRMAA_EXIT_STATUS, token + 12); 
    371371                                                                                fsd_log_info(("WT - Completion of job %s (Exit_status=%s) detected after %d seconds", job->job_id, token+12, (int)(time(NULL) - timestamp_time_t) )); 
    372372                                                                         } 
     
    451451 
    452452 
    453                                  { /* poll on log file */ 
    454                                         struct timeval timeout_tv; 
    455                                         fd_set log_fds; 
    456  
    457                                         fsd_mutex_unlock( &self->session->mutex ); 
    458                                          
    459                                         FD_ZERO(&log_fds); 
    460                                         FD_SET(fileno(self->fhandle), &log_fds); 
    461  
    462                                         timeout_tv.tv_sec = 1; 
    463                                         timeout_tv.tv_usec = 0; 
    464                                         fsd_log_debug(("Polling log file for %d seconds", timeout_tv.tv_sec)); 
    465                                         /* ignore return value - the next get line call will handle IO errors */ 
    466                                         (void)select(1, &log_fds, NULL, NULL, &timeout_tv); 
    467  
    468                                         fsd_mutex_lock( &self->session->mutex ); 
    469  
    470                                         self->run_flag = self->session->wait_thread_run_flag; 
    471                                  } 
     453 
     454                                fsd_mutex_unlock( &self->session->mutex ); 
     455                                 
     456                                usleep(1500000); /* 500 ms - consider using inotify - but this would not work with NFS */                                
     457 
     458                                fsd_mutex_lock( &self->session->mutex ); 
     459 
     460                                self->run_flag = self->session->wait_thread_run_flag; 
    472461                        } 
    473462                        EXCEPT_DEFAULT 
  • trunk/pbs_drmaa/session.c

    r29 r33  
    239239                                char errbuf[256] = "InternalError"; 
    240240                                (void)strerror_r(errno, errbuf, sizeof(errbuf)); 
    241                                 fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"stat error: %s",errbuf); 
     241                                fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"stat error on file %s: %s", log_path, errbuf); 
    242242                          } 
    243243         
Note: See TracChangeset for help on using the changeset viewer.