Changeset 12 for trunk/pbs_drmaa


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

version 1.0.7 release candidate

Location:
trunk/pbs_drmaa
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/.gitignore

    • Property svn:keywords set to Id
  • trunk/pbs_drmaa/CHANGELOG

    • Property svn:keywords set to Id
  • trunk/pbs_drmaa/Makefile.am

    • Property svn:keywords set to Id
    r7 r12  
    1 # $Id: Makefile.am 2420 2009-06-24 14:40:21Z lukasz $ 
     1# $Id$ 
    22#  
    33# FedStage DRMAA for PBS Professional 
  • trunk/pbs_drmaa/drmaa.c

    • Property svn:keywords set to Id
    r1 r12  
    1 /* $Id: drmaa.c 353 2010-10-18 13:45:14Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • trunk/pbs_drmaa/job.c

    • Property svn:keywords set to Id
    r10 r12  
    1 /* $Id: job.c 370 2010-11-16 09:51:00Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
     
    4343                __attribute__ ((unused)) 
    4444#       endif 
    45         = "$Id: job.c 370 2010-11-16 09:51:00Z mamonski $"; 
     45        = "$Id$"; 
    4646#endif 
    4747 
     
    385385                int hours, minutes, seconds; 
    386386                long mem; 
    387                 if( cpu_usage && sscanf( cpu_usage, "%d:%d:%d", 
    388                                 &hours, &minutes, &seconds ) == 3 ) 
     387                if( cpu_usage && sscanf( cpu_usage, "%d:%d:%d", &hours, &minutes, &seconds ) == 3 ) 
    389388                 { 
    390389                        self->cpu_usage = 60*( 60*hours + minutes ) + seconds; 
     
    401400                        fsd_log_debug(( "vmem_usage: %s=%ldB", vmem_usage, self->vmem_usage )); 
    402401                 } 
    403                 if( walltime && sscanf( walltime, "%d:%d:%d", 
    404                                         &hours, &minutes, &seconds ) == 3 ) 
     402                if( walltime && sscanf( walltime, "%d:%d:%d", &hours, &minutes, &seconds ) == 3 ) 
    405403                 { 
    406404                        self->walltime = 60*( 60*hours + minutes ) + seconds; 
     
    414412{ 
    415413        pbsdrmaa_session_t *pbssession = (pbsdrmaa_session_t*)self->session; 
    416          
     414 
    417415        if( pbssession->pbs_home == NULL ) 
    418416                pbsdrmaa_job_on_missing_standard( self );        
     
    429427 
    430428        fsd_log_enter(( "({job_id=%s})", self->job_id )); 
    431         fsd_log_warning(( "self %s missing from DRM queue", self->job_id )); 
     429        fsd_log_warning(( "Job %s missing from DRM queue", self->job_id )); 
    432430 
    433431        switch( session->missing_jobs ) 
     
    465463        } 
    466464 
     465        fsd_cond_broadcast( &self->status_cond); 
     466 
    467467        fsd_log_return(( "; job_ps=%s, exit_status=%d", 
    468468                                drmaa_job_ps_to_str(self->state), self->exit_status )); 
     
    476476         
    477477        fsd_log_enter(( "({job_id=%s})", self->job_id )); 
    478         fsd_log_warning(( "self %s missing from DRM queue", self->job_id )); 
     478        fsd_log_info(( "Job %s missing from DRM queue", self->job_id )); 
    479479         
    480480        TRY 
  • trunk/pbs_drmaa/job.h

    • Property svn:keywords set to Id
    r8 r12  
    1 /* $Id: job.h 2 2009-10-12 09:51:22Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • trunk/pbs_drmaa/log_reader.c

    • Property svn:keywords set to Id
    r8 r12  
    1 /* $Id: log_reader.c 323 2010-09-21 21:31:29Z mmatloka $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • trunk/pbs_drmaa/log_reader.h

    • Property svn:keywords set to Id
    r8 r12  
    1 /* $Id: log_reader.h 323 2010-09-21 21:31:29Z mmatloka $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • trunk/pbs_drmaa/pbs_attrib.gperf

    • Property svn:keywords set to Id
    r4 r12  
    11%{ 
    2 /* $Id: pbs_attrib.gperf 2677 2009-09-08 14:32:22Z mmamonski $ */ 
     2/* $Id$ */ 
    33/* 
    44 *  FedStage DRMAA for PBS Pro 
     
    3131                __attribute__ ((unused)) 
    3232#       endif 
    33         = "$Id: pbs_attrib.gperf 2677 2009-09-08 14:32:22Z mmamonski $"; 
     33        = "$Id$"; 
    3434#endif 
    3535 
  • trunk/pbs_drmaa/pbs_attrib.h

    • Property svn:keywords set to Id
    r4 r12  
    1 /* $Id: pbs_attrib.h 256 2010-08-10 16:31:35Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • trunk/pbs_drmaa/pbs_drmaa.conf.example

    • Property svn:keywords set to Id
    r1 r12  
    1 # $Id: pbs_drmaa.conf.example 2420 2009-06-24 14:40:21Z lukasz $ 
     1# $Id$ 
    22# pbs_drmaa.conf - Sample pbs_drmaa configuration file. 
    33 
  • trunk/pbs_drmaa/pbs_drmaa.h

    • Property svn:keywords set to Id
    r1 r12  
    1 /* $Id: pbs_drmaa.h 2 2009-10-12 09:51:22Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • 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} 
  • trunk/pbs_drmaa/session.h

    • Property svn:keywords set to Id
    r7 r12  
    1 /* $Id: session.h 323 2010-09-21 21:31:29Z mmatloka $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • trunk/pbs_drmaa/submit.c

    • Property svn:keywords set to Id
    r10 r12  
    1 /* $Id: submit.c 386 2011-01-06 18:13:33Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
     
    4646                __attribute__ ((unused)) 
    4747#       endif 
    48         = "$Id: submit.c 386 2011-01-06 18:13:33Z mamonski $"; 
     48        = "$Id$"; 
    4949#endif 
    5050 
     
    546546                        else 
    547547                        { 
    548                                 fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, "Invalid native specification: %s (Invalid resource specification: %s)", resources, arg); 
    549  
     548                                fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, "Invalid native specification: %s (Invalid resource specification: %s)", resources, arg); 
    550549                        } 
    551550                } 
     
    569568        TRY 
    570569          { 
    571                 for (arg = strtok_r(add_attr_copy, ",", &ctxt); arg; arg = strtok_r(NULL, ":",&ctxt) ) 
     570                for (arg = strtok_r(add_attr_copy, ";", &ctxt); arg; arg = strtok_r(NULL, ";",&ctxt) ) 
    572571                { 
    573572                        name = fsd_strdup(strtok_r(arg, "=", &ctxt2)); 
     
    606605 
    607606                TRY 
    608                  { 
     607                  { 
    609608                        for (arg = strtok_r(native_spec_copy, " \t", &ctxt); arg; arg = strtok_r(NULL, " \t",&ctxt) ) { 
    610                                 if (!opt) { 
    611                                         if ( (arg[0] != '-') || ((strlen(arg) != 2) &&  arg[2] != ' ' && arg[1] !='-' ) ) 
     609                                if (!opt) 
     610                                  { 
     611                                        if ( (arg[0] != '-') || (strlen(arg) != 2) ) 
    612612                                                fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, 
    613                                                                 "Invalid native specification: %s", 
    614                                                                 native_specification); 
    615                                         if(arg[1] == '-') { 
    616                                                 parse_additional_attr(pbs_attr, arg+2); 
     613                                                        "Invalid native specification: -o(ption) expected (arg=%s native=%s).", 
     614                                                        arg, native_specification); 
     615 
     616                                                case 'h' : 
     617                                                        pbs_attr->set_attr( pbs_attr, "Hold_Types" , arg ); 
     618                                                        break; 
     619 
     620                                        opt = arg[1]; 
     621 
     622                                        /* handle NO-arg options */ 
     623 
     624                                        switch (opt) { 
     625                                                case 'h' : 
     626                                                        pbs_attr->set_attr( pbs_attr, "Hold_Types" , "u" ); 
     627                                                        break; 
     628                                                default : 
     629                                                        continue; /*no NO-ARG option */ 
    617630                                        } 
    618                                         else { 
    619                                                 opt = arg[1]; 
    620                                         } 
    621                                          
    622                                 } else { 
     631 
     632                                        opt = 0; 
     633                                  } 
     634                                else 
     635                                  { 
    623636                                        switch (opt) { 
    624637                                                 
     
    644657                                                        pbs_attr->set_attr( pbs_attr, "Execution_Time" , arg ); 
    645658                                                        break; 
    646                                                 case 'h' : 
    647                                                         pbs_attr->set_attr( pbs_attr, "Hold_Types" , arg ); 
    648                                                         break; 
    649659                                                case 'A' : 
    650660                                                        pbs_attr->set_attr( pbs_attr, "Account_Name" , arg ); 
     
    672682                                                        break; 
    673683                                                case 'v' : 
    674                                                 case 'V' : 
    675684                                                        pbs_attr->set_attr( pbs_attr, "Variable_List" , arg ); 
    676685                                                        break; 
     
    687696                                                                        native_specification, opt); 
    688697                                        } 
    689  
    690698                                        opt = 0; 
    691699                                } 
  • trunk/pbs_drmaa/submit.h

    • Property svn:keywords set to Id
    r1 r12  
    1 /* $Id: submit.h 338 2010-09-28 14:48:45Z mamonski $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
  • trunk/pbs_drmaa/util.c

    • Property svn:keywords set to Id
    r8 r12  
    1 /* $Id: util.c 323 2010-09-21 21:31:29Z mmatloka $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
     
    4141                __attribute__ ((unused)) 
    4242#       endif 
    43         = "$Id: util.c 323 2010-09-21 21:31:29Z mmatloka $"; 
     43        = "$Id$"; 
    4444#endif 
    4545 
  • trunk/pbs_drmaa/util.h

    • Property svn:keywords set to Id
    r8 r12  
    1 /* $Id: util.h 323 2010-09-21 21:31:29Z mmatloka $ */ 
     1/* $Id$ */ 
    22/* 
    33 *  FedStage DRMAA for PBS Pro 
Note: See TracChangeset for help on using the changeset viewer.