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

« back to all changes in this revision

Viewing changes to src/common/slurmdbd_defs.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:
4
4
 *  Copyright (C) 2008 Lawrence Livermore National Security.
5
5
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
6
6
 *  Written by Morris Jette <jette1@llnl.gov>
7
 
 *  LLNL-CODE-402394.
 
7
 *  CODE-OCEC-09-009. All rights reserved.
8
8
 *  
9
9
 *  This file is part of SLURM, a resource management program.
10
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
10
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
11
 *  Please also read the included file: DISCLAIMER.
11
12
 *  
12
13
 *  SLURM is free software; you can redistribute it and/or modify it under
13
14
 *  the terms of the GNU General Public License as published by the Free
84
85
 *      communicating with it (e.g. it will not accept messages with a
85
86
 *      version higher than SLURMDBD_VERSION).
86
87
 */
87
 
#define SLURMDBD_VERSION        04
 
88
#define SLURMDBD_VERSION        05 
88
89
#define SLURMDBD_VERSION_MIN    02
89
90
 
90
91
/* SLURM DBD message types */
117
118
        DBD_GOT_USERS,          /* Response to DBD_GET_USERS            */
118
119
        DBD_JOB_COMPLETE,       /* Record job completion                */
119
120
        DBD_JOB_START,          /* Record job starting                  */
120
 
        DBD_JOB_START_RC,       /* return db_index from job insertion   */
 
121
        DBD_ID_RC,              /* return db_index from job
 
122
                                 * insertion, or any other id from
 
123
                                 * other commands.                      */
121
124
        DBD_JOB_SUSPEND,        /* Record job suspension                */
122
125
        DBD_MODIFY_ACCOUNTS,    /* Modify existing account              */
123
126
        DBD_MODIFY_ASSOCS,      /* Modify existing association          */
135
138
        DBD_ROLL_USAGE,         /* Roll up usage                        */
136
139
        DBD_STEP_COMPLETE,      /* Record step completion               */
137
140
        DBD_STEP_START,         /* Record step starting                 */
138
 
        DBD_UPDATE_SHARES_USED, /* Record current share usage           */
 
141
        DBD_UPDATE_SHARES_USED, /* Doesn't do anything but
 
142
                                 * needs to be here for
 
143
                                 * history sake         */
139
144
        DBD_GET_JOBS_COND,      /* Get job information with a condition */
140
145
        DBD_GET_TXN,            /* Get transaction information          */
141
146
        DBD_GOT_TXN,            /* Got transaction information          */
154
159
        DBD_ARCHIVE_DUMP,       /* issue a request to dump jobs to
155
160
                                 * archive */
156
161
        DBD_ARCHIVE_LOAD,       /* load an archive file                 */
 
162
        DBD_ADD_RESV,           /* add a reservation                    */
 
163
        DBD_REMOVE_RESV,        /* remove a reservation                 */
 
164
        DBD_MODIFY_RESV,        /* modify a reservation                 */
 
165
        DBD_GET_RESVS,          /* Get reservation information          */
 
166
        DBD_GOT_RESVS,          /* Response to DBD_GET_RESV             */
 
167
        DBD_GET_CONFIG,         /* Get configuration information        */
 
168
        DBD_GOT_CONFIG,         /* Response to DBD_GET_CONFIG           */
157
169
} slurmdbd_msg_type_t;
158
170
 
159
171
/*****************************************************************************\
172
184
 
173
185
typedef struct dbd_cluster_procs_msg {
174
186
        char *cluster_name;     /* name of cluster */
 
187
        char *cluster_nodes;    /* name of cluster */
175
188
        uint32_t proc_count;    /* total processor count */
176
189
        time_t event_time;      /* time of transition */
177
190
} dbd_cluster_procs_msg_t;
178
191
 
179
192
typedef struct {
 
193
        void *rec; /* this could be anything based on the type types
 
194
                     * are defined in slurm_accounting_storage.h
 
195
                     * *_rec_t */
 
196
} dbd_rec_msg_t;
 
197
 
 
198
typedef struct {
180
199
        void *cond; /* this could be anything based on the type types
181
200
                     * are defined in slurm_accounting_storage.h
182
201
                     * *_cond_t */
183
202
} dbd_cond_msg_t;
184
203
 
