~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/libs/sgeobj/sge_schedd_conf.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SGE_SCHEDD_CONF_H
 
2
#define __SGE_SCHEDD_CONF_H
 
3
/*___INFO__MARK_BEGIN__*/
 
4
/*************************************************************************
 
5
 * 
 
6
 *  The Contents of this file are made available subject to the terms of
 
7
 *  the Sun Industry Standards Source License Version 1.2
 
8
 * 
 
9
 *  Sun Microsystems Inc., March, 2001
 
10
 * 
 
11
 * 
 
12
 *  Sun Industry Standards Source License Version 1.2
 
13
 *  =================================================
 
14
 *  The contents of this file are subject to the Sun Industry Standards
 
15
 *  Source License Version 1.2 (the "License"); You may not use this file
 
16
 *  except in compliance with the License. You may obtain a copy of the
 
17
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
18
 * 
 
19
 *  Software provided under this License is provided on an "AS IS" basis,
 
20
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
21
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
22
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
23
 *  See the License for the specific provisions governing your rights and
 
24
 *  obligations concerning the Software.
 
25
 * 
 
26
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
27
 * 
 
28
 *   Copyright: 2001 by Sun Microsystems, Inc.
 
29
 * 
 
30
 *   All Rights Reserved.
 
31
 * 
 
32
 ************************************************************************/
 
33
/*___INFO__MARK_END__*/
 
34
 
 
35
#include "sge_schedd_confL.h"
 
36
 
 
37
/* defines the last dispatched job */
 
38
enum { 
 
39
    DISPATCH_TYPE_NONE = 0,      /* did not dispatch a job */
 
40
    DISPATCH_TYPE_FAST,          /* dispatched a sequential job */
 
41
    DISPATCH_TYPE_FAST_SOFT_REQ, /* dispatch a sequential job with soft requests */
 
42
    DISPATCH_TYPE_COMPREHENSIVE  /* dispatched a pe job*/
 
43
};
 
44
 
 
45
enum schedd_job_info_key {
 
46
   SCHEDD_JOB_INFO_FALSE=0,
 
47
   SCHEDD_JOB_INFO_TRUE,
 
48
   SCHEDD_JOB_INFO_JOB_LIST,
 
49
   SCHEDD_JOB_INFO_UNDEF
 
50
};
 
51
 
 
52
/* defines the algorithm that should be used to compute pe-ranges */
 
53
typedef enum {
 
54
   SCHEDD_PE_AUTO=-1,      /* automatic, the scheduler will decide */
 
55
   SCHEDD_PE_LOW_FIRST=0,  /* least slot first */
 
56
   SCHEDD_PE_HIGH_FIRST,   /* highest slot first */
 
57
   SCHEDD_PE_BINARY,       /* binary search */
 
58
   SCHEDD_PE_ALG_MAX       /* number of algorithms */    /* number of algorithms */
 
59
} schedd_pe_algorithm;
 
60
 
 
61
typedef enum {
 
62
   FIRST_POLICY_VALUE,
 
63
   INVALID_POLICY = FIRST_POLICY_VALUE,
 
64
 
 
65
   OVERRIDE_POLICY,
 
66
   FUNCTIONAL_POLICY,
 
67
   SHARE_TREE_POLICY,
 
68
 
 
69
   /* TODO: shouldn't LAST_POLICY_VALUE equal SHARE_TREE_POLICY? 
 
70
    * POLICY_VALUES = 4, should probably be 3
 
71
    */
 
72
   LAST_POLICY_VALUE,
 
73
   POLICY_VALUES = (LAST_POLICY_VALUE - FIRST_POLICY_VALUE)
 
74
} policy_type_t;
 
75
 
 
76
typedef struct {
 
77
   policy_type_t policy;
 
78
   int dependent;
 
79
} policy_hierarchy_t;  
 
80
 
 
81
void sc_mt_init(void); 
 
82
 
 
83
void sconf_ph_fill_array(policy_hierarchy_t array[]);
 
84
 
 
85
void sconf_ph_print_array(policy_hierarchy_t array[]);
 
86
 
 
87
void sconf_print_config(void);
 
88
 
 
89
lListElem *sconf_create_default(void);
 
90
 
 
91
bool sconf_set_config(lList **config, lList **answer_list);
 
92
 
 
93
bool sconf_is_valid_load_formula(lList **answer_list,
 
94
                                       lList *cmplx_list);
 
95
 
 
96
bool
 
97
sconf_is_centry_referenced(const lListElem *centry);
 
98
 
 
99
bool sconf_validate_config(lList **answer_list, lList *config);
 
100
 
 
101
bool sconf_validate_config_(lList **answer_list);
 
102
 
 
103
lListElem *sconf_get_config(void); 
 
104
 
 
105
lList *sconf_get_config_list(void); 
 
106
 
 
107
bool sconf_is_new_config(void); 
 
108
void sconf_reset_new_config(void);
 
