1
/*****************************************************************************\
2
* slurm_priority.h - Define priority plugin functions
3
*****************************************************************************
4
* Copyright (C) 2008 Lawrence Livermore National Security.
5
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
6
* Written by Danny Auble <da@llnl.gov>
7
* CODE-OCEC-09-009. All rights reserved.
9
* This file is part of SLURM, a resource management program.
10
* For details, see <https://computing.llnl.gov/linux/slurm/>.
11
* Please also read the included file: DISCLAIMER.
13
* SLURM is free software; you can redistribute it and/or modify it under
14
* the terms of the GNU General Public License as published by the Free
15
* Software Foundation; either version 2 of the License, or (at your option)
18
* In addition, as a special exception, the copyright holders give permission
19
* to link the code of portions of this program with the OpenSSL library under
20
* certain conditions as described in each individual source file, and
21
* distribute linked combinations including the two. You must obey the GNU
22
* General Public License in all respects for all of the code used other than
23
* OpenSSL. If you modify file(s) with this exception, you may extend this
24
* exception to your version of the file(s), but you are not obligated to do
25
* so. If you do not wish to do so, delete this exception statement from your
26
* version. If you delete this exception statement from all source files in
27
* the program, then also delete it here.
29
* SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
30
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
31
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
34
* You should have received a copy of the GNU General Public License along
35
* with SLURM; if not, write to the Free Software Foundation, Inc.,
36
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
37
\*****************************************************************************/
39
#ifndef _SLURM_PRIORITY_H
40
#define _SLURM_PRIORITY_H
46
# include <stdint.h> /* for uint16_t, uint32_t definitions */
49
# include <inttypes.h> /* for uint16_t, uint32_t definitions */
52
#include "src/slurmctld/slurmctld.h"
53
#include "src/common/slurm_accounting_storage.h"
55
extern int slurm_priority_init(void);
56
extern int slurm_priority_fini(void);
57
extern uint32_t priority_g_set(uint32_t last_prio, struct job_record *job_ptr);
58
extern void priority_g_reconfig();
60
* set up how much usage can happen on the cluster during a given half
61
* life. This can only be done after we get a correct proc count for
63
* IN: procs - number of proccessors on the system
64
* IN: half_life - time half_life is in seconds.
65
* RET: SLURM_SUCCESS on SUCCESS, SLURM_ERROR else.
67
extern int priority_g_set_max_cluster_usage(uint32_t procs, uint32_t half_life);
69
/* sets up the normalized usage and the effective usage of an
71
* IN/OUT: assoc - association to have usage set.
73
extern void priority_g_set_assoc_usage(acct_association_rec_t *assoc);
74
extern List priority_g_get_priority_factors_list(
75
priority_factors_request_msg_t *req_msg);
77
#endif /*_SLURM_PRIORIY_H */