185
204
typedef struct {
 
205
        uint16_t archive_data;
 
206
        time_t end;
186
207
        time_t start;
187
208
} dbd_roll_usage_msg_t;
188
209
 
189
210
typedef struct {
 
211
        time_t end;
190
212
        void *rec;
191
213
        time_t start;
192
 
        time_t end;
193
214
} dbd_usage_msg_t;
194
215
 
195
216
typedef struct dbd_get_jobs_msg {
234
255
        char *   account;       /* Account name for those not running
235
256
                                 * with associations */
236
257
        uint32_t alloc_cpus;    /* count of allocated processors */
 
258
        uint32_t alloc_nodes;   /* how many nodes used in job */ 
237
259
        uint32_t assoc_id;      /* accounting association id */
238
260
        char *   cluster;       /* cluster job is being ran on */
239
261
        char *   block_id;      /* Bluegene block id */
244
266
        uint16_t job_state;     /* job state */
245
267
        char *   name;          /* job name */
246
268
        char *   nodes;         /* hosts allocated to the job */
 
269
        char *   node_inx;      /* ranged bitmap string of hosts
 
270
                                 * allocated to the job */
247
271
        char *   partition;     /* partition job is running on */
248
272
        uint32_t priority;      /* job priority */
249
273
        uint32_t req_cpus;      /* count of req processors */
 
274
        uint32_t resv_id;       /* reservation id */
250
275
        time_t   start_time;    /* job start time */
251
276
        time_t   submit_time;   /* job submit time */
 
277
        uint32_t timelimit;     /* job timelimit */
252
278
        uint32_t uid;           /* user ID if associations are being used */
 
279
        char *   wckey;         /* wckey name */
253
280
} dbd_job_start_msg_t;
254
281
 
255
 
typedef struct dbd_job_start_rc_msg {
256
 
        uint32_t db_index;      /* db_index */
 
282
/* returns a uint32_t along with a return code */
 
283
typedef struct dbd_id_rc_msg {
 
284
        uint32_t id;
257
285
        uint32_t return_code;
258
 
} dbd_job_start_rc_msg_t;
 
286
} dbd_id_rc_msg_t;
259
287
 
260
288
typedef struct dbd_job_suspend_msg {
261
289
        uint32_t assoc_id;      /* accounting association id needed
288
316
        char *hostlist;         /* name of hosts */
289
317
        uint16_t new_state;     /* new state of host, see DBD_NODE_STATE_* */
290
318
        char *reason;           /* explanation for the node's state */
 
319
        uint16_t state;         /* current state of node.  Used to get
 
320
                                   flags on the state (i.e. maintenance) */
291
321
} dbd_node_state_msg_t;
292
322
 
293
323
typedef struct dbd_rc_msg {
314
344
                                  * in db */
315
345
        uint32_t step_id;       /* step ID */
316
346
        uint32_t total_procs;   /* count of allocated processors */
 
347
        uint32_t total_tasks;   /* count of tasks for step */
317
348
} dbd_step_comp_msg_t;
318
349
 
319
350
typedef struct dbd_step_start_msg {
322
353
        uint32_t job_id;        /* job ID */
323
354
        char *   name;          /* step name */
324
355
        char *   nodes;         /* hosts allocated to the step */
 
356
        char *   node_inx;      /* bitmap index of hosts allocated to
 
357
                                 * the step */
 
358
        uint32_t node_cnt;      /* how many nodes used in step */ 
325
359
        time_t   start_time;    /* step start time */
326
360
        time_t   job_submit_time;/* job submit time needed to find job record
327
361
                                  * in db */
328
362
        uint32_t step_id;       /* step ID */
 
363
        uint16_t task_dist;     /* layout method of step */
329
364
        uint32_t total_procs;   /* count of allocated processors */
 
365
        uint32_t total_tasks;   /* count of tasks for step */
330
366
} dbd_step_start_msg_t;
331
367
 
