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