60
61
#include "src/common/slurm_jobacct_gather.h"
61
62
#include "src/common/slurm_accounting_storage.h"
62
63
#include "src/common/slurm_jobcomp.h"
64
#include "src/common/print_fields.h"
66
68
#define BRIEF_FIELDS "jobid,state,exitcode"
67
69
#define BRIEF_COMP_FIELDS "jobid,uid,state"
68
#define DEFAULT_FIELDS "jobid,jobname,partition,ncpus,state,exitcode"
70
#define DEFAULT_FIELDS "jobid,jobname,partition,account,alloccpus,state,exitcode"
69
71
#define DEFAULT_COMP_FIELDS "jobid,uid,jobname,partition,nnodes,nodes,state,end"
70
#define STAT_FIELDS "jobid,vsize,rss,pages,cputime,ntasks,state"
71
#define LONG_FIELDS "jobid,jobname,partition,vsize,rss,pages,cputime,ntasks,ncpus,elapsed,state,exitcode"
72
#define LONG_FIELDS "jobid,jobname,partition,maxvmsize,maxvmsizenode,maxvmsizetask,avevmsize,maxrss,maxrssnode,maxrsstask,averss,maxpages,maxpagesnode,maxpagestask,avepages,mincpu,mincpunode,mincputask,avecpu,ntasks,alloccpus,elapsed,state,exitcode"
74
#define LONG_COMP_FIELDS "jobid,uid,jobname,partition,blockid,nnodes,nodes,state,start,end,timelimit,connection,reboot,rotate,max_procs,geo,bg_start_point"
76
74
#define LONG_COMP_FIELDS "jobid,uid,jobname,partition,nnodes,nodes,state,start,end,timelimit"
79
76
#define BUFFER_SIZE 4096
80
77
#define STATE_COUNT 10
82
79
#define MAX_PRINTFIELDS 100
80
#define FORMAT_STRING_SIZE 34
84
82
#define SECONDS_IN_MINUTE 60
85
83
#define SECONDS_IN_HOUR (60*SECONDS_IN_MINUTE)
151
} sacct_print_types_t;
98
acct_archive_cond_t *arch_cond;
154
acct_job_cond_t *job_cond;
99
155
int opt_completion; /* --completion */
100
156
int opt_dump; /* --dump */
101
157
int opt_dup; /* --duplicates; +1 = explicitly set */
102
158
int opt_fdump; /* --formattted_dump */
103
int opt_expire; /* --expire */
104
159
char *opt_field_list; /* --fields= */
105
160
int opt_gid; /* running persons gid */
106
161
int opt_help; /* --help */
107
int opt_long; /* --long */
108
int opt_lowmem; /* --low_memory */
109
163
int opt_noheader; /* can only be cleared */
110
int opt_raw; /* --raw */
111
int opt_stat; /* --stat */
112
int opt_total; /* --total */
164
int opt_allocs; /* --total */
113
165
int opt_uid; /* running persons uid */
114
int opt_verbose; /* --verbose */
115
166
} sacct_parameters_t;
117
typedef struct fields {
118
char *name; /* Specified in --fields= */
119
void (*print_routine) (); /* Who gets to print it? */
122
extern fields_t fields[];
168
extern print_field_t fields[];
123
169
extern sacct_parameters_t params;
125
171
extern List jobs;
127
extern int printfields[MAX_PRINTFIELDS], /* Indexed into fields[] */
173
extern List print_fields_list;
174
extern ListIterator print_fields_itr;
175
extern int field_count;
176
extern List qos_list;
131
void find_hostname(uint32_t pos, char *hosts, char *host);
179
char *find_hostname(uint32_t pos, char *hosts);
132
180
void aggregate_sacct(sacct_t *dest, sacct_t *from);
135
183
void print_fields(type_t type, void *object);
136
void print_cpu(type_t type, void *object);
137
void print_elapsed(type_t type, void *object);
138
void print_exitcode(type_t type, void *object);
139
void print_gid(type_t type, void *object);
140
void print_group(type_t type, void *object);
141
void print_job(type_t type, void *object);
142
void print_name(type_t type, void *object);
143
void print_jobid(type_t type, void *object);
144
void print_ncpus(type_t type, void *object);
145
void print_nodes(type_t type, void *object);
146
void print_nnodes(type_t type, void *object);
147
void print_ntasks(type_t type, void *object);
148
void print_partition(type_t type, void *object);
149
void print_blockid(type_t type, void *object);
150
void print_pages(type_t type, void *object);
151
void print_rss(type_t type, void *object);
152
void print_state(type_t type, void *object);
153
void print_submit(type_t type, void *object);
154
void print_eligible(type_t type, void *object);
155
void print_start(type_t type, void *object);
156
void print_end(type_t type, void *object);
157
void print_systemcpu(type_t type, void *object);
158
void print_timelimit(type_t type, void *object);
159
void print_uid(type_t type, void *object);
160
void print_user(type_t type, void *object);
161
void print_usercpu(type_t type, void *object);
162
void print_vsize(type_t type, void *object);
163
void print_cputime(type_t type, void *object);
164
void print_account(type_t type, void *object);
165
void print_assoc(type_t type, void *object);
166
void print_cluster(type_t type, void *object);
168
void print_connection(type_t type, void *object);
169
void print_geo(type_t type, void *object);
170
void print_max_procs(type_t type, void *object);
171
void print_reboot(type_t type, void *object);
172
void print_rotate(type_t type, void *object);
173
void print_bg_start_point(type_t type, void *object);
174
void print_wckey(type_t type, void *object);
177
186
int decode_state_char(char *state);