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

« back to all changes in this revision

Viewing changes to source/daemons/qmaster/sge_rusage.h

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SGE_RUSAGE_H
 
2
#define __SGE_RUSAGE_H
 
3
/*___INFO__MARK_BEGIN__*/
 
4
/*************************************************************************
 
5
 * 
 
6
 *  The Contents of this file are made available subject to the terms of
 
7
 *  the Sun Industry Standards Source License Version 1.2
 
8
 * 
 
9
 *  Sun Microsystems Inc., March, 2001
 
10
 * 
 
11
 * 
 
12
 *  Sun Industry Standards Source License Version 1.2
 
13
 *  =================================================
 
14
 *  The contents of this file are subject to the Sun Industry Standards
 
15
 *  Source License Version 1.2 (the "License"); You may not use this file
 
16
 *  except in compliance with the License. You may obtain a copy of the
 
17
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
18
 * 
 
19
 *  Software provided under this License is provided on an "AS IS" basis,
 
20
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
21
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
22
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
23
 *  See the License for the specific provisions governing your rights and
 
24
 *  obligations concerning the Software.
 
25
 * 
 
26
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
27
 * 
 
28
 *   Copyright: 2001 by Sun Microsystems, Inc.
 
29
 * 
 
30
 *   All Rights Reserved.
 
31
 * 
 
32
 ************************************************************************/
 
33
/*___INFO__MARK_END__*/
 
34
/****************************************************************
 
35
 Structures for architecture depended data
 
36
 ****************************************************************/
 
37
 
 
38
#include "sge_dstring.h"
 
39
 
 
40
struct all_drsuage {
 
41
   char        *arch;
 
42
};
 
43
 
 
44
typedef struct all_drsuage sge_all_rusage_type;
 
45
 
 
46
struct necsx_drusage {
 
47
   char        *arch;
 
48
   u_long32    base_prty;            /* base priority */
 
49
   u_long32    time_slice;           /* timeslice value */
 
50
   u_long32    num_procs;            /* number of processes */
 
51
   u_long32    kcore_min;            /* amount of memory usage */
 
52
   u_long32    mean_size;            /* mean memory size */
 
53
   u_long32    maxmem_size;          /* maximum memory size */
 
54
   u_long32    chars_trnsfd;         /* number of characters transfered */
 
55
   u_long32    blocks_rw;            /* total blocks read and written */
 
56
   u_long32    inst;                 /* number of instructions */
 
57
   u_long32    vector_inst;          /* number of vector instructions */
 
58
   u_long32    vector_elmt;          /* number of vector elements */
 
59
   u_long32    vec_exe;              /* execution time of vector instr */
 
60
   u_long32    flops;                /* FLOPS value */
 
61
   u_long32    concurrent_flops;     /* concurrent FLOPS value */
 
62
   u_long32    fpec;                 /* floating point data execution element
 
63
                                       count */
 
64
   u_long32    cmcc;                 /* cache miss time */
 
65
   u_long32    bccc;                 /* bank conflict time */
 
66
   u_long32    mt_open;              /* MT open counts */
 
67
   u_long32    io_blocks; /* device  I/O blocks (DSK, ADK (array disk),  XMU,
 
68
                           MASSDPS (mass data processing system disk),
 
69
                           SCD (SCSI  disk), QT (1/4" CGMT), HCT (1/2" CGMT),
 
70
                           DT (DAT), ET (8mm CGMT), MT (1/2" MT),
 
71
                           SMT (SCSI tape), IMT (other MT device connected
 
72
                           to IOX) and HMT (HIPPI MT). */
 
73
   u_long32    multi_single;         /* multitask or single task */
 
74
   u_long32    max_nproc;            /* maximum process counts */
 
75
};
 
76
 
 
77
typedef struct necsx_drusage sge_necsx_rusage_type;
 
78
 
 
79
/****************************************************************
 
80
 Structure used for reporting about the end of a job.
 
81
 ****************************************************************/
 
