Changeset 35


Ignore:
Timestamp:
10/27/11 16:13:55 (12 years ago)
Author:
mmamonski
Message:

on site fixies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/log_reader.c

    r34 r35  
    2323 
    2424#include <stdlib.h> 
     25#include <ctype.h> 
    2526#include <string.h> 
    2627#include <unistd.h> 
     
    408409                                                                goto cleanup; /* ignore other job events*/ 
    409410                                                        } 
     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 ); 
    410417 
    411418                                                        if ( in_running_state ) 
     
    423430                                                                END_TRY 
    424431                                                         } 
    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 */ 
    435435 
    436436                                                        fsd_cond_broadcast( &job->status_cond); 
     
    578578{ 
    579579                pbsdrmaa_session_t *pbssession = (pbsdrmaa_session_t*) log_reader->session; 
    580  
    581580                struct tm tm; 
    582581                time_t tm_t; 
    583582                char *line = NULL; 
     583                char *exec_host = NULL; 
     584                char *log_path = NULL; 
    584585                FILE *fhandle = NULL; 
    585                 char *exec_host = NULL; 
    586  
    587                 fsd_log_enter(("")); 
     586 
     587                fsd_log_enter(("(job_id=%s)", job_id)); 
    588588 
    589589                tm_t = time(NULL); 
    590                 localtime_r(&time_t, &tm); 
     590                localtime_r(&tm_t, &tm); 
    591591 
    592592                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); 
     
    596596                if ((fhandle = fopen(log_path, "r")) == NULL) 
    597597                 { 
    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)); 
    599599                        fsd_free(log_path); 
    600600                        return NULL; 
     
    607607                while ((line = fsd_readline(fhandle)) != NULL) 
    608608                 { 
    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 ) 
    610611                         { 
    611612                                char *p = NULL; 
     
    622623 
    623624                                p = exec_host; 
    624                                 while (p != ' ' && p != '\0') 
     625                                while (*p != ' ' && *p != '\0') 
    625626                                        p++; 
    626                                 p = '\0'; 
     627                                *p = '\0'; 
    627628 
    628629                                break; 
     
    639640                else 
    640641                 { 
    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)); 
    642643                 } 
    643644 
Note: See TracChangeset for help on using the changeset viewer.