Changeset 26


Ignore:
Timestamp:
10/12/11 14:21:23 (13 years ago)
Author:
mmamonski
Message:

try pbs

Location:
trunk/pbs_drmaa
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/job.c

    r25 r26  
    247247                conn_lock = fsd_mutex_unlock( &self->session->drm_connection_mutex ); 
    248248 
    249                 if(pbsdrmaa_job_update_status_accounting(self) == false) 
    250  
    251249 
    252250                if( status != NULL ) 
     
    327325                                        self->project = fsd_strdup(i->value); 
    328326                                break; 
     327#ifndef PBS_PROFESSIONAL 
    329328                        case PBSDRMAA_ATTR_EXECUTION_HOST: 
    330329                                if (!self->execution_hosts) { 
     
    333332                                } 
    334333                                break; 
     334#else 
     335                        case PBSDRMAA_ATTR_EXECUTION_VNODE: 
     336                                if (!self->execution_hosts) { 
     337                                        fsd_log_debug(("execution_hosts = %s", i->value)); 
     338                                        self->execution_hosts = fsd_strdup(i->value); 
     339                                } 
     340                                break; 
     341#endif 
    335342                        case PBSDRMAA_ATTR_START_TIME: 
    336343                                { 
  • trunk/pbs_drmaa/log_reader.c

    r25 r26  
    260260pbsdrmaa_read_log( pbsdrmaa_log_reader_t * self ) 
    261261{ 
    262         pbsdrmaa_job_t *pbsjob = (pbsdrmaa_job_t*) self->job;    
     262        pbsdrmaa_job_t *pbsjob = (pbsdrmaa_job_t*) self->job; 
    263263        fsd_job_t *volatile temp_job = NULL; 
    264264                 
     
    279279                        self->select_file(self); 
    280280 
    281                         while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0)                          
     281                        while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0) 
    282282                        { 
    283283                                const char *volatile ptr = line; 
     
    349349                                                                        self->run_flag = false; 
    350350                                                                        job_id_match = true;  
    351                                                                         status.name = fsd_strdup(self->job->job_id);                                                                     
     351                                                                        status.name = fsd_strdup(self->job->job_id); 
    352352                                                                } 
    353353                                                                else if ( !job_found && diff >= 1) 
     
    379379                                                        struct_mtime, 
    380380                                                        struct_queue, 
    381                                                         struct_account_name; 
     381                                                        struct_account_name, 
     382                                                        struct_exec_vnode; 
     383                                                struct attrl *last_attr = NULL; 
    382384                                                 
    383385                                                bool state_running = false; 
     
    393395                                                memset(&struct_queue,0,sizeof(struct attrl)); 
    394396                                                memset(&struct_account_name,0,sizeof(struct attrl)); 
     397                                                memset(&struct_exec_vnode,0,sizeof(struct attrl)); 
    395398                                                                 
    396399                                                if (strcmp(event,FLD_MSG_STATE) == 0)  
     
    401404                                                        struct_state.next = NULL; 
    402405                                                        struct_state.name = "job_state"; 
     406                                                        last_attr = &struct_state; 
     407 
    403408                                                        if(field[0] == 'J') /* Job Queued, Job Modified, Job Run*/ 
    404409                                                         { 
     
    424429                                                                         { 
    425430                                                                                time_t temp_time = mktime(&temp_time_tm); 
    426                                                                                 status.attribs = &struct_mtime; 
     431                                                                                last_attr->next = &struct_mtime; 
     432                                                                                last_attr = &struct_mtime; 
    427433                                                                                struct_mtime.name = "mtime"; 
    428434                                                                                struct_mtime.next = NULL; 
     
    434440                                                        /* != Job deleted and Job to be deleted*/ 
    435441#ifdef PBS_PROFESSIONAL 
    436                                                         else if (field[4] != 't' && field[10] != 'd') { 
     442                                                        else if (field[4] != 't' && field[10] != 'd') 
     443                                                         { 
    437444#else 
    438                                                         else if(field[4] != 'd') { 
     445                                                        else if (field[4] != 'd') 
     446                                                         { 
    439447#endif 
    440  
    441                                                                 if ((struct_state.value = fsd_asprintf("%c",field[n]) ) == NULL ) { /* 4 first letter of state */ 
    442                                                                         fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"%s - Memory allocation wasn't possible",self->name); 
    443                                                                 } 
    444                                                                 if(struct_state.value[0] == 'R'){ 
     448                                                                struct_state.value = fsd_asprintf("%c",field[n]); 
     449 
     450                                                                if(struct_state.value[0] == 'R') 
     451                                                                 { 
    445452                                                                        state_running = true; 
    446                                                                 } 
    447                                                         } 
    448                                                         else { /* job terminated - pbs drmaa detects failed as completed with exit_status !=0, aborted with status -1*/ 
     453#ifdef PBS_PROFESSIONAL 
     454                                                                        { 
     455                                                                                char *p_vnode = NULL; 
     456                                                                                if (p_vnode = strstr(field, "exec_vnode")) 
     457                                                                                 { 
     458                                                                                        last_attr->next = &struct_exec_vnode; 
     459                                                                                        last_attr =  &struct_exec_vnode; 
     460                                                                                        struct_exec_vnode.name = "exec_vnode"; 
     461                                                                                        struct_exec_vnode.next = NULL; 
     462                                                                                        struct_exec_vnode.value = fsd_strdup(p + 11); 
     463                                                                                 } 
     464                                                                        } 
     465#endif 
     466                                                                 } 
     467                                                         } 
     468                                                        else 
     469                                                         { /* job terminated - pbs drmaa detects failed as completed with exit_status !=0, aborted with status -1*/ 
    449470                                                                struct_status.name = "exit_status"; 
    450471                                                                struct_status.value = fsd_strdup("-1"); 
     
    452473                                                                struct_state.next = &struct_status; 
    453474                                                                struct_state.value = fsd_strdup("C"); 
    454                                                         } 
     475                                                         } 
    455476                                                } 
    456477                                                else /*if (strcmp(event,FLD_MSG_STATUS) == 0 )*/ 
     
    534555                                                        else 
    535556                                                        { 
    536                                                                 fsd_log_debug(("%s - updating job: %s",self->name, temp_job->job_id ));                                                  
     557                                                                fsd_log_debug(("%s - updating job: %s",self->name, temp_job->job_id )); 
    537558                                                                pbsjob->update( temp_job, &status ); 
    538559                                                        } 
     
    540561                                                else if( job_found ) /* job_on_missing */ 
    541562                                                { 
    542                                                         fsd_log_debug(("Job_on_missing - updating job: %s", self->job->job_id ));                                                        
     563                                                        fsd_log_debug(("Job_on_missing - updating job: %s", self->job->job_id )); 
    543564                                                        pbsjob->update( self->job, &status ); 
    544565                                                } 
     
    575596                                                log_event = false; 
    576597                                        } 
    577                                         else if( self->job == NULL && log_match && field_n == FLD_MSG && strncmp(field,"Log closed",10) == 0)  
     598                                        else if( self->job == NULL && log_match && field_n == FLD_MSG && strncmp(field,"Log closed",10) == 0) 
    578599                                        { 
    579600                                                fsd_log_debug(("%s - Date changed. Closing log file",self->name)); 
     
    591612                                }                
    592613 
    593                                 fsd_free(temp_date);                     
    594                         } /* end of while getline loop */                        
     614                                fsd_free(temp_date); 
     615                        } /* end of while getline loop */ 
    595616                         
    596617                        if(self->job == NULL) 
     
    599620                                fd_set log_fds; 
    600621         
    601                                 fsd_mutex_unlock( &self->session->mutex );                       
     622                                fsd_mutex_unlock( &self->session->mutex ); 
    602623                                 
    603624                                FD_ZERO(&log_fds); 
     
    874895                close(self->fd); 
    875896 
    876         fsd_log_debug(("Accounting Log file: %s",log_path));                             
     897        fsd_log_debug(("Accounting Log file: %s",log_path)); 
    877898 
    878899        if((self->fd = open(log_path,O_RDONLY) ) == -1 ) 
     
    926947                         
    927948                        if(self->fd != -1)                                       
    928                         while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0)                          
     949                        while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0) 
    929950                        { 
    930951                                const char *volatile ptr = line; 
     
    965986                                                                        job_found = true; 
    966987                                                                        job_id_match = true;  
    967                                                                         status.name = fsd_strdup(self->job->job_id);                                                                     
     988                                                                        status.name = fsd_strdup(self->job->job_id); 
    968989                                                                }        
    969990                                                } 
     
    973994                                        {                                        
    974995                                                struct attrl * struct_attrl = calloc(10,sizeof(struct attrl)); 
    975                                                                                               
     996                                                int i; 
     997 
    976998                                                if(field[0] == 'q') 
    977999                                                { 
     
    9871009                                                        char  msg[ 256 ] = ""; 
    9881010                                                        int n2 = 0; 
    989                                                         int msg_field_n = 0;     
     1011                                                        int msg_field_n = 0; 
    9901012                                 
    9911013                                                        status.attribs = &struct_attrl[0]; 
     
    9961018                                                                { 
    9971019                                                                        case FLD_MSG_ACC_USER: 
    998                                                                                 struct_attrl[msg_field_n].name = ATTR_euser;                                                                     
     1020                                                                                struct_attrl[msg_field_n].name = ATTR_euser; 
    9991021                                                                                break; 
    10001022 
     
    10611083                                                if( job_found && status.attribs != NULL) 
    10621084                                                { 
    1063                                                         fsd_log_debug(("Accounting file - updating job: %s", self->job->job_id ));                                       
     1085                                                        fsd_log_debug(("Accounting file - updating job: %s", self->job->job_id )); 
    10641086                                                        pbsjob->update( self->job, &status ); 
    10651087                                                        res = true; 
     
    10741096                                                        temp_job->release( temp_job ); 
    10751097         
    1076                                                 int i = 0; 
    10771098                                                for(i = 0; i < 10; i++) 
    10781099                                                { 
  • trunk/pbs_drmaa/pbs_attrib.gperf

    r12 r26  
    44 *  FedStage DRMAA for PBS Pro 
    55 *  Copyright (C) 2006-2009  FedStage Systems 
    6  * 
     6 *  Copyright (C) 2011 Poznan Supercomputing and Networking Center 
    77 *  This program is free software: you can redistribute it and/or modify 
    88 *  it under the terms of the GNU General Public License as published by 
     
    8888# additional job and general attribute names 
    8989exec_host, t(PBSDRMAA_ATTR_EXECUTION_HOST) 
     90exec_vnode, t(PBSDRMAA_ATTR_EXECUTION_VNODE) 
    9091Job_Owner, t(PBSDRMAA_ATTR_JOB_OWNER) 
    9192resources_used, t(PBSDRMAA_ATTR_RESOURCES_USED) 
     
    202203        { "stageout", PBSDRMAA_ATTR_STAGEOUT, false }, 
    203204        { "exec_host", PBSDRMAA_ATTR_EXECUTION_HOST, false }, 
     205        { "exec_vnode", PBSDRMAA_ATTR_EXECUTION_VNODE, false }, 
    204206        { "Job_Owner", PBSDRMAA_ATTR_JOB_OWNER, false }, 
    205207        { "resources_used", PBSDRMAA_ATTR_RESOURCES_USED, false }, 
  • trunk/pbs_drmaa/pbs_attrib.h

    r12 r26  
    7070/* additional job and general attribute names */ 
    7171#define PBSDRMAA_EXECUTION_HOST         "exec_host" 
     72#define PBSDRMAA_EXECUTION_VNODE        "exec_vnode" /* PBS PRO */ 
    7273#define PBSDRMAA_JOB_OWNER              "Job_Owner" 
    7374#define PBSDRMAA_RESOURCES_USED         "resources_used" 
     
    7980#define PBSDRMAA_START_TIME             "start_time" 
    8081#define PBSDRMAA_EXTENSION              "extension" 
    81 #define PBSDRMAA_SUBMIT_ARGS            "submit_args" 
     82#define PBSDRMAA_SUBMIT_ARGS            "submit_args" 
    8283 
    8384 
     
    123124        /* additional job and general attribute names */ 
    124125        PBSDRMAA_ATTR_EXECUTION_HOST, 
     126        PBSDRMAA_ATTR_EXECUTION_VNODE, /* PBS PRO */ 
    125127        PBSDRMAA_ATTR_JOB_OWNER, 
    126128        PBSDRMAA_ATTR_RESOURCES_USED, 
     
    135137        PBSDRMAA_ATTR_MTIME, 
    136138 
    137 #if 0 
    138         /* Additional Torque/OpenPBS attribs (not in DRMAA specification): */ 
    139         /* Used by OpenPBS user commands: */ 
    140         PBSDRMAA_ATTR_CHECKPOINT = DRMAA_N_ATTRIBUTES, /* MAX_DRMAA_ATTR+1, */ 
    141         PBSDRMAA_ATTR_GROUP_LIST, 
    142         PBSDRMAA_ATTR_HOLD_TYPES, 
    143         PBSDRMAA_ATTR_KEEP_FILES, 
    144         PBSDRMAA_ATTR_RESOURCES, 
    145         PBSDRMAA_ATTR_MAIL_POINTS, 
    146         PBSDRMAA_ATTR_PRIORITY, 
    147         PBSDRMAA_ATTR_DESTINATION_QUEUE, 
    148         PBSDRMAA_ATTR_RERUNABLE, 
    149         PBSDRMAA_ATTR_USER_LIST, 
    150         PBSDRMAA_ATTR_ACCOUNT_NAME, 
    151         PBSDRMAA_ATTR_SHELL, 
    152         PBSDRMAA_ATTR_DEPENDENCIES, 
    153         PBSDRMAA_ATTR_INTERACTIVE, 
    154         PBSDRMAA_ATTR_STAGEIN, 
    155         PBSDRMAA_ATTR_STAGEOUT, 
    156  
    157         /* Additional job and general attribute names: */ 
    158         PBSDRMAA_ATTR_JOB_STATE, 
    159         PBSDRMAA_ATTR_CTIME, 
    160         /* PBSDRMAA_ATTR_MTIME, moved to basic attributes - needed to determine job end time*/ 
    161         PBSDRMAA_ATTR_QTIME, 
    162         PBSDRMAA_ATTR_ETIME, 
    163         PBSDRMAA_ATTR_RESOURCES_USED, 
    164         PBSDRMAA_ATTR_EXIT_STATUS, 
    165         PBSDRMAA_ATTR_JOB_OWNER, 
    166         PBSDRMAA_ATTR_EUSER, 
    167         PBSDRMAA_ATTR_EGROUP, 
    168         PBSDRMAA_ATTR_HOP_COUNT, 
    169         PBSDRMAA_ATTR_SECURITY, 
    170         PBSDRMAA_ATTR_SCHEDULER_HINT, 
    171         PBSDRMAA_ATTR_SERVER, 
    172         PBSDRMAA_ATTR_QUEUE, 
    173         PBSDRMAA_ATTR_QUEUE_RANK, 
    174         PBSDRMAA_ATTR_EXECUTION_HOST, 
    175         PBSDRMAA_ATTR_TOTAL_JOBS, 
    176         PBSDRMAA_ATTR_MAX_RUNNING, 
    177         PBSDRMAA_ATTR_COMMENT, 
    178         PBSDRMAA_ATTR_JOB_COOKIE, 
    179         PBSDRMAA_ATTR_HASHNAME, 
    180         PBSDRMAA_ATTR_SESSION_ID, 
    181         PBSDRMAA_ATTR_ALT_ID, 
    182  
    183         /* Reservation attributes */ 
    184         PBSDRMAA_ATTR_RESERVATION_START, 
    185         PBSDRMAA_ATTR_RESERVATION_END, 
    186         PBSDRMAA_ATTR_RESERVATION_DURATION, 
    187         PBSDRMAA_ATTR_RESERVATION_STATE, 
    188         PBSDRMAA_ATTR_RESERVATION_SUBSTATE, 
    189  
    190         /* Pseudo PBS attributes */ 
    191         PBSDRMAA_ATTR_RESERVATION_ID, 
    192 #endif 
    193  
    194139        PBSDRMAA_N_PBS_ATTRIBUTES 
    195140} pbs_attribute_t; 
Note: See TracChangeset for help on using the changeset viewer.