Changeset 72


Ignore:
Timestamp:
09/06/12 17:30:01 (12 years ago)
Author:
mmamonski
Message:

DRMAA submit filter - almost done

Location:
trunk/pbs_drmaa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/session.h

    r52 r72  
    8989         */ 
    9090        char *job_exit_status_file_prefix; 
     91 
     92        /* 
     93         * Whether to cache PBS Connection 
     94         */ 
     95        bool cache_connection; 
    9196}; 
    9297 
  • trunk/pbs_drmaa/submit.c

    r69 r72  
    2424#include <unistd.h> 
    2525#include <string.h> 
     26#include <stdlib.h> 
    2627 
    2728#include <pbs_ifl.h> 
     
    5657 
    5758static void pbsdrmaa_submit_set( pbsdrmaa_submit_t *self, const char *pbs_attr, char *value, unsigned placeholders ); 
     59 
     60static struct attrl *pbsdrmaa_submit_filter(struct attrl *pbs_attr); 
     61 
    5862 
    5963static void pbsdrmaa_submit_apply_defaults( pbsdrmaa_submit_t *self ); 
     
    200204                 } 
    201205 
     206 
     207                pbs_attr = pbsdrmaa_submit_filter(pbs_attr); 
     208 
    202209                conn_lock = fsd_mutex_lock( &self->session->drm_connection_mutex ); 
    203210retry: 
     
    232239                                 { 
    233240                                        if (tries_left--) 
    234                                                 goto retry; 
    235                                         else 
     241                                                goto retry; 
     242                                        else 
    236243                                                pbsdrmaa_exc_raise_pbs( "pbs_submit" ); 
    237244                                 } 
     
    692699 
    693700        { 
    694                 fsd_iter_t * volatile args_list = fsd_iter_new(NULL, 0); 
    695701                fsd_template_t *pbs_attr = self->pbs_job_attributes; 
    696702                char *arg = NULL; 
     
    799805                                                "Invalid native specification: %s", 
    800806                                                native_specification); 
    801  
    802807                 } 
    803808                FINALLY 
     
    806811                        pbs_attr->set_attr( pbs_attr, "submit_args", native_specification); 
    807812#endif 
    808                         args_list->destroy(args_list); 
    809813                        fsd_free((char *)native_spec_copy); 
    810814                 } 
     
    813817} 
    814818 
     819struct attrl * 
     820pbsdrmaa_submit_filter(struct attrl *pbs_attr) 
     821{ 
     822        fsd_log_enter(( "({pbs_attr=%p})", pbs_attr)); 
     823 
     824        if (getenv(PBSDRMAA_SUBMIT_FILTER_ENV) == NULL) { 
     825                return pbs_attr; 
     826        } else { 
     827                struct attrl *ii = NULL; 
     828                const char *submit_filter = getenv(PBSDRMAA_SUBMIT_FILTER_ENV); 
     829 
     830                fsd_log_info(("Executing filter script: %s", submit_filter)); 
     831 
     832                for (ii = pbs_attr; ii; ii = ii->next) { 
     833                        fsd_log_info(("FILTER: %s=%s ", ii->name, ii->value)); 
     834                } 
     835 
     836                return pbs_attr; 
     837        } 
     838 
     839 
     840} 
     841 
  • trunk/pbs_drmaa/submit.h

    r12 r72  
    2828 
    2929typedef struct pbsdrmaa_submit_s pbsdrmaa_submit_t; 
     30 
     31#define PBSDRMAA_SUBMIT_FILTER_ENV "PBSDRMAA_SUBMIT_FILTER" 
    3032 
    3133pbsdrmaa_submit_t * 
Note: See TracChangeset for help on using the changeset viewer.