Ignore:
Timestamp:
04/20/11 17:20:29 (13 years ago)
Author:
mmamonski
Message:

version 1.0.7 release candidate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/session.c

    • Property svn:keywords set to Id
    r10 r12  
    1 /* $Id: session.c 385 2011-01-04 18:24:05Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
     
    5353                __attribute__ ((unused)) 
    5454#       endif 
    55         = "$Id: session.c 385 2011-01-04 18:24:05Z mamonski $"; 
     55        = "$Id$"; 
    5656#endif 
    5757 
     
    213213        fsd_conf_option_t *pbs_home; 
    214214        pbs_home = fsd_conf_dict_get(self->configuration, "pbs_home" ); 
    215         if( pbs_home ) 
    216          { 
    217                 if( pbs_home->type == FSD_CONF_STRING ) 
    218                  { 
     215 
     216        if( pbs_home && pbs_home->type == FSD_CONF_STRING ) 
     217          { 
    219218                        struct stat statbuf; 
    220219                        char * volatile log_path; 
     
    222221                         
    223222                        pbsself->pbs_home = pbs_home->val.string; 
    224                         fsd_log_debug(("pbs_home: %s",pbsself->pbs_home)); 
     223                        fsd_log_info(("pbs_home: %s",pbsself->pbs_home)); 
    225224                        pbsself->super_wait_thread = pbsself->super.wait_thread; 
    226225                        pbsself->super.wait_thread = pbsdrmaa_session_wait_thread;               
     
    230229                        localtime_r(&pbsself->log_file_initial_time,&tm); 
    231230 
    232                         if((log_path = fsd_asprintf("%s/server_logs/%04d%02d%02d", 
    233                                 pbsself->pbs_home,        
    234                                 tm.tm_year + 1900, 
    235                                 tm.tm_mon + 1, 
    236                                         tm.tm_mday)) == NULL) { 
    237                                 fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"WT - Memory allocation wasn't possible"); 
    238                         } 
    239  
    240                         if(stat(log_path,&statbuf) == -1) { 
     231                        log_path = fsd_asprintf("%s/server_logs/%04d%02d%02d", 
     232                                        pbsself->pbs_home, 
     233                                        tm.tm_year + 1900, 
     234                                        tm.tm_mon + 1, 
     235                                        tm.tm_mday); 
     236 
     237                        if(stat(log_path,&statbuf) == -1) 
     238                          { 
    241239                                char errbuf[256] = "InternalError"; 
    242                                 (void)strerror_r(errno, errbuf, 256); 
     240                                (void)strerror_r(errno, errbuf, sizeof(errbuf)); 
    243241                                fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"stat error: %s",errbuf); 
    244                         } 
     242                          } 
    245243         
    246244                        fsd_log_debug(("Log file %s size %d",log_path,(int) statbuf.st_size)); 
    247245                        pbsself->log_file_initial_size = statbuf.st_size; 
    248246                        fsd_free(log_path); 
    249                  } 
    250                 else 
    251                 { 
    252                         pbsself->super.enable_wait_thread = false; 
    253                         pbsself->wait_thread_log = false; 
    254                         fsd_log_debug(("pbs_home not configured. Running standard wait_thread (pooling).")); 
    255                 } 
    256          } 
    257  
    258  
     247          } 
    259248 
    260249        pbsself->super_apply_configuration(self); /* call method from the superclass */ 
     
    277266                conn_lock = fsd_mutex_lock( &self->drm_connection_mutex ); 
    278267retry: 
    279  
     268/* TODO: query only for user's jobs pbs_selstat + ATTR_u */ 
    280269#ifdef PBS_PROFESSIONAL 
    281270                status = pbs_statjob( pbsself->pbs_conn, NULL, NULL, NULL ); 
     
    494483                        fsd_log_warning(( "no default queue set on PBS server" )); 
    495484                else if( keep_completed == NULL && self->pbs_home == NULL ) 
    496                         fsd_log_warning(( "PBS server is not configured to keep completed jobs\n" 
     485                        fsd_log_warning(( "Torque server is not configured to keep completed jobs\n" 
    497486                                                "in Torque: set keep_completed parameter of default queue\n" 
    498487                                                "  $ qmgr -c 'set queue batch keep_completed = 60'\n" 
     
    513502         } 
    514503        END_TRY 
     504 
     505        return result; 
    515506#endif 
     507        fsd_log_warning(( "PBS Professional does not keep information about the completed jobs\n" 
     508                                " You must configure DRMAA to utilize log files in order to always get valid job exit status" 
     509                                )); 
    516510        return false; 
    517511} 
Note: See TracChangeset for help on using the changeset viewer.