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 <config.h>
00027 #endif
00028 
00029 #include <sys/types.h>
00030 #include <stdbool.h>
00031 #include <drmaa.h>
00032 
00033 typedef struct drmaa_attrib_info_s drmaa_attrib_info_t;
00034 
00035 enum {
00036   ATTR_F_VECTOR  = 1 << 0, /* bit 0: scalar/vector attribute */
00037   ATTR_F_BOOL    = 1 << 1, /* bits 1-2: type */
00038   ATTR_F_INT     = 2 << 1,
00039   ATTR_F_STR     = 3 << 1,
00040   ATTR_F_PATH    = 1 << 3, /* bits 3-4: (string) format */
00041   ATTR_F_TIME    = 2 << 3,
00042   ATTR_F_TIMED   = 3 << 3,
00043   ATTR_F_IMPL    = 1 << 5, /* bit 5: implemented flag */
00044   ATTR_F_TYPE_MASK   =  06,
00045   ATTR_F_FORMAT_MASK = 030
00046 };
00047 
00048 struct drmaa_attrib_info_s {
00049   int         code;
00050   const char *drmaa_name;
00051   const char *pbs_name;
00052   unsigned    flags;
00053 };
00054 
00056 extern const drmaa_attrib_info_t drmaa_attr_table[];
00057 
00058 #if defined(__GNUC__) && 0
00059 bool drmaa_is_vector( const drmaa_attrib_info_t *attr ) __attribute__ ((weak));
00060 bool drmaa_is_implemented( const drmaa_attrib_info_t *attr ) __attribute__ ((weak));
00061 bool
00062 drmaa_is_vector( const drmaa_attrib_info_t *attr )
00063  { return attr->flags & ATTR_F_VECTOR; }
00064 bool
00065 drmaa_is_implemented( const drmaa_attrib_info_t *attr )
00066  { return attr->flags & ATTR_F_IMPL; }
00067 #else
00068 #define drmaa_is_vector( attr )         ( ((attr)->flags & ATTR_F_VECTOR) != 0 )
00069 #define drmaa_is_implemented( attr )    ( ((attr)->flags & ATTR_F_IMPL) != 0 )
00070 #endif /* __GNUC__ */
00071 
00072 const drmaa_attrib_info_t *
00073 attr_by_drmaa_name( const char *drmaa_name );
00074 
00075 const drmaa_attrib_info_t *
00076 attr_by_pbs_name( const char *pbs_name );
00077 
00078 
00083 typedef enum {
00084 
00085   /* DRMAA 1.0 attributes: */
00086   ATTR_JOB_NAME,
00087   ATTR_JOB_PATH,
00088   ATTR_ARGV,
00089   ATTR_ENV,
00090   ATTR_INPUT_PATH,
00091   ATTR_OUTPUT_PATH,
00092   ATTR_ERROR_PATH,
00093   ATTR_JOIN_FILES,
00094   ATTR_TRANSFER_FILES, /* optional */
00095   ATTR_JOB_WORKING_DIR,
00096   ATTR_EMAIL,
00097   ATTR_BLOCK_EMAIL,
00098   ATTR_START_TIME,
00099   ATTR_JOB_SUBMIT_STATE,
00100   ATTR_HARD_CPU_TIME_LIMIT, /* optional */
00101   ATTR_SOFT_CPU_TIME_LIMIT, /* optional */
00102   ATTR_HARD_WCT_LIMIT, /* optional */
00103   ATTR_SOFT_WCT_LIMIT, /* optional */
00104   ATTR_DEADLINE_TIME, /* optional */
00105   ATTR_JOB_CATEGORY,
00106   ATTR_NATIVE,
00107 
00108   /* Additional Torque/OpenPBS attribs (not in DRMAA specification): */
00109   /* Used by OpenPBS user commands: */
00110   ATTR_CHECKPOINT,
00111   ATTR_GROUP_LIST,
00112   ATTR_HOLD_TYPES,
00113   ATTR_KEEP_FILES,
00114   ATTR_RESOURCES,
00115   ATTR_MAIL_POINTS,
00116   ATTR_PRIORITY,
00117   ATTR_DESTINATION_QUEUE,
00118   ATTR_RERUNABLE,
00119   ATTR_USER_LIST,
00120   ATTR_REMOTE_USER,
00121   ATTR_SHELL,
00122   ATTR_DEPENDENCIES,
00123   ATTR_INTERACTIVE,
00124   ATTR_STAGEIN,
00125   ATTR_STAGEOUT,
00126 
00127   /* Additional job and general attribute names: */
00128   ATTR_JOB_STATE,
00129   ATTR_CTIME,
00130   ATTR_ETIME,
00131   ATTR_QTIME,
00132   ATTR_RESOURCES_USED,
00133   ATTR_EXIT_STATUS,
00134   ATTR_JOB_OWNER,
00135   ATTR_EUSER,
00136   ATTR_EGROUP,
00137   ATTR_HOP_COUNT,
00138   ATTR_SECURITY,
00139   ATTR_SCHEDULER_HINT,
00140   ATTR_SERVER,
00141   ATTR_QUEUE,
00142   ATTR_QUEUE_RANK,
00143   ATTR_EXECUTION_HOST,
00144   ATTR_TOTAL_JOBS,
00145   ATTR_MAX_RUNNING,
00146   ATTR_COMMENT,
00147   ATTR_JOB_COOKIE,
00148   ATTR_HASHNAME,
00149   ATTR_SESSION_ID,
00150   ATTR_ALT_ID,
00151 
00152   N_ATTRIBS,
00153 
00154   MIN_DRMAA_ATTR = ATTR_JOB_NAME,
00155   MAX_DRMAA_ATTR = ATTR_NATIVE,
00156   N_DRMAA_ATTRIBS = MAX_DRMAA_ATTR + 1
00157 } drmaa_attribute_t;
00158 
00159 #endif /* __ATTRIB_H */
00160 

Generated on Fri Sep 8 20:19:21 2006 for DRMAA 1.0 library for Torque/PBS by  doxygen 1.4.4