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 "msg_common.h"
38
#include "rmon/sgermon.h"
39
#include "sched/sge_resource_utilizationL.h"
40
#include "spool/flatfile/sge_flatfile.h"
41
#include "spool/flatfile/msg_spoollib_flatfile.h"
42
#include "sgeobj/sge_answer.h"
43
#include "sgeobj/sge_attr.h"
44
#include "sgeobj/sge_calendar.h"
45
#include "sgeobj/sge_centry.h"
46
#include "sgeobj/sge_ckpt.h"
47
#include "sgeobj/sge_conf.h"
48
#include "sgeobj/sge_cqueue.h"
49
#include "sgeobj/sge_cuser.h"
50
#include "sgeobj/sge_feature.h"
51
#include "sgeobj/sge_href.h"
52
#include "sgeobj/sge_host.h"
53
#include "sgeobj/sge_hgroup.h"
54
#include "sgeobj/sge_pe.h"
55
#include "sgeobj/sge_resource_quota.h"
56
#include "sgeobj/sge_qinstance.h"
57
#include "sgeobj/sge_range.h"
58
#include "sgeobj/sge_schedd_conf.h"
59
#include "sgeobj/sge_sharetree.h"
60
#include "sgeobj/sge_str.h"
61
#include "sgeobj/sge_subordinate.h"
62
#include "sgeobj/sge_usage.h"
63
#include "sgeobj/sge_userprj.h"
64
#include "sgeobj/sge_userset.h"
65
#include "sgeobj/sge_advance_reservation.h"
66
#include "sgeobj/sge_qrefL.h"
67
#include "sgeobj/sge_jobL.h"
68
#include "sgeobj/sge_mailrecL.h"
69
#include "uti/sge_log.h"
70
#include "uti/sge_string.h"
72
/* This file defines variables and functions that are used to create field
73
* lists to pass to the flatfile spooling framework. The reason that some
74
* field lists are represented as structs and some are represented as
75
* functions is that some field lists are always that same, while others
76
* change depending on the context from which they're called. */
78
/* read_func's and write_func's -- signature is defined in
79
* sge_spooling_utilities.h:spooling_field. */
80
static void create_spooling_field (
81
spooling_field *field,
85
struct spooling_field *sub_fields,
86
const void *clientdata,
87
int (*read_func) (lListElem *ep, int nm, const char *buffer, lList **alp),
88
int (*write_func) (const lListElem *ep, int nm, dstring *buffer, lList **alp)
90
static int read_SC_queue_sort_method(lListElem *ep, int nm,
91
const char *buffer, lList **alp);
92
static int write_SC_queue_sort_method(const lListElem *ep, int nm,
93
dstring *buffer, lList **alp);
94
static int read_CF_value(lListElem *ep, int nm, const char *buf,
96
static int read_CQ_ulng_attr_list(lListElem *ep, int nm, const char *buffer,
98
static int write_CQ_ulng_attr_list(const lListElem *ep, int nm,
99
dstring *buffer, lList **alp);
100
static int read_CQ_mem_attr_list(lListElem *ep, int nm, const char *buffer,
102
static int write_CQ_mem_attr_list(const lListElem *ep, int nm,
103
dstring *buffer, lList **alp);
104
static int read_CQ_time_attr_list(lListElem *ep, int nm, const char *buffer,
106
static int write_CQ_time_attr_list(const lListElem *ep, int nm,
107
dstring *buffer, lList **alp);
108
static int read_CQ_prjlist_attr_list(lListElem *ep, int nm, const char *buffer,
110
static int write_CQ_prjlist_attr_list(const lListElem *ep, int nm,
111
dstring *buffer, lList **alp);
112
static int read_CQ_solist_attr_list(lListElem *ep, int nm, const char *buffer,
114
static int write_CQ_solist_attr_list(const lListElem *ep, int nm,
115
dstring *buffer, lList **alp);
116
static int read_CQ_usrlist_attr_list(lListElem *ep, int nm, const char *buffer,
118
static int write_CQ_usrlist_attr_list(const lListElem *ep, int nm,
119
dstring *buffer, lList **alp);
120
static int read_CQ_bool_attr_list(lListElem *ep, int nm, const char *buffer,
122
static int write_CQ_bool_attr_list(const lListElem *ep, int nm,
123
dstring *buffer, lList **alp);
124
static int read_CQ_strlist_attr_list(lListElem *ep, int nm, const char *buffer,
126
static int write_CQ_strlist_attr_list(const lListElem *ep, int nm,
127
dstring *buffer, lList **alp);
128
static int read_CQ_qtlist_attr_list(lListElem *ep, int nm, const char *buffer,
130
static int write_CQ_qtlist_attr_list(const lListElem *ep, int nm,
131
dstring *buffer, lList **alp);
132
static int read_CQ_str_attr_list(lListElem *ep, int nm, const char *buffer,
134
static int write_CQ_str_attr_list(const lListElem *ep, int nm,
135
dstring *buffer, lList **alp);
136
static int read_CQ_inter_attr_list(lListElem *ep, int nm, const char *buffer,
138
static int write_CQ_inter_attr_list(const lListElem *ep, int nm,
139
dstring *buffer, lList **alp);
140
static int read_CQ_celist_attr_list(lListElem *ep, int nm, const char *buffer,
142
static int write_CQ_celist_attr_list(const lListElem *ep, int nm,
143
dstring *buffer, lList **alp);
144
static int read_CQ_hostlist(lListElem *ep, int nm, const char *buffer,
146
static int write_CQ_hostlist(const lListElem *ep, int nm,
147
dstring *buffer, lList **alp);
148
static int write_CE_stringval(const lListElem *ep, int nm, dstring *buffer,
150
static int read_RQR_obj(lListElem *ep, int nm, const char *buffer,
152
static int write_RQR_obj(const lListElem *ep, int nm, dstring *buffer,
155
/* Field lists for context-independent spooling of sub-lists */
156
static spooling_field AMEM_sub_fields[] = {
157
{ AMEM_href, 0, NULL, NULL, NULL, NULL},
158
{ AMEM_value, 0, NULL, NULL, NULL, NULL},
159
{ NoName, 0, NULL, NULL, NULL, NULL}
162
static spooling_field ATIME_sub_fields[] = {
163
{ ATIME_href, 0, NULL, NULL, NULL, NULL},
164
{ ATIME_value, 0, NULL, NULL, NULL, NULL},
165
{ NoName, 0, NULL, NULL, NULL, NULL}
168
static spooling_field PR_sub_fields[] = {
169
{ PR_name, 0, NULL, NULL, NULL, NULL},
170
{ NoName, 0, NULL, NULL, NULL, NULL}
173
static spooling_field APRJLIST_sub_fields[] = {
174
{ APRJLIST_href, 0, NULL, NULL, NULL, NULL},
175
{ APRJLIST_value, 0, NULL, PR_sub_fields, NULL, NULL},
176
{ NoName, 0, NULL, NULL, NULL, NULL}
179
static spooling_field SO_sub_fields[] = {
180
{ SO_name, 11, NULL, NULL, NULL, NULL, NULL},
181
{ SO_threshold, 11, NULL, NULL, NULL, NULL, NULL},
182
{ NoName, 11, NULL, NULL, NULL, NULL, NULL}
185
static spooling_field ASOLIST_sub_fields[] = {
186
{ ASOLIST_href, 0, NULL, NULL, NULL, NULL},
187
{ ASOLIST_value, 0, NULL, SO_sub_fields, NULL, NULL},
188
{ NoName, 0, NULL, NULL, NULL, NULL}
191
static spooling_field US_sub_fields[] = {
192
{ US_name, 0, NULL, NULL, NULL, NULL},
193
{ NoName, 0, NULL, NULL, NULL, NULL}
196
static spooling_field AUSRLIST_sub_fields[] = {
197
{ AUSRLIST_href, 0, NULL, NULL, NULL, NULL},
198
{ AUSRLIST_value, 0, NULL, US_sub_fields, NULL, NULL},
199
{ NoName, 0, NULL, NULL, NULL, NULL}
202
static spooling_field ABOOL_sub_fields[] = {
203
{ ABOOL_href, 0, NULL, NULL, NULL, NULL},
204
{ ABOOL_value, 0, NULL, NULL, NULL, NULL},
205
{ NoName, 0, NULL, NULL, NULL, NULL}
208
static spooling_field ST_sub_fields[] = {
209
{ ST_name, 0, NULL, NULL, NULL, NULL},
210
{ NoName, 0, NULL, NULL, NULL, NULL}
213
static spooling_field ASTRLIST_sub_fields[] = {
214
{ ASTRLIST_href, 0, NULL, NULL, NULL, NULL},
215
{ ASTRLIST_value, 0, NULL, ST_sub_fields, NULL, NULL},
216
{ NoName, 0, NULL, NULL, NULL, NULL}
219
static spooling_field AQTLIST_sub_fields[] = {
220
{ AQTLIST_href, 0, NULL, NULL, NULL, NULL},
221
{ AQTLIST_value, 0, NULL, NULL, NULL, NULL},
222
{ NoName, 0, NULL, NULL, NULL, NULL}
225
static spooling_field ASTR_sub_fields[] = {
226
{ ASTR_href, 0, NULL, NULL, NULL, NULL},
227
{ ASTR_value, 0, NULL, NULL, NULL, NULL},
228
{ NoName, 0, NULL, NULL, NULL, NULL}
231
static spooling_field AINTER_sub_fields[] = {
232
{ AINTER_href, 0, NULL, NULL, NULL, NULL},
233
{ AINTER_value, 0, NULL, NULL, NULL, NULL},
234
{ NoName, 0, NULL, NULL, NULL, NULL}
237
static spooling_field CE_sub_fields[] = {
238
{ CE_name, 11, "name", NULL, NULL, NULL, NULL},
239
{ CE_stringval, 11, "value", NULL, NULL, NULL, write_CE_stringval},
240
{ NoName, 11, NULL, NULL, NULL, NULL, NULL}
243
static spooling_field RUE_sub_fields[] = {
244
{ RUE_name, 11, NULL, NULL, NULL, NULL, NULL},
245
{ RUE_utilized_now, 11, NULL, NULL, NULL, NULL, NULL},
246
{ NoName, 11, NULL, NULL, NULL, NULL, NULL}
249
static spooling_field ACELIST_sub_fields[] = {
250
{ ACELIST_href, 0, NULL, NULL, NULL, NULL, NULL},
251
{ ACELIST_value, 0, NULL, CE_sub_fields, NULL, NULL, NULL},
252
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
255
static spooling_field AULNG_sub_fields[] = {
256
{ AULNG_href, 0, NULL, NULL, NULL, NULL, NULL},
257
{ AULNG_value, 0, NULL, NULL, NULL, NULL, NULL},
258
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
261
static spooling_field CF_sub_fields[] = {
262
{ CF_name, 28, NULL, NULL, NULL, NULL, NULL},
263
{ CF_value, 28, NULL, NULL, NULL, read_CF_value, NULL},
264
{ NoName, 28, NULL, NULL, NULL, NULL, NULL}
267
static spooling_field STN_sub_fields[] = {
268
{ STN_id, 0, NULL, NULL, NULL, NULL, NULL},
269
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
272
static spooling_field HS_sub_fields[] = {
273
{ HS_name, 0, NULL, NULL, NULL, NULL, NULL},
274
{ HS_value, 0, NULL, NULL, NULL, NULL, NULL},
275
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
278
static spooling_field RU_sub_fields[] = {
279
{ RU_job_number, 0, NULL, NULL, NULL, NULL, NULL},
280
{ RU_task_number, 0, NULL, NULL, NULL, NULL, NULL},
281
{ RU_state, 0, NULL, NULL, NULL, NULL, NULL},
282
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
285
static spooling_field HL_sub_fields[] = {
286
{ HL_name, 0, NULL, NULL, NULL, NULL, NULL},
287
{ HL_value, 0, NULL, NULL, NULL, NULL, NULL},
288
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
291
static spooling_field STU_sub_fields[] = {
292
{ STU_name, 0, NULL, NULL, NULL, NULL, NULL},
293
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
296
static spooling_field UE_sub_fields[] = {
297
{ UE_name, 0, NULL, NULL, NULL, NULL, NULL},
298
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
301
static spooling_field UA_sub_fields[] = {
302
{ UA_name, 0, NULL, NULL, NULL, NULL, NULL},
303
{ UA_value, 0, NULL, NULL, NULL, NULL, NULL},
304
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
307
static spooling_field UPP_sub_fields[] = {
308
{ UPP_name, 0, NULL, NULL, NULL, NULL, NULL},
309
{ UPP_usage, 0, NULL, UA_sub_fields, NULL, NULL, NULL},
310
{ UPP_long_term_usage, 0, NULL, UA_sub_fields, NULL, NULL, NULL},
311
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
314
static spooling_field UPU_sub_fields[] = {
315
{ UPU_job_number, 0, NULL, NULL, NULL, NULL, NULL},
316
{ UPU_old_usage_list, 0, NULL, UA_sub_fields, &qconf_sub_name_value_comma_sfi, NULL, NULL},
317
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
320
static spooling_field HR_sub_fields[] = {
321
{ HR_name, 0, NULL, NULL, NULL, NULL, NULL},
322
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
325
static spooling_field RQRL_sub_fields[] = {
326
{ RQRL_name, 0, NULL, NULL, NULL, NULL, NULL},
327
{ RQRL_value, 0, NULL, NULL, NULL, NULL, NULL},
328
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
331
static spooling_field RQR_sub_fields[] = {
332
{ RQR_name, 0, "name", NULL, NULL, NULL, NULL},
333
{ RQR_filter_users, 0, "users", NULL, NULL, read_RQR_obj, write_RQR_obj},
334
{ RQR_filter_projects, 0, "projects", NULL, NULL, read_RQR_obj, write_RQR_obj},
335
{ RQR_filter_pes, 0, "pes", NULL, NULL, read_RQR_obj, write_RQR_obj},
336
{ RQR_filter_queues, 0, "queues", NULL, NULL, read_RQR_obj, write_RQR_obj},
337
{ RQR_filter_hosts, 0, "hosts", NULL, NULL, read_RQR_obj, write_RQR_obj},
338
{ RQR_limit, 0, "to", RQRL_sub_fields, &qconf_sub_name_value_comma_sfi, NULL, NULL},
339
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
342
/* Field lists for context-independent object spooling */
343
spooling_field CE_fields[] = {
344
{ CE_name, 11, "name", NULL, NULL, NULL, NULL},
345
{ CE_shortcut, 11, "shortcut", NULL, NULL, NULL, NULL},
346
{ CE_valtype, 11, "type", NULL, NULL, NULL, NULL},
347
{ CE_relop, 11, "relop", NULL, NULL, NULL, NULL},
348
{ CE_requestable, 11, "requestable", NULL, NULL, NULL, NULL},
349
{ CE_consumable, 11, "consumable", NULL, NULL, NULL, NULL},
350
{ CE_default, 11, "default", NULL, NULL, NULL, NULL},
351
{ CE_urgency_weight, 11, "urgency", NULL, NULL, NULL, NULL},
352
{ NoName, 11, NULL, NULL, NULL, NULL, NULL}
355
spooling_field CAL_fields[] = {
356
{ CAL_name, 16, "calendar_name", NULL, NULL, NULL, NULL},
357
{ CAL_year_calendar, 16, "year", NULL, NULL, NULL, NULL},
358
{ CAL_week_calendar, 16, "week", NULL, NULL, NULL, NULL},
359
{ NoName, 16, NULL, NULL, NULL, NULL, NULL}
362
spooling_field CK_fields[] = {
363
{ CK_name, 18, "ckpt_name", NULL, NULL, NULL},
364
{ CK_interface, 18, "interface", NULL, NULL, NULL},
365
{ CK_ckpt_command, 18, "ckpt_command", NULL, NULL, NULL},
366
{ CK_migr_command, 18, "migr_command", NULL, NULL, NULL},
367
{ CK_rest_command, 18, "restart_command", NULL, NULL, NULL},
368
{ CK_clean_command, 18, "clean_command", NULL, NULL, NULL},
369
{ CK_ckpt_dir, 18, "ckpt_dir", NULL, NULL, NULL},
370
{ CK_signal, 18, "signal", NULL, NULL, NULL},
371
{ CK_when, 18, "when", NULL, NULL, NULL},
372
{ NoName, 18, NULL, NULL, NULL, NULL}
375
spooling_field HGRP_fields[] = {
376
{ HGRP_name, 0, "group_name", NULL, NULL, NULL},
377
{ HGRP_host_list, 0, "hostlist", HR_sub_fields, NULL, NULL},
378
{ NoName, 0, NULL, NULL, NULL, NULL}
381
spooling_field US_fields[] = {
382
{ US_name, 7, "name", NULL, NULL, NULL, NULL},
383
{ US_type, 7, "type", NULL, NULL, NULL, NULL},
384
{ US_fshare, 7, "fshare", US_sub_fields, NULL, NULL, NULL},
385
{ US_oticket, 7, "oticket", US_sub_fields, NULL, NULL, NULL},
386
{ US_entries, 7, "entries", UE_sub_fields, NULL, NULL, NULL},
387
{ NoName, 7, NULL, NULL, NULL, NULL, NULL}
390
spooling_field SC_fields[] = {
391
{ SC_algorithm, 33, "algorithm", NULL, NULL, NULL, NULL},
392
{ SC_schedule_interval, 33, "schedule_interval", NULL, NULL, NULL, NULL},
393
{ SC_maxujobs, 33, "maxujobs", NULL, NULL, NULL, NULL},
394
{ SC_queue_sort_method, 33, "queue_sort_method", NULL, NULL, read_SC_queue_sort_method, write_SC_queue_sort_method},
395
{ SC_job_load_adjustments, 33, "job_load_adjustments", CE_sub_fields, NULL, NULL, NULL},
396
{ SC_load_adjustment_decay_time, 33, "load_adjustment_decay_time", CE_sub_fields, NULL, NULL, NULL},
397
{ SC_load_formula, 33, "load_formula", NULL, NULL, NULL, NULL},
398
{ SC_schedd_job_info, 33, "schedd_job_info", NULL, NULL, NULL, NULL},
399
{ SC_flush_submit_sec, 33, "flush_submit_sec", NULL, NULL, NULL, NULL},
400
{ SC_flush_finish_sec, 33, "flush_finish_sec", NULL, NULL, NULL, NULL},
401
{ SC_params, 33, "params", NULL, NULL, NULL, NULL},
402
{ SC_reprioritize_interval, 33, "reprioritize_interval", NULL, NULL, NULL, NULL},
403
{ SC_halftime, 33, "halftime", NULL, NULL, NULL, NULL},
404
{ SC_usage_weight_list, 33, "usage_weight_list", UA_sub_fields, NULL, NULL, NULL},
405
{ SC_compensation_factor, 33, "compensation_factor", NULL, NULL, NULL, NULL},
406
{ SC_weight_user, 33, "weight_user", NULL, NULL, NULL, NULL},
407
{ SC_weight_project, 33, "weight_project", NULL, NULL, NULL, NULL},
408
{ SC_weight_department, 33, "weight_department", NULL, NULL, NULL, NULL},
409
{ SC_weight_job, 33, "weight_job", NULL, NULL, NULL, NULL},
410
{ SC_weight_tickets_functional, 33, "weight_tickets_functional", NULL, NULL, NULL, NULL},
411
{ SC_weight_tickets_share, 33, "weight_tickets_share", NULL, NULL, NULL, NULL},
412
{ SC_share_override_tickets, 33, "share_override_tickets", NULL, NULL, NULL, NULL},
413
{ SC_share_functional_shares, 33, "share_functional_shares", NULL, NULL, NULL, NULL},
414
{ SC_max_functional_jobs_to_schedule, 33, "max_functional_jobs_to_schedule", NULL, NULL, NULL, NULL},
415
{ SC_report_pjob_tickets, 33, "report_pjob_tickets", NULL, NULL, NULL, NULL},
416
{ SC_max_pending_tasks_per_job, 33, "max_pending_tasks_per_job", NULL, NULL, NULL, NULL},
417
{ SC_halflife_decay_list, 33, "halflife_decay_list", NULL, NULL, NULL, NULL},
418
{ SC_policy_hierarchy, 33, "policy_hierarchy", NULL, NULL, NULL, NULL},
419
{ SC_weight_ticket, 33, "weight_ticket", NULL, NULL, NULL, NULL},
420
{ SC_weight_waiting_time, 33, "weight_waiting_time", NULL, NULL, NULL, NULL},
421
{ SC_weight_deadline, 33, "weight_deadline", NULL, NULL, NULL, NULL},
422
{ SC_weight_urgency, 33, "weight_urgency", NULL, NULL, NULL, NULL},
423
{ SC_weight_priority, 33, "weight_priority", NULL, NULL, NULL, NULL},
424
{ SC_max_reservation, 33, "max_reservation", NULL, NULL, NULL, NULL},
425
{ SC_default_duration, 33, "default_duration", NULL, NULL, NULL, NULL},
426
{ NoName, 33, NULL, NULL, NULL, NULL, NULL}
429
spooling_field CQ_fields[] = {
430
{ CQ_name, 21, "qname", NULL, NULL, NULL, NULL},
431
{ CQ_hostlist, 21, "hostlist", HR_sub_fields, NULL, read_CQ_hostlist, write_CQ_hostlist},
432
{ CQ_seq_no, 21, "seq_no", AULNG_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_ulng_attr_list, write_CQ_ulng_attr_list},
433
{ CQ_load_thresholds, 21, "load_thresholds", ACELIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_celist_attr_list, write_CQ_celist_attr_list},
434
{ CQ_suspend_thresholds, 21, "suspend_thresholds", ACELIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_celist_attr_list, write_CQ_celist_attr_list},
435
{ CQ_nsuspend, 21, "nsuspend", AULNG_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_ulng_attr_list, write_CQ_ulng_attr_list},
436
{ CQ_suspend_interval, 21, "suspend_interval", AINTER_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_inter_attr_list, write_CQ_inter_attr_list},
437
{ CQ_priority, 21, "priority", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
438
{ CQ_min_cpu_interval, 21, "min_cpu_interval", AINTER_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_inter_attr_list, write_CQ_inter_attr_list},
439
{ CQ_processors, 21, "processors", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
440
{ CQ_qtype, 21, "qtype", AQTLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_qtlist_attr_list, write_CQ_qtlist_attr_list},
441
{ CQ_ckpt_list, 21, "ckpt_list", ASTRLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_strlist_attr_list, write_CQ_strlist_attr_list},
442
{ CQ_pe_list, 21, "pe_list", ASTRLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_strlist_attr_list, write_CQ_strlist_attr_list},
443
{ CQ_rerun, 21, "rerun", ABOOL_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_bool_attr_list, write_CQ_bool_attr_list},
444
{ CQ_job_slots, 21, "slots", AULNG_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_ulng_attr_list, write_CQ_ulng_attr_list},
445
{ CQ_tmpdir, 21, "tmpdir", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
446
{ CQ_shell, 21, "shell", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
447
{ CQ_prolog, 21, "prolog", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
448
{ CQ_epilog, 21, "epilog", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
449
{ CQ_shell_start_mode, 21, "shell_start_mode", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
450
{ CQ_starter_method, 21, "starter_method", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
451
{ CQ_suspend_method, 21, "suspend_method", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
452
{ CQ_resume_method, 21, "resume_method", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
453
{ CQ_terminate_method, 21, "terminate_method", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
454
{ CQ_notify, 21, "notify", AINTER_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_inter_attr_list, write_CQ_inter_attr_list},
455
{ CQ_owner_list, 21, "owner_list", AUSRLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_usrlist_attr_list, write_CQ_usrlist_attr_list},
456
{ CQ_acl, 21, "user_lists", AUSRLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_usrlist_attr_list, write_CQ_usrlist_attr_list},
457
{ CQ_xacl, 21, "xuser_lists", AUSRLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_usrlist_attr_list, write_CQ_usrlist_attr_list},
458
{ CQ_subordinate_list, 21, "subordinate_list", ASOLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_solist_attr_list, write_CQ_solist_attr_list},
459
{ CQ_consumable_config_list, 21, "complex_values", ACELIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_celist_attr_list, write_CQ_celist_attr_list},
460
{ CQ_projects, 21, "projects", APRJLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_prjlist_attr_list, write_CQ_prjlist_attr_list},
461
{ CQ_xprojects, 21, "xprojects", APRJLIST_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_prjlist_attr_list, write_CQ_prjlist_attr_list},
462
{ CQ_calendar, 21, "calendar", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
463
{ CQ_initial_state, 21, "initial_state", ASTR_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_str_attr_list, write_CQ_str_attr_list},
464
{ CQ_s_rt, 21, "s_rt", ATIME_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_time_attr_list, write_CQ_time_attr_list},
465
{ CQ_h_rt, 21, "h_rt", ATIME_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_time_attr_list, write_CQ_time_attr_list},
466
{ CQ_s_cpu, 21, "s_cpu", ATIME_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_time_attr_list, write_CQ_time_attr_list},
467
{ CQ_h_cpu, 21, "h_cpu", ATIME_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_time_attr_list, write_CQ_time_attr_list},
468
{ CQ_s_fsize, 21, "s_fsize", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
469
{ CQ_h_fsize, 21, "h_fsize", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
470
{ CQ_s_data, 21, "s_data", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
471
{ CQ_h_data, 21, "h_data", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
472
{ CQ_s_stack, 21, "s_stack", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
473
{ CQ_h_stack, 21, "h_stack", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
474
{ CQ_s_core, 21, "s_core", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
475
{ CQ_h_core, 21, "h_core", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
476
{ CQ_s_rss, 21, "s_rss", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
477
{ CQ_h_rss, 21, "h_rss", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
478
{ CQ_s_vmem, 21, "s_vmem", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
479
{ CQ_h_vmem, 21, "h_vmem", AMEM_sub_fields, &qconf_sub_name_value_comma_braced_sfi, read_CQ_mem_attr_list, write_CQ_mem_attr_list},
480
{ NoName, 21, NULL, NULL, NULL, NULL, NULL}
483
spooling_field CU_fields[] = {
484
{ CU_name, 0, "cluster user", NULL},
485
{ CU_ruser_list, 0, "remote user", ASTR_sub_fields},
486
{ CU_ulong32, 0, "ulong32", AULNG_sub_fields},
487
{ CU_bool, 0, "bool", ABOOL_sub_fields},
488
{ CU_time, 0, "time", ATIME_sub_fields},
489
{ CU_mem, 0, "mem", AMEM_sub_fields},
490
{ CU_inter, 0, "inter", AINTER_sub_fields},
491
{ NoName, 0, NULL, NULL}
494
spooling_field SH_fields[] = {
495
{ SH_name, 21, "hostname", NULL, NULL, NULL, NULL},
496
{ NoName, 21, NULL, NULL, NULL, NULL, NULL}
499
spooling_field AH_fields[] = {
500
{ AH_name, 21, "hostname", NULL, NULL, NULL, NULL},
501
{ NoName, 21, NULL, NULL, NULL, NULL, NULL}
504
static spooling_field RN_sub_fields[] = {
505
{ RN_min, 0, NULL, NULL, NULL, NULL, NULL},
506
{ RN_max, 0, NULL, NULL, NULL, NULL, NULL},
507
{ RN_step, 0, NULL, NULL, NULL, NULL, NULL},
508
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
511
static spooling_field QR_sub_fields[] = {
512
{ QR_name, 0, NULL, NULL, NULL, NULL, NULL},
513
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
516
static spooling_field JG_sub_fields[] = {
517
{ JG_qname, 0, NULL, NULL, NULL, NULL, NULL},
518
{ JG_slots, 0, NULL, NULL, NULL, NULL, NULL},
519
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
522
static spooling_field MR_sub_fields[] = {
523
{ MR_user, 0, NULL, NULL, NULL, NULL, NULL},
524
{ MR_host, 0, NULL, NULL, NULL, NULL, NULL},
525
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
528
static spooling_field ARA_sub_fields[] = {
529
{ ARA_name, 0, NULL, NULL, NULL, NULL, NULL},
530
{ ARA_group, 0, NULL, NULL, NULL, NULL, NULL},
531
{ NoName, 0, NULL, NULL, NULL, NULL, NULL}
534
spooling_field AR_fields[] = {
535
{ AR_id, 20, "id", NULL, NULL, NULL},
536
{ AR_name, 20, "name", NULL, NULL, NULL},
537
{ AR_account, 20, "account", NULL, NULL, NULL},
538
{ AR_owner, 20, "owner", NULL, NULL, NULL},
539
{ AR_group, 20, "group", NULL, NULL, NULL},
540
{ AR_submission_time, 20, "submission_time", NULL, NULL, NULL},
541
{ AR_start_time, 20, "start_time", NULL, NULL, NULL},
542
{ AR_end_time, 20, "end_time", NULL, NULL, NULL},
543
{ AR_duration, 20, "duration", NULL, NULL, NULL},
544
{ AR_verify, 20, "verify", NULL, NULL, NULL},
545
{ AR_error_handling, 20, "error_handling", NULL, NULL, NULL},
546
{ AR_state, 20, "state", NULL, NULL, NULL},
547
{ AR_checkpoint_name, 20, "checkpoint_name", NULL, NULL, NULL},
548
{ AR_resource_list, 20, "resource_list", CE_sub_fields, &qconf_sub_name_value_comma_sfi, NULL},
549
{ AR_queue_list, 20, "queue_list", QR_sub_fields, NULL, NULL},
550
{ AR_granted_slots, 20, "granted_slots", JG_sub_fields, &qconf_sub_name_value_comma_sfi, NULL},
551
{ AR_mail_options, 20, "mail_options", NULL, NULL, NULL},
552
{ AR_mail_list, 20, "mail_list", MR_sub_fields, &qconf_sub_name_value_comma_sfi, NULL},
553
{ AR_pe, 20, "pe", NULL, NULL, NULL},
554
{ AR_pe_range, 20, "pe_range", RN_sub_fields, &qconf_sub_name_value_comma_sfi, NULL, NULL},
555
{ AR_granted_pe, 20, "granted_pe", NULL, NULL, NULL},
556
{ AR_master_queue_list, 20, "master_queue_list", QR_sub_fields, NULL, NULL},
557
{ AR_acl_list, 20, "acl_list", ARA_sub_fields, &qconf_sub_name_value_comma_sfi, NULL},
558
{ AR_xacl_list, 20, "xacl_list", ARA_sub_fields, &qconf_sub_name_value_comma_sfi, NULL},
559
{ AR_type, 20, "type", NULL, NULL, NULL},
560
{ NoName, 20, NULL, NULL, NULL, NULL}
563
spooling_field PE_fields[] = {
564
{ PE_name, 18, "pe_name", NULL, NULL, NULL},
565
{ PE_slots, 18, "slots", NULL, NULL, NULL},
566
{ PE_user_list, 18, "user_lists", US_sub_fields, NULL, NULL},
567
{ PE_xuser_list, 18, "xuser_lists", US_sub_fields, NULL, NULL},
568
{ PE_start_proc_args, 18, "start_proc_args", NULL, NULL, NULL},
569
{ PE_stop_proc_args, 18, "stop_proc_args", NULL, NULL, NULL},
570
{ PE_allocation_rule, 18, "allocation_rule", NULL, NULL, NULL},
571
{ PE_control_slaves, 18, "control_slaves", NULL, NULL, NULL},
572
{ PE_job_is_first_task, 18, "job_is_first_task", NULL, NULL, NULL},
573
{ PE_urgency_slots, 18, "urgency_slots", NULL, NULL, NULL},
575
{ PE_qsort_args, 18, "qsort_args", NULL, NULL, NULL},
577
{ PE_accounting_summary, 18, "accounting_summary", NULL, NULL, NULL},
578
{ NoName, 18, NULL, NULL, NULL, NULL}
581
spooling_field RQS_fields[] = {
582
{ RQS_name, 12, "name", NULL, NULL, NULL},
583
{ RQS_description, 12, "description", NULL, NULL, NULL},
584
{ RQS_enabled, 12, "enabled", NULL, NULL, NULL},
585
{ RQS_rule, 12, "limit", RQR_sub_fields, &qconf_sub_rqs_sfi, NULL},
586
{ NoName, 12, NULL, NULL, NULL, NULL}
589
static void create_spooling_field (
590
spooling_field *field,
594
struct spooling_field *sub_fields,
595
const void *clientdata,
596
int (*read_func) (lListElem *ep, int nm, const char *buffer, lList **alp),
597
int (*write_func) (const lListElem *ep, int nm, dstring *buffer, lList **alp)
602
field->width = width;
604
field->sub_fields = sub_fields;
605
field->clientdata = clientdata;
606
field->read_func = read_func;
607
field->write_func = write_func;
611
spooling_field *sge_build_PR_field_list(bool spool)
613
/* There are 11 possible PR_Type fields. */
614
spooling_field *fields = (spooling_field *)malloc(sizeof(spooling_field)*11);
617
/* Build the list of fields to read and write */
618
create_spooling_field(&fields[count++], PR_name, 0, "name", NULL,
620
create_spooling_field(&fields[count++], PR_oticket, 0, "oticket",
621
NULL, NULL, NULL, NULL);
622
create_spooling_field(&fields[count++], PR_fshare, 0, "fshare",
623
NULL, NULL, NULL, NULL);
625
create_spooling_field(&fields[count++], PR_usage, 0, "usage",
626
UA_sub_fields, &qconf_sub_name_value_space_sfi, NULL, NULL);
627
create_spooling_field(&fields[count++], PR_usage_time_stamp, 0, "usage_time_stamp",
628
NULL, NULL, NULL, NULL);
629
create_spooling_field(&fields[count++], PR_long_term_usage, 0, "long_term_usage",
630
UA_sub_fields, &qconf_sub_name_value_space_sfi, NULL, NULL);
631
create_spooling_field(&fields[count++], PR_project, 0, "project",
632
UPP_sub_fields, &qconf_sub_spool_usage_sfi, NULL, NULL);
634
create_spooling_field(&fields[count++], PR_acl, 0, "acl", US_sub_fields,
636
create_spooling_field(&fields[count++], PR_xacl, 0, "xacl",
637
US_sub_fields, NULL, NULL, NULL);
639
create_spooling_field(&fields[count++], PR_debited_job_usage, 0, "debited_job_usage",
640
UPU_sub_fields, &qconf_sub_spool_usage_sfi, NULL, NULL);
642
create_spooling_field(&fields[count++], NoName, 0, NULL, NULL, NULL, NULL,
648
spooling_field *sge_build_UU_field_list(bool spool)
650
/* There are 11 possible UU_Type fields. */
651
spooling_field *fields = (spooling_field *)malloc(sizeof(spooling_field)*11);
654
/* Build the list of fields to read and write */
655
create_spooling_field(&fields[count++], UU_name, 0, "name", NULL,
657
create_spooling_field(&fields[count++], UU_oticket, 0, "oticket",
658
NULL, NULL, NULL, NULL);
659
create_spooling_field(&fields[count++], UU_fshare, 0, "fshare",
660
NULL, NULL, NULL, NULL);
661
create_spooling_field(&fields[count++], UU_delete_time, 0,
662
"delete_time", NULL, NULL, NULL, NULL);
664
create_spooling_field(&fields[count++], UU_usage, 0, "usage",
665
UA_sub_fields, &qconf_sub_name_value_space_sfi, NULL, NULL);
666
create_spooling_field(&fields[count++], UU_usage_time_stamp, 0, "usage_time_stamp",
667
NULL, NULL, NULL, NULL);
668
create_spooling_field(&fields[count++], UU_long_term_usage, 0, "long_term_usage",
669
UA_sub_fields, &qconf_sub_name_value_space_sfi, NULL, NULL);
670
create_spooling_field(&fields[count++], UU_project, 0, "project",
671
UPP_sub_fields, &qconf_sub_spool_usage_sfi, NULL, NULL);
673
create_spooling_field(&fields[count++], UU_default_project, 0,
674
"default_project", NULL, NULL, NULL, NULL);
676
create_spooling_field(&fields[count++], UU_debited_job_usage, 0, "debited_job_usage",
677
UPU_sub_fields, &qconf_sub_spool_usage_sfi, NULL, NULL);
679
create_spooling_field(&fields[count++], NoName, 0, NULL, NULL, NULL, NULL,
685
spooling_field *sge_build_STN_field_list(bool spool, bool recurse)
687
/* There are 7 possible STN_Type fields. */
688
spooling_field *fields = (spooling_field *)malloc (sizeof(spooling_field)*7);
692
create_spooling_field (&fields[count++], STN_id, 0, "id", NULL,
697
create_spooling_field (&fields[count++], STN_version, 0, "version",
698
NULL, NULL, NULL, NULL);
701
create_spooling_field (&fields[count++], STN_name, 0, "name", NULL,
703
create_spooling_field (&fields[count++], STN_type, 0, "type", NULL,
705
create_spooling_field (&fields[count++], STN_shares, 0, "shares",
706
NULL, NULL, NULL, NULL);
709
create_spooling_field (&fields[count++], STN_children, 0, "childnodes",
710
STN_sub_fields, NULL, NULL, NULL);
713
create_spooling_field (&fields[count++], NoName, 0, NULL, NULL, NULL, NULL,
719
/* The spool_flatfile_read_object() function will fail to read the
720
* EH_reschedule_unknown_list field from a classic spooling file because
721
* classic spooling uses two different field delimiters to represent the
723
spooling_field *sge_build_EH_field_list(bool spool, bool to_stdout,
726
/* There are 14 possible EH_Type fields. */
727
spooling_field *fields = (spooling_field *)malloc(sizeof(spooling_field)*14);
730
create_spooling_field(&fields[count++], EH_name, 21, "hostname",
731
NULL, NULL, NULL, NULL);
732
create_spooling_field(&fields[count++], EH_scaling_list, 21, "load_scaling",
733
HS_sub_fields, &qconf_sub_name_value_comma_sfi, NULL,
735
create_spooling_field(&fields[count++], EH_consumable_config_list, 21,
736
"complex_values", CE_sub_fields,
737
&qconf_sub_name_value_comma_sfi, NULL, NULL);
739
if (getenv("MORE_INFO")) {
740
create_spooling_field(&fields[count++], EH_resource_utilization, 21,
741
"complex_values_actual", RUE_sub_fields,
742
&qconf_sub_name_value_comma_sfi, NULL, NULL);
745
if (spool || (!spool && to_stdout) || history) {
746
create_spooling_field(&fields[count++], EH_load_list, 21, "load_values",
747
HL_sub_fields, &qconf_sub_name_value_comma_sfi,
749
create_spooling_field(&fields[count++], EH_processors, 21, "processors",
750
NULL, NULL, NULL, NULL);
754
create_spooling_field(&fields[count++], EH_reschedule_unknown_list, 21,
755
"reschedule_unknown_list", RU_sub_fields,
756
&qconf_sub_name_value_comma_sfi, NULL, NULL);
759
create_spooling_field(&fields[count++], EH_acl, 21, "user_lists",
760
US_sub_fields, NULL, NULL, NULL);
761
create_spooling_field(&fields[count++], EH_xacl, 21, "xuser_lists",
762
US_sub_fields, NULL, NULL, NULL);
764
create_spooling_field(&fields[count++], EH_prj, 21, "projects",
765
PR_sub_fields, NULL, NULL, NULL);
766
create_spooling_field(&fields[count++], EH_xprj, 21, "xprojects",
767
PR_sub_fields, NULL, NULL, NULL);
768
create_spooling_field(&fields[count++], EH_usage_scaling_list, 21,
769
"usage_scaling", HS_sub_fields,
770
&qconf_sub_name_value_comma_sfi, NULL, NULL);
771
create_spooling_field(&fields[count++], EH_report_variables, 21,
772
"report_variables", STU_sub_fields,
773
&qconf_sub_name_value_comma_sfi, NULL, NULL);
774
create_spooling_field(&fields[count++], NoName, 21, NULL, NULL, NULL, NULL,
780
static int read_SC_queue_sort_method(lListElem *ep, int nm,
781
const char *buffer, lList **alp)
783
if (!strncasecmp(buffer, "load", 4)) {
784
lSetUlong(ep, nm, QSM_LOAD);
785
} else if (!strncasecmp(buffer, "seqno", 5)) {
786
lSetUlong(ep, nm, QSM_SEQNUM);
792
static int write_SC_queue_sort_method(const lListElem *ep, int nm,
793
dstring *buffer, lList **alp)
795
if (lGetUlong(ep, nm) == QSM_SEQNUM) {
796
sge_dstring_append(buffer, "seqno");
798
sge_dstring_append(buffer, "load");
804
static int read_CF_value(lListElem *ep, int nm, const char *buf,
807
const char *name = lGetString(ep, CF_name);
809
char *buffer = strdup(buf);
810
struct saved_vars_s *context = NULL;
812
DENTER(TOP_LAYER, "read_CF_value");
814
if (!strcmp(name, "gid_range")) {
815
if ((value = sge_strtok_r(buffer, " \t\n", &context))) {
816
if (!strcasecmp(value, NONE_STR)) {
817
lSetString(ep, CF_value, value);
821
range_list_parse_from_string(&rlp, alp, value,
822
false, false, INF_NOT_ALLOWED);
824
WARNING((SGE_EVENT, MSG_CONFIG_CONF_INCORRECTVALUEFORCONFIGATTRIB_SS,
827
sge_free_saved_vars(context);
836
min = lGetUlong(rep, RN_min);
837
if (min < GID_RANGE_NOT_ALLOWED_ID) {
838
WARNING((SGE_EVENT, MSG_CONFIG_CONF_GIDRANGELESSTHANNOTALLOWED_I, GID_RANGE_NOT_ALLOWED_ID));
840
sge_free_saved_vars(context);
847
lSetString(ep, CF_value, value);
851
} else if (!strcmp(name, "admin_user")) {
852
value = sge_strtok_r(buffer, " \t\n", &context);
853
while (value[0] && isspace((int)value[0]))
856
lSetString(ep, CF_value, value);
858
WARNING((SGE_EVENT, MSG_CONFIG_CONF_NOVALUEFORCONFIGATTRIB_S, name));
860
sge_free_saved_vars(context);
864
} else if (!strcmp(name, "user_lists") ||
865
!strcmp(name, "xuser_lists") ||
866
!strcmp(name, "projects") ||
867
!strcmp(name, "xprojects") ||
868
!strcmp(name, "prolog") ||
869
!strcmp(name, "epilog") ||
870
!strcmp(name, "starter_method") ||
871
!strcmp(name, "suspend_method") ||
872
!strcmp(name, "resume_method") ||
873
!strcmp(name, "terminate_method") ||
874
!strcmp(name, "qmaster_params") ||
875
!strcmp(name, "execd_params") ||
876
!strcmp(name, "reporting_params") ||
877
!strcmp(name, "qlogin_command") ||
878
!strcmp(name, "rlogin_command") ||
879
!strcmp(name, "rsh_command") ||
880
!strcmp(name, "qlogin_daemon") ||
881
!strcmp(name, "rlogin_daemon") ||
882
!strcmp(name, "rsh_daemon") ||
883
!strcmp(name, "libjvm_path") ||
884
!strcmp(name, "additional_jvm_args")) {
885
if (!(value = sge_strtok_r(buffer, "\t\n", &context))) {
886
/* return line if value is empty */
887
WARNING((SGE_EVENT, MSG_CONFIG_CONF_NOVALUEFORCONFIGATTRIB_S, name));
889
sge_free_saved_vars(context);
893
/* skip leading delimitors */
894
while (value[0] && isspace((int)value[0]))
897
lSetString(ep, CF_value, value);
899
if (!(value = sge_strtok_r(buffer, " \t\n", &context))) {
900
WARNING((SGE_EVENT, MSG_CONFIG_CONF_NOVALUEFORCONFIGATTRIB_S, name));
902
sge_free_saved_vars(context);
906
if (strcmp(name, "auto_user_oticket") == 0 ||
907
strcmp(name, "auto_user_fshare") == 0 ) {
908
char *end_ptr = NULL;
911
dbl_value = strtod(value, &end_ptr);
912
if ( dbl_value < 0) {
913
answer_list_add_sprintf(alp, STATUS_EUNKNOWN,
914
ANSWER_QUALITY_ERROR,
915
MSG_MUST_BE_POSITIVE_VALUE_S,
920
lSetString(ep, CF_value, value);
922
if (sge_strtok_r(NULL, " \t\n", &context)) {
923
/* Allow only one value per line */
924
WARNING((SGE_EVENT, MSG_CONFIG_CONF_ONLYSINGLEVALUEFORCONFIGATTRIB_S,
927
sge_free_saved_vars(context);
933
sge_free_saved_vars(context);
938
spooling_field *sge_build_CONF_field_list(bool spool_config)
940
/* There are 4 possible CONF_Type fields. */
941
spooling_field *fields = (spooling_field *)malloc(sizeof(spooling_field)*4);
945
create_spooling_field(&fields[count++], CONF_name, 28, "conf_name",
946
NULL, NULL, NULL, NULL);
947
create_spooling_field(&fields[count++], CONF_version, 28, "conf_version",
948
NULL, NULL, NULL, NULL);
951
create_spooling_field(&fields[count++], CONF_entries, 28, NULL,
952
CF_sub_fields, &qconf_sub_param_sfi, NULL, NULL);
953
create_spooling_field(&fields[count++], NoName, 28, NULL, NULL, NULL, NULL,
959
spooling_field *sge_build_QU_field_list(bool to_stdout, bool to_file)
961
/* There are 52 possible QU_Type fields. */
962
spooling_field *fields = (spooling_field *)malloc(sizeof(spooling_field)*52);
965
create_spooling_field (&fields[count++], QU_qname, 21, "qname", NULL,
967
create_spooling_field (&fields[count++], QU_qhostname, 21, "hostname",
968
NULL, NULL, NULL, NULL);
971
create_spooling_field (&fields[count++], QU_seq_no, 21, "seq_no", NULL,
973
create_spooling_field (&fields[count++], QU_load_thresholds, 21,
974
"load_thresholds", CE_sub_fields, NULL, NULL, NULL);
975
create_spooling_field (&fields[count++], QU_suspend_thresholds, 21,
976
"suspend_thresholds", CE_sub_fields, NULL, NULL, NULL);
977
create_spooling_field (&fields[count++], QU_nsuspend, 21, "nsuspend",
978
NULL, NULL, NULL, NULL);
979
create_spooling_field (&fields[count++], QU_suspend_interval, 21,
980
"suspend_interval", NULL, NULL, NULL, NULL);
981
create_spooling_field (&fields[count++], QU_priority, 21, "priority",
982
NULL, NULL, NULL, NULL);
983
create_spooling_field (&fields[count++], QU_min_cpu_interval, 21,
984
"min_cpu_interval", NULL, NULL, NULL, NULL);
985
create_spooling_field (&fields[count++], QU_processors, 21, "processors",
986
NULL, NULL, NULL, NULL);
987
create_spooling_field (&fields[count++], QU_qtype, 21, "qtype", NULL,
989
create_spooling_field (&fields[count++], QU_ckpt_list, 21, "ckpt_list",
990
ST_sub_fields, NULL, NULL, NULL);
991
create_spooling_field (&fields[count++], QU_pe_list, 21, "pe_list",
992
ST_sub_fields, NULL, NULL, NULL);
993
create_spooling_field (&fields[count++], QU_rerun, 21, "rerun", NULL,
995
create_spooling_field (&fields[count++], QU_job_slots, 21, "slots", NULL,
997
create_spooling_field (&fields[count++], QU_tmpdir, 21, "tmpdir", NULL,
999
create_spooling_field (&fields[count++], QU_shell, 21, "shell", NULL,
1001
create_spooling_field (&fields[count++], QU_prolog, 21, "prolog", NULL,
1003
create_spooling_field (&fields[count++], QU_epilog, 21, "epilog", NULL,
1005
create_spooling_field (&fields[count++], QU_shell_start_mode, 21,
1006
"shell_start_mode", NULL, NULL, NULL, NULL);
1007
create_spooling_field (&fields[count++], QU_starter_method, 21,
1008
"starter_method", NULL, NULL, NULL, NULL);
1009
create_spooling_field (&fields[count++], QU_suspend_method, 21,
1010
"suspend_method", NULL, NULL, NULL, NULL);
1011
create_spooling_field (&fields[count++], QU_resume_method, 21,
1012
"resume_method", NULL, NULL, NULL, NULL);
1013
create_spooling_field (&fields[count++], QU_terminate_method, 21,
1014
"terminate_method", NULL, NULL, NULL, NULL);
1015
create_spooling_field (&fields[count++], QU_notify, 21, "notify", NULL,
1017
create_spooling_field (&fields[count++], QU_owner_list, 21, "owner_list",
1018
US_sub_fields, NULL, NULL, NULL);
1019
create_spooling_field (&fields[count++], QU_acl, 21, "user_lists",
1020
US_sub_fields, NULL, NULL, NULL);
1021
create_spooling_field (&fields[count++], QU_xacl, 21, "xuser_lists",
1022
US_sub_fields, NULL, NULL, NULL);
1023
create_spooling_field (&fields[count++], QU_subordinate_list, 21,
1024
"subordinate_list", SO_sub_fields, NULL, NULL,
1026
create_spooling_field (&fields[count++], QU_consumable_config_list, 21,
1027
"complex_values", CE_sub_fields, NULL, NULL, NULL);
1029
create_spooling_field (&fields[count++], QU_projects, 21, "projects",
1030
PR_sub_fields, NULL, NULL, NULL);
1031
create_spooling_field (&fields[count++], QU_xprojects, 21, "xprojects",
1032
PR_sub_fields, NULL, NULL, NULL);
1034
create_spooling_field (&fields[count++], QU_calendar, 21, "calendar",
1035
NULL, NULL, NULL, NULL);
1036
create_spooling_field (&fields[count++], QU_initial_state, 21,
1037
"initial_state", NULL, NULL, NULL, NULL);
1039
create_spooling_field (&fields[count++], QU_fshare, 21, "fshare", NULL,
1041
create_spooling_field (&fields[count++], QU_oticket, 21, "oticket",
1042
NULL, NULL, NULL, NULL);
1044
create_spooling_field (&fields[count++], QU_s_rt, 21, "s_rt", NULL, NULL,
1046
create_spooling_field (&fields[count++], QU_h_rt, 21, "h_rt", NULL, NULL,
1048
create_spooling_field (&fields[count++], QU_s_cpu, 21, "s_cpu", NULL,
1050
create_spooling_field (&fields[count++], QU_h_cpu, 21, "h_cpu", NULL,
1052
create_spooling_field (&fields[count++], QU_s_fsize, 21, "s_fsize", NULL,
1054
create_spooling_field (&fields[count++], QU_h_fsize, 21, "h_fsize", NULL,
1056
create_spooling_field (&fields[count++], QU_s_data, 21, "s_data", NULL,
1058
create_spooling_field (&fields[count++], QU_h_data, 21, "h_data", NULL,
1060
create_spooling_field (&fields[count++], QU_s_stack, 21, "s_stack", NULL,
1062
create_spooling_field (&fields[count++], QU_h_stack, 21, "h_stack", NULL,
1064
create_spooling_field (&fields[count++], QU_s_core, 21, "s_core", NULL,
1066
create_spooling_field (&fields[count++], QU_h_core, 21, "h_core", NULL,
1068
create_spooling_field (&fields[count++], QU_s_rss, 21, "s_rss", NULL,
1070
create_spooling_field (&fields[count++], QU_h_rss, 21, "h_rss", NULL,
1072
create_spooling_field (&fields[count++], QU_s_vmem, 21, "s_vmem", NULL,
1074
create_spooling_field (&fields[count++], QU_h_vmem, 21, "h_vmem", NULL,
1076
} else if (to_file) {
1078
* Spool only non-CQ attributes
1080
create_spooling_field (&fields[count++], QU_state, 21, "state", NULL,
1082
create_spooling_field (&fields[count++], QU_pending_signal, 21,
1083
"pending_signal", NULL, NULL, NULL, NULL);
1084
create_spooling_field (&fields[count++], QU_pending_signal_delivery_time,
1085
21, "pending_signal_del", NULL, NULL,
1087
create_spooling_field (&fields[count++], QU_version, 21, "version", NULL,
1089
/* SG: not supported */
1091
create_spooling_field (&fields[count++], QU_error_messages, 21,
1092
"error_messages", NULL, NULL, NULL, NULL);
1095
create_spooling_field (&fields[count++], NoName, 21, NULL, NULL, NULL, NULL,
1101
static int read_CQ_ulng_attr_list(lListElem *ep, int nm, const char *buffer, lList **alp)
1105
if (!ulng_attr_list_parse_from_string(&lp, alp, buffer,
1106
HOSTATTR_ALLOW_AMBIGUITY)) {
1111
lSetList(ep, nm, lp);
1118
static int write_CQ_ulng_attr_list(const lListElem *ep, int nm,
1119
dstring *buffer, lList **alp)
1121
ulng_attr_list_append_to_dstring(lGetList (ep, nm), buffer);
1126
static int read_CQ_celist_attr_list(lListElem *ep, int nm, const char *buffer,
1131
if (!celist_attr_list_parse_from_string(&lp, alp, buffer,
1132
HOSTATTR_ALLOW_AMBIGUITY)) {
1137
lSetList(ep, nm, lp);
1144
static int write_CQ_celist_attr_list(const lListElem *ep, int nm,
1145
dstring *buffer, lList **alp)
1147
celist_attr_list_append_to_dstring(lGetList(ep, nm), buffer);
1152
static int read_CQ_inter_attr_list(lListElem *ep, int nm, const char *buffer,
1157
if (!inter_attr_list_parse_from_string(&lp, alp, buffer,
1158
HOSTATTR_ALLOW_AMBIGUITY)) {
1163
lSetList(ep, nm, lp);
1170
static int write_CQ_inter_attr_list(const lListElem *ep, int nm,
1171
dstring *buffer, lList **alp)
1173
inter_attr_list_append_to_dstring(lGetList (ep, nm), buffer);
1178
static int read_CQ_str_attr_list(lListElem *ep, int nm, const char *buffer,
1183
if (!str_attr_list_parse_from_string(&lp, alp, buffer,
1184
HOSTATTR_ALLOW_AMBIGUITY)) {
1189
lSetList(ep, nm, lp);
1196
static int write_CQ_str_attr_list(const lListElem *ep, int nm,
1197
dstring *buffer, lList **alp)
1199
str_attr_list_append_to_dstring(lGetList(ep, nm), buffer);
1204
static int read_CQ_qtlist_attr_list(lListElem *ep, int nm, const char *buffer,
1209
if (!qtlist_attr_list_parse_from_string(&lp, alp, buffer,
1210
HOSTATTR_ALLOW_AMBIGUITY)) {
1215
lSetList(ep, nm, lp);
1222
static int write_CQ_qtlist_attr_list(const lListElem *ep, int nm,
1223
dstring *buffer, lList **alp)
1225
qtlist_attr_list_append_to_dstring(lGetList (ep, nm), buffer);
1230
static int read_CQ_strlist_attr_list(lListElem *ep, int nm, const char *buffer,
1235
if (!strlist_attr_list_parse_from_string(&lp, alp, buffer,
1236
HOSTATTR_ALLOW_AMBIGUITY)) {
1241
lSetList(ep, nm, lp);
1248
static int write_CQ_strlist_attr_list(const lListElem *ep, int nm,
1249
dstring *buffer, lList **alp)
1251
strlist_attr_list_append_to_dstring(lGetList (ep, nm), buffer);
1256
static int read_CQ_bool_attr_list(lListElem *ep, int nm, const char *buffer,
1261
if (!bool_attr_list_parse_from_string(&lp, alp, buffer,
1262
HOSTATTR_ALLOW_AMBIGUITY)) {
1267
lSetList(ep, nm, lp);
1274
static int write_CQ_bool_attr_list(const lListElem *ep, int nm,
1275
dstring *buffer, lList **alp)
1277
bool_attr_list_append_to_dstring(lGetList (ep, nm), buffer);
1282
static int read_CQ_usrlist_attr_list(lListElem *ep, int nm, const char *buffer,
1287
if (!usrlist_attr_list_parse_from_string(&lp, alp, buffer,
1288
HOSTATTR_ALLOW_AMBIGUITY)) {
1293
lSetList(ep, nm, lp);
1300
static int write_CQ_usrlist_attr_list(const lListElem *ep, int nm,
1301
dstring *buffer, lList **alp)
1303
usrlist_attr_list_append_to_dstring(lGetList (ep, nm), buffer);
1308
static int read_CQ_solist_attr_list(lListElem *ep, int nm, const char *buffer,
1313
if (!solist_attr_list_parse_from_string(&lp, alp, buffer,
1314
HOSTATTR_ALLOW_AMBIGUITY)) {
1319
lSetList(ep, nm, lp);
1326
static int write_CQ_solist_attr_list(const lListElem *ep, int nm,
1327
dstring *buffer, lList **alp)
1329
solist_attr_list_append_to_dstring(lGetList (ep, nm), buffer);
1334
static int read_CQ_prjlist_attr_list(lListElem *ep, int nm, const char *buffer,
1339
if (!prjlist_attr_list_parse_from_string(&lp, alp, buffer,
1340
HOSTATTR_ALLOW_AMBIGUITY)) {
1345
lSetList(ep, nm, lp);
1352
static int write_CQ_prjlist_attr_list(const lListElem *ep, int nm,
1353
dstring *buffer, lList **alp)
1355
prjlist_attr_list_append_to_dstring(lGetList(ep, nm), buffer);
1360
static int read_CQ_time_attr_list(lListElem *ep, int nm, const char *buffer,
1365
if (!time_attr_list_parse_from_string(&lp, alp, buffer,
1366
HOSTATTR_ALLOW_AMBIGUITY)) {
1371
lSetList(ep, nm, lp);
1378
static int write_CQ_time_attr_list(const lListElem *ep, int nm,
1379
dstring *buffer, lList **alp)
1381
time_attr_list_append_to_dstring(lGetList(ep, nm), buffer);
1386
static int read_CQ_mem_attr_list(lListElem *ep, int nm, const char *buffer,
1391
if (!mem_attr_list_parse_from_string(&lp, alp, buffer,
1392
HOSTATTR_ALLOW_AMBIGUITY)) {
1397
lSetList(ep, nm, lp);
1404
static int write_CQ_mem_attr_list(const lListElem *ep, int nm,
1405
dstring *buffer, lList **alp)
1407
mem_attr_list_append_to_dstring(lGetList(ep, nm), buffer);
1412
static int read_CQ_hostlist(lListElem *ep, int nm, const char *buffer,
1416
char delims[] = "\t \v\r,";
1418
lString2List(buffer, &lp, HR_Type, HR_name, delims);
1421
if (strcasecmp(NONE_STR, lGetHost(lFirst(lp), HR_name)) != 0) {
1422
lSetList(ep, CQ_hostlist, lp);
1431
static int write_CQ_hostlist(const lListElem *ep, int nm,
1432
dstring *buffer, lList **alp)
1434
lList *lp = lGetList(ep, nm);
1437
href_list_append_to_dstring(lp, buffer);
1439
sge_dstring_append(buffer, NONE_STR);
1445
static int write_CE_stringval(const lListElem *ep, int nm, dstring *buffer,
1450
if ((s=lGetString(ep, CE_stringval)) != NULL) {
1451
sge_dstring_append(buffer, s);
1453
sge_dstring_sprintf_append(buffer, "%f", lGetDouble(ep, CE_doubleval));
1459
/****** sge_flatfile_obj/read_RQR_obj() ****************************************
1461
* read_RQR_obj() -- parse a RQR object from string
1464
* static int read_RQR_obj(lListElem *ep, int nm, const char *buffer, lList
1468
* Reads in a RQR Element from string
1471
* lListElem *ep - Store for parsed Elem
1472
* int nm - nm to be parsed
1473
* const char *buffer - String of the elem to be parsed
1474
* lList **alp - Answer list
1477
* static int - 1 on success
1481
* MT-NOTE: read_RQR_obj() is MT safe
1483
*******************************************************************************/
1484
static int read_RQR_obj(lListElem *ep, int nm, const char *buffer,
1486
lListElem *filter = NULL;
1489
DENTER(TOP_LAYER, "read_RQR_obj");
1491
if ((ret = rqs_parse_filter_from_string(&filter, buffer, alp)) == 1) {
1492
lSetObject(ep, nm, filter);
1498
/****** sge_flatfile_obj/write_RQR_obj() ***************************************
1500
* write_RQR_obj() -- converts a element to string
1503
* static int write_RQR_obj(const lListElem *ep, int nm, dstring *buffer, lList
1507
* Prints out a RQR Element to a string
1510
* const lListElem *ep - Elem to be converted
1511
* int nm - nm of Elem
1512
* dstring *buffer - Element as string
1513
* lList **alp - Answer List
1516
* static int - 1 on success
1520
* MT-NOTE: write_RQR_obj() is MT safe
1522
*******************************************************************************/
1523
static int write_RQR_obj(const lListElem *ep, int nm, dstring *buffer,
1525
return rqs_append_filter_to_dstring(lGetObject(ep, nm), buffer, alp);