torque  4.2.8
 All Data Structures Files Functions Variables Groups
attrib.h
1 /* $Id: attrib.h,v 1.4 2006/06/05 23:27:17 ciesnik Exp $ */
2 /*
3  * DRMAA library for Torque/PBS
4  * Copyright (C) 2006 Poznan Supercomputing and Networking Center
5  * DSP team <dsp-devel@hedera.man.poznan.pl>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef __DRMAA__ATTRIB_H
23 #define __DRMAA__ATTRIB_H
24 
25 #ifdef HAVE_CONFIG_H
26 # include <pbs_config.h>
27 #endif
28 
29 #include <sys/types.h>
30 #ifdef HAVE_STDBOOL_H
31 #include <stdbool.h>
32 #endif
33 #include <drmaa.h>
34 
36 
37 enum
38  {
39  ATTR_F_VECTOR = 1 << 0, /* bit 0: scalar/vector attribute */
40  ATTR_F_BOOL = 1 << 1, /* bits 1-2: type */
41  ATTR_F_INT = 2 << 1,
42  ATTR_F_STR = 3 << 1,
43  ATTR_F_PATH = 1 << 3, /* bits 3-4: (string) format */
44  ATTR_F_TIME = 2 << 3,
45  ATTR_F_TIMED = 3 << 3,
46  ATTR_F_IMPL = 1 << 5, /* bit 5: implemented flag */
47  ATTR_F_TYPE_MASK = 06,
48  ATTR_F_FORMAT_MASK = 030
49  };
50 
52  {
53  int code;
54  const char *drmaa_name;
55  const char *pbs_name;
56  unsigned flags;
57  };
58 
60 extern const drmaa_attrib_info_t drmaa_attr_table[];
61 
62 #if defined(__GNUC__) && 0
63 bool drmaa_is_vector(const drmaa_attrib_info_t *attr) __attribute__((weak));
64 bool drmaa_is_implemented(const drmaa_attrib_info_t *attr) __attribute__((weak));
65 bool
66 drmaa_is_vector(const drmaa_attrib_info_t *attr)
67  {
68  return attr->flags & ATTR_F_VECTOR;
69  }
70 
71 bool
72 drmaa_is_implemented(const drmaa_attrib_info_t *attr)
73  {
74  return attr->flags & ATTR_F_IMPL;
75  }
76 
77 #else
78 #define drmaa_is_vector( attr ) ( ((attr)->flags & ATTR_F_VECTOR) != 0 )
79 #define drmaa_is_implemented( attr ) ( ((attr)->flags & ATTR_F_IMPL) != 0 )
80 #endif /* __GNUC__ */
81 
82 const drmaa_attrib_info_t *
83 attr_by_drmaa_name(const char *drmaa_name);
84 
85 const drmaa_attrib_info_t *
86 attr_by_pbs_name(const char *pbs_name);
87 
88 
93 typedef enum
94  {
95 
96  /* DRMAA 1.0 attributes: */
97  ATTR_JOB_NAME,
98  ATTR_JOB_PATH,
99  ATTR_ARGV,
100  ATTR_ENV,
101  ATTR_INPUT_PATH,
102  ATTR_OUTPUT_PATH,
103  ATTR_ERROR_PATH,
104  ATTR_JOIN_FILES,
105  ATTR_TRANSFER_FILES, /* optional */
106  ATTR_JOB_WORKING_DIR,
107  ATTR_EMAIL,
108  ATTR_BLOCK_EMAIL,
109  ATTR_START_TIME,
110  ATTR_JOB_SUBMIT_STATE,
111  ATTR_HARD_CPU_TIME_LIMIT, /* optional */
112  ATTR_SOFT_CPU_TIME_LIMIT, /* optional */
113  ATTR_HARD_WCT_LIMIT, /* optional */
114  ATTR_SOFT_WCT_LIMIT, /* optional */
115  ATTR_DEADLINE_TIME, /* optional */
116  ATTR_JOB_CATEGORY,
117  ATTR_NATIVE,
118 
119  /* Additional Torque/OpenPBS attribs (not in DRMAA specification): */
120  /* Used by OpenPBS user commands: */
121  ATTR_CHECKPOINT,
122  ATTR_GROUP_LIST,
123  ATTR_HOLD_TYPES,
124  ATTR_KEEP_FILES,
125  ATTR_RESOURCES,
126  ATTR_MAIL_POINTS,
127  ATTR_PRIORITY,
128  ATTR_DESTINATION_QUEUE,
129  ATTR_RERUNABLE,
130  ATTR_USER_LIST,
131  ATTR_REMOTE_USER,
132  ATTR_SHELL,
133  ATTR_DEPENDENCIES,
134  ATTR_INTERACTIVE,
135  ATTR_STAGEIN,
136  ATTR_STAGEOUT,
137 
138  /* Additional job and general attribute names: */
139  ATTR_JOB_STATE,
140  ATTR_CTIME,
141  ATTR_ETIME,
142  ATTR_QTIME,
143  ATTR_RESOURCES_USED,
144  ATTR_EXIT_STATUS,
145  ATTR_JOB_OWNER,
146  ATTR_EUSER,
147  ATTR_EGROUP,
148  ATTR_HOP_COUNT,
149  ATTR_SECURITY,
150  ATTR_SCHEDULER_HINT,
151  ATTR_SERVER,
152  ATTR_QUEUE,
153  ATTR_QUEUE_RANK,
154  ATTR_EXECUTION_HOST,
155  ATTR_TOTAL_JOBS,
156  ATTR_MAX_RUNNING,
157  ATTR_COMMENT,
158  ATTR_JOB_COOKIE,
159  ATTR_HASHNAME,
160  ATTR_SESSION_ID,
161  ATTR_ALT_ID,
162 
163  N_ATTRIBS,
164 
165  MIN_DRMAA_ATTR = ATTR_JOB_NAME,
166  MAX_DRMAA_ATTR = ATTR_NATIVE,
167  N_DRMAA_ATTRIBS = MAX_DRMAA_ATTR + 1
168  } drmaa_attribute_t;
169 
170 #endif /* __ATTRIB_H */
171 
Definition: attrib.h:51
DRMAA library for Torque/PBS.