109
 
 
110
bool sconf_is(void);
 
111
 
 
112
u_long32 sconf_get_load_adjustment_decay_time(void);
 
113
 
 
114
lList *sconf_get_job_load_adjustments(void);
 
115
 
 
116
char *sconf_get_load_formula(void);
 
117
 
 
118
u_long32 sconf_get_queue_sort_method(void);
 
119
 
 
120
u_long32 sconf_get_maxujobs(void);
 
121
 
 
122
u_long32 sconf_get_schedule_interval(void);
 
123
 
 
124
u_long32 sconf_get_reprioritize_interval(void);
 
125
 
 
126
u_long32 sconf_get_weight_tickets_share(void);
 
127
 
 
128
lList *sconf_get_schedd_job_info_range(void);
 
129
 
 
130
bool sconf_is_id_in_schedd_job_info_range(u_long32 job_number);
 
131
 
 
132
lList *sconf_get_usage_weight_list(void);
 
133
 
 
134
double sconf_get_weight_user(void);
 
135
 
 
136
double sconf_get_weight_department(void);
 
137
 
 
138
double sconf_get_weight_project(void);
 
139
 
 
140
double sconf_get_weight_job(void);
 
141
 
 
142
u_long32 sconf_get_weight_tickets_share(void);
 
143
 
 
144
u_long32 sconf_get_weight_tickets_functional(void);
 
145
 
 
146
u_long32 sconf_get_halftime(void);
 
147
 
 
148
void sconf_set_weight_tickets_override(u_long32 active);
 
149
 
 
150
u_long32 sconf_get_weight_tickets_override(void);
 
151
 
 
152
double sconf_get_compensation_factor(void);
 
153
 
 
154
bool sconf_get_share_override_tickets(void);
 
155
 
 
156
bool sconf_get_share_functional_shares(void);
 
157
 
 
158
bool sconf_get_report_pjob_tickets(void);
 
159
 
 
160
bool sconf_is_job_category_filtering(void);
 
161
 
 
162
u_long32 sconf_get_flush_submit_sec(void);
 
163
   
 
164
u_long32 sconf_get_flush_finish_sec(void);
 
165
   
 
166
u_long32 sconf_get_max_functional_jobs_to_schedule(void);
 
167
 
 
168
u_long32 sconf_get_max_pending_tasks_per_job(void);
 
169
 
 
170
lList* sconf_get_halflife_decay_list(void);
 
171
 
 
172
double sconf_get_weight_ticket(void);
 
173
double sconf_get_weight_waiting_time(void);
 
174
double sconf_get_weight_deadline(void);
 
175
double sconf_get_weight_urgency(void);
 
176
 
 
177
u_long32 sconf_get_max_reservations(void);
 
178
 
 
179
double sconf_get_weight_priority(void);
 
180
bool sconf_get_profiling(void);
 
181
 
 
182
u_long32 sconf_get_default_duration(void);
 
183
 
 
184
typedef enum {
 
185
   QS_STATE_EMPTY,
 
186
   QS_STATE_FULL
 
187
} qs_state_t;
 
188
 
 
189
u_long32 sconf_get_schedd_job_info(void);
 
190
void sconf_disable_schedd_job_info(void);
 
191
void sconf_enable_schedd_job_info(void);
 
192
 
 
193
void sconf_set_qs_state(qs_state_t state);
 
194
qs_state_t sconf_get_qs_state(void);
 
195
 
 
196
void sconf_set_global_load_correction(bool flag);
 
197
bool sconf_get_global_load_correction(void);
 
198
 
 
199
void     sconf_set_now(u_long32);
 
200
u_long32 sconf_get_now(void);
 
201
 
 
202
bool sconf_get_host_order_changed(void);
 
203
void sconf_set_host_order_changed(bool changed);
 
204
 
 
205
int  sconf_get_last_dispatch_type(void);
 
206
void sconf_set_last_dispatch_type(int changed);
 
207
 
 
208
u_long32  sconf_get_duration_offset(void);
 
209
 
 
210
bool serf_get_active(void);
 
211
 
 
212
schedd_pe_algorithm sconf_best_pe_alg(void);
 
213
void sconf_update_pe_alg(int runs, int current, int max);
 
214
int  sconf_get_pe_alg_value(schedd_pe_algorithm alg);
 
215
 
 
216
void sconf_inc_fast_jobs(void); 
 
217
int sconf_get_fast_jobs(void); 
 
218
   
 
219
void sconf_inc_comprehensive_jobs(void); 
 
220
int sconf_get_comprehensive_jobs(void);
 
221
 
 
222
void sconf_set_decay_constant(double decay);
 
223
double sconf_get_decay_constant(void);
 
224
 
 
225
void sconf_reset_jobs(void);
 
226
 
 
227
void sconf_get_weight_ticket_urgency_priority(double *ticket, double *urgency, double *priority);
 
228
 
 
229
#endif /* __SGE_SCHEDD_CONF_H */