82
struct drusage {
 
83
   char     *qname;
 
84
   char     *hostname;
 
85
   char     *group;   /* the user's UNIX group on the exec host */
 
86
   char     *owner;    /* owner of the job we report about */
 
87
   char     *project;  /* project of the job we report about */
 
88
   char     *department; /* department of the job we report about */
 
89
   char     *job_name; /* -N switch or script_file or "STDIN" */
 
90
   char     *account;         /* accounting string see -A switch */
 
91
   u_long32 failed;           /* != 0 -> this job failed, 
 
92
                                 see states in execution_states.h */
 
93
   u_long32 general_failure;  /* != 0 execd reports "can execute no job", 
 
94
                                 also see above header */
 
95
   char     *err_str;         /* error string if this job is canceled
 
96
                                 abnormaly */
 
97
   u_long32 priority;         /* priority of job */
 
98
   u_long32 job_number;
 
99
   u_long32 submission_time;
 
100
   u_long32 start_time;
 
101
   u_long32 end_time;
 
102
   u_long32 exit_status;
 
103
   u_long32 signal;
 
104
   double   ru_wallclock;
 
105
   double   ru_utime;      /* user time used */
 
106
   double   ru_stime;      /* system time used */
 
107
   u_long32 ru_maxrss;
 
108
   u_long32 ru_ixrss;      /* integral shared text size */
 
109
   u_long32 ru_ismrss;     /* integral shared memory size*/
 
110
   u_long32 ru_idrss;      /* integral unshared data " */
 
111
   u_long32 ru_isrss;      /* integral unshared stack " */
 
112
   u_long32 ru_minflt;     /* page reclaims */
 
113
   u_long32 ru_majflt;     /* page faults */
 
114
   u_long32 ru_nswap;      /* swaps */
 
115
   u_long32 ru_inblock;    /* block input operations */
 
116
   u_long32 ru_oublock;    /* block output operations */
 
117
   u_long32 ru_msgsnd;     /* messages sent */
 
118
   u_long32 ru_msgrcv;     /* messages received */
 
119
   u_long32 ru_nsignals;   /* signals received */
 
120
   u_long32 ru_nvcsw;      /* voluntary context switches */
 
121
   u_long32 ru_nivcsw;     /* involuntary " */
 
122
   u_long32 pid;
 
123
   char     *granted_pe;
 
124
   u_long32 slots;
 
125
   char     *hard_resources_list;
 
126
   char     *hard_queue_list;
 
127
   u_long32 task_number;   /* job-array task number */
 
128
   double   cpu;
 
129
   double   mem;
 
130
   double   io;
 
131
   double   iow;
 
132
   double   maxvmem;
 
133
   u_long32 ar;
 
134
   sge_all_rusage_type *arch_dep_usage;/* pointer to a structure with
 
135
                                          architecture dependend usage
 
136
                                          information
 
137
                                           for NECSX4/5:
 
138
                                            pointer to sge_necsx_rusage_type */
 
139
                                              
 
140
};
 
141
 
 
142
typedef struct drusage sge_rusage_type;
 
143
 
 
144
/* 
 
145
 * name of the usage record that will hold the time when the last intermediate 
 
146
 * record has been written 
 
147
 */
 
148
#define LAST_INTERMEDIATE "im_acct_time"
 
149
 
 
150
/* 
 
151
 * time window in minutes after midnight in which intermediate usage will be 
 
152
 * written - we needn't do all the checks for intermediate usage reporting
 
153
 * at any time of the day.
 
154
 */
 
155
#define INTERMEDIATE_ACCT_WINDOW 10
 
156
 
 
157
/*
 
158
 * minimum runtime of a job in seconds as prerequisit for the writing of 
 
159
 * intermediate usage reporting - it's not worth writing an intermediate usage 
 
160
 * record for jobs that have started some seconds before midnight.
 
161
 */
 
162
#define INTERMEDIATE_MIN_RUNTIME 60
 
163
 
 
164
const char *
 
165
sge_write_rusage(dstring *buffer, 
 
166
                 lListElem *jr, lListElem *job, lListElem *ja_task, 
 
167
                 const char *category_str, const char delimiter,
 
168
                 bool intermediate);
 
169
 
 
170
#endif /* __SGE_RUSAGE_H */