Changeset 33 for trunk/pbs_drmaa/log_reader.c
- Timestamp:
- 10/27/11 14:10:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pbs_drmaa/log_reader.c
r32 r33 321 321 } 322 322 #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) 324 324 #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) 326 326 #endif 327 327 { … … 338 338 if (job->state < DRMAA_PS_RUNNING) 339 339 { 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)); 341 341 attribs = pbsdrmaa_add_attr(attribs, PBSDRMAA_JOB_STATE, "C"); 342 342 attribs = pbsdrmaa_add_attr(attribs, PBSDRMAA_MTIME, timestamp_unix); … … 368 368 { 369 369 token[11] = '\0'; 370 attribs = pbsdrmaa_add_attr(attribs, token, token + 12);370 attribs = pbsdrmaa_add_attr(attribs, PBSDRMAA_EXIT_STATUS, token + 12); 371 371 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) )); 372 372 } … … 451 451 452 452 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; 472 461 } 473 462 EXCEPT_DEFAULT
Note: See TracChangeset
for help on using the changeset viewer.