File: sge_qinstance_state.h

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 56,880 kB
  • sloc: ansic: 432,689; java: 87,068; cpp: 31,958; sh: 29,429; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,701; csh: 3,928; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (197 lines) | stat: -rw-r--r-- 6,013 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#ifndef __SGE_QINSTANCE_STATE_H
#define __SGE_QINSTANCE_STATE_H

/*___INFO__MARK_BEGIN__*/
/*************************************************************************
 * 
 *  The Contents of this file are made available subject to the terms of
 *  the Sun Industry Standards Source License Version 1.2
 * 
 *  Sun Microsystems Inc., March, 2001
 * 
 * 
 *  Sun Industry Standards Source License Version 1.2
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.2 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 * 
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 * 
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 * 
 *   Copyright: 2001 by Sun Microsystems, Inc.
 * 
 *   All Rights Reserved.
 * 
 ************************************************************************/
/*___INFO__MARK_END__*/

#include "cull/cull.h"
#include "uti/sge_dstring.h"

/*
 * QI states
 */
#define QI_DEFAULT                     0x00000000 
#define QI_ALARM                       0x00000001
#define QI_SUSPEND_ALARM               0x00000002
#define QI_DISABLED                    0x00000004
#define QI_SUSPENDED                   0x00000100
#define QI_UNKNOWN                     0x00000400
#define QI_ERROR                       0x00004000
#define QI_SUSPENDED_ON_SUBORDINATE    0x00008000
#define QI_CAL_DISABLED                0x00020000
#define QI_CAL_SUSPENDED               0x00040000
#define QI_AMBIGUOUS                   0x00080000
#define QI_ORPHANED                    0x00100000
#define QI_FULL                        0x00200000

/*
 * QI state transition
 */
#define QI_DO_NOTHING                  0x00000000
#define QI_DO_DISABLE                  0x00000004
#define QI_DO_ENABLE                   0x00000008
#define QI_DO_UNSUSPEND                0x00000080
#define QI_DO_SUSPEND                  0x00000100
#define QI_DO_CLEARERROR               0x00004000
#define QI_DO_CLEAN                    0x00010000
#define QI_DO_RESCHEDULE               0x00080000
#define QI_DO_CAL_DISABLE              0x00020000
#define QI_DO_CAL_SUSPEND              0x00040000

#ifdef __SGE_QINSTANCE_STATE_DEBUG__
#  define QI_DO_SETERROR               0x00100000
#  define QI_DO_SETORPHANED            0x00200000
#  define QI_DO_CLEARORPHANED          0x00400000
#  define QI_DO_SETUNKNOWN             0x00800000
#  define QI_DO_CLEARUNKNOWN           0x01000000
#  define QI_DO_SETAMBIGUOUS           0x02000000
#  define QI_DO_CLEARAMBIGUOUS         0x04000000
#endif

/* job/queue state transition via job identifier */
#define JOB_DO_ACTION                  0x80000000
#define QUEUE_DO_ACTION                0x40000000

/*
 *
 */
#define QI_TRANSITION_NOTHING          0x00000000
#define QI_TRANSITION_OPTION           0x00000001

bool
transition_is_valid_for_qinstance(u_long32 transition, lList **answer_list);

bool
transition_option_is_valid_for_qinstance(u_long32 option, lList **answer_list);

#ifdef __SGE_QINSTANCE_STATE_DEBUG__
#  define QI_DO_SETERROR               0x00100000
#endif

/*
 *
 */
#define QI_TRANSITION_NOTHING          0x00000000
#define QI_TRANSITION_OPTION           0x00000001

bool
transition_is_valid_for_qinstance(u_long32 transition, lList **answer_list);

bool
transition_option_is_valid_for_qinstance(u_long32 option, lList **answer_list);

bool qinstance_has_state(const lListElem *this_elem, u_long32 bit); 

const char * qinstance_state_as_string(u_long32 bit);

u_long32 qinstance_state_from_string(const char* state, lList **answer_list, u_long32 filter);
/* */

bool
qinstance_state_set_alarm(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_suspend_alarm(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_manual_disabled(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_manual_suspended(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_unknown(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_error(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_susp_on_sub(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_cal_disabled(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_cal_suspended(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_full(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_orphaned(lListElem *this_elem, bool set_state);

bool
qinstance_state_set_ambiguous(lListElem *this_elem, bool set_state);

bool 
qinstance_state_is_alarm(const lListElem *this_elem);

bool 
qinstance_state_is_suspend_alarm(const lListElem *this_elem);

bool 
qinstance_state_is_manual_disabled(const lListElem *this_elem);

bool 
qinstance_state_is_manual_suspended(const lListElem *this_elem);

bool 
qinstance_state_is_unknown(const lListElem *this_elem);

bool 
qinstance_state_is_error(const lListElem *this_elem);

bool 
qinstance_state_is_susp_on_sub(const lListElem *this_elem);

bool 
qinstance_state_is_cal_disabled(const lListElem *this_elem);

bool 
qinstance_state_is_cal_suspended(const lListElem *this_elem);

bool
qinstance_state_is_orphaned(const lListElem *this_elem);

bool
qinstance_state_is_ambiguous(const lListElem *this_elem);

bool 
qinstance_state_is_full(const lListElem *this_elem);

bool 
qinstance_state_append_to_dstring(const lListElem *this_elem, dstring *string);

bool
qinstance_set_state(lListElem *this_elem, bool set_state, u_long32 bit);

#endif /* __SGE_QINSTANCE_STATE_H */