Main Page | Modules | Data Structures | File List | Data Fields | Globals

src/attrib.h

00001 /* $Id: attrib.h,v 1.4 2006/06/05 23:27:17 ciesnik Exp $ */
00002 /*
00003  *  DRMAA library for Torque/PBS
00004  *  Copyright (C) 2006  Poznan Supercomputing and Networking Center
00005  *                      DSP team <dsp-devel@hedera.man.poznan.pl>
00006  *
00007  *  This library is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU Lesser General Public
00009  *  License as published by the Free Software Foundation; either
00010  *  version 2.1 of the License, or (at your option) any later version.
00011  *
00012  *  This library is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *  Lesser General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU Lesser General Public
00018  *  License along with this library; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #ifndef __DRMAA__ATTRIB_H
00023 #define __DRMAA__ATTRIB_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026 # include <pbs_config.h>
00027 #endif
00028 
00029 #include <sys/types.h>
00030 #ifdef HAVE_STDBOOL_H
00031 #include <stdbool.h>
00032 #endif
00033 #include <drmaa.h>
00034 
00035 typedef struct drmaa_attrib_info_s drmaa_attrib_info_t;
00036 
00037 enum {
00038   ATTR_F_VECTOR  = 1 << 0, /* bit 0: scalar/vector attribute */
00039   ATTR_F_BOOL    = 1 << 1, /* bits 1-2: type */
00040   ATTR_F_INT     = 2 << 1,
00041   ATTR_F_STR     = 3 << 1,
00042   ATTR_F_PATH    = 1 << 3, /* bits 3-4: (string) format */
00043   ATTR_F_TIME    = 2 << 3,
00044   ATTR_F_TIMED   = 3 << 3,
00045   ATTR_F_IMPL    = 1 << 5, /* bit 5: implemented flag */
00046   ATTR_F_TYPE_MASK   =  06,
00047   ATTR_F_FORMAT_MASK = 030
00048 };
00049 
00050 struct drmaa_attrib_info_s {
00051   int         code;
00052   const char *drmaa_name;
00053   const char *pbs_name;
00054   unsigned    flags;
00055 };
00056 
00058 extern const drmaa_attrib_info_t drmaa_attr_table[];
00059 
00060 #if defined(__GNUC__) && 0
00061 bool drmaa_is_vector( const drmaa_attrib_info_t *attr ) __attribute__ ((weak));
00062 bool drmaa_is_implemented( const drmaa_attrib_info_t *attr ) __attribute__ ((weak));
00063 bool
00064 drmaa_is_vector( const drmaa_attrib_info_t *attr )
00065  { return attr->flags & ATTR_F_VECTOR; }
00066 bool
00067 drmaa_is_implemented( const drmaa_attrib_info_t *attr )
00068  { return attr->flags & ATTR_F_IMPL; }
00069 #else
00070 #define drmaa_is_vector( attr )         ( ((attr)->flags & ATTR_F_VECTOR) != 0 )
00071 #define drmaa_is_implemented( attr )    ( ((attr)->flags & ATTR_F_IMPL) != 0 )
00072 #endif /* __GNUC__ */
00073 
00074 const drmaa_attrib_info_t *
00075 attr_by_drmaa_name( const char *drmaa_name );
00076 
00077 const drmaa_attrib_info_t *
00078 attr_by_pbs_name( const char *pbs_name );
00079 
00080 
00085 typedef enum {
00086 
00087   /* DRMAA 1.0 attributes: */
00088   ATTR_JOB_NAME,
00089   ATTR_JOB_PATH,
00090   ATTR_ARGV,
00091   ATTR_ENV,
00092   ATTR_INPUT_PATH,
00093   ATTR_OUTPUT_PATH,
00094   ATTR_ERROR_PATH,
00095   ATTR_JOIN_FILES,
00096   ATTR_TRANSFER_FILES, /* optional */
00097   ATTR_JOB_WORKING_DIR,
00098   ATTR_EMAIL,
00099   ATTR_BLOCK_EMAIL,
00100   ATTR_START_TIME,
00101   ATTR_JOB_SUBMIT_STATE,
00102   ATTR_HARD_CPU_TIME_LIMIT, /* optional */
00103   ATTR_SOFT_CPU_TIME_LIMIT, /* optional */
00104   ATTR_HARD_WCT_LIMIT, /* optional */
00105   ATTR_SOFT_WCT_LIMIT, /* optional */
00106   ATTR_DEADLINE_TIME, /* optional */
00107   ATTR_JOB_CATEGORY,
00108   ATTR_NATIVE,
00109 
00110   /* Additional Torque/OpenPBS attribs (not in DRMAA specification): */
00111   /* Used by OpenPBS user commands: */
00112   ATTR_CHECKPOINT,
00113   ATTR_GROUP_LIST,
00114   ATTR_HOLD_TYPES,
00115   ATTR_KEEP_FILES,
00116   ATTR_RESOURCES,
00117   ATTR_MAIL_POINTS,
00118   ATTR_PRIORITY,
00119   ATTR_DESTINATION_QUEUE,
00120   ATTR_RERUNABLE,
00121   ATTR_USER_LIST,
00122   ATTR_REMOTE_USER,
00123   ATTR_SHELL,
00124   ATTR_DEPENDENCIES,
00125   ATTR_INTERACTIVE,
00126   ATTR_STAGEIN,
00127   ATTR_STAGEOUT,
00128 
00129   /* Additional job and general attribute names: */
00130   ATTR_JOB_STATE,
00131   ATTR_CTIME,
00132   ATTR_ETIME,
00133   ATTR_QTIME,
00134   ATTR_RESOURCES_USED,
00135   ATTR_EXIT_STATUS,
00136   ATTR_JOB_OWNER,
00137   ATTR_EUSER,
00138   ATTR_EGROUP,
00139   ATTR_HOP_COUNT,
00140   ATTR_SECURITY,
00141   ATTR_SCHEDULER_HINT,
00142   ATTR_SERVER,
00143   ATTR_QUEUE,
00144   ATTR_QUEUE_RANK,
00145   ATTR_EXECUTION_HOST,
00146   ATTR_TOTAL_JOBS,
00147   ATTR_MAX_RUNNING,
00148   ATTR_COMMENT,
00149   ATTR_JOB_COOKIE,
00150   ATTR_HASHNAME,
00151   ATTR_SESSION_ID,
00152   ATTR_ALT_ID,
00153 
00154   N_ATTRIBS,
00155 
00156   MIN_DRMAA_ATTR = ATTR_JOB_NAME,
00157   MAX_DRMAA_ATTR = ATTR_NATIVE,
00158   N_DRMAA_ATTRIBS = MAX_DRMAA_ATTR + 1
00159 } drmaa_attribute_t;
00160 
00161 #endif /* __ATTRIB_H */
00162 

Generated on Thu Oct 9 22:21:32 2008 for torque by  doxygen 1.3.9.1