Changeset 35 for trunk/pbs_drmaa
- Timestamp:
- 10/27/11 16:13:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pbs_drmaa/log_reader.c
r34 r35 23 23 24 24 #include <stdlib.h> 25 #include <ctype.h> 25 26 #include <string.h> 26 27 #include <unistd.h> … … 408 409 goto cleanup; /* ignore other job events*/ 409 410 } 411 412 fsd_log_debug(("WT - updating job: %s", job->job_id )); 413 status.name = job->job_id; 414 status.attribs = attribs; 415 416 ((pbsdrmaa_job_t *)job)->update( job, &status ); 410 417 411 418 if ( in_running_state ) … … 423 430 END_TRY 424 431 } 425 else 426 { 427 fsd_log_debug(("WT - updating job: %s", job->job_id )); 428 status.name = job->job_id; 429 status.attribs = attribs; 430 431 ((pbsdrmaa_job_t *)job)->update( job, &status ); 432 433 pbsdrmaa_free_attrl(attribs); /* TODO free on exception */ 434 } 432 433 434 pbsdrmaa_free_attrl(attribs); /* TODO free on exception */ 435 435 436 436 fsd_cond_broadcast( &job->status_cond); … … 578 578 { 579 579 pbsdrmaa_session_t *pbssession = (pbsdrmaa_session_t*) log_reader->session; 580 581 580 struct tm tm; 582 581 time_t tm_t; 583 582 char *line = NULL; 583 char *exec_host = NULL; 584 char *log_path = NULL; 584 585 FILE *fhandle = NULL; 585 char *exec_host = NULL; 586 587 fsd_log_enter(("")); 586 587 fsd_log_enter(("(job_id=%s)", job_id)); 588 588 589 589 tm_t = time(NULL); 590 localtime_r(&t ime_t, &tm);590 localtime_r(&tm_t, &tm); 591 591 592 592 log_path = fsd_asprintf("%s/server_priv/accounting/%04d%02d%02d", pbssession->pbs_home, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); … … 596 596 if ((fhandle = fopen(log_path, "r")) == NULL) 597 597 { 598 fsd_log_error( "Failed to open accounting log file: %s", log_path);598 fsd_log_error(("Failed to open accounting log file: %s", log_path)); 599 599 fsd_free(log_path); 600 600 return NULL; … … 607 607 while ((line = fsd_readline(fhandle)) != NULL) 608 608 { 609 if (line[20] == 'E' && strncmp(line + 23, job_id, strlen(job_id)) == 0 ) 609 610 if (line[20] == 'E' && strncmp(line + 22, job_id, strlen(job_id)) == 0 ) 610 611 { 611 612 char *p = NULL; … … 622 623 623 624 p = exec_host; 624 while ( p != ' ' &&p != '\0')625 while (*p != ' ' && *p != '\0') 625 626 p++; 626 p = '\0';627 *p = '\0'; 627 628 628 629 break; … … 639 640 else 640 641 { 641 fsd_log_error(("Could not find executions hosts for %s.", job_id)) 642 fsd_log_error(("Could not find executions hosts for %s.", job_id)); 642 643 } 643 644
Note: See TracChangeset
for help on using the changeset viewer.