~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to src/sacct/sacct.h

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 *  Copyright (C) 2006 The Regents of the University of California.
7
7
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
8
8
 *  Written by Danny Auble <da@llnl.gov>.
9
 
 *  LLNL-CODE-402394.
 
9
 *  CODE-OCEC-09-009. All rights reserved.
10
10
 *  
11
11
 *  This file is part of SLURM, a resource management program.
12
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
12
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
13
 *  Please also read the included file: DISCLAIMER.
13
14
 *  
14
15
 *  SLURM is free software; you can redistribute it and/or modify it under
15
16
 *  the terms of the GNU General Public License as published by the Free
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"
63
65
 
64
66
#define ERROR 2
65
67
 
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"
72
73
 
73
 
#ifdef HAVE_BG
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"
75
 
#else
76
74
#define LONG_COMP_FIELDS "jobid,uid,jobname,partition,nnodes,nodes,state,start,end,timelimit"
77
 
#endif
78
75
 
79
76
#define BUFFER_SIZE 4096
80
77
#define STATE_COUNT 10
81
78
 
82
79
#define MAX_PRINTFIELDS 100
 
80
#define FORMAT_STRING_SIZE 34
83
81
 
84
82
#define SECONDS_IN_MINUTE 60
85
83
#define SECONDS_IN_HOUR (60*SECONDS_IN_MINUTE)
94
92
                JOBCOMP
95
93
} type_t;
96
94
 
 
95
typedef enum {
 
96
                PRINT_ALLOC_CPUS,
 
97
                PRINT_ACCOUNT,
 
98
                PRINT_ASSOCID,
 
99
                PRINT_AVECPU,
 
100
                PRINT_AVEPAGES,
 
101
                PRINT_AVERSS,
 
102
                PRINT_AVEVSIZE,
 
103
                PRINT_BLOCKID,
 
104
                PRINT_CLUSTER,
 
105
                PRINT_CPU_TIME,
 
106
                PRINT_CPU_TIME_RAW,
 
107
                PRINT_ELAPSED,
 
108
                PRINT_ELIGIBLE,
 
109
                PRINT_END,
 
110
                PRINT_EXITCODE,
 
111
                PRINT_GID,
 
112
                PRINT_GROUP,
 
113
                PRINT_JOBID,
 
114
                PRINT_JOBNAME,
 
115
                PRINT_LAYOUT,
 
116
                PRINT_MAXPAGES,
 
117
                PRINT_MAXPAGESNODE,
 
118
                PRINT_MAXPAGESTASK,
 
119
                PRINT_MAXRSS,
 
120
                PRINT_MAXRSSNODE,
 
121
                PRINT_MAXRSSTASK,
 
122
                PRINT_MAXVSIZE,
 
123
                PRINT_MAXVSIZENODE,
 
124
                PRINT_MAXVSIZETASK,
 
125
                PRINT_MINCPU,
 
126
                PRINT_MINCPUNODE,
 
127
                PRINT_MINCPUTASK,
 
128
                PRINT_NODELIST,
 
129
                PRINT_NNODES,
 
130
                PRINT_NTASKS,
 
131
                PRINT_PRIO,
 
132
                PRINT_PARTITION,
 
133
                PRINT_QOS,
 
134
                PRINT_QOSRAW,
 
135
                PRINT_REQ_CPUS,
 
136
                PRINT_RESV,
 
137
                PRINT_RESV_CPU,
 
138
                PRINT_RESV_CPU_RAW,
 
139
                PRINT_START,
 
140
                PRINT_STATE,
 
141
                PRINT_SUBMIT,
 
142
                PRINT_SUSPENDED,
 
143
                PRINT_SYSTEMCPU,
 
144
                PRINT_TIMELIMIT,
 
145
                PRINT_TOTALCPU,
 
146
                PRINT_UID,
 
147
                PRINT_USER,
 
148
                PRINT_USERCPU,
 
149
                PRINT_WCKEY,
 
150
                PRINT_WCKEYID,
 
151
} sacct_print_types_t;
 
152
 
97
153
typedef struct {
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 */
 
162
        char *opt_filein;
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;
116
167
 
117
 
typedef struct fields {
118
 
        char *name;             /* Specified in --fields= */
119
 
        void (*print_routine) ();       /* Who gets to print it? */
120
 
} fields_t;
121
 
 
122
 
extern fields_t fields[];
 
168
extern print_field_t fields[];
123
169
extern sacct_parameters_t params;
124
170
 
125
171
extern List jobs;
126
172
 
127
 
extern int printfields[MAX_PRINTFIELDS],        /* Indexed into fields[] */
128
 
        nprintfields;
 
173
extern List print_fields_list;
 
174
extern ListIterator print_fields_itr;
 
175
extern int field_count;
 
176
extern List qos_list;
129
177
 
130
178
/* process.c */
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);
133
181
 
134
182
/* print.c */
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);
167
 
 
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);
175
184
 
176
185
/* options.c */
177
186
int decode_state_char(char *state);
180
189
void parse_command_line(int argc, char **argv);
181
190
void do_dump(void);
182
191
void do_dump_completion(void);
183
 
void do_expire();
184
192
void do_help(void);
185
193
void do_list(void);
186
194
void do_list_completion(void);
187
 
void do_stat(void);
188
195
void sacct_init();
189
196
void sacct_fini();
190
197
 
191
 
/* sacct_stat.c */
192
 
extern int sacct_stat(uint32_t jobid, uint32_t stepid);
193
 
 
194
198
#endif /* !_SACCT_H */