332
368
/* flag to let us know if we are running on cache or from the actual
389
425
                                         dbd_acct_coord_msg_t *msg);
390
426
void inline slurmdbd_free_cluster_procs_msg(uint16_t rpc_version, 
391
427
                                            dbd_cluster_procs_msg_t *msg);
 
428
void inline slurmdbd_free_rec_msg(uint16_t rpc_version, 
 
429
                                  slurmdbd_msg_type_t type,
 
430
                                  dbd_rec_msg_t *msg);
392
431
void inline slurmdbd_free_cond_msg(uint16_t rpc_version, 
393
432
                                   slurmdbd_msg_type_t type,
394
433
                                   dbd_cond_msg_t *msg);
402
441
                                           dbd_job_comp_msg_t *msg);
403
442
void inline slurmdbd_free_job_start_msg(uint16_t rpc_version, 
404
443
                                        dbd_job_start_msg_t *msg);
405
 
void inline slurmdbd_free_job_start_rc_msg(uint16_t rpc_version, 
406
 
                                           dbd_job_start_rc_msg_t *msg);
 
444
void inline slurmdbd_free_id_rc_msg(uint16_t rpc_version, 
 
445
                                           dbd_id_rc_msg_t *msg);
407
446
void inline slurmdbd_free_job_suspend_msg(uint16_t rpc_version, 
408
447
                                          dbd_job_suspend_msg_t *msg);
409
448
void inline slurmdbd_free_list_msg(uint16_t rpc_version, 
436
475
void inline slurmdbd_pack_cluster_procs_msg(uint16_t rpc_version, 
437
476
                                            dbd_cluster_procs_msg_t *msg,
438
477
                                            Buf buffer);
 
478
void inline slurmdbd_pack_rec_msg(uint16_t rpc_version, 
 
479
                                  slurmdbd_msg_type_t type,
 
480
                                  dbd_rec_msg_t *msg, Buf buffer);
439
481
void inline slurmdbd_pack_cond_msg(uint16_t rpc_version, 
440
482
                                   slurmdbd_msg_type_t type,
441
483
                                   dbd_cond_msg_t *msg, Buf buffer);
452
494
void inline slurmdbd_pack_job_start_msg(uint16_t rpc_version, 
453
495
                                        dbd_job_start_msg_t *msg,
454
496
                                        Buf buffer);
455
 
void inline slurmdbd_pack_job_start_rc_msg(uint16_t rpc_version, 
456
 
                                           dbd_job_start_rc_msg_t *msg,
457
 
                                           Buf buffer);
 
497
void inline slurmdbd_pack_id_rc_msg(uint16_t rpc_version, 
 
498
                                    dbd_id_rc_msg_t *msg,
 
499
                                    Buf buffer);
458
500
void inline slurmdbd_pack_job_suspend_msg(uint16_t rpc_version, 
459
501
                                          dbd_job_suspend_msg_t *msg,
460
502
                                          Buf buffer);
493
535
int inline slurmdbd_unpack_cluster_procs_msg(uint16_t rpc_version, 
494
536
                                             dbd_cluster_procs_msg_t **msg,
495
537
                                             Buf buffer);
 
538
int inline slurmdbd_unpack_rec_msg(uint16_t rpc_version, 
 
539
                                   slurmdbd_msg_type_t type,
 
540
                                   dbd_rec_msg_t **msg, Buf buffer);
496
541
int inline slurmdbd_unpack_cond_msg(uint16_t rpc_version, 
497
542
                                    slurmdbd_msg_type_t type,
498
543
                                    dbd_cond_msg_t **msg, Buf buffer);
509
554
int inline slurmdbd_unpack_job_start_msg(uint16_t rpc_version, 
510
555
                                         dbd_job_start_msg_t **msg,
511
556
                                         Buf buffer);
512
 
int inline slurmdbd_unpack_job_start_rc_msg(uint16_t rpc_version, 
513
 
                                            dbd_job_start_rc_msg_t **msg,
514
 
                                            Buf buffer);
 
557
int inline slurmdbd_unpack_id_rc_msg(uint16_t rpc_version, 
 
558
                                     dbd_id_rc_msg_t **msg,
 
559
                                     Buf buffer);
515
560
int inline slurmdbd_unpack_job_suspend_msg(uint16_t rpc_version, 
516
561
                                           dbd_job_suspend_msg_t **msg,
517
562
                                           Buf buffer);