1
/*___INFO__MARK_BEGIN__*/
2
/*************************************************************************
4
* The Contents of this file are made available subject to the terms of
5
* the Sun Industry Standards Source License Version 1.2
7
* Sun Microsystems Inc., March, 2001
10
* Sun Industry Standards Source License Version 1.2
11
* =================================================
12
* The contents of this file are subject to the Sun Industry Standards
13
* Source License Version 1.2 (the "License"); You may not use this file
14
* except in compliance with the License. You may obtain a copy of the
15
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
17
* Software provided under this License is provided on an "AS IS" basis,
18
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21
* See the License for the specific provisions governing your rights and
22
* obligations concerning the Software.
24
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
26
* Copyright: 2001 by Sun Microsystems, Inc.
28
* All Rights Reserved.
30
************************************************************************/
31
/*___INFO__MARK_END__*/
37
#include "sge_string.h"
39
#include "cull_list.h"
43
#include "gdi/sge_gdi.h"
46
#include "sge_dstring.h"
47
#include "sge_object.h"
48
#include "sge_answer.h"
50
#include "sge_centry.h"
51
#include "sge_cqueue.h"
52
#include "sge_cqueue_verify.h"
53
#include "sge_qinstance.h"
54
#include "sge_qinstance_state.h"
55
#include "sge_qinstance_type.h"
56
#include "sge_utility_qmaster.h"
58
#include "sge_userprj.h"
59
#include "sge_userset.h"
60
#include "sge_feature.h"
62
#include "sge_hgroup.h"
64
#include "sge_calendar.h"
67
#include "sge_range.h"
68
#include "sge_subordinate.h"
69
#include "sge_hostname.h"
70
#include "sge_eval_expression.h"
73
#include "msg_common.h"
74
#include "msg_sgeobjlib.h"
76
#define CQUEUE_LAYER TOP_LAYER
80
list_attribute_struct cqueue_attribute_array[] = {
81
{ CQ_seq_no, QU_seq_no, AULNG_href, AULNG_value, NoName, SGE_ATTR_SEQ_NO, false, false, NULL},
82
{ CQ_nsuspend, QU_nsuspend, AULNG_href, AULNG_value, NoName, SGE_ATTR_NSUSPEND, false, false, NULL},
83
{ CQ_job_slots, QU_job_slots, AULNG_href, AULNG_value, NoName, SGE_ATTR_SLOTS, false, false, cqueue_verify_job_slots},
85
{ CQ_tmpdir, QU_tmpdir, ASTR_href, ASTR_value, NoName, SGE_ATTR_TMPDIR, false, false, NULL},
86
{ CQ_shell, QU_shell, ASTR_href, ASTR_value, NoName, SGE_ATTR_SHELL, false, true, cqueue_verify_shell},
87
{ CQ_calendar, QU_calendar, ASTR_href, ASTR_value, NoName, SGE_ATTR_CALENDAR, false, false, cqueue_verify_calendar},
88
{ CQ_priority, QU_priority, ASTR_href, ASTR_value, NoName, SGE_ATTR_PRIORITY, false, true, cqueue_verify_priority},
89
{ CQ_processors, QU_processors, ASTR_href, ASTR_value, NoName, SGE_ATTR_PROCESSORS, false, true, cqueue_verify_processors},
90
{ CQ_prolog, QU_prolog, ASTR_href, ASTR_value, NoName, SGE_ATTR_PROLOG, false, false, NULL},
91
{ CQ_epilog, QU_epilog, ASTR_href, ASTR_value, NoName, SGE_ATTR_EPILOG, false, false, NULL},
92
{ CQ_shell_start_mode, QU_shell_start_mode, ASTR_href, ASTR_value, NoName, SGE_ATTR_SHELL_START_MODE, false, true, cqueue_verify_shell_start_mode},
93
{ CQ_starter_method, QU_starter_method, ASTR_href, ASTR_value, NoName, SGE_ATTR_STARTER_METHOD, false, false, NULL},
94
{ CQ_suspend_method, QU_suspend_method, ASTR_href, ASTR_value, NoName, SGE_ATTR_SUSPEND_METHOD, false, false, NULL},
95
{ CQ_resume_method, QU_resume_method, ASTR_href, ASTR_value, NoName, SGE_ATTR_RESUME_METHOD, false, false, NULL},
96
{ CQ_terminate_method, QU_terminate_method, ASTR_href, ASTR_value, NoName, SGE_ATTR_TERMINATE_METHOD, false, false, NULL},
97
{ CQ_initial_state, QU_initial_state, ASTR_href, ASTR_value, NoName, SGE_ATTR_INITIAL_STATE, false, true, cqueue_verify_initial_state},
99
{ CQ_rerun, QU_rerun, ABOOL_href, ABOOL_value, NoName, SGE_ATTR_RERUN, false, false, NULL},
101
{ CQ_s_fsize, QU_s_fsize, AMEM_href, AMEM_value, NoName, SGE_ATTR_S_FSIZE, false, false, cqueue_verify_memory_value},
102
{ CQ_h_fsize, QU_h_fsize, AMEM_href, AMEM_value, NoName, SGE_ATTR_H_FSIZE, false, false, cqueue_verify_memory_value},
103
{ CQ_s_data, QU_s_data, AMEM_href, AMEM_value, NoName, SGE_ATTR_S_DATA, false, false, cqueue_verify_memory_value},
104
{ CQ_h_data, QU_h_data, AMEM_href, AMEM_value, NoName, SGE_ATTR_H_DATA, false, false, cqueue_verify_memory_value},
105
{ CQ_s_stack, QU_s_stack, AMEM_href, AMEM_value, NoName, SGE_ATTR_S_STACK, false, false, cqueue_verify_memory_value},
106
{ CQ_h_stack, QU_h_stack, AMEM_href, AMEM_value, NoName, SGE_ATTR_H_STACK, false, false, cqueue_verify_memory_value},
107
{ CQ_s_core, QU_s_core, AMEM_href, AMEM_value, NoName, SGE_ATTR_S_CORE, false, false, cqueue_verify_memory_value},
108
{ CQ_h_core, QU_h_core, AMEM_href, AMEM_value, NoName, SGE_ATTR_H_CORE, false, false, cqueue_verify_memory_value},
109
{ CQ_s_rss, QU_s_rss, AMEM_href, AMEM_value, NoName, SGE_ATTR_S_RSS, false, false, cqueue_verify_memory_value},
110
{ CQ_h_rss, QU_h_rss, AMEM_href, AMEM_value, NoName, SGE_ATTR_H_RSS, false, false, cqueue_verify_memory_value},
111
{ CQ_s_vmem, QU_s_vmem, AMEM_href, AMEM_value, NoName, SGE_ATTR_S_VMEM, false, false, cqueue_verify_memory_value},
112
{ CQ_h_vmem, QU_h_vmem, AMEM_href, AMEM_value, NoName, SGE_ATTR_H_VMEM, false, false, cqueue_verify_memory_value},
114
{ CQ_s_rt, QU_s_rt, ATIME_href, ATIME_value, NoName, SGE_ATTR_S_RT, false, false, cqueue_verify_time_value},
115
{ CQ_h_rt, QU_h_rt, ATIME_href, ATIME_value, NoName, SGE_ATTR_H_RT, false, false, cqueue_verify_time_value},
116
{ CQ_s_cpu, QU_s_cpu, ATIME_href, ATIME_value, NoName, SGE_ATTR_S_CPU, false, false, cqueue_verify_time_value},
117
{ CQ_h_cpu, QU_h_cpu, ATIME_href, ATIME_value, NoName, SGE_ATTR_H_CPU, false, false, cqueue_verify_time_value},
119
{ CQ_suspend_interval, QU_suspend_interval, AINTER_href, AINTER_value, NoName, SGE_ATTR_SUSPEND_INTERVAL, false, false, NULL},
120
{ CQ_min_cpu_interval, QU_min_cpu_interval, AINTER_href, AINTER_value, NoName, SGE_ATTR_MIN_CPU_INTERVAL, false, false, NULL},
121
{ CQ_notify, QU_notify, AINTER_href, AINTER_value, NoName, SGE_ATTR_NOTIFY, false, false, NULL},
123
{ CQ_qtype, QU_qtype, AQTLIST_href, AQTLIST_value, NoName, SGE_ATTR_QTYPE, false, false, NULL},
125
{ CQ_ckpt_list, QU_ckpt_list, ASTRLIST_href, ASTRLIST_value, ST_name, SGE_ATTR_CKPT_LIST, false, false, cqueue_verify_ckpt_list},
126
{ CQ_pe_list, QU_pe_list, ASTRLIST_href, ASTRLIST_value, ST_name, SGE_ATTR_PE_LIST, false, false, cqueue_verify_pe_list},
128
{ CQ_owner_list, QU_owner_list, AUSRLIST_href, AUSRLIST_value, US_name, SGE_ATTR_OWNER_LIST, false, false, NULL},
129
{ CQ_acl, QU_acl, AUSRLIST_href, AUSRLIST_value, US_name, SGE_ATTR_USER_LISTS, false, false, cqueue_verify_user_list},
130
{ CQ_xacl, QU_xacl, AUSRLIST_href, AUSRLIST_value, US_name, SGE_ATTR_XUSER_LISTS, false, false, cqueue_verify_user_list},
132
{ CQ_projects, QU_projects, APRJLIST_href, APRJLIST_value, PR_name, SGE_ATTR_PROJECTS, true, false, cqueue_verify_project_list},
133
{ CQ_xprojects, QU_xprojects, APRJLIST_href, APRJLIST_value, PR_name, SGE_ATTR_XPROJECTS, true, false, cqueue_verify_project_list},
135
{ CQ_consumable_config_list, QU_consumable_config_list, ACELIST_href, ACELIST_value, CE_name, SGE_ATTR_COMPLEX_VALUES, false, false, cqueue_verify_consumable_config_list},
136
{ CQ_load_thresholds, QU_load_thresholds, ACELIST_href, ACELIST_value, CE_name, SGE_ATTR_LOAD_THRESHOLD, false, false, NULL},
137
{ CQ_suspend_thresholds, QU_suspend_thresholds, ACELIST_href, ACELIST_value, CE_name, SGE_ATTR_SUSPEND_THRESHOLD, false, false, NULL},
139
{ CQ_subordinate_list, QU_subordinate_list, ASOLIST_href, ASOLIST_value, SO_name, SGE_ATTR_SUBORDINATE_LIST, false, false, cqueue_verify_subordinate_list},
141
{ NoName, NoName, NoName, NoName, NoName, NULL, false, false, NULL}
146
/* EB: ADOC: add commets */
149
enumeration_create_reduced_cq(bool fetch_all_qi, bool fetch_all_nqi)
152
dstring format_string = DSTRING_INIT;
153
lDescr *descr = CQ_Type;
158
DENTER(CQUEUE_LAYER, "enumeration_create_reduced_cq");
159
for_each_attr(attr, descr) {
161
sge_dstring_clear(&format_string);
162
sge_dstring_append(&format_string, "%T(");
164
if ((attr == CQ_name) ||
165
(fetch_all_qi && attr == CQ_qinstances) ||
166
(fetch_all_nqi && attr != CQ_qinstances)) {
168
name_array[names] = attr;
169
sge_dstring_append(&format_string, "%I");
172
sge_dstring_append(&format_string, ")");
173
ret = _lWhat(sge_dstring_get_string(&format_string), CQ_Type,
174
name_array, ++names);
175
sge_dstring_free(&format_string);
181
/****** sgeobj/cqueue/cqueue_name_split() *************************************
183
* cqueue_name_split() -- Get the CQ and host part of a QI name
187
* cqueue_name_split(const char *name,
188
* dstring *cqueue_name,
189
* dstring *host_domain,
190
* bool *has_hostname,
194
* Splits a qinstance name into its components.
198
* QI-name cqueue_name host_domain has_hostname has_domain
199
* ------------------------------------------------------------------
200
* all.q all.q "" false false
201
* all.q@hostname all.q hostname true false
202
* all.q@@hgrp all.q @hgrp false true
205
* const char *name - CQ/QD or QI name
206
* dstring *cqueue_name - CQ part of the name
207
* dstring *host_domain - host or hostgroup or nothing
208
* bool *has_hostname - is "host_domain" a hostname
209
* bool *has_domain - if "host_domain" a hostgroup
213
* always true - success
214
*******************************************************************************/
216
cqueue_name_split(const char *name,
217
dstring *cqueue_name, dstring *host_domain,
218
bool *has_hostname, bool *has_domain)
222
DENTER(CQUEUE_LAYER, "cqueue_name_split");
225
*has_hostname = false;
229
if (name != NULL && cqueue_name != NULL && host_domain != NULL ) {
230
bool at_skiped = false;
232
sge_dstring_clear(cqueue_name);
233
sge_dstring_clear(host_domain);
235
while (*name != '\0') {
236
if (!at_skiped && *name == '@') {
243
*has_hostname = false;
248
*has_hostname = true;
253
sge_dstring_append_char(cqueue_name, name[0]);
255
sge_dstring_append_char(host_domain, name[0]);
263
/****** sge_cqueue/cqueue_get_name_from_qinstance() ****************************
265
* cqueue_get_name_from_qinstance() -- returns the cluster queue part of a queue
268
* char* cqueue_get_name_from_qinstance(const char *queue_instance)
271
* Returns a character pointer to a newly malloced string containing the cluster
272
* queue part of a queue instance name.
274
* The memory needs to be free'd by the caller
277
* const char *queue_instance - queue instance or cluster queue
280
* char* - cluster queue name
283
* MT-NOTE: cqueue_get_name_from_qinstance() is MT safe
285
*******************************************************************************/
286
char* cqueue_get_name_from_qinstance(const char *queue_instance)
288
char *at_sign = NULL;
291
if ((at_sign = strchr(queue_instance, '@'))) {
292
int size = at_sign - queue_instance;
293
cqueue = malloc(sizeof(char) * (size + 1));
294
cqueue = strncpy(cqueue, queue_instance, size);
297
cqueue = strdup(queue_instance);
303
/****** sgeobj/cqueue/cqueue_create() *****************************************
305
* cqueue_create() -- Create a new cluster queue object
309
* cqueue_create(lList **answer_list,
313
* Returns a new cluster queue object with the name "name".
316
* lList **answer_list - AN_Type list
317
* const char *name - cluster queue name
320
* lListElem * - CQ_Type object or NULL
321
*******************************************************************************/
323
cqueue_create(lList **answer_list, const char *name)
325
lListElem *ret = NULL;
327
DENTER(CQUEUE_LAYER, "cqueue_create");
329
ret = lCreateElem(CQ_Type);
332
lSetString(ret, CQ_name, name);
334
SGE_ADD_MSG_ID(sprintf(SGE_EVENT,
335
MSG_MEM_MEMORYALLOCFAILED_S, SGE_FUNC));
336
answer_list_add(answer_list, SGE_EVENT,
337
STATUS_EMALLOC, ANSWER_QUALITY_ERROR);
344
/****** sgeobj/cqueue/cqueue_is_href_referenced() *****************************
346
* cqueue_is_href_referenced() -- is a host/hostgroup referenced in cqueue
350
* cqueue_is_href_referenced(const lListElem *this_elem,
351
* const lListElem *href)
354
* Is the given "href" (host or hostgroup referenece) used in the
355
* definition of the cluster queue "this_elem"?
358
* const lListElem *this_elem - CQ_Type
359
* const lListElem *href - HR_Type
362
* bool - true if it is referenced
363
*******************************************************************************/
365
cqueue_is_href_referenced(const lListElem *this_elem, const lListElem *href)
369
if (this_elem != NULL && href != NULL) {
370
const char *href_name = lGetHost(href, HR_name);
372
if (href_name != NULL) {
373
lList *href_list = lGetList(this_elem, CQ_hostlist);
374
lListElem *tmp_href = lGetElemHost(href_list, HR_name, href_name);
378
* Is the host group part of the hostlist definition ...
380
if (tmp_href != NULL) {
384
* ... or is it contained on one of the attribute lists
387
while (cqueue_attribute_array[index].cqueue_attr != NoName && !ret) {
388
lList *attr_list = lGetList(this_elem,
389
cqueue_attribute_array[index].cqueue_attr);
390
lListElem *attr_elem = lGetElemHost(attr_list,
391
cqueue_attribute_array[index].href_attr, href_name);
393
if (attr_elem != NULL) {
403
/****** sgeobj/cqueue/cqueue_is_hgroup_referenced() ***************************
405
* cqueue_is_hgroup_referenced() -- is a hgroup referenced in cqueue
409
* cqueue_is_hgroup_referenced(const lListElem *this_elem,
410
* const lListElem *hgroup)
413
* Is the given "hgroup" object referenced in the cluster queue
417
* const lListElem *this_elem - CQ_Type
418
* const lListElem *hgroup - HGRP_Type
421
* bool - true if "hgroup" is referenced
422
*******************************************************************************/
424
cqueue_is_hgroup_referenced(const lListElem *this_elem, const lListElem *hgroup)
428
if (this_elem != NULL && hgroup != NULL) {
429
const char *name = lGetHost(hgroup, HGRP_name);
432
lList *href_list = lGetList(this_elem, CQ_hostlist);
433
lListElem *tmp_href = lGetElemHost(href_list, HR_name, name);
435
if (tmp_href != NULL) {
443
/****** sgeobj/cqueue/cqueue_is_a_href_referenced() ***************************
445
* cqueue_is_a_href_referenced() -- Is one href referenced
449
* cqueue_is_a_href_referenced(const lListElem *this_elem,
450
* const lList *href_list)
453
* Is at least one host reference contained in "href_list" referenced
454
* in the cluster queue "this_elem"
457
* const lListElem *this_elem - CQ_Type object
458
* const lList *href_list - HR_Type list
461
* bool - at least one object is referenced
462
*******************************************************************************/
464
cqueue_is_a_href_referenced(const lListElem *this_elem, const lList *href_list)
468
if (this_elem != NULL && href_list != NULL) {
471
for_each(href, href_list) {
472
if (cqueue_is_href_referenced(this_elem, href)) {
481
/****** sgeobj/cqueue/cqueue_set_template_attributes() ************************
483
* cqueue_set_template_attributes() -- Set default attributes
487
* cqueue_set_template_attributes(lListElem *this_elem,
488
* lList **answer_list)
491
* This function initializes all attributes of an empty cluster
492
* queue with default values. Please note that "this_elem" has to
493
* be "empty" before this function is called.
496
* lListElem *this_elem - CQ_Type
497
* lList **answer_list - AN_Type
503
*******************************************************************************/
505
cqueue_set_template_attributes(lListElem *this_elem, lList **answer_list)
509
DENTER(CQUEUE_LAYER, "cqueue_set_template_attributes");
510
if (this_elem != NULL) {
512
* initialize u_long32 values
515
const u_long32 value[] = {
519
CQ_seq_no, CQ_nsuspend, CQ_job_slots, NoName
523
while (attr[index] != NoName) {
524
lList *attr_list = NULL;
525
lListElem *attr_elem = lAddElemHost(&attr_list, AULNG_href,
526
HOSTREF_DEFAULT, AULNG_Type);
528
lSetUlong(attr_elem, AULNG_value, value[index]);
529
lSetList(this_elem, attr[index], attr_list);
536
* initialize u_long32 values (SGEEE attributes)
539
const u_long32 value[] = {
543
CQ_fshare, CQ_oticket, NoName
547
while (attr[index] != NoName) {
548
lList *attr_list = NULL;
549
lListElem *attr_elem = lAddElemHost(&attr_list, AULNG_href,
550
HOSTREF_DEFAULT, AULNG_Type);
552
lSetUlong(attr_elem, AULNG_value, value[index]);
553
lSetList(this_elem, attr[index], attr_list);
563
const char *string = "BATCH INTERACTIVE";
565
lList *attr_list = NULL;
566
lListElem *attr_elem = lAddElemHost(&attr_list, AQTLIST_href,
567
HOSTREF_DEFAULT, AQTLIST_Type);
569
sge_parse_bitfield_str(string, queue_types, &value, "",
572
lSetUlong(attr_elem, AQTLIST_value, value);
573
lSetList(this_elem, CQ_qtype, attr_list);
577
* initialize bool values
580
lList *attr_list = NULL;
581
lListElem *attr = lAddElemHost(&attr_list, ABOOL_href,
582
HOSTREF_DEFAULT, ABOOL_Type);
584
lSetBool(attr, ABOOL_value, false);
585
lSetList(this_elem, CQ_rerun, attr_list);
589
* initialize memory values
592
const char *value[] = {
593
"INFINITY", "INFINITY", "INFINITY", "INFINITY",
594
"INFINITY", "INFINITY", "INFINITY", "INFINITY",
595
"INFINITY", "INFINITY", "INFINITY", "INFINITY",
599
CQ_s_fsize, CQ_h_fsize, CQ_s_data, CQ_h_data,
600
CQ_s_stack, CQ_h_stack, CQ_s_core, CQ_h_core,
601
CQ_s_rss, CQ_h_rss, CQ_s_vmem, CQ_h_vmem,
606
while (attr[index] != NoName) {
607
lList *attr_list = NULL;
608
lListElem *attr_elem = lAddElemHost(&attr_list, AMEM_href,
609
HOSTREF_DEFAULT, AMEM_Type);
611
lSetString(attr_elem, AMEM_value, value[index]);
612
lSetList(this_elem, attr[index], attr_list);
618
* initialize time values
621
const char *value[] = {
622
"INFINITY", "INFINITY", "INFINITY", "INFINITY",
626
CQ_s_rt, CQ_h_rt, CQ_s_cpu, CQ_h_cpu,
631
while (attr[index] != NoName) {
632
lList *attr_list = NULL;
633
lListElem *attr_elem = lAddElemHost(&attr_list, ATIME_href,
634
HOSTREF_DEFAULT, ATIME_Type);
636
lSetString(attr_elem, ATIME_value, value[index]);
637
lSetList(this_elem, attr[index], attr_list);
643
* initialize interval values
646
const char *value[] = {
647
"00:05:00", "00:05:00", "00:00:60",
651
CQ_suspend_interval, CQ_min_cpu_interval, CQ_notify,
656
while (attr[index] != NoName) {
657
lList *attr_list = NULL;
658
lListElem *attr_elem = lAddElemHost(&attr_list, AINTER_href,
659
HOSTREF_DEFAULT, AINTER_Type);
661
lSetString(attr_elem, AINTER_value, value[index]);
662
lSetList(this_elem, attr[index], attr_list);
668
* initialize string values
671
const char *value[] = {
672
"/tmp", "/bin/csh", "NONE",
673
"0", "UNDEFINED", "NONE",
674
"NONE", "posix_compliant", "NONE",
675
"NONE", "NONE", "NONE",
680
CQ_tmpdir, CQ_shell, CQ_calendar,
681
CQ_priority, CQ_processors, CQ_prolog,
682
CQ_epilog, CQ_shell_start_mode, CQ_starter_method,
683
CQ_suspend_method, CQ_resume_method, CQ_terminate_method,
689
while (attr[index] != NoName) {
690
lList *attr_list = NULL;
691
lListElem *attr_elem = lAddElemHost(&attr_list, ASTR_href,
692
HOSTREF_DEFAULT, ASTR_Type);
694
lSetString(attr_elem, ASTR_value, value[index]);
695
lSetList(this_elem, attr[index], attr_list);
701
* initialize string-list values
705
CQ_pe_list, CQ_ckpt_list,
713
value[0] = lCreateList("", ST_Type);
714
lAddElemStr(&(value[0]), ST_name, "make", ST_Type);
716
while (attr[index] != NoName) {
717
lList *attr_list = NULL;
718
lListElem *attr_elem = lAddElemHost(&attr_list, ASTRLIST_href,
719
HOSTREF_DEFAULT, ASTRLIST_Type);
721
lSetList(attr_elem, ASTRLIST_value, value[index]);
722
lSetList(this_elem, attr[index], attr_list);
728
* initialize AUSRLIST_Type-list values
732
CQ_owner_list, CQ_acl, CQ_xacl,
737
while (attr[index] != NoName) {
738
lList *attr_list = NULL;
739
lListElem *attr_elem = lAddElemHost(&attr_list, AUSRLIST_href,
740
HOSTREF_DEFAULT, AUSRLIST_Type);
742
lSetList(attr_elem, AUSRLIST_value, NULL);
743
lSetList(this_elem, attr[index], attr_list);
749
* initialize APRJLIST_Type-list values (only sgeee mode)
753
CQ_projects, CQ_xprojects,
758
while (attr[index] != NoName) {
759
lList *attr_list = NULL;
760
lListElem *attr_elem = lAddElemHost(&attr_list, APRJLIST_href,
761
HOSTREF_DEFAULT, APRJLIST_Type);
763
lSetList(attr_elem, APRJLIST_value, NULL);
764
lSetList(this_elem, attr[index], attr_list);
770
* initialize ACELIST_Type-list values
774
CQ_load_thresholds, CQ_suspend_thresholds,
775
CQ_consumable_config_list,
779
NULL, NULL, NULL, NULL
784
value[0] = lCreateList("", CE_Type);
785
elem = lAddElemStr(&(value[0]), CE_name, "np_load_avg", CE_Type);
786
lSetString(elem, CE_stringval, "1.75");
788
while (attr[index] != NoName) {
789
lList *attr_list = NULL;
790
lListElem *attr_elem = lAddElemHost(&attr_list, ACELIST_href,
791
HOSTREF_DEFAULT, ACELIST_Type);
793
lSetList(attr_elem, ACELIST_value, value[index]);
794
lSetList(this_elem, attr[index], attr_list);
800
* initialize ASOLIST_Type-list values
809
while (attr[index] != NoName) {
810
lList *attr_list = NULL;
811
lListElem *attr_elem = lAddElemHost(&attr_list, ASOLIST_href,
812
HOSTREF_DEFAULT, ASOLIST_Type);
814
lSetList(attr_elem, ASOLIST_value, NULL);
815
lSetList(this_elem, attr[index], attr_list);
824
/****** sgeobj/cqueue/cqueue_list_add_cqueue() ********************************
826
* cqueue_list_add_cqueue() -- Add a cluster queue to its master list
830
* cqueue_list_add_cqueue(lListElem *queue)
833
* Add a cluster queue in its master list.
836
* lListElem *queue - CQ_Type
842
*******************************************************************************/
844
cqueue_list_add_cqueue(lList *this_list, lListElem *queue)
847
static lSortOrder *so = NULL;
849
DENTER(TOP_LAYER, "cqueue_list_add_cqueue");
853
so = lParseSortOrderVarArg(CQ_Type, "%I+", CQ_name);
856
lInsertSorted(so, queue, this_list);
863
/****** sgeobj/cqueue/cqueue_list_locate() ************************************
865
* cqueue_list_locate() -- Find a cluster queue in list
869
* cqueue_list_locate(const lList *this_list,
873
* Find the cluster queue with name "name" in the list "this_list".
876
* const lList *this_list - CQ_Type list
877
* const char *name - cluster queue name
880
* lListElem * - cluster queue object or NULL
881
*******************************************************************************/
883
cqueue_list_locate(const lList *this_list, const char *name)
885
return lGetElemStr(this_list, CQ_name, name);
888
/****** sgeobj/cqueue/cqueue_locate_qinstance() *******************************
890
* cqueue_locate_qinstance() -- returns one qinstance from a cqueue
894
* cqueue_locate_qinstance(const lListElem *this_elem,
895
* const char *hostname)
898
* Finds the queue instance locateted on the host "hostname" of a
899
* given cluster queue "this_elem".
902
* const lListElem *this_elem - CQ_Type object
903
* const char *hostname - resolved hostname
906
* lListElem * - qinstance object or NULL
907
*******************************************************************************/
909
cqueue_locate_qinstance(const lListElem *this_elem, const char *hostname)
911
lList *qinstance_list = lGetList(this_elem, CQ_qinstances);
913
return qinstance_list_locate(qinstance_list, hostname, NULL);
916
/****** sgeobj/cqueue/cqueue_verify_attributes() ******************************
918
* cqueue_verify_attributes() -- check all cluster queue attributes
922
* cqueue_verify_attributes(lListElem *cqueue,
923
* lList **answer_list,
924
* lListElem *reduced_elem,
928
* Check all cluster queue settings (and correct them if possible).
930
* - test that there is exact one default setting
931
* - check that there is only one setting for used hgroups/hosts
932
* - resolve hostnames
933
* - test attribute values
936
* lListElem *cqueue - CQ_Type object to be verified
937
* lList **answer_list - AN_Type list
938
* lListElem *reduced_elem - reduced CQ_Type. Containes
939
* only those attributes to be checked
940
* bool in_master - true if this function is called in the
947
*******************************************************************************/
949
cqueue_verify_attributes(lListElem *cqueue, lList **answer_list,
950
lListElem *reduced_elem, bool in_master)
954
DENTER(CQUEUE_LAYER, "cqueue_verify_attributes");
955
if (cqueue != NULL && reduced_elem != NULL) {
958
while (cqueue_attribute_array[index].cqueue_attr != NoName && ret) {
959
int pos = lGetPosViaElem(reduced_elem,
960
cqueue_attribute_array[index].cqueue_attr, SGE_NO_ABORT);
965
list = lGetList(cqueue,
966
cqueue_attribute_array[index].cqueue_attr);
969
* Configurations without default setting are rejected
972
lListElem *elem = lGetElemHost(list,
973
cqueue_attribute_array[index].href_attr, HOSTREF_DEFAULT);
976
SGE_ADD_MSG_ID(sprintf(SGE_EVENT,
977
MSG_CQUEUE_NODEFVALUE_S,
978
cqueue_attribute_array[index].name));
979
answer_list_add(answer_list, SGE_EVENT,
980
STATUS_EUNKNOWN, ANSWER_QUALITY_ERROR);
986
* Reject multiple settings for one domain/host
987
* Resolve all hostnames
988
* Verify host group names
991
lListElem *elem = NULL;
993
for_each(elem, list) {
994
const char *hostname = NULL;
995
const void *iterator = NULL;
996
lListElem *first_elem = NULL;
998
hostname = lGetHost(elem,
999
cqueue_attribute_array[index].href_attr);
1000
first_elem = lGetElemHostFirst(list,
1001
cqueue_attribute_array[index].href_attr,
1002
hostname, &iterator);
1004
if (elem != first_elem) {
1005
SGE_ADD_MSG_ID(sprintf(SGE_EVENT,
1006
MSG_CQUEUE_MULVALNOTALLOWED_S, hostname));
1007
answer_list_add(answer_list, SGE_EVENT,
1008
STATUS_EUNKNOWN, ANSWER_QUALITY_ERROR);
1012
if (is_hgroup_name(hostname)) {
1013
if (in_master && strcmp(hostname, HOSTREF_DEFAULT)) {
1014
const lList *master_list =
1015
*(object_type_get_master_list(SGE_TYPE_HGROUP));
1016
const lListElem *hgroup =
1017
hgroup_list_locate(master_list, hostname);
1019
if (hgroup == NULL) {
1020
ERROR((SGE_EVENT, MSG_CQUEUE_INVALIDDOMSETTING_SS,
1021
cqueue_attribute_array[index].name,
1023
answer_list_add(answer_list, SGE_EVENT,
1024
STATUS_ESYNTAX, ANSWER_QUALITY_ERROR);
1030
char resolved_name[CL_MAXHOSTLEN+1];
1031
int back = getuniquehostname(hostname, resolved_name, 0);
1033
if (back == CL_RETVAL_OK) {
1035
cqueue_attribute_array[index].href_attr,
1039
* Due to CR 6319231, IZ 1760 this is allowed
1047
* Call native verify function if it is possible
1050
cqueue_attribute_array[index].verify_function != NULL &&
1051
(cqueue_attribute_array[index].verify_client || in_master)) {
1052
lListElem *elem = NULL;
1054
for_each(elem, list) {
1055
ret &= cqueue_attribute_array[index].
1056
verify_function(cqueue, answer_list, elem);
1068
/****** sgeobj/cqueue/cqueue_list_find_all_matching_references() **************
1070
* cqueue_list_find_all_matching_references() -- as it says
1074
* cqueue_list_find_all_matching_references(const lList *this_list,
1075
* lList **answer_list,
1076
* const char *cqueue_pattern,
1077
* lList **qref_list)
1080
* Find all cqueues in "this_list" where the cqueue name matches
1081
* the pattern "cqueue_pattern". The names of that cqueues will
1082
* be added to the sublist "qref_list" (QR_Type). "answer_list" will
1083
* contain an error message if this function failes.
1086
* const lList *this_list - CQ_Type
1087
* lList **answer_list - AN_Type
1088
* const char *cqueue_pattern - fnmatch patterm
1089
* lList **qref_list - QR_Type list
1092
* bool - error state
1097
* MT-NOTE: cqueue_list_find_all_matching_references() is MT safe
1098
*******************************************************************************/
1100
cqueue_list_find_all_matching_references(const lList *this_list,
1101
lList **answer_list,
1102
const char *cqueue_pattern,
1107
DENTER(CQUEUE_LAYER, "cqueue_list_find_all_matching_references");
1108
if (this_list != NULL && cqueue_pattern != NULL && qref_list != NULL) {
1111
for_each(cqueue, this_list) {
1112
const char *cqueue_name = lGetString(cqueue, CQ_name);
1113
/* use cqueue expression */
1114
if (!sge_eval_expression(TYPE_STR,cqueue_pattern, cqueue_name, NULL)) {
1115
if (*qref_list == NULL) {
1116
*qref_list = lCreateList("", QR_Type);
1118
if (*qref_list != NULL) {
1119
lAddElemStr(qref_list, QR_name, cqueue_name, QR_Type);
1128
/****** sgeobj/cqueue/cqueue_xattr_pre_gdi() **********************************
1130
* cqueue_xattr_pre_gdi() --
1134
* cqueue_xattr_pre_gdi(lList *this_list, lList **answer_list)
1137
* This function makes sure that a cqueue elements has the necessary
1138
* information before it is sent to qmaster as a modify gdi request
1141
* lList *this_list - CQ_Type
1142
* lList **answer_list - AN_Type
1145
* bool - error state
1147
* false - error ("answer_list" containes more information
1150
* MT-NOTE: cqueue_xattr_pre_gdi() is MT safe
1151
*******************************************************************************/
1153
cqueue_xattr_pre_gdi(lList *this_list, lList **answer_list)
1156
dstring cqueue_name = DSTRING_INIT;
1157
dstring host_domain = DSTRING_INIT;
1159
DENTER(CQUEUE_LAYER, "cqueue_xattr_pre_gdi");
1160
if (this_list != NULL) {
1161
lListElem *cqueue = NULL;
1163
for_each(cqueue, this_list) {
1164
const char *name = lGetString(cqueue, CQ_name);
1165
bool has_hostname = false;
1166
bool has_domain = false;
1168
cqueue_name_split(name, &cqueue_name, &host_domain,
1169
&has_hostname, &has_domain);
1170
if (has_domain || has_hostname) {
1174
* Change QI/QD name to CQ name
1176
lSetString(cqueue, CQ_name, sge_dstring_get_string(&cqueue_name));
1179
* Make sure that there is only a default entry
1180
* and change that default entry to be a QD/QI entry
1182
while (cqueue_attribute_array[index].cqueue_attr != NoName && ret) {
1183
int pos = lGetPosViaElem(cqueue,
1184
cqueue_attribute_array[index].cqueue_attr, SGE_NO_ABORT);
1187
lList *list = lGetPosList(cqueue, pos);
1188
lListElem *elem = NULL;
1190
for_each(elem, list) {
1191
const char *attr_hostname = lGetHost(elem,
1192
cqueue_attribute_array[index].href_attr);
1194
if (strcmp(HOSTREF_DEFAULT, attr_hostname)) {
1195
SGE_ADD_MSG_ID(sprintf(SGE_EVENT,
1196
MSG_CQUEUE_NONDEFNOTALLOWED));
1197
answer_list_add(answer_list, SGE_EVENT,
1198
STATUS_EUNKNOWN, ANSWER_QUALITY_ERROR);
1201
lSetHost(elem, cqueue_attribute_array[index].href_attr,
1202
sge_dstring_get_string(&host_domain));
1212
sge_dstring_free(&host_domain);
1213
sge_dstring_free(&cqueue_name);
1217
/****** sgeobj/cqueue_is_used_in_subordinate() ****************************
1219
* cqueue_is_used_in_subordinate() -- checks for cqueue references
1222
* bool cqueue_is_used_in_subordinate(const char *cqueue_name,
1223
* lListElem *cqueue)
1226
* The function goes through all cq subordinate definition and looks
1227
* for the cq_name handed in. If it is found, the function will return
1231
* const char *cqueue_name - cq name to look for
1232
* const lListElem *cqueue - cq to look in
1236
* bool - true - a reference was found
1239
* MT-NOTE: cqueue_is_used_in_subordinate() is MT safe
1240
*******************************************************************************/
1242
cqueue_is_used_in_subordinate(const char *cqueue_name, const lListElem *cqueue)
1246
DENTER(CQUEUE_LAYER, "cqueue_is_used_in_subordinate");
1248
if (cqueue != NULL && cqueue_name != NULL) {
1249
const lList *sub_list = lGetList(cqueue, CQ_subordinate_list);
1250
const lListElem *sub_el;
1251
const lListElem *so;
1253
for_each(sub_el, sub_list) {
1254
so = lGetSubStr(sub_el, SO_name, cqueue_name, ASOLIST_value);
1256
if (so != NULL) { /* we found a reference */
1267
/****** sgeobj/cqueue/cqueue_list_find_hgroup_references() ********************
1269
* cqueue_list_find_hgroup_references() -- find hgroup references
1273
* cqueue_list_find_hgroup_references(const lList *this_list,
1274
* lList **answer_list,
1275
* const lListElem *hgroup,
1276
* lList **string_list)
1279
* This function add each cqueue name contained in "this_list"
1280
* to "string_list" where "hgroup" is referenced. Errors will
1281
* be reported via "answer_list".
1284
* const lList *this_list - CQ_Type
1285
* lList **answer_list - AN_Type
1286
* const lListElem *hgroup - HGRP_Type
1287
* lList **string_list - ST_Type
1290
* bool - error state
1295
* MT-NOTE: cqueue_list_find_hgroup_references() is MT safe
1296
*******************************************************************************/
1298
cqueue_list_find_hgroup_references(const lList *this_list, lList **answer_list,
1299
const lListElem *hgroup, lList **string_list)
1304
DENTER(CQUEUE_LAYER, "cqueue_list_find_hgroup_references");
1305
if (this_list != NULL && hgroup != NULL && string_list != NULL) {
1306
for_each(cqueue, this_list) {
1307
if (cqueue_is_hgroup_referenced(cqueue, hgroup)) {
1308
const char *name = lGetString(cqueue, CQ_name);
1310
lAddElemStr(string_list, ST_name, name, ST_Type);
1318
/****** sgeobj/cqueue/cqueue_list_set_tag() ***********************************
1320
* cqueue_list_set_tag() -- tags each cqueue and optionally qinstance
1324
* cqueue_list_set_tag(lList *this_list,
1325
* u_long32 tag_value, bool tag_qinstances)
1328
* Tags all cqueues contained in "this_list" with the value
1329
* "tag_value". Optionally all qinstances contained in the
1330
* CQ_qinstances-sublist will be tagged too if "tag_qinstances"
1334
* lList *this_list - CQ_Type
1335
* u_long32 tag_value - value
1336
* bool tag_qinstances - true if instances should be tagged
1342
* MT-NOTE: cqueue_list_set_tag() is MT safe
1343
*******************************************************************************/
1345
cqueue_list_set_tag(lList *this_list, u_long32 tag_value, bool tag_qinstances)
1347
DENTER(TOP_LAYER, "cqueue_list_set_tag");
1348
if (this_list != NULL) {
1349
lListElem *cqueue = NULL;
1351
for_each(cqueue, this_list) {
1352
lSetUlong(cqueue, CQ_tag, tag_value);
1353
if (tag_qinstances) {
1354
lList *qinstance_list = lGetList(cqueue, CQ_qinstances);
1356
qinstance_list_set_tag(qinstance_list, tag_value);
1363
/****** sgeobj/cqueue/cqueue_list_locate_qinstance() **************************
1365
* cqueue_list_locate_qinstance() -- finds a certain qinstance
1369
* cqueue_list_locate_qinstance(lList *cqueue_list, const char *full_name)
1372
* Returns a certain qinstance with the name "full_name" from
1373
* the master cqueue list given by "cqueue_list".
1376
* lList *cqueue_list - CQ_Type
1377
* const char *full_name - qinstance name of the form <CQNAME>@<HOSTNAME>
1380
* lListElem * - QU_Type
1383
* MT-NOTE: cqueue_list_locate_qinstance() is MT safe
1384
*******************************************************************************/
1386
cqueue_list_locate_qinstance(lList *cqueue_list, const char *full_name)
1388
return cqueue_list_locate_qinstance_msg(cqueue_list, full_name, true);
1391
/****** sgeobj/cqueue/cqueue_list_locate_qinstance_msg() ***********************
1393
* cqueue_list_locate_qinstance_msg() -- finds a certain qinstance
1397
* cqueue_list_locate_qinstance_msg(lList *cqueue_list, const char *full_name, bool raise_error)
1400
* Returns a certain qinstance with the name "full_name" from
1401
* the master cqueue list given by "cqueue_list".
1404
* lList *cqueue_list - CQ_Type
1405
* const char *full_name - qinstance name of the form <CQNAME>@<HOSTNAME>
1406
* bool raise_error - true - show error messages
1407
* - false - suppress error messages
1410
* lListElem * - QU_Type
1413
* MT-NOTE: cqueue_list_locate_qinstance_msg() is MT safe
1414
*******************************************************************************/
1416
cqueue_list_locate_qinstance_msg(lList *cqueue_list, const char *full_name, bool raise_error)
1418
lListElem *ret = NULL;
1420
DENTER(TOP_LAYER, "cqueue_list_locate_qinstance");
1421
if (full_name != NULL) {
1422
lListElem *cqueue = NULL;
1423
dstring cqueue_name_buffer = DSTRING_INIT;
1424
dstring host_domain_buffer = DSTRING_INIT;
1425
const char *cqueue_name = NULL;
1426
const char *hostname = NULL;
1427
bool has_hostname = false;
1428
bool has_domain = false;
1430
cqueue_name_split(full_name, &cqueue_name_buffer,
1431
&host_domain_buffer, &has_hostname, &has_domain);
1432
cqueue_name = sge_dstring_get_string(&cqueue_name_buffer);
1433
hostname = sge_dstring_get_string(&host_domain_buffer);
1434
cqueue = lGetElemStr(cqueue_list, CQ_name, cqueue_name);
1435
if (cqueue != NULL) {
1436
lList *qinstance_list = lGetList(cqueue, CQ_qinstances);
1438
ret = lGetElemHost(qinstance_list, QU_qhostname, hostname);
1441
ERROR((SGE_EVENT, MSG_CQUEUE_CQUEUEISNULL_SSSII, full_name,
1442
cqueue_name != NULL ? cqueue_name : "<null>",
1443
hostname != NULL ? hostname: "<null>",
1444
(int)has_hostname, (int)has_domain));
1447
sge_dstring_free(&cqueue_name_buffer);
1448
sge_dstring_free(&host_domain_buffer);
1451
ERROR((SGE_EVENT, MSG_CQUEUE_FULLNAMEISNULL));
1457
/****** sge_cqueue/cqueue_find_used_href() *************************************
1459
* cqueue_find_used_href() -- Finds used host references
1463
* cqueue_find_used_href(lListElem *this_elem,
1464
* lList **answer_list,
1465
* lList **href_list)
1468
* This function returns all host references in "href_list"
1469
* for which attribute specific overwritings exist in the cqueue
1473
* lListElem *this_elem - CQ_Type
1474
* lList **answer_list - AN_Type
1475
* lList **href_list - HR_Type
1478
* bool - error state
1483
* MT-NOTE: cqueue_find_used_href() is MT safe
1484
*******************************************************************************/
1486
cqueue_find_used_href(lListElem *this_elem, lList **answer_list,
1491
DENTER(CQUEUE_LAYER, "cqueue_find_used_href");
1492
if (this_elem != NULL) {
1495
while (cqueue_attribute_array[index].cqueue_attr != NoName && ret) {
1496
int pos = lGetPosViaElem(this_elem,
1497
cqueue_attribute_array[index].cqueue_attr, SGE_NO_ABORT);
1500
lList *list = lGetPosList(this_elem, pos);
1501
lListElem *elem = NULL;
1503
for_each(elem, list) {
1504
const char *attr_hostname = lGetHost(elem,
1505
cqueue_attribute_array[index].href_attr);
1507
ret = href_list_add(href_list, answer_list, attr_hostname);
1517
/****** sgeobj/cqueue/cqueue_trash_used_href_setting() ************************
1519
* cqueue_trash_used_href_setting() -- trash certain setting
1523
* cqueue_trash_used_href_setting(lListElem *this_elem,
1524
* lList **answer_list,
1525
* const char *hgroup_or_hostname)
1528
* Trash all attribute specific overwritings in "this_elem" for
1529
* the give host or hgroup "hgroup_or_hostname". Errors will be
1530
* reported in "answer_list".
1533
* lListElem *this_elem - CQ_Type
1534
* lList **answer_list - AN_Type
1535
* const char *hgroup_or_hostname - host or hgroup name
1538
* bool - error result
1543
* MT-NOTE: cqueue_trash_used_href_setting() is MT safe
1544
*******************************************************************************/
1546
cqueue_trash_used_href_setting(lListElem *this_elem, lList **answer_list,
1547
const char *hgroup_or_hostname)
1551
DENTER(CQUEUE_LAYER, "cqueue_trash_used_href_setting");
1552
if (this_elem != NULL) {
1555
while (cqueue_attribute_array[index].cqueue_attr != NoName && ret) {
1556
int pos = lGetPosViaElem(this_elem,
1557
cqueue_attribute_array[index].cqueue_attr, SGE_NO_ABORT);
1560
lList *list = lGetPosList(this_elem, pos);
1561
lListElem *elem = NULL;
1562
lListElem *next_elem = NULL;
1564
next_elem = lFirst(list);
1565
while ((elem = next_elem) != NULL) {
1566
const char *attr_hostname = lGetHost(elem,
1567
cqueue_attribute_array[index].href_attr);
1569
next_elem = lNext(elem);
1570
if (!sge_hostcmp(hgroup_or_hostname, attr_hostname)) {
1571
lRemoveElem(list, &elem);
1582
/****** sge_cqueue/cqueue_purge_host() *****************************************
1584
* cqueue_purge_host() -- purge attributes from queue
1587
* bool cqueue_purge_host(lListElem *this_elem, lList **answer_list, lList
1588
* *attr_list, const char *hgroup_or_hostname)
1594
* lListElem *this_elem - cqueue list element
1595
* lList **answer_list - answer list
1596
* lList *attr_list - list with attributes to search for
1597
* hgroup_or_hostname
1599
* const char *hgroup_or_hostname - host group or hostname which should be purged
1603
* true - hostname found and purged
1604
* false - attribute or hostname not found
1607
* MT-NOTE: cqueue_purge_host() is not MT safe
1609
*******************************************************************************/
1611
cqueue_purge_host(lListElem *this_elem, lList **answer_list,
1612
lList *attr_list, const char *hgroup_or_hostname)
1617
lList *sublist = NULL;
1618
lListElem *ep = NULL;
1619
const char *attr_name = NULL;
1621
DENTER(CQUEUE_LAYER, "cqueue_purge_host");
1623
if (this_elem != NULL) {
1624
for_each (ep, attr_list) {
1625
attr_name = lGetString(ep, US_name);
1626
DPRINTF((SFQ"\n", attr_name));
1628
/* purge hostlist */
1629
if (!sge_eval_expression(TYPE_HOST, attr_name, SGE_ATTR_HOSTLIST, NULL)) {
1631
lXchgList(this_elem, CQ_hostlist, &sublist);
1632
if (lDelElemHost(&sublist, HR_name, hgroup_or_hostname) == 1) {
1633
DPRINTF((SFQ" deleted in "SFQ"\n", hgroup_or_hostname,
1634
SGE_ATTR_HOSTLIST ));
1637
lXchgList(this_elem, CQ_hostlist, &sublist);
1640
/* purge attributes */
1642
while(cqueue_attribute_array[index].name != NULL) {
1644
/* Does the given attr_wildcard match with the actual attr_name */
1645
if (!sge_eval_expression(TYPE_STR, attr_name, cqueue_attribute_array[index].name, NULL)) {
1646
sublist = lGetList(this_elem,
1647
cqueue_attribute_array[index].cqueue_attr );
1649
if (lDelElemHost(&sublist,
1650
cqueue_attribute_array[index].href_attr,
1651
hgroup_or_hostname) == 1) {
1652
DPRINTF((SFQ" deleted in "SFQ"\n", hgroup_or_hostname,
1653
cqueue_attribute_array[index].name ));
1667
cqueue_sick(lListElem *cqueue, lList **answer_list,
1668
lList *master_hgroup_list, dstring *ds)
1672
DENTER(TOP_LAYER, "cqueue_sick");
1676
* - unused setting for attributes
1677
* - hgroup settings were not all hosts are contained in hostlist
1680
const char *cqueue_name = lGetString(cqueue, CQ_name);
1681
lList *used_hosts = NULL;
1682
lList *used_groups = NULL;
1683
lList **answer_list = NULL;
1687
* resolve href list of cqueue
1689
href_list_find_all_references(lGetList(cqueue, CQ_hostlist), answer_list,
1690
master_hgroup_list, &used_hosts,
1694
while (cqueue_attribute_array[index].cqueue_attr != NoName) {
1696
* Skip geee attributes in ge mode
1698
lList *attr_list = lGetList(cqueue,
1699
cqueue_attribute_array[index].cqueue_attr);
1700
lListElem *next_attr = lFirst(attr_list);
1701
lListElem *attr = NULL;
1704
* Test each attribute setting if it is really used in the
1705
* current configuration
1707
while((attr = next_attr) != NULL) {
1708
const char *name = lGetHost(attr,
1709
cqueue_attribute_array[index].href_attr);
1711
next_attr = lNext(attr);
1712
if (is_hgroup_name(name)) {
1713
if (strcmp(name, HOSTREF_DEFAULT)) {
1714
lListElem *hgroup = NULL;
1715
lList *used_hgroup_hosts = NULL;
1716
lList *used_hgroup_groups = NULL;
1717
lList *add_hosts = NULL;
1718
lList *equity_hosts = NULL;
1720
hgroup = hgroup_list_locate(master_hgroup_list, name);
1723
* hgroup specific setting:
1724
* make sure each host of hgroup is part of
1727
hgroup_find_all_references(hgroup, answer_list,
1730
&used_hgroup_groups);
1731
href_list_compare(used_hgroup_hosts, answer_list,
1732
used_hosts, &add_hosts, NULL,
1733
&equity_hosts, NULL);
1735
if (lGetNumberOfElem(add_hosts)) {
1737
sge_dstring_sprintf_append(ds,
1738
MSG_CQUEUE_DEFOVERWRITTEN_SSSSS,
1739
cqueue_attribute_array[index].name,
1740
name, cqueue_name, name, cqueue_name);
1741
sge_dstring_append(ds, "\n");
1744
lFreeList(&add_hosts);
1745
lFreeList(&equity_hosts);
1746
lFreeList(&used_hgroup_hosts);
1747
lFreeList(&used_hgroup_groups);
1753
* host specific setting:
1754
* make sure the host is contained in resolved list
1756
if (!href_list_has_member(used_hosts, name)) {
1758
sge_dstring_sprintf_append(ds,
1759
MSG_CQUEUE_UNUSEDATTRSETTING_SS,
1760
cqueue_attribute_array[index].name,
1762
sge_dstring_append(ds, "\n");
1771
lFreeList(&used_hosts);
1772
lFreeList(&used_groups);