Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-20 08:46:38

0001 /*****************************************************************************\
0002  *  slurmdb.h - Interface codes and functions for slurm
0003  ******************************************************************************
0004  *  Copyright (C) 2010 Lawrence Livermore National Security.
0005  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
0006  *  Written by Danny Auble da@llnl.gov, et. al.
0007  *  CODE-OCEC-09-009. All rights reserved.
0008  *
0009  *  This file is part of Slurm, a resource management program.
0010  *  For details, see <https://slurm.schedmd.com/>.
0011  *  Please also read the included file: DISCLAIMER.
0012  *
0013  *  Slurm is free software; you can redistribute it and/or modify it under
0014  *  the terms of the GNU General Public License as published by the Free
0015  *  Software Foundation; either version 2 of the License, or (at your option)
0016  *  any later version.
0017  *
0018  *  In addition, as a special exception, the copyright holders give permission
0019  *  to link the code of portions of this program with the OpenSSL library under
0020  *  certain conditions as described in each individual source file, and
0021  *  distribute linked combinations including the two. You must obey the GNU
0022  *  General Public License in all respects for all of the code used other than
0023  *  OpenSSL. If you modify file(s) with this exception, you may extend this
0024  *  exception to your version of the file(s), but you are not obligated to do
0025  *  so. If you do not wish to do so, delete this exception statement from your
0026  *  version.  If you delete this exception statement from all source files in
0027  *  the program, then also delete it here.
0028  *
0029  *  Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
0030  *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
0031  *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
0032  *  details.
0033  *
0034  *  You should have received a copy of the GNU General Public License along
0035  *  with Slurm; if not, write to the Free Software Foundation, Inc.,
0036  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
0037 \*****************************************************************************/
0038 #ifndef _SLURMDB_H
0039 #define _SLURMDB_H
0040 
0041 #ifdef __cplusplus
0042 extern "C" {
0043 #endif
0044 
0045 #include <slurm/slurm.h>
0046 
0047 typedef enum {
0048     SLURMDB_ADMIN_NOTSET,
0049     SLURMDB_ADMIN_NONE,
0050     SLURMDB_ADMIN_OPERATOR,
0051     SLURMDB_ADMIN_SUPER_USER
0052 } slurmdb_admin_level_t;
0053 
0054 typedef enum {
0055     SLURMDB_CLASS_NONE, /* no class given */
0056     SLURMDB_CLASS_CAPABILITY, /* capability cluster */
0057     SLURMDB_CLASS_CAPACITY, /* capacity cluster */
0058     SLURMDB_CLASS_CAPAPACITY, /* a cluster that is both capability
0059                    * and capacity */
0060 } slurmdb_classification_type_t;
0061 
0062 typedef enum {
0063     SLURMDB_EVENT_ALL,
0064     SLURMDB_EVENT_CLUSTER,
0065     SLURMDB_EVENT_NODE
0066 } slurmdb_event_type_t;
0067 
0068 typedef enum {
0069     SLURMDB_PROBLEM_NOT_SET,
0070     SLURMDB_PROBLEM_ACCT_NO_ASSOC,
0071     SLURMDB_PROBLEM_ACCT_NO_USERS,
0072     SLURMDB_PROBLEM_USER_NO_ASSOC,
0073     SLURMDB_PROBLEM_USER_NO_UID,
0074 } slurmdb_problem_type_t;
0075 
0076 typedef enum {
0077     SLURMDB_REPORT_SORT_TIME,
0078     SLURMDB_REPORT_SORT_NAME
0079 } slurmdb_report_sort_t;
0080 
0081 typedef enum {
0082     SLURMDB_REPORT_TIME_SECS,
0083     SLURMDB_REPORT_TIME_MINS,
0084     SLURMDB_REPORT_TIME_HOURS,
0085     SLURMDB_REPORT_TIME_PERCENT,
0086     SLURMDB_REPORT_TIME_SECS_PER,
0087     SLURMDB_REPORT_TIME_MINS_PER,
0088     SLURMDB_REPORT_TIME_HOURS_PER,
0089 } slurmdb_report_time_format_t;
0090 
0091 typedef enum {
0092     SLURMDB_RESOURCE_NOTSET,
0093     SLURMDB_RESOURCE_LICENSE
0094 } slurmdb_resource_type_t;
0095 
0096 typedef enum {
0097     SLURMDB_UPDATE_NOTSET,
0098     SLURMDB_ADD_USER,
0099     SLURMDB_ADD_ASSOC,
0100     SLURMDB_ADD_COORD,
0101     SLURMDB_MODIFY_USER,
0102     SLURMDB_MODIFY_ASSOC,
0103     SLURMDB_REMOVE_USER,
0104     SLURMDB_REMOVE_ASSOC,
0105     SLURMDB_REMOVE_COORD,
0106     SLURMDB_ADD_QOS,
0107     SLURMDB_REMOVE_QOS,
0108     SLURMDB_MODIFY_QOS,
0109     SLURMDB_ADD_WCKEY,
0110     SLURMDB_REMOVE_WCKEY,
0111     SLURMDB_MODIFY_WCKEY,
0112     SLURMDB_ADD_CLUSTER,
0113     SLURMDB_REMOVE_CLUSTER,
0114     SLURMDB_REMOVE_ASSOC_USAGE,
0115     SLURMDB_ADD_RES,
0116     SLURMDB_REMOVE_RES,
0117     SLURMDB_MODIFY_RES,
0118     SLURMDB_UPDATE_QOS_USAGE,
0119     SLURMDB_ADD_TRES,
0120     SLURMDB_UPDATE_FEDS,
0121 } slurmdb_update_type_t;
0122 
0123 /* Define QOS flags */
0124 #define QOS_FLAG_BASE                0x0fffffff
0125 #define QOS_FLAG_NOTSET              0x10000000
0126 #define QOS_FLAG_ADD                 0x20000000
0127 #define QOS_FLAG_REMOVE              0x40000000
0128 
0129 #define QOS_FLAG_PART_MIN_NODE       SLURM_BIT(0)
0130 #define QOS_FLAG_PART_MAX_NODE       SLURM_BIT(1)
0131 #define QOS_FLAG_PART_TIME_LIMIT     SLURM_BIT(2)
0132 #define QOS_FLAG_ENFORCE_USAGE_THRES SLURM_BIT(3)
0133 #define QOS_FLAG_NO_RESERVE          SLURM_BIT(4)
0134 #define QOS_FLAG_REQ_RESV            SLURM_BIT(5)
0135 #define QOS_FLAG_DENY_LIMIT          SLURM_BIT(6)
0136 #define QOS_FLAG_OVER_PART_QOS       SLURM_BIT(7)
0137 #define QOS_FLAG_NO_DECAY            SLURM_BIT(8)
0138 #define QOS_FLAG_USAGE_FACTOR_SAFE   SLURM_BIT(9)
0139 #define QOS_FLAG_RELATIVE            SLURM_BIT(10)
0140 #define QOS_FLAG_RELATIVE_SET        SLURM_BIT(11)
0141 #define QOS_FLAG_PART_QOS            SLURM_BIT(12)
0142 
0143 /* Define Server Resource flags */
0144 #define SLURMDB_RES_FLAG_BASE        0x0fffffff /* apply to get real flags */
0145 #define SLURMDB_RES_FLAG_NOTSET      0x10000000
0146 #define SLURMDB_RES_FLAG_ADD         0x20000000
0147 #define SLURMDB_RES_FLAG_REMOVE      0x40000000
0148 
0149 #define SLURMDB_RES_FLAG_ABSOLUTE    SLURM_BIT(0)
0150 
0151 /* Define Federation flags */
0152 #define FEDERATION_FLAG_BASE           0x0fffffff
0153 #define FEDERATION_FLAG_NOTSET         0x10000000
0154 #define FEDERATION_FLAG_ADD            0x20000000
0155 #define FEDERATION_FLAG_REMOVE         0x40000000
0156 
0157 /* SLURM CLUSTER FEDERATION STATES */
0158 enum cluster_fed_states {
0159     CLUSTER_FED_STATE_NA,
0160     CLUSTER_FED_STATE_ACTIVE,
0161     CLUSTER_FED_STATE_INACTIVE
0162 };
0163 #define CLUSTER_FED_STATE_BASE       0x000f
0164 #define CLUSTER_FED_STATE_FLAGS      0xfff0
0165 #define CLUSTER_FED_STATE_DRAIN      0x0010 /* drain cluster by not accepting
0166                            any new jobs and waiting for all
0167                            federated jobs to complete.*/
0168 #define CLUSTER_FED_STATE_REMOVE     0x0020 /* remove cluster from federation
0169                            once cluster is drained of
0170                            federated jobs */
0171 
0172 /* flags and types of resources */
0173 /* when we come up with some */
0174 
0175 /*
0176  * Translation of db_flags in job_record_t and flag
0177  * slurmdb_job_[rec|cond]_t
0178  */
0179 #define SLURMDB_JOB_FLAG_NONE     0x00000000 /* No flags */
0180 #define SLURMDB_JOB_CLEAR_SCHED   0x0000000f /* clear scheduling bits (0-3) */
0181 #define SLURMDB_JOB_FLAG_NOTSET   SLURM_BIT(0) /* Schedule bits not set */
0182 #define SLURMDB_JOB_FLAG_SUBMIT   SLURM_BIT(1) /* Job was started on submit */
0183 #define SLURMDB_JOB_FLAG_SCHED    SLURM_BIT(2) /* Job was started from main
0184                         * scheduler */
0185 #define SLURMDB_JOB_FLAG_BACKFILL SLURM_BIT(3) /* Job was started from
0186                         * backfill */
0187 #define SLURMDB_JOB_FLAG_START_R  SLURM_BIT(4) /* Job start rpc was received */
0188 
0189 /*
0190  * Slurm job condition flags
0191  * slurmdb_job_cond_t
0192  */
0193 #define JOBCOND_FLAG_DUP              SLURM_BIT(0) /* Report duplicate job
0194                             * entries */
0195 #define JOBCOND_FLAG_NO_STEP          SLURM_BIT(1) /* Don't report job step
0196                             * info */
0197 #define JOBCOND_FLAG_NO_TRUNC         SLURM_BIT(2) /* Report info. without
0198                             * truncating the time to the
0199                             * usage_start and
0200                             * usage_end */
0201 #define JOBCOND_FLAG_RUNAWAY          SLURM_BIT(3) /* Report runaway jobs onl */
0202 #define JOBCOND_FLAG_WHOLE_HETJOB     SLURM_BIT(4) /* Report info about all
0203                             * hetjob components */
0204 #define JOBCOND_FLAG_NO_WHOLE_HETJOB  SLURM_BIT(5) /* Only report info about
0205                             * requested hetjob
0206                             * components */
0207 #define JOBCOND_FLAG_NO_WAIT          SLURM_BIT(6) /* Tell dbd plugin not to
0208                             * wait around for result. */
0209 #define JOBCOND_FLAG_NO_DEFAULT_USAGE SLURM_BIT(7) /* Use usage_time as the
0210                             * submit_time of the job.
0211                             */
0212 #define JOBCOND_FLAG_SCRIPT           SLURM_BIT(8) /* Get batch script only */
0213 #define JOBCOND_FLAG_ENV              SLURM_BIT(9) /* Get job's env only */
0214 
0215 /* Archive / Purge time flags */
0216 #define SLURMDB_PURGE_BASE    0x0000ffff   /* Apply to get the number
0217                         * of units */
0218 #define SLURMDB_PURGE_FLAGS   0xffff0000   /* apply to get the flags */
0219 #define SLURMDB_PURGE_HOURS   0x00010000   /* Purge units are in hours */
0220 #define SLURMDB_PURGE_DAYS    0x00020000   /* Purge units are in days */
0221 #define SLURMDB_PURGE_MONTHS  0x00040000   /* Purge units are in months,
0222                         * the default */
0223 #define SLURMDB_PURGE_ARCHIVE 0x00080000   /* Archive before purge */
0224 
0225 /* Parent account should be used when calculating FairShare */
0226 #define SLURMDB_FS_USE_PARENT 0x7FFFFFFF
0227 
0228 #define SLURMDB_CLASSIFIED_FLAG 0x0100
0229 #define SLURMDB_CLASS_BASE      0x00ff
0230 
0231 /* Cluster flags */
0232 #define CLUSTER_FLAG_REGISTER SLURM_BIT(0) /* If the cluster is registering
0233                         * right now or not */
0234 #define CLUSTER_FLAG_A2     SLURM_BIT(1) /* UNUSED */
0235 #define CLUSTER_FLAG_A3     SLURM_BIT(2) /* UNUSED */
0236 #define CLUSTER_FLAG_A4     SLURM_BIT(3) /* UNUSED */
0237 #define CLUSTER_FLAG_A5     SLURM_BIT(4) /* UNUSED */
0238 #define CLUSTER_FLAG_A6     SLURM_BIT(5) /* UNUSED */
0239 #define CLUSTER_FLAG_A7     SLURM_BIT(6) /* UNUSED */
0240 #define CLUSTER_FLAG_MULTSD SLURM_BIT(7) /* This cluster is multiple slurmd */
0241 #define CLUSTER_FLAG_A9     SLURM_BIT(8) /* UNUSED */
0242 #define CLUSTER_FLAG_FE     SLURM_BIT(9) /* This cluster is a front end system*/
0243 #define CLUSTER_FLAG_CRAY   SLURM_BIT(10) /* This cluster is a Native cray */
0244 #define CLUSTER_FLAG_FED    SLURM_BIT(11) /* This cluster is in a federation. */
0245 #define CLUSTER_FLAG_EXT    SLURM_BIT(12) /* This cluster is external */
0246 
0247 /* Assoc flags */
0248 #define ASSOC_FLAG_DELETED  SLURM_BIT(0)
0249 #define ASSOC_FLAG_NO_UPDATE SLURM_BIT(1)
0250 
0251 /* Event condition flags */
0252 #define SLURMDB_EVENT_COND_OPEN SLURM_BIT(0) /* Return only open events */
0253 
0254 /* Flags for slurmdbd_conn->db_conn */
0255 #define DB_CONN_FLAG_CLUSTER_DEL SLURM_BIT(0)
0256 #define DB_CONN_FLAG_ROLLBACK SLURM_BIT(1)
0257 #define DB_CONN_FLAG_FEDUPDATE SLURM_BIT(2)
0258 
0259 /********************************************/
0260 
0261 /* Association conditions used for queries of the database */
0262 
0263 /* slurmdb_tres_rec_t is used in other structures below so this needs
0264  * to be declared before hand.
0265  */
0266 typedef struct {
0267     uint64_t alloc_secs; /* total amount of secs allocated if used in an
0268                 accounting_list */
0269     uint32_t rec_count;  /* number of records alloc_secs is, DON'T PACK */
0270     uint64_t count; /* Count of TRES on a given cluster, 0 if
0271              * listed generically. */
0272     uint32_t id;    /* Database ID for the TRES */
0273     char *name;     /* Name of TRES if type is generic like GRES
0274              * or License. Make include optional GRES type
0275              * (e.g. "gpu" or "gpu:tesla") */
0276     char *type;     /* Type of TRES (CPU, MEM, etc) */
0277 } slurmdb_tres_rec_t;
0278 
0279 /* slurmdb_assoc_cond_t is used in other structures below so
0280  * this needs to be declared first.
0281  */
0282 typedef struct {
0283     List acct_list;     /* list of char * */
0284     List cluster_list;  /* list of char * */
0285 
0286     List def_qos_id_list;   /* list of char * */
0287 
0288     List format_list;   /* list of char * */
0289     List id_list;       /* list of char */
0290 
0291     uint16_t only_defs;  /* only send back defaults */
0292 
0293     List parent_acct_list;  /* name of parent account */
0294     List partition_list;    /* list of char * */
0295 
0296     List qos_list; /* list of char * */
0297 
0298     time_t usage_end;
0299     time_t usage_start;
0300 
0301     List user_list;     /* list of char * */
0302 
0303     uint16_t with_usage;  /* fill in usage */
0304     uint16_t with_deleted; /* return deleted associations */
0305     uint16_t with_raw_qos; /* return a raw qos or delta_qos */
0306     uint16_t with_sub_accts; /* return sub acct information also */
0307     uint16_t without_parent_info; /* don't give me parent id/name */
0308     uint16_t without_parent_limits; /* don't give me limits from
0309                      * parents */
0310 } slurmdb_assoc_cond_t;
0311 
0312 /* slurmdb_job_cond_t is used by slurmdb_archive_cond_t so it needs to
0313  * be defined before hand.
0314  */
0315 typedef struct {
0316     List acct_list;     /* list of char * */
0317     List associd_list;  /* list of char */
0318     List cluster_list;  /* list of char * */
0319     List constraint_list;   /* list of char * */
0320     uint32_t cpus_max;      /* number of cpus high range */
0321     uint32_t cpus_min;      /* number of cpus low range */
0322     uint32_t db_flags;      /* flags sent from the slurmctld on the job */
0323     int32_t exitcode;       /* exit code of job */
0324     uint32_t flags;         /* Reporting flags*/
0325     List format_list;   /* list of char * */
0326     List groupid_list;  /* list of char * */
0327     List jobname_list;  /* list of char * */
0328     uint32_t nodes_max;     /* number of nodes high range */
0329     uint32_t nodes_min;     /* number of nodes low range */
0330     List partition_list;    /* list of char * */
0331     List qos_list;      /* list of char * */
0332     List reason_list;   /* list of char * */
0333     List resv_list;     /* list of char * */
0334     List resvid_list;   /* list of char * */
0335     List state_list;        /* list of char * */
0336     List step_list;         /* list of slurm_selected_step_t */
0337     uint32_t timelimit_max; /* max timelimit */
0338     uint32_t timelimit_min; /* min timelimit */
0339     time_t usage_end;
0340     time_t usage_start;
0341     char *used_nodes;       /* a ranged node string where jobs ran */
0342     List userid_list;   /* list of char * */
0343     List wckey_list;    /* list of char * */
0344 } slurmdb_job_cond_t;
0345 
0346 /* slurmdb_stats_t needs to be defined before slurmdb_job_rec_t and
0347  * slurmdb_step_rec_t.
0348  */
0349 typedef struct {
0350     double act_cpufreq; /* contains actual average cpu frequency */
0351     uint64_t consumed_energy; /* contains energy consumption in joules */
0352     char *tres_usage_in_ave; /* average amount of usage in data */
0353     char *tres_usage_in_max; /* contains max amount of usage in data */
0354     char *tres_usage_in_max_nodeid; /* contains node number max was on */
0355     char *tres_usage_in_max_taskid; /* contains task number max was on */
0356     char *tres_usage_in_min; /* contains min amount of usage in data */
0357     char *tres_usage_in_min_nodeid; /* contains node number min was on */
0358     char *tres_usage_in_min_taskid; /* contains task number min was on */
0359     char *tres_usage_in_tot; /* total amount of usage in data */
0360     char *tres_usage_out_ave; /* average amount of usage out data */
0361     char *tres_usage_out_max; /* contains amount of max usage out data */
0362     char *tres_usage_out_max_nodeid; /* contains node number max was on */
0363     char *tres_usage_out_max_taskid; /* contains task number max was on */
0364     char *tres_usage_out_min; /* contains amount of min usage out data */
0365     char *tres_usage_out_min_nodeid; /* contains node number min was on */
0366     char *tres_usage_out_min_taskid; /* contains task number min was on */
0367     char *tres_usage_out_tot; /* total amount of usage out data */
0368 } slurmdb_stats_t;
0369 
0370 /************** alphabetical order of structures **************/
0371 
0372 typedef struct {
0373     slurmdb_assoc_cond_t *assoc_cond;/* use acct_list here for
0374                           names */
0375     List description_list; /* list of char * */
0376     List organization_list; /* list of char * */
0377     uint16_t with_assocs;
0378     uint16_t with_coords;
0379     uint16_t with_deleted;
0380 } slurmdb_account_cond_t;
0381 
0382 enum {
0383     SLURMDB_ACCT_FLAG_NONE          = 0,
0384     SLURMDB_ACCT_FLAG_DELETED       = (1 << 0),
0385 };
0386 
0387 typedef struct {
0388     List assoc_list; /* list of slurmdb_assoc_rec_t *'s */
0389     List coordinators; /* list of slurmdb_coord_rec_t *'s */
0390     char *description;
0391     uint32_t flags; /* SLURMDB_ACCT_FLAG_* */
0392     char *name;
0393     char *organization;
0394 } slurmdb_account_rec_t;
0395 
0396 typedef struct {
0397     uint64_t alloc_secs; /* number of cpu seconds allocated */
0398     uint32_t id;    /* association/wckey ID     */
0399     time_t period_start; /* when this record was started */
0400     slurmdb_tres_rec_t tres_rec;
0401 } slurmdb_accounting_rec_t;
0402 
0403 typedef struct {
0404     char *archive_dir;     /* location to place archive file */
0405     char *archive_script;  /* script to run instead of default
0406                   actions */
0407     slurmdb_job_cond_t *job_cond; /* conditions for the jobs to archive */
0408     uint32_t purge_event; /* purge events older than this in
0409                    * months by default set the
0410                    * SLURMDB_PURGE_ARCHIVE bit for
0411                    * archiving */
0412     uint32_t purge_job; /* purge jobs older than this in months
0413                  * by default set the
0414                  * SLURMDB_PURGE_ARCHIVE bit for
0415                  * archiving */
0416     uint32_t purge_resv; /* purge reservations older than this in months
0417                   * by default set the
0418                   * SLURMDB_PURGE_ARCHIVE bit for
0419                   * archiving */
0420     uint32_t purge_step; /* purge steps older than this in months
0421                   * by default set the
0422                   * SLURMDB_PURGE_ARCHIVE bit for
0423                   * archiving */
0424     uint32_t purge_suspend; /* purge suspend data older than this
0425                  * in months by default set the
0426                  * SLURMDB_PURGE_ARCHIVE bit for
0427                  * archiving */
0428     uint32_t purge_txn; /* purge transaction data older than this
0429                  * in months by default set the
0430                  * SLURMDB_PURGE_ARCHIVE bit for
0431                  * archiving */
0432     uint32_t purge_usage; /* purge usage data older than this
0433                    * in months by default set the
0434                    * SLURMDB_PURGE_ARCHIVE bit for
0435                    * archiving */
0436 } slurmdb_archive_cond_t;
0437 
0438 typedef struct {
0439     char *archive_file;  /* archive file containing data that was
0440                 once flushed from the database */
0441     char *insert;     /* an sql statement to be ran containing the
0442                  insert of jobs since past */
0443 } slurmdb_archive_rec_t;
0444 
0445 typedef struct {
0446     uint64_t count;  /* Count of tres on a given cluster, 0 if
0447                 listed generically. */
0448     List format_list;/* list of char * */
0449     List id_list;    /* Database ID */
0450     List name_list;  /* Name of tres if type is generic like GRES
0451                 or License. */
0452     List type_list;  /* Type of tres (CPU, MEM, etc) */
0453     uint16_t with_deleted;
0454 } slurmdb_tres_cond_t;
0455 
0456 /* slurmdb_tres_rec_t is defined above alphabetical */
0457 
0458 /* slurmdb_assoc_cond_t is defined above alphabetical */
0459 
0460 /* This has slurmdb_assoc_rec_t's in it so we define the struct afterwards. */
0461 typedef struct slurmdb_assoc_usage slurmdb_assoc_usage_t;
0462 typedef struct slurmdb_bf_usage slurmdb_bf_usage_t;
0463 typedef struct slurmdb_user_rec slurmdb_user_rec_t;
0464 
0465 typedef struct slurmdb_assoc_rec {
0466     List accounting_list; /* list of slurmdb_accounting_rec_t *'s */
0467     char *acct;        /* account/project associated to
0468                     * assoc */
0469     struct slurmdb_assoc_rec *assoc_next; /* next assoc with
0470                                * same hash index
0471                                * based off the
0472                                * account/user
0473                                * DOESN'T GET PACKED */
0474     struct slurmdb_assoc_rec *assoc_next_id; /* next assoc with
0475                             * same hash index
0476                             * DOESN'T GET PACKED */
0477     slurmdb_bf_usage_t *bf_usage; /* data for backfill scheduler,
0478                        * (DON'T PACK) */
0479     char *cluster;         /* cluster associated to association */
0480 
0481     char *comment;         /* comment for the association */
0482 
0483     uint32_t def_qos_id;       /* Which QOS id is this
0484                     * associations default */
0485     uint16_t flags;            /* various flags see ASSOC_FLAG_* */
0486     uint32_t grp_jobs;     /* max number of jobs the
0487                     * underlying group of associations can run
0488                     * at one time */
0489     uint32_t grp_jobs_accrue;  /* max number of jobs the
0490                     * underlying group of associations can have
0491                     * accruing priority at one time */
0492     uint32_t grp_submit_jobs;  /* max number of jobs the
0493                     * underlying group of
0494                     * associations can submit at
0495                     * one time */
0496     char *grp_tres;            /* max number of cpus the
0497                     * underlying group of
0498                     * associations can allocate at one time */
0499     uint64_t *grp_tres_ctld;   /* grp_tres broken out in an array
0500                     * based off the ordering of the total
0501                     * number of TRES in the system
0502                     * (DON'T PACK) */
0503     char *grp_tres_mins;       /* max number of cpu minutes the
0504                     * underlying group of
0505                     * associations can run for */
0506     uint64_t *grp_tres_mins_ctld; /* grp_tres_mins broken out in an array
0507                        * based off the ordering of the total
0508                        * number of TRES in the system
0509                        * (DON'T PACK) */
0510     char *grp_tres_run_mins;   /* max number of cpu minutes the
0511                     * underlying group of
0512                     * assoiciations can
0513                     * having running at one time */
0514     uint64_t *grp_tres_run_mins_ctld; /* grp_tres_run_mins
0515                        * broken out in an array
0516                        * based off the ordering
0517                        * of the total number of TRES in
0518                        * the system
0519                        * (DON'T PACK) */
0520     uint32_t grp_wall;         /* total time in hours the
0521                     * underlying group of
0522                     * associations can run for */
0523 
0524     uint32_t id;           /* id identifing a combination of
0525                     * user-account(-partition) */
0526 
0527     uint16_t is_def;           /* Is this the users default assoc/acct */
0528 
0529     slurmdb_assoc_usage_t *leaf_usage; /* Points to usage for user assocs.
0530                         * Holds usage of deleted users in
0531                         * parent assocs (DON'T PACK) */
0532     uint32_t lft;          /* lft used for grouping sub
0533                     * associations and jobs as a left
0534                     * most container used with rgt */
0535     char *lineage;         /* Complete path up the hierarchy to the root
0536                     * association */
0537     uint32_t max_jobs;     /* max number of jobs this
0538                     * association can run at one time */
0539     uint32_t max_jobs_accrue;  /* max number of jobs this association can
0540                     * have accruing priority time.
0541                     */
0542     uint32_t max_submit_jobs;  /* max number of jobs that can be
0543                       submitted by association */
0544     char *max_tres_mins_pj;    /* max number of cpu minutes this
0545                     * association can have per job */
0546     uint64_t *max_tres_mins_ctld; /* max_tres_mins broken out in an array
0547                        * based off the ordering of the
0548                        * total number of TRES in the system
0549                        * (DON'T PACK) */
0550     char *max_tres_run_mins;   /* max number of cpu minutes this
0551                     * association can
0552                     * having running at one time */
0553     uint64_t *max_tres_run_mins_ctld; /* max_tres_run_mins
0554                        * broken out in an array
0555                        * based off the ordering
0556                        * of the total number of TRES in
0557                        * the system
0558                        * (DON'T PACK) */
0559     char *max_tres_pj;         /* max number of cpus this
0560                     * association can allocate per job */
0561     uint64_t *max_tres_ctld;   /* max_tres broken out in an array
0562                     * based off the ordering of the
0563                     * total number of TRES in the system
0564                     * (DON'T PACK) */
0565     char *max_tres_pn;         /* max number of TRES this
0566                     * association can allocate per node */
0567     uint64_t *max_tres_pn_ctld;   /* max_tres_pn broken out in an array
0568                        * based off the ordering of the
0569                        * total number of TRES in the system
0570                        * (DON'T PACK) */
0571     uint32_t max_wall_pj;      /* longest time this
0572                     * association can run a job */
0573 
0574     uint32_t min_prio_thresh;  /* Don't reserve resources for pending jobs
0575                     * unless they have a priority equal to or
0576                     * higher than this. */
0577     char *parent_acct;     /* name of parent account */
0578     uint32_t parent_id;    /* id of parent account */
0579     char *partition;       /* optional partition in a cluster
0580                     * associated to association */
0581     uint32_t priority;     /* association priority */
0582     List qos_list;             /* list of char * */
0583 
0584     uint32_t rgt;          /* rgt used for grouping sub
0585                     * associations and jobs as a right
0586                     * most container used with lft */
0587 
0588     uint32_t shares_raw;       /* number of shares allocated to
0589                     * association */
0590 
0591     uint32_t uid;          /* user ID */
0592     slurmdb_assoc_usage_t *usage;
0593     char *user;        /* user associated to assoc */
0594     slurmdb_user_rec_t *user_rec; /* Cache of user record
0595                        * soft ref - mem not managed here
0596                        * (DON'T PACK)
0597                        */
0598 } slurmdb_assoc_rec_t;
0599 
0600 typedef struct {
0601     list_t *acct_list;  /* list of char * */
0602     slurmdb_assoc_rec_t assoc; /* filled with limits for associations
0603                       to be added. */
0604     list_t *cluster_list; /* list of char * */
0605 
0606     char *default_acct; /* default account name (DON'T PACK) */
0607 
0608     list_t *partition_list; /* list of char * */
0609     list_t *user_list;  /* list of char * */
0610     list_t *wckey_list; /* list of char * */
0611 } slurmdb_add_assoc_cond_t;
0612 
0613 struct slurmdb_assoc_usage {
0614     uint32_t accrue_cnt;    /* Count of how many jobs I have accuring prio
0615                  * (DON'T PACK for state file) */
0616     List children_list;     /* list of children associations
0617                  * (DON'T PACK) */
0618     bitstr_t *grp_node_bitmap;  /* Bitmap of allocated nodes
0619                      * (DON'T PACK) */
0620     uint16_t *grp_node_job_cnt; /* Count of jobs allocated on each node
0621                      * (DON'T PACK) */
0622     uint64_t *grp_used_tres; /* array of active tres counts
0623                   * (DON'T PACK for state file) */
0624     uint64_t *grp_used_tres_run_secs; /* array of running tres secs
0625                        * (DON'T PACK for state file) */
0626 
0627     double grp_used_wall;   /* group count of time used in running jobs */
0628     double fs_factor;   /* Fairshare factor. Not used by all algorithms
0629                  * (DON'T PACK for state file) */
0630     uint32_t level_shares;  /* number of shares on this level of
0631                  * the tree (DON'T PACK for state file) */
0632 
0633     slurmdb_assoc_rec_t *parent_assoc_ptr; /* ptr to direct
0634                         * parent assoc
0635                         * set in slurmctld
0636                         * (DON'T PACK) */
0637 
0638     double priority_norm;   /* normalized priority (DON'T PACK for
0639                  * state file) */
0640 
0641     slurmdb_assoc_rec_t *fs_assoc_ptr;    /* ptr to fairshare parent
0642                            * assoc if fairshare
0643                            * == SLURMDB_FS_USE_PARENT
0644                            * set in slurmctld
0645                            * (DON'T PACK) */
0646 
0647     double shares_norm;     /* normalized shares
0648                  * (DON'T PACK for state file) */
0649 
0650     uint32_t tres_cnt; /* size of the tres arrays,
0651                 * (DON'T PACK for state file) */
0652     long double usage_efctv;/* effective, normalized usage
0653                  * (DON'T PACK for state file) */
0654     long double usage_norm; /* normalized usage
0655                  * (DON'T PACK for state file) */
0656     long double usage_raw;  /* measure of TRESBillableUnits usage */
0657 
0658     long double *usage_tres_raw; /* measure of each TRES usage */
0659     uint32_t used_jobs; /* count of active jobs
0660                  * (DON'T PACK for state file) */
0661     uint32_t used_submit_jobs; /* count of jobs pending or running
0662                     * (DON'T PACK for state file) */
0663 
0664     /* Currently FAIR_TREE systems are defining data on
0665      * this struct but instead we could keep a void pointer to system
0666      * specific data. This would allow subsystems to define whatever data
0667      * they need without having to modify this struct; it would also save
0668      * space.
0669      */
0670     long double level_fs;   /* (FAIR_TREE) Result of fairshare equation
0671                  * compared to the association's siblings
0672                  * (DON'T PACK for state file) */
0673 
0674     bitstr_t *valid_qos;    /* qos available for this association
0675                  * derived from the qos_list.
0676                  * (DON'T PACK for state file) */
0677 };
0678 
0679 struct slurmdb_bf_usage {
0680     uint64_t count;
0681     time_t last_sched;
0682 };
0683 
0684 typedef struct {
0685     uint16_t classification; /* how this machine is classified */
0686     List cluster_list; /* list of char * */
0687     List federation_list; /* list of char */
0688     uint32_t flags;
0689     List format_list;   /* list of char * */
0690     List rpc_version_list; /* list of char * */
0691     time_t usage_end;
0692     time_t usage_start;
0693     uint16_t with_deleted;
0694     uint16_t with_usage;
0695 } slurmdb_cluster_cond_t;
0696 
0697 typedef struct {
0698     List feature_list; /* list of cluster features */
0699     uint32_t id; /* id of cluster in federation */
0700     char *name; /* Federation name */
0701     void *recv;  /* slurm_persist_conn_t we recv information about this
0702               * sibling on. (We get this information) */
0703     void *send; /* slurm_persist_conn_t we send information to this
0704              * cluster on. (We set this information) */
0705     uint32_t state; /* state of cluster in federation */
0706     bool sync_recvd; /* true sync jobs from sib has been processed. */
0707     bool sync_sent;  /* true after sib sent sync jobs to sibling */
0708 } slurmdb_cluster_fed_t;
0709 
0710 struct slurmdb_cluster_rec {
0711     List accounting_list; /* list of slurmdb_cluster_accounting_rec_t *'s */
0712     uint16_t classification; /* how this machine is classified */
0713     time_t comm_fail_time;  /* avoid constant error messages. For
0714                      * convenience only. DOESN'T GET PACKED */
0715     slurm_addr_t control_addr; /* For convenience only.
0716                     * DOESN'T GET PACKED */
0717     char *control_host;
0718     uint32_t control_port;
0719     uint16_t dimensions; /* number of dimensions this cluster is */
0720     int *dim_size; /* For convenience only.
0721             * Size of each dimension For now only on
0722             * a bluegene cluster.  DOESN'T GET
0723             * PACKED, is set up in slurmdb_get_info_cluster */
0724     slurmdb_cluster_fed_t fed; /* Federation information */
0725     uint32_t flags;      /* set of CLUSTER_FLAG_* */
0726     pthread_mutex_t lock; /* For convenience only. DOESN"T GET PACKED */
0727     char *name;
0728     char *nodes;
0729     uint32_t plugin_id_select; /* Remove 2 versions after 23.02 */
0730     slurmdb_assoc_rec_t *root_assoc; /* root assoc for
0731                         * cluster */
0732     uint16_t rpc_version; /* rpc version this cluster is running */
0733     List send_rpc;        /* For convenience only. DOESN'T GET PACKED */
0734     char    *tres_str;    /* comma separated list of TRES */
0735 };
0736 
0737 #ifndef __slurmdb_cluster_rec_t_defined
0738 #  define __slurmdb_cluster_rec_t_defined
0739 typedef struct slurmdb_cluster_rec slurmdb_cluster_rec_t;
0740 #endif
0741 
0742 typedef struct {
0743     uint64_t alloc_secs; /* number of cpu seconds allocated */
0744     uint64_t down_secs; /* number of cpu seconds down */
0745     uint64_t idle_secs; /* number of cpu seconds idle */
0746     uint64_t over_secs; /* number of cpu seconds overcommitted */
0747     uint64_t pdown_secs; /* number of cpu seconds planned down */
0748     time_t period_start; /* when this record was started */
0749     uint64_t plan_secs; /* number of cpu seconds planned */
0750     slurmdb_tres_rec_t tres_rec;
0751 } slurmdb_cluster_accounting_rec_t;
0752 
0753 typedef struct {
0754     char *cluster; /* name of cluster */
0755     uint32_t allowed; /* percentage/count of total resources
0756                * allowed for this cluster */
0757 } slurmdb_clus_res_rec_t;
0758 
0759 typedef struct {
0760     char *name;
0761     uint16_t direct;
0762 } slurmdb_coord_rec_t;
0763 
0764 typedef struct {
0765     List cluster_list;  /* list of char * */
0766     uint32_t cond_flags;    /* condition flags */
0767     uint32_t cpus_max;      /* number of cpus high range */
0768     uint32_t cpus_min;      /* number of cpus low range */
0769     uint16_t event_type;    /* type of events (slurmdb_event_type_t),
0770                  * default is all */
0771     List format_list;   /* list of char * */
0772     char *node_list;        /* node list string */
0773     time_t period_end;      /* period end of events */
0774     time_t period_start;    /* period start of events */
0775     List reason_list;       /* list of char * */
0776     List reason_uid_list;   /* list of char * */
0777     List state_list;        /* list of char * */
0778 } slurmdb_event_cond_t;
0779 
0780 typedef struct {
0781     char *cluster;          /* Name of associated cluster */
0782     char *cluster_nodes;    /* node list in cluster during time
0783                  * period (only set in a cluster event) */
0784     uint16_t event_type;    /* type of event (slurmdb_event_type_t) */
0785     char *node_name;        /* Name of node (only set in a node event) */
0786     time_t period_end;      /* End of period */
0787     time_t period_start;    /* Start of period */
0788     char *reason;           /* reason node is in state during time
0789                    period (only set in a node event) */
0790     uint32_t reason_uid;    /* uid of that who set the reason */
0791     uint32_t state;         /* State of node during time
0792                    period (only set in a node event) */
0793     char *tres_str;         /* TRES touched by this event */
0794 } slurmdb_event_rec_t;
0795 
0796 typedef struct {
0797     List cluster_list;  /* list of char * */
0798     List federation_list;   /* list of char * */
0799     List format_list;   /* list of char * */
0800     uint16_t with_deleted;
0801 } slurmdb_federation_cond_t;
0802 
0803 typedef struct {
0804     char     *name;     /* Name of federation */
0805     uint32_t  flags;    /* flags to control scheduling on controller */
0806     List      cluster_list; /* List of slurmdb_cluster_rec_t *'s */
0807 } slurmdb_federation_rec_t;
0808 
0809 typedef struct {
0810     List cluster_list; /* list of char * */
0811     List extra_list; /* list of char * */
0812     List format_list; /* list of char * */
0813     List instance_id_list; /* list of char * */
0814     List instance_type_list; /* list of char * */
0815     char *node_list; /* node list string */
0816     time_t time_end; /* time end of instances */
0817     time_t time_start; /* time start of instances */
0818 } slurmdb_instance_cond_t;
0819 
0820 typedef struct {
0821     char *cluster; /* name of associated cluster */
0822     char *extra; /* name of instance_id */
0823     char *instance_id; /* name of instance_id */
0824     char *instance_type; /* name of instance_id */
0825     char *node_name; /* name of node */
0826     time_t time_end; /* time end of instance */
0827     time_t time_start; /* time start of instance */
0828 } slurmdb_instance_rec_t;
0829 
0830 /* slurmdb_job_cond_t is defined above alphabetical */
0831 
0832 typedef struct {
0833     char    *account;
0834     char    *admin_comment;
0835     uint32_t alloc_nodes;
0836     uint32_t array_job_id;  /* job_id of a job array or 0 if N/A */
0837     uint32_t array_max_tasks; /* How many tasks of the array can be
0838                      running at one time.
0839                   */
0840     uint32_t array_task_id; /* task_id of a job array of NO_VAL
0841                  * if N/A */
0842     char    *array_task_str; /* If pending these are the array
0843                     tasks this record represents.
0844                  */
0845     uint32_t associd;
0846     char    *blockid;
0847     char    *cluster;
0848     char    *constraints;
0849     char *container; /* OCI Container Bundle path */
0850     uint64_t db_index; /* index in the table */
0851     uint32_t derived_ec;
0852     char    *derived_es; /* aka "comment" */
0853     uint32_t elapsed;
0854     time_t eligible;
0855     time_t end;
0856     char *env;
0857     uint32_t exitcode;
0858     char *extra; /* Extra - arbitrary string */
0859     char *failed_node;
0860     uint32_t flags;
0861     void *first_step_ptr;
0862     uint32_t gid;
0863     uint32_t het_job_id;
0864     uint32_t het_job_offset;
0865     uint32_t jobid;
0866     char    *jobname;
0867     uint32_t lft;
0868     char *lineage;         /* Complete path up the hierarchy to the root
0869                     * association */
0870     char *licenses;
0871     char    *mcs_label;
0872     char    *nodes;
0873     char    *partition;
0874     uint32_t priority;
0875     uint32_t qosid;
0876     uint32_t req_cpus;
0877     uint64_t req_mem;
0878     uint32_t requid;
0879     uint32_t resvid;
0880     char *resv_name;
0881     char *script;
0882     uint32_t show_full;
0883     time_t start;
0884     uint32_t state;
0885     uint32_t state_reason_prev;
0886     List    steps; /* list of slurmdb_step_rec_t *'s */
0887     time_t submit;
0888     char *submit_line;
0889     uint32_t suspended;
0890     char    *system_comment;
0891     uint64_t sys_cpu_sec;
0892     uint64_t sys_cpu_usec;
0893     uint32_t timelimit;
0894     uint64_t tot_cpu_sec;
0895     uint64_t tot_cpu_usec;
0896     char *tres_alloc_str;
0897     char *tres_req_str;
0898     uint32_t uid;
0899     char    *used_gres;
0900     char    *user;
0901     uint64_t user_cpu_sec;
0902     uint64_t user_cpu_usec;
0903     char    *wckey;
0904     uint32_t wckeyid;
0905     char    *work_dir;
0906 } slurmdb_job_rec_t;
0907 
0908 typedef struct {
0909     uint32_t accrue_cnt;    /* Count of how many jobs I have accuring prio
0910                  * (DON'T PACK for state file) */
0911     List acct_limit_list; /* slurmdb_used_limits_t's (DON'T PACK
0912                    * for state file) */
0913     List job_list; /* list of job pointers to submitted/running
0914               jobs (DON'T PACK) */
0915     bitstr_t *grp_node_bitmap;  /* Bitmap of allocated nodes
0916                      * (DON'T PACK) */
0917     uint16_t *grp_node_job_cnt; /* Count of jobs allocated on each node
0918                      * (DON'T PACK) */
0919     uint32_t grp_used_jobs; /* count of active jobs (DON'T PACK
0920                  * for state file) */
0921     uint32_t grp_used_submit_jobs; /* count of jobs pending or running
0922                     * (DON'T PACK for state file) */
0923     uint64_t *grp_used_tres; /* count of tres in use in this qos
0924                  * (DON'T PACK for state file) */
0925     uint64_t *grp_used_tres_run_secs; /* count of running tres secs
0926                      * (DON'T PACK for state file) */
0927     double grp_used_wall;   /* group count of time (minutes) used in
0928                  * running jobs */
0929     double norm_priority;/* normalized priority (DON'T PACK for
0930                   * state file) */
0931     uint32_t tres_cnt; /* size of the tres arrays,
0932                 * (DON'T PACK for state file) */
0933     long double usage_raw;  /* measure of resource usage */
0934 
0935     long double *usage_tres_raw; /* measure of each TRES usage */
0936     List user_limit_list; /* slurmdb_used_limits_t's (DON'T PACK
0937                    * for state file) */
0938 } slurmdb_qos_usage_t;
0939 
0940 typedef struct {
0941     char *description;
0942     uint32_t id;
0943     uint32_t flags; /* flags for various things to enforce or
0944                override other limits */
0945     uint32_t grace_time; /* preemption grace time */
0946     uint32_t grp_jobs_accrue; /* max number of jobs this qos can
0947                    * have accruing priority time
0948                    */
0949     uint32_t grp_jobs;  /* max number of jobs this qos can run
0950                  * at one time */
0951     uint32_t grp_submit_jobs; /* max number of jobs this qos can submit at
0952                    * one time */
0953     char *grp_tres;            /* max number of tres this qos can
0954                     * allocate at one time */
0955     uint64_t *grp_tres_ctld;   /* grp_tres broken out in an array
0956                     * based off the ordering of the total
0957                     * number of TRES in the system
0958                     * (DON'T PACK) */
0959     char *grp_tres_mins;       /* max number of tres minutes this
0960                     * qos can run for */
0961     uint64_t *grp_tres_mins_ctld; /* grp_tres_mins broken out in an array
0962                        * based off the ordering of the total
0963                        * number of TRES in the system
0964                        * (DON'T PACK) */
0965     char *grp_tres_run_mins;   /* max number of tres minutes this
0966                     * qos can have running at one time */
0967     uint64_t *grp_tres_run_mins_ctld; /* grp_tres_run_mins
0968                        * broken out in an array
0969                        * based off the ordering
0970                        * of the total number of TRES in
0971                        * the system
0972                        * (DON'T PACK) */
0973     uint32_t grp_wall; /* total time in hours this qos can run for */
0974 
0975     double limit_factor; /* factor to apply to tres_cnt for associations
0976                   * using this qos */
0977     uint32_t max_jobs_pa;   /* max number of jobs an account can
0978                  * run with this qos at one time */
0979     uint32_t max_jobs_pu;   /* max number of jobs a user can
0980                  * run with this qos at one time */
0981     uint32_t max_jobs_accrue_pa; /* max number of jobs an account can
0982                       * have accruing priority time
0983                       */
0984     uint32_t max_jobs_accrue_pu; /* max number of jobs a user can
0985                       * have accruing priority time
0986                       */
0987     uint32_t max_submit_jobs_pa; /* max number of jobs an account can
0988                     submit with this qos at once */
0989     uint32_t max_submit_jobs_pu; /* max number of jobs a user can
0990                     submit with this qos at once */
0991     char *max_tres_mins_pj;    /* max number of tres minutes this
0992                     * qos can have per job */
0993     uint64_t *max_tres_mins_pj_ctld; /* max_tres_mins broken out in an array
0994                       * based off the ordering of the
0995                       * total number of TRES in the system
0996                       * (DON'T PACK) */
0997     char *max_tres_pa;         /* max number of tres this
0998                     * QOS can allocate per account */
0999     uint64_t *max_tres_pa_ctld;   /* max_tres_pa broken out in an array
1000                        * based off the ordering of the
1001                        * total number of TRES in the system
1002                        * (DON'T PACK) */
1003     char *max_tres_pj;         /* max number of tres this
1004                     * qos can allocate per job */
1005     uint64_t *max_tres_pj_ctld;   /* max_tres_pj broken out in an array
1006                        * based off the ordering of the
1007                        * total number of TRES in the system
1008                        * (DON'T PACK) */
1009     char *max_tres_pn;         /* max number of tres this
1010                     * qos can allocate per job */
1011     uint64_t *max_tres_pn_ctld;   /* max_tres_pj broken out in an array
1012                        * based off the ordering of the
1013                        * total number of TRES in the system
1014                        * (DON'T PACK) */
1015     char *max_tres_pu;         /* max number of tres this
1016                     * QOS can allocate per user */
1017     uint64_t *max_tres_pu_ctld;   /* max_tres broken out in an array
1018                        * based off the ordering of the
1019                        * total number of TRES in the system
1020                        * (DON'T PACK) */
1021     char *max_tres_run_mins_pa;   /* max number of tres minutes this
1022                        * qos can having running at one
1023                        * time per account, currently
1024                        * this doesn't do anything.
1025                        */
1026     uint64_t *max_tres_run_mins_pa_ctld; /* max_tres_run_mins_pa
1027                           * broken out in an array
1028                           * based off the ordering
1029                           * of the total number of TRES in
1030                           * the system, currently
1031                           * this doesn't do anything.
1032                           * (DON'T PACK) */
1033     char *max_tres_run_mins_pu;   /* max number of tres minutes this
1034                        * qos can having running at one
1035                        * time, currently this doesn't
1036                        * do anything.
1037                        */
1038     uint64_t *max_tres_run_mins_pu_ctld; /* max_tres_run_mins_pu
1039                           * broken out in an array
1040                           * based off the ordering
1041                           * of the total number of TRES in
1042                           * the system, currently
1043                           * this doesn't do anything.
1044                           * (DON'T PACK) */
1045     uint32_t max_wall_pj; /* longest time this
1046                    * qos can run a job */
1047     uint32_t min_prio_thresh;  /* Don't reserve resources for pending jobs
1048                     * unless they have a priority equal to or
1049                     * higher than this. */
1050     char *min_tres_pj; /* min number of tres a job can
1051                 * allocate with this qos */
1052     uint64_t *min_tres_pj_ctld;   /* min_tres_pj broken out in an array
1053                        * based off the ordering of the
1054                        * total number of TRES in the system
1055                        * (DON'T PACK) */
1056 
1057     char *name;
1058     bitstr_t *preempt_bitstr; /* other qos' this qos can preempt */
1059     List preempt_list; /* list of char *'s only used to add or
1060                 * change the other qos' this can preempt,
1061                 * when doing a get use the preempt_bitstr */
1062     uint16_t preempt_mode;  /* See PREEMPT_MODE_* in slurm/slurm.h */
1063     uint32_t preempt_exempt_time; /* Job run time before becoming
1064                      eligible for preemption */
1065     uint32_t priority;  /* ranged int needs to be a unint for
1066                  * heterogeneous systems */
1067     uint64_t *relative_tres_cnt; /* Only here for convenience DON'T PACK */
1068     slurmdb_qos_usage_t *usage; /* For internal use only, DON'T PACK */
1069     double usage_factor; /* factor to apply to usage in this qos */
1070     double usage_thres; /* percent of effective usage of an
1071                    association when breached will deny
1072                    pending and new jobs */
1073     time_t blocked_until; /* internal use only, DON'T PACK  */
1074 } slurmdb_qos_rec_t;
1075 
1076 typedef struct {
1077     List description_list; /* list of char * */
1078     List id_list; /* list of char * */
1079     List format_list;/* list of char * */
1080     List name_list; /* list of char * */
1081     uint16_t preempt_mode;  /* See PREEMPT_MODE_* in slurm/slurm.h */
1082     uint16_t with_deleted;
1083 } slurmdb_qos_cond_t;
1084 
1085 typedef struct {
1086     List cluster_list; /* cluster reservations are on list of
1087                 * char * */
1088     uint64_t flags; /* flags for reservation. */
1089     List format_list;/* list of char * */
1090     List id_list;   /* ids of reservations. list of char * */
1091     List name_list; /* name of reservations. list of char * */
1092     char *nodes; /* list of nodes in reservation */
1093     time_t time_end; /* end time of reservation */
1094     time_t time_start; /* start time of reservation */
1095     uint16_t with_usage; /* send usage for reservation */
1096 } slurmdb_reservation_cond_t;
1097 
1098 typedef struct {
1099     char *assocs; /* comma separated list of associations */
1100     char *cluster; /* cluster reservation is for */
1101     char *comment; /* arbitrary comment assigned to reservation */
1102     uint64_t flags; /* flags for reservation. */
1103     uint32_t id;   /* id of reservation. */
1104     char *name; /* name of reservation */
1105     char *nodes; /* list of nodes in reservation */
1106     char *node_inx; /* node index of nodes in reservation */
1107     time_t time_end; /* end time of reservation */
1108     time_t time_start; /* start time of reservation */
1109     time_t time_start_prev; /* If start time was changed this is
1110                  * the pervious start time.  Needed
1111                  * for accounting */
1112     char *tres_str;
1113     double unused_wall; /* amount of seconds this reservation wasn't used */
1114     List tres_list; /* list of slurmdb_tres_rec_t, only set when
1115              * job usage is requested.
1116              */
1117 } slurmdb_reservation_rec_t;
1118 
1119 typedef struct {
1120     char *container;
1121     uint32_t elapsed;
1122     time_t end;
1123     int32_t exitcode;
1124     slurmdb_job_rec_t *job_ptr;
1125     uint32_t nnodes;
1126     char *nodes;
1127     uint32_t ntasks;
1128     char *pid_str;
1129     uint32_t req_cpufreq_min;
1130     uint32_t req_cpufreq_max;
1131     uint32_t req_cpufreq_gov;
1132     uint32_t requid;
1133     time_t start;
1134     uint32_t state;
1135     slurmdb_stats_t stats;
1136     slurm_step_id_t step_id;    /* job's step number */
1137     char *stepname;
1138     char *submit_line;
1139     uint32_t suspended;
1140     uint64_t sys_cpu_sec;
1141     uint32_t sys_cpu_usec;
1142     uint32_t task_dist;
1143     uint64_t tot_cpu_sec;
1144     uint32_t tot_cpu_usec;
1145     char *tres_alloc_str;
1146     uint64_t user_cpu_sec;
1147     uint32_t user_cpu_usec;
1148 } slurmdb_step_rec_t;
1149 
1150 /* slurmdb_stats_t defined above alphabetical */
1151 
1152 typedef struct {
1153     list_t *allowed_list; /* list of char * */
1154     List cluster_list; /* list of char * */
1155     List description_list; /* list of char * */
1156     uint32_t flags;
1157     List format_list;/* list of char * */
1158     List id_list; /* list of char * */
1159     List manager_list; /* list of char * */
1160     List name_list; /* list of char * */
1161     List server_list; /* list of char * */
1162     List type_list; /* list of char * */
1163     uint16_t with_deleted;
1164     uint16_t with_clusters;
1165 } slurmdb_res_cond_t;
1166 
1167 typedef struct {
1168     uint32_t allocated; /* count allocated to the clus_res_list */
1169     uint32_t last_consumed; /* number from the server saying how many it
1170                  * currently has consumed */
1171     List clus_res_list; /* list of slurmdb_clus_res_rec_t *'s */
1172     slurmdb_clus_res_rec_t *clus_res_rec; /* if only one cluster
1173                          being represented */
1174     uint32_t count; /* count of resources managed on the server */
1175     char *description;
1176     uint32_t flags; /* resource attribute flags */
1177     uint32_t id;
1178     time_t last_update;
1179     char *manager;  /* resource manager name */
1180     char *name;
1181     char *server;  /* resource server name */
1182     uint32_t type; /* resource type */
1183 } slurmdb_res_rec_t;
1184 
1185 typedef struct {
1186     List acct_list; /* list of char * */
1187     List action_list; /* list of char * */
1188     List actor_list; /* list of char * */
1189     List cluster_list; /* list of char * */
1190     List format_list;/* list of char * */
1191     List id_list; /* list of char * */
1192     List info_list; /* list of char * */
1193     List name_list; /* list of char * */
1194     time_t time_end;
1195     time_t time_start;
1196     List user_list; /* list of char * */
1197     uint16_t with_assoc_info;
1198 } slurmdb_txn_cond_t;
1199 
1200 typedef struct {
1201     char *accts;
1202     uint16_t action;
1203     char *actor_name;
1204     char *clusters;
1205     uint32_t id;
1206     char *set_info;
1207     time_t timestamp;
1208     char *users;
1209     char *where_query;
1210 } slurmdb_txn_rec_t;
1211 
1212 /* Right now this is used in the slurmdb_qos_rec_t structure.  In the
1213  * user_limit_list and acct_limit_list. */
1214 typedef struct {
1215     uint32_t accrue_cnt; /* count of jobs accruing prio */
1216     char *acct; /* If limits for an account this is the accounts name */
1217     uint32_t jobs;  /* count of active jobs */
1218     uint32_t submit_jobs; /* count of jobs pending or running */
1219     uint64_t *tres; /* array of TRES allocated */
1220     uint64_t *tres_run_mins; /* array of how many TRES mins are
1221                   * allocated currently, currently this doesn't
1222                   * do anything and isn't set up. */
1223     bitstr_t *node_bitmap;  /* Bitmap of allocated nodes */
1224     uint16_t *node_job_cnt; /* Count of jobs allocated on each node */
1225     uint32_t uid; /* If limits for a user this is the users uid */
1226 } slurmdb_used_limits_t;
1227 
1228 typedef struct {
1229     uint16_t admin_level; /* really slurmdb_admin_level_t but for
1230                  packing purposes needs to be uint16_t */
1231     slurmdb_assoc_cond_t *assoc_cond; /* use user_list here for
1232                            names and acct_list for
1233                            default accounts */
1234     List def_acct_list; /* list of char * (We can't really use
1235                  * the assoc_cond->acct_list for this
1236                  * because then it is impossible for us
1237                  * to tell which accounts are defaults
1238                  * and which ones aren't, especially when
1239                  * dealing with other versions.)*/
1240     List def_wckey_list; /* list of char * */
1241     uint16_t with_assocs;
1242     uint16_t with_coords;
1243     uint16_t with_deleted;
1244     uint16_t with_wckeys;
1245     uint16_t without_defaults;
1246 } slurmdb_user_cond_t;
1247 
1248 enum {
1249     SLURMDB_USER_FLAG_NONE      = 0,
1250     SLURMDB_USER_FLAG_DELETED   = (1 << 0),
1251 };
1252 
1253 struct slurmdb_user_rec {
1254     uint16_t admin_level; /* really slurmdb_admin_level_t but for
1255                  packing purposes needs to be uint16_t */
1256     List assoc_list; /* list of slurmdb_assoc_rec_t *'s */
1257     slurmdb_bf_usage_t *bf_usage; /* data for backfill scheduler,
1258                        * (DON'T PACK) */
1259     List coord_accts; /* list of slurmdb_coord_rec_t *'s */
1260     char *default_acct;
1261     char *default_wckey;
1262     uint32_t flags;     /* SLURMDB_USER_FLAG_* */
1263     char *name;
1264     char *old_name;
1265     uint32_t uid;
1266     List wckey_list; /* list of slurmdb_wckey_rec_t *'s */
1267 };
1268 
1269 typedef struct {
1270     List objects; /* depending on type */
1271     uint16_t type; /* really slurmdb_update_type_t but for
1272             * packing purposes needs to be a
1273             * uint16_t */
1274 } slurmdb_update_object_t;
1275 
1276 typedef struct {
1277     List cluster_list;  /* list of char * */
1278     List format_list;   /* list of char * */
1279     List id_list;       /* list of char * */
1280 
1281     List name_list;         /* list of char * */
1282 
1283     uint16_t only_defs;     /* only give me the defaults */
1284 
1285     time_t usage_end;
1286     time_t usage_start;
1287 
1288     List user_list;     /* list of char * */
1289 
1290     uint16_t with_usage;    /* fill in usage */
1291     uint16_t with_deleted;  /* return deleted associations */
1292 } slurmdb_wckey_cond_t;
1293 
1294 enum {
1295     SLURMDB_WCKEY_FLAG_NONE          = 0,
1296     SLURMDB_WCKEY_FLAG_DELETED       = (1 << 0),
1297 };
1298 
1299 typedef struct {
1300     List accounting_list; /* list of slurmdb_accounting_rec_t *'s */
1301     char *cluster;      /* cluster associated */
1302     uint32_t flags;     /* SLURMDB_WCKEY_FLAG_* */
1303     uint32_t id;        /* id identifing a combination of
1304                  * user-wckey-cluster */
1305     uint16_t is_def;        /* Is this the users default wckey */
1306 
1307     char *name;     /* wckey name */
1308     uint32_t uid;       /* user ID */
1309 
1310     char *user;     /* user associated */
1311 } slurmdb_wckey_rec_t;
1312 
1313 typedef struct {
1314     char *name;
1315     char *print_name;
1316     char *spaces;
1317     uint16_t user; /* set to 1 if it is a user i.e. if name[0] is
1318             * '|' */
1319 } slurmdb_print_tree_t;
1320 
1321 typedef struct {
1322     slurmdb_assoc_rec_t *assoc;
1323     char *key;
1324     char *sort_name;
1325     List children;
1326 } slurmdb_hierarchical_rec_t;
1327 
1328 /************** report specific structures **************/
1329 
1330 typedef struct {
1331     char *acct;
1332     char *cluster;
1333     char *parent_acct;
1334     List tres_list; /* list of slurmdb_tres_rec_t *'s */
1335     char *user;
1336 } slurmdb_report_assoc_rec_t;
1337 
1338 typedef struct {
1339     char *acct;
1340     List acct_list; /* list of char *'s */
1341     List assoc_list; /* list of slurmdb_report_assoc_rec_t's */
1342     char *name;
1343     List tres_list; /* list of slurmdb_tres_rec_t *'s */
1344     uid_t uid;
1345 } slurmdb_report_user_rec_t;
1346 
1347 typedef struct {
1348     List accounting_list; /* list of slurmdb_accounting_rec_t *'s */
1349     List assoc_list; /* list of slurmdb_report_assoc_rec_t *'s */
1350     char *name;
1351     List tres_list; /* list of slurmdb_tres_rec_t *'s */
1352     List user_list; /* list of slurmdb_report_user_rec_t *'s */
1353 } slurmdb_report_cluster_rec_t;
1354 
1355 typedef struct {
1356     uint32_t count; /* count of jobs */
1357     List jobs; /* This should be a NULL destroy since we are just
1358             * putting a pointer to a slurmdb_job_rec_t here
1359             * not allocating any new memory */
1360     uint32_t min_size; /* smallest size of job in cpus here 0 if first */
1361     uint32_t max_size; /* largest size of job in cpus here INFINITE if
1362                 * last */
1363     List tres_list; /* list of slurmdb_tres_rec_t *'s */
1364 } slurmdb_report_job_grouping_t;
1365 
1366 typedef struct {
1367     char *acct; /* account name */
1368     uint32_t count; /* total count of jobs taken up by this acct */
1369     List groups;    /* containing slurmdb_report_job_grouping_t's*/
1370     char *lineage;  /* Complete path up the hierarchy to the root
1371              * association */
1372     List tres_list; /* list of slurmdb_tres_rec_t *'s */
1373 } slurmdb_report_acct_grouping_t;
1374 
1375 typedef struct {
1376     List acct_list; /* containing slurmdb_report_acct_grouping_t's */
1377     char *cluster;  /* cluster name */
1378     uint32_t count; /* total count of jobs taken up by this cluster */
1379     List tres_list; /* list of slurmdb_tres_rec_t *'s */
1380 } slurmdb_report_cluster_grouping_t;
1381 
1382 enum {
1383     DBD_ROLLUP_HOUR,
1384     DBD_ROLLUP_DAY,
1385     DBD_ROLLUP_MONTH,
1386     DBD_ROLLUP_COUNT
1387 };
1388 
1389 typedef struct {
1390     char *cluster_name;                      /* Cluster name */
1391     uint16_t count[DBD_ROLLUP_COUNT]; /* How many rollups have
1392                        * happened in time period */
1393     time_t timestamp[DBD_ROLLUP_COUNT]; /* Timestamps of last rollup. */
1394     uint64_t time_last[DBD_ROLLUP_COUNT]; /* Last rollup time */
1395     uint64_t time_max[DBD_ROLLUP_COUNT]; /* What was the longest time
1396                              * for each rollup */
1397     uint64_t time_total[DBD_ROLLUP_COUNT]; /* Time it took to do each
1398                          * rollup */
1399 } slurmdb_rollup_stats_t;
1400 
1401 typedef struct {
1402     uint32_t cnt;      /* count of object processed */
1403     uint32_t id;       /* ID of object */
1404     uint64_t time;     /* total usecs this object */
1405     uint64_t time_ave; /* ave usecs this object (DON'T PACK) */
1406 } slurmdb_rpc_obj_t;
1407 
1408 typedef struct {
1409     slurmdb_rollup_stats_t *dbd_rollup_stats;
1410     List rollup_stats;              /* List of Clusters rollup stats */
1411     List rpc_list;                  /* list of RPCs sent to the dbd. */
1412     time_t time_start;              /* When we started collecting data */
1413     List user_list;                 /* list of users issuing RPCs */
1414 } slurmdb_stats_rec_t;
1415 
1416 
1417 /* global variable for cross cluster communication */
1418 extern slurmdb_cluster_rec_t *working_cluster_rec;
1419 
1420 
1421 /************** account functions **************/
1422 
1423 /*
1424  * add accounts to accounting system
1425  * IN:  account_list List of slurmdb_account_rec_t *
1426  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1427  */
1428 extern int slurmdb_accounts_add(void *db_conn, List acct_list);
1429 
1430 /*
1431  * add accounts to accounting system
1432  * IN: slurmdb_add_assoc_cond_t *assoc_cond with cluster (optional) and acct
1433  *     lists filled in along with any limits in the assoc rec.
1434  * IN: slurmdb_account_rec_t *
1435  * RET: Return char * to print out of what was added or NULL and errno set on
1436  *      error.
1437  */
1438 extern char *slurmdb_accounts_add_cond(void *db_conn,
1439                        slurmdb_add_assoc_cond_t *add_assoc,
1440                        slurmdb_account_rec_t *acct);
1441 
1442 /*
1443  * get info from the storage
1444  * IN:  slurmdb_account_cond_t *
1445  * IN:  params void *
1446  * returns List of slurmdb_account_rec_t *
1447  * note List needs to be freed with slurm_list_destroy() when called
1448  */
1449 extern List slurmdb_accounts_get(void *db_conn,
1450                  slurmdb_account_cond_t *acct_cond);
1451 
1452 /*
1453  * modify existing accounts in the accounting system
1454  * IN:  slurmdb_acct_cond_t *acct_cond
1455  * IN:  slurmdb_account_rec_t *acct
1456  * RET: List containing (char *'s) else NULL on error
1457  * note List needs to be freed with slurm_list_destroy() when called
1458  */
1459 extern List slurmdb_accounts_modify(void *db_conn,
1460                     slurmdb_account_cond_t *acct_cond,
1461                     slurmdb_account_rec_t *acct);
1462 
1463 /*
1464  * remove accounts from accounting system
1465  * IN:  slurmdb_account_cond_t *acct_cond
1466  * RET: List containing (char *'s) else NULL on error
1467  * note List needs to be freed with slurm_list_destroy() when called
1468  */
1469 extern List slurmdb_accounts_remove(void *db_conn,
1470                     slurmdb_account_cond_t *acct_cond);
1471 
1472 
1473 /************** archive functions **************/
1474 
1475 /*
1476  * expire old info from the storage
1477  */
1478 extern int slurmdb_archive(void *db_conn, slurmdb_archive_cond_t *arch_cond);
1479 
1480 /*
1481  * expire old info from the storage
1482  */
1483 extern int slurmdb_archive_load(void *db_conn,
1484                 slurmdb_archive_rec_t *arch_rec);
1485 
1486 
1487 /************** association functions **************/
1488 
1489 /*
1490  * add associations to accounting system
1491  * IN:  assoc_list List of slurmdb_assoc_rec_t *
1492  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1493  */
1494 extern int slurmdb_associations_add(void *db_conn, List assoc_list);
1495 
1496 /*
1497  * get info from the storage
1498  * IN:  slurmdb_assoc_cond_t *
1499  * RET: List of slurmdb_assoc_rec_t *
1500  * note List needs to be freed with slurm_list_destroy() when called
1501  */
1502 extern List slurmdb_associations_get(void *db_conn,
1503                      slurmdb_assoc_cond_t *assoc_cond);
1504 
1505 /*
1506  * modify existing associations in the accounting system
1507  * IN:  slurmdb_assoc_cond_t *assoc_cond
1508  * IN:  slurmdb_assoc_rec_t *assoc
1509  * RET: List containing (char *'s) else NULL on error
1510  * note List needs to be freed with slurm_list_destroy() when called
1511  */
1512 extern List slurmdb_associations_modify(void *db_conn,
1513                     slurmdb_assoc_cond_t *assoc_cond,
1514                     slurmdb_assoc_rec_t *assoc);
1515 
1516 /*
1517  * remove associations from accounting system
1518  * IN:  slurmdb_assoc_cond_t *assoc_cond
1519  * RET: List containing (char *'s) else NULL on error
1520  * note List needs to be freed with slurm_list_destroy() when called
1521  */
1522 extern List slurmdb_associations_remove(void *db_conn,
1523                     slurmdb_assoc_cond_t *assoc_cond);
1524 
1525 /************** cluster functions **************/
1526 
1527 /*
1528  * add clusters to accounting system
1529  * IN:  cluster_list List of slurmdb_cluster_rec_t *
1530  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1531  */
1532 extern int slurmdb_clusters_add(void *db_conn, List cluster_list);
1533 
1534 /*
1535  * get info from the storage
1536  * IN:  slurmdb_cluster_cond_t *
1537  * IN:  params void *
1538  * returns List of slurmdb_cluster_rec_t *
1539  * note List needs to be freed with slurm_list_destroy() when called
1540  */
1541 extern List slurmdb_clusters_get(void *db_conn,
1542                  slurmdb_cluster_cond_t *cluster_cond);
1543 
1544 /*
1545  * modify existing clusters in the accounting system
1546  * IN:  slurmdb_cluster_cond_t *cluster_cond
1547  * IN:  slurmdb_cluster_rec_t *cluster
1548  * RET: List containing (char *'s) else NULL on error
1549  * note List needs to be freed with slurm_list_destroy() when called
1550  */
1551 extern List slurmdb_clusters_modify(void *db_conn,
1552                     slurmdb_cluster_cond_t *cluster_cond,
1553                     slurmdb_cluster_rec_t *cluster);
1554 
1555 /*
1556  * remove clusters from accounting system
1557  * IN:  slurmdb_cluster_cond_t *cluster_cond
1558  * RET: List containing (char *'s) else NULL on error
1559  * note List needs to be freed with slurm_list_destroy() when called
1560  */
1561 extern List slurmdb_clusters_remove(void *db_conn,
1562                     slurmdb_cluster_cond_t *cluster_cond);
1563 
1564 /************** cluster report functions **************/
1565 
1566 /* report for clusters of account per user
1567  * IN: slurmdb_assoc_cond_t *assoc_cond
1568  * RET: List containing (slurmdb_report_cluster_rec_t *'s) else NULL on error
1569  * note List needs to be freed with slurm_list_destroy() when called
1570  */
1571 extern List slurmdb_report_cluster_account_by_user(void *db_conn,
1572                            slurmdb_assoc_cond_t *assoc_cond);
1573 
1574 /* report for clusters of users per account
1575  * IN: slurmdb_assoc_cond_t *assoc_cond
1576  * RET: List containing (slurmdb_report_cluster_rec_t *'s) else NULL on error
1577  * note List needs to be freed with slurm_list_destroy() when called
1578  */
1579 extern List slurmdb_report_cluster_user_by_account(void *db_conn,
1580                            slurmdb_assoc_cond_t *assoc_cond);
1581 
1582 /* report for clusters of wckey per user
1583  * IN: slurmdb_wckey_cond_t *wckey_cond
1584  * RET: List containing (slurmdb_report_cluster_rec_t *'s) else NULL on error
1585  * note List needs to be freed with slurm_list_destroy() when called
1586  */
1587 extern List slurmdb_report_cluster_wckey_by_user(void *db_conn,
1588                          slurmdb_wckey_cond_t *wckey_cond);
1589 
1590 /* report for clusters of users per wckey
1591  * IN: slurmdb_wckey_cond_t *wckey_cond
1592  * RET: List containing (slurmdb_report_cluster_rec_t *'s) else NULL on error
1593  * note List needs to be freed with slurm_list_destroy() when called
1594  */
1595 extern List slurmdb_report_cluster_user_by_wckey(void *db_conn,
1596                          slurmdb_wckey_cond_t *wckey_cond);
1597 
1598 
1599 extern List slurmdb_report_job_sizes_grouped_by_account(
1600     void *db_conn,
1601     slurmdb_job_cond_t *job_cond,
1602     List grouping_list,
1603     bool flat_view,
1604     bool acct_as_parent);
1605 
1606 extern List slurmdb_report_job_sizes_grouped_by_wckey(void *db_conn,
1607                               slurmdb_job_cond_t *job_cond,
1608                               List grouping_list);
1609 
1610 extern List slurmdb_report_job_sizes_grouped_by_account_then_wckey(
1611     void *db_conn,
1612     slurmdb_job_cond_t *job_cond,
1613     List grouping_list,
1614     bool flat_view,
1615     bool acct_as_parent);
1616 
1617 
1618 /* report on users with top usage
1619  * IN: slurmdb_user_cond_t *user_cond
1620  * IN: group_accounts - Whether or not to group all accounts together
1621  *                      for each  user. If 0 a separate entry for each
1622  *                      user and account reference is displayed.
1623  * RET: List containing (slurmdb_report_cluster_rec_t *'s) else NULL on error
1624  * note List needs to be freed with slurm_list_destroy() when called
1625  */
1626 extern List slurmdb_report_user_top_usage(void *db_conn,
1627                       slurmdb_user_cond_t *user_cond,
1628                       bool group_accounts);
1629 
1630 /************** connection functions **************/
1631 
1632 /*
1633  * get a new connection to the slurmdb
1634  * OUT: persist_conn_flags - Flags returned from connection if any see
1635  *                           slurm_persist_conn.h.
1636  * RET: pointer used to access db
1637  */
1638 extern void *slurmdb_connection_get(uint16_t *persist_conn_flags);
1639 
1640 /*
1641  * release connection to the storage unit
1642  * IN/OUT: void ** pointer returned from
1643  *         slurmdb_connection_get() which will be freed.
1644  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1645  */
1646 extern int slurmdb_connection_close(void **db_conn);
1647 
1648 /*
1649  * commit or rollback changes made without closing connection
1650  * IN: void * pointer returned from slurmdb_connection_get()
1651  * IN: bool - true will commit changes false will rollback
1652  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1653  */
1654 extern int slurmdb_connection_commit(void *db_conn, bool commit);
1655 
1656 /************** coordinator functions **************/
1657 
1658 /*
1659  * add users as account coordinators
1660  * IN: acct_list list of char *'s of names of accounts
1661  * IN:  slurmdb_user_cond_t *user_cond
1662  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1663  */
1664 extern int slurmdb_coord_add(void *db_conn,
1665                  List acct_list,
1666                  slurmdb_user_cond_t *user_cond);
1667 
1668 /*
1669  * remove users from being a coordinator of an account
1670  * IN: acct_list list of char *'s of names of accounts
1671  * IN: slurmdb_user_cond_t *user_cond
1672  * RET: List containing (char *'s) else NULL on error
1673  * note List needs to be freed with slurm_list_destroy() when called
1674  */
1675 extern List slurmdb_coord_remove(void *db_conn, List acct_list,
1676                  slurmdb_user_cond_t *user_cond);
1677 
1678 /*************** Federation functions **************/
1679 
1680 /*
1681  * add federations to accounting system
1682  * IN:  list List of slurmdb_federation_rec_t *
1683  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1684  */
1685 extern int slurmdb_federations_add(void *db_conn, List federation_list);
1686 
1687 /*
1688  * modify existing federations in the accounting system
1689  * IN:  slurmdb_federation_cond_t *fed_cond
1690  * IN:  slurmdb_federation_rec_t  *fed
1691  * RET: List containing (char *'s) else NULL on error
1692  */
1693 extern List slurmdb_federations_modify(void *db_conn,
1694                        slurmdb_federation_cond_t *fed_cond,
1695                        slurmdb_federation_rec_t *fed);
1696 
1697 /*
1698  * remove federations from accounting system
1699  * IN:  slurmdb_federation_cond_t *fed_cond
1700  * RET: List containing (char *'s) else NULL on error
1701  */
1702 extern List slurmdb_federations_remove(void *db_conn,
1703                        slurmdb_federation_cond_t *fed_cond);
1704 
1705 /*
1706  * get info from the storage
1707  * IN:  slurmdb_federation_cond_t *
1708  * RET: List of slurmdb_federation_rec_t *
1709  * note List needs to be freed when called
1710  */
1711 extern List slurmdb_federations_get(void *db_conn,
1712                     slurmdb_federation_cond_t *fed_cond);
1713 
1714 /*************** Job functions **************/
1715 
1716 /*
1717  * modify existing job in the accounting system
1718  * IN:  slurmdb_job_cond_t *job_cond
1719  * IN:  slurmdb_job_rec_t *job
1720  * RET: List containing (char *'s) else NULL on error
1721  */
1722 extern List slurmdb_job_modify(void *db_conn,
1723                    slurmdb_job_cond_t *job_cond,
1724                    slurmdb_job_rec_t *job);
1725 
1726 /*
1727  * get info from the storage
1728  * returns List of slurmdb_job_rec_t *
1729  * note List needs to be freed with slurm_list_destroy() when called
1730  */
1731 extern List slurmdb_jobs_get(void *db_conn, slurmdb_job_cond_t *job_cond);
1732 
1733 /*
1734  * Fix runaway jobs
1735  * IN: jobs, a list of all the runaway jobs
1736  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1737  */
1738 extern int slurmdb_jobs_fix_runaway(void *db_conn, List jobs);
1739 
1740 /* initialization of job completion logging */
1741 extern int slurmdb_jobcomp_init(void);
1742 
1743 /* terminate pthreads and free, general clean-up for termination */
1744 extern int slurmdb_jobcomp_fini(void);
1745 
1746 /*
1747  * get info from the storage
1748  * returns List of jobcomp_job_rec_t *
1749  * note List needs to be freed when called
1750  */
1751 extern List slurmdb_jobcomp_jobs_get(slurmdb_job_cond_t *job_cond);
1752 
1753 /************** extra get functions **************/
1754 
1755 /*
1756  * reconfigure the slurmdbd
1757  */
1758 extern int slurmdb_reconfig(void *db_conn);
1759 
1760 /*
1761  * shutdown the slurmdbd
1762  */
1763 extern int slurmdb_shutdown(void *db_conn);
1764 
1765 /*
1766  * clear the slurmdbd statistics
1767  */
1768 extern int slurmdb_clear_stats(void *db_conn);
1769 
1770 /*
1771  * get the slurmdbd statistics
1772  * Call slurmdb_destroy_stats_rec() to free stats_pptr
1773  */
1774 extern int slurmdb_get_stats(void *db_conn, slurmdb_stats_rec_t **stats_pptr);
1775 
1776 /*
1777  * get info from the storage
1778  * RET: List of config_key_pair_t *
1779  * note List needs to be freed with slurm_list_destroy() when called
1780  */
1781 extern List slurmdb_config_get(void *db_conn);
1782 
1783 /*
1784  * get info from the storage
1785  * IN:  slurmdb_event_cond_t *
1786  * RET: List of slurmdb_event_rec_t *
1787  * note List needs to be freed with slurm_list_destroy() when called
1788  */
1789 extern List slurmdb_events_get(void *db_conn,
1790                    slurmdb_event_cond_t *event_cond);
1791 
1792 /*
1793  * get info from the storage
1794  *
1795  * IN:  slurmdb_instance_cond_t *
1796  * RET: List of slurmdb_instance_rec_t *
1797  * note List needs to be freed with slurm_list_destroy() when called
1798  */
1799 extern List slurmdb_instances_get(void *db_conn,
1800                   slurmdb_instance_cond_t *instance_cond);
1801 
1802 /*
1803  * get info from the storage
1804  * IN:  slurmdb_assoc_cond_t *
1805  * RET: List of slurmdb_assoc_rec_t *
1806  * note List needs to be freed with slurm_list_destroy() when called
1807  */
1808 extern List slurmdb_problems_get(void *db_conn,
1809                  slurmdb_assoc_cond_t *assoc_cond);
1810 
1811 /*
1812  * get info from the storage
1813  * IN:  slurmdb_reservation_cond_t *
1814  * RET: List of slurmdb_reservation_rec_t *
1815  * note List needs to be freed with slurm_list_destroy() when called
1816  */
1817 extern List slurmdb_reservations_get(void *db_conn,
1818                      slurmdb_reservation_cond_t *resv_cond);
1819 
1820 /*
1821  * get info from the storage
1822  * IN:  slurmdb_txn_cond_t *
1823  * RET: List of slurmdb_txn_rec_t *
1824  * note List needs to be freed with slurm_list_destroy() when called
1825  */
1826 extern List slurmdb_txn_get(void *db_conn, slurmdb_txn_cond_t *txn_cond);
1827 
1828 /*
1829  * Get information about requested cluster(s). Similar to
1830  * slurmdb_clusters_get, but should be used when setting up the
1831  * working_cluster_rec.  It replaces the plugin_id_select with
1832  * the position of the id in the select plugin array, as well as sets up the
1833  * control_addr and dim_size parts of the structure.
1834  *
1835  * IN: cluster_names - comma separated string of cluster names
1836  * RET: List of slurmdb_cluster_rec_t *
1837  * note List needs to bbe freed with slurm_list_destroy() when called
1838  */
1839 extern List slurmdb_get_info_cluster(char *cluster_names);
1840 
1841 /*
1842  * get the first cluster that will run a job
1843  * IN: req - description of resource allocation request
1844  * IN: cluster_names - comma separated string of cluster names
1845  * OUT: cluster_rec - record of selected cluster or NULL if none found or
1846  *            cluster_names is NULL
1847  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1848  *
1849  * Note: Cluster_rec needs to be freed with slurmdb_destroy_cluster_rec() when
1850  * called
1851  * Note: The will_runs are not threaded. Currently it relies on the
1852  * working_cluster_rec to pack the job_desc's jobinfo. See previous commit for
1853  * an example of how to thread this.
1854  */
1855 extern int slurmdb_get_first_avail_cluster(job_desc_msg_t *req,
1856                        char *cluster_names,
1857                        slurmdb_cluster_rec_t **cluster_rec);
1858 
1859 /*
1860  * get the first cluster that will run a heterogeneous job
1861  * IN: req - description of resource allocation request
1862  * IN: cluster_names - comma separated string of cluster names
1863  * OUT: cluster_rec - record of selected cluster or NULL if none found or
1864  *            cluster_names is NULL
1865  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1866  *
1867  * Note: Cluster_rec needs to be freed with slurmdb_destroy_cluster_rec() when
1868  * called
1869  * Note: The will_runs are not threaded. Currently it relies on the
1870  * working_cluster_rec to pack the job_desc's jobinfo. See previous commit for
1871  * an example of how to thread this.
1872  */
1873 extern int slurmdb_get_first_het_job_cluster(List job_req_list,
1874     char *cluster_names, slurmdb_cluster_rec_t **cluster_rec);
1875 
1876 /************** helper functions **************/
1877 extern void slurmdb_destroy_assoc_usage(void *object);
1878 extern void slurmdb_destroy_bf_usage(void *object);
1879 extern void slurmdb_destroy_bf_usage_members(void *object);
1880 extern void slurmdb_destroy_qos_usage(void *object);
1881 extern void slurmdb_free_user_rec_members(slurmdb_user_rec_t *slurmdb_user);
1882 extern void slurmdb_destroy_user_rec(void *object);
1883 extern void slurmdb_destroy_account_rec(void *object);
1884 extern void slurmdb_destroy_coord_rec(void *object);
1885 extern void slurmdb_destroy_clus_res_rec(void *object);
1886 extern void slurmdb_destroy_cluster_accounting_rec(void *object);
1887 extern void slurmdb_destroy_cluster_rec(void *object);
1888 extern void slurmdb_destroy_federation_rec(void *object);
1889 extern void slurmdb_destroy_accounting_rec(void *object);
1890 extern void slurmdb_free_assoc_mgr_state_msg(void *object);
1891 extern void slurmdb_free_assoc_rec_members(slurmdb_assoc_rec_t *assoc);
1892 extern void slurmdb_destroy_assoc_rec(void *object);
1893 extern void slurmdb_destroy_event_rec(void *object);
1894 extern void slurmdb_destroy_instance_rec(void *object);
1895 extern void slurmdb_destroy_job_rec(void *object);
1896 extern void slurmdb_free_qos_rec_members(slurmdb_qos_rec_t *qos);
1897 extern void slurmdb_destroy_qos_rec(void *object);
1898 extern void slurmdb_destroy_reservation_rec(void *object);
1899 extern void slurmdb_destroy_step_rec(void *object);
1900 extern void slurmdb_destroy_res_rec(void *object);
1901 extern void slurmdb_destroy_txn_rec(void *object);
1902 extern void slurmdb_destroy_wckey_rec(void *object);
1903 extern void slurmdb_destroy_archive_rec(void *object);
1904 extern void slurmdb_destroy_tres_rec_noalloc(void *object);
1905 extern void slurmdb_destroy_tres_rec(void *object);
1906 extern void slurmdb_destroy_report_assoc_rec(void *object);
1907 extern void slurmdb_destroy_report_user_rec(void *object);
1908 extern void slurmdb_destroy_report_cluster_rec(void *object);
1909 
1910 extern void slurmdb_destroy_user_cond(void *object);
1911 extern void slurmdb_destroy_account_cond(void *object);
1912 extern void slurmdb_destroy_cluster_cond(void *object);
1913 extern void slurmdb_destroy_federation_cond(void *object);
1914 extern void slurmdb_destroy_tres_cond(void *object);
1915 extern void slurmdb_destroy_assoc_cond(void *object);
1916 extern void slurmdb_destroy_event_cond(void *object);
1917 extern void slurmdb_destroy_instance_cond(void *object);
1918 extern void slurmdb_destroy_job_cond(void *object);
1919 extern void slurmdb_destroy_qos_cond(void *object);
1920 extern void slurmdb_destroy_reservation_cond(void *object);
1921 extern void slurmdb_destroy_res_cond(void *object);
1922 extern void slurmdb_destroy_txn_cond(void *object);
1923 extern void slurmdb_destroy_wckey_cond(void *object);
1924 extern void slurmdb_destroy_archive_cond(void *object);
1925 extern void slurmdb_free_add_assoc_cond_members(
1926     slurmdb_add_assoc_cond_t *add_assoc);
1927 extern void slurmdb_destroy_add_assoc_cond(void *object);
1928 
1929 extern void slurmdb_destroy_update_object(void *object);
1930 extern void slurmdb_destroy_used_limits(void *object);
1931 extern void slurmdb_destroy_print_tree(void *object);
1932 extern void slurmdb_destroy_hierarchical_rec(void *object);
1933 
1934 extern void slurmdb_destroy_report_job_grouping(void *object);
1935 extern void slurmdb_destroy_report_acct_grouping(void *object);
1936 extern void slurmdb_destroy_report_cluster_grouping(void *object);
1937 extern void slurmdb_destroy_rpc_obj(void *object);
1938 extern void slurmdb_destroy_rollup_stats(void *object);
1939 extern void slurmdb_free_stats_rec_members(void *object);
1940 extern void slurmdb_destroy_stats_rec(void *object);
1941 
1942 extern void slurmdb_free_slurmdb_stats_members(slurmdb_stats_t *stats);
1943 extern void slurmdb_destroy_slurmdb_stats(slurmdb_stats_t *stats);
1944 
1945 extern void slurmdb_init_assoc_rec(slurmdb_assoc_rec_t *assoc,
1946                    bool free_it);
1947 extern void slurmdb_init_clus_res_rec(slurmdb_clus_res_rec_t *clus_res,
1948                       bool free_it);
1949 extern void slurmdb_init_cluster_rec(slurmdb_cluster_rec_t *cluster,
1950                      bool free_it);
1951 extern void slurmdb_init_federation_rec(slurmdb_federation_rec_t *federation,
1952                     bool free_it);
1953 extern void slurmdb_init_instance_rec(slurmdb_instance_rec_t *instance);
1954 extern void slurmdb_init_qos_rec(slurmdb_qos_rec_t *qos,
1955                  bool free_it,
1956                  uint32_t init_val);
1957 extern void slurmdb_init_res_rec(slurmdb_res_rec_t *res,
1958                  bool free_it);
1959 extern void slurmdb_init_wckey_rec(slurmdb_wckey_rec_t *wckey,
1960                    bool free_it);
1961 extern void slurmdb_init_add_assoc_cond(slurmdb_add_assoc_cond_t *add_assoc,
1962                     bool free_it);
1963 extern void slurmdb_init_tres_cond(slurmdb_tres_cond_t *tres,
1964                    bool free_it);
1965 extern void slurmdb_init_cluster_cond(slurmdb_cluster_cond_t *cluster,
1966                       bool free_it);
1967 extern void slurmdb_init_federation_cond(slurmdb_federation_cond_t *federation,
1968                      bool free_it);
1969 extern void slurmdb_init_res_cond(slurmdb_res_cond_t *cluster,
1970                   bool free_it);
1971 
1972 /* The next two functions have pointers to assoc_list so do not
1973  * destroy assoc_list before using the list returned from this function.
1974  */
1975 extern List slurmdb_get_hierarchical_sorted_assoc_list(List assoc_list);
1976 extern List slurmdb_get_acct_hierarchical_rec_list(List assoc_list);
1977 
1978 
1979 /* IN/OUT: tree_list a list of slurmdb_print_tree_t's */
1980 extern char *slurmdb_tree_name_get(char *name, char *parent, List tree_list);
1981 
1982 /************** job report functions **************/
1983 
1984 /************** resource functions **************/
1985 /*
1986  * add resource's to accounting system
1987  * IN:  res_list List of char *
1988  * RET: SLURM_SUCCESS on success SLURM_ERROR else
1989  */
1990 extern int slurmdb_res_add(void *db_conn, List res_list);
1991 
1992 /*
1993  * get info from the storage
1994  * IN:  slurmdb_res_cond_t *
1995  * RET: List of slurmdb_res_rec_t *
1996  * note List needs to be freed with slurm_list_destroy() when called
1997  */
1998 extern List slurmdb_res_get(void *db_conn, slurmdb_res_cond_t *res_cond);
1999 
2000 /*
2001  * modify existing resource in the accounting system
2002  * IN:  slurmdb_res_cond_t *res_cond
2003  * IN:  slurmdb_res_rec_t *res
2004  * RET: List containing (char *'s) else NULL on error
2005  * note List needs to be freed with slurm_list_destroy() when called
2006  */
2007 extern List slurmdb_res_modify(void *db_conn,
2008                    slurmdb_res_cond_t *res_cond,
2009                    slurmdb_res_rec_t *res);
2010 
2011 /*
2012  * remove resource from accounting system
2013  * IN:  slurmdb_res_cond_t *res
2014  * RET: List containing (char *'s) else NULL on error
2015  * note List needs to be freed with slurm_list_destroy() when called
2016  */
2017 extern List slurmdb_res_remove(void *db_conn, slurmdb_res_cond_t *res_cond);
2018 
2019 /************** qos functions **************/
2020 
2021 /*
2022  * add qos's to accounting system
2023  * IN:  qos_list List of char *
2024  * RET: SLURM_SUCCESS on success SLURM_ERROR else
2025  */
2026 extern int slurmdb_qos_add(void *db_conn, List qos_list);
2027 
2028 /*
2029  * get info from the storage
2030  * IN:  slurmdb_qos_cond_t *
2031  * RET: List of slurmdb_qos_rec_t *
2032  * note List needs to be freed with slurm_list_destroy() when called
2033  */
2034 extern List slurmdb_qos_get(void *db_conn, slurmdb_qos_cond_t *qos_cond);
2035 
2036 /*
2037  * modify existing qos in the accounting system
2038  * IN:  slurmdb_qos_cond_t *qos_cond
2039  * IN:  slurmdb_qos_rec_t *qos
2040  * RET: List containing (char *'s) else NULL on error
2041  * note List needs to be freed with slurm_list_destroy() when called
2042  */
2043 extern List slurmdb_qos_modify(void *db_conn,
2044                    slurmdb_qos_cond_t *qos_cond,
2045                    slurmdb_qos_rec_t *qos);
2046 
2047 /*
2048  * remove qos from accounting system
2049  * IN:  slurmdb_qos_cond_t *assoc_qos
2050  * RET: List containing (char *'s) else NULL on error
2051  * note List needs to be freed with slurm_list_destroy() when called
2052  */
2053 extern List slurmdb_qos_remove(void *db_conn, slurmdb_qos_cond_t *qos_cond);
2054 
2055 /************** tres functions **************/
2056 
2057 /*
2058  * add tres's to accounting system
2059  * IN:  tres_list List of char *
2060  * RET: SLURM_SUCCESS on success SLURM_ERROR else
2061  */
2062 extern int slurmdb_tres_add(void *db_conn, List tres_list);
2063 
2064 /*
2065  * get info from the storage
2066  * IN:  slurmdb_tres_cond_t *
2067  * RET: List of slurmdb_tres_rec_t *
2068  * note List needs to be freed with slurm_list_destroy() when called
2069  */
2070 extern List slurmdb_tres_get(void *db_conn, slurmdb_tres_cond_t *tres_cond);
2071 
2072 
2073 /************** usage functions **************/
2074 
2075 /*
2076  * get info from the storage
2077  * IN/OUT:  in void * (slurmdb_assoc_rec_t *) or
2078  *          (slurmdb_wckey_rec_t *) of (slurmdb_cluster_rec_t *) with
2079  *          the id, and cluster set.
2080  * IN:  type what type is 'in'
2081  * IN:  start time stamp for records >=
2082  * IN:  end time stamp for records <=
2083  * RET: SLURM_SUCCESS on success SLURM_ERROR else
2084  */
2085 extern int slurmdb_usage_get(void *db_conn,
2086                  void *in,
2087                  int type,
2088                  time_t start,
2089                  time_t end);
2090 
2091 /*
2092  * roll up data in the storage
2093  * IN: sent_start (option time to do a re-roll or start from this point)
2094  * IN: sent_end (option time to do a re-roll or end at this point)
2095  * IN: archive_data (if 0 old data is not archived in a monthly rollup)
2096  * OUT: rollup_stats_list_in (list containing stats about each clusters rollup)
2097  * RET: SLURM_SUCCESS on success SLURM_ERROR else
2098  */
2099 extern int slurmdb_usage_roll(void *db_conn,
2100                   time_t sent_start,
2101                   time_t sent_end,
2102                   uint16_t archive_data,
2103                   List *rollup_stats_list_in);
2104 
2105 /************** user functions **************/
2106 
2107 /*
2108  * add users to accounting system
2109  * IN:  user_list List of slurmdb_user_rec_t *
2110  * RET: SLURM_SUCCESS on success SLURM_ERROR else
2111  */
2112 extern int slurmdb_users_add(void *db_conn, List user_list);
2113 
2114 /*
2115  * add users to accounting system
2116  * IN: slurmdb_add_assoc_cond_t *assoc_cond with cluster (optional) acct
2117  *     and user lists filled in along with any limits in the assoc rec.
2118  * IN: slurmdb_user_rec_t *
2119  * RET: Return char * to print out of what was added or NULL and errno set on
2120  *      error.
2121  */
2122 extern char *slurmdb_users_add_cond(void *db_conn,
2123                     slurmdb_add_assoc_cond_t *add_assoc,
2124                     slurmdb_user_rec_t *user);
2125 
2126 /*
2127  * add users to accounting system
2128  * IN:  slurmdb_user_rec_t *user
2129  * IN:  slurmdb_assoc_cond_t *assoc_cond
2130  * IN:  slurmdb_assoc_rec_t *assoc
2131  * RET: SLURM_SUCCESS on success SLURM_ERROR else
2132  */
2133 extern List slurmdb_users_add_conn(void *db_conn,
2134                    slurmdb_user_rec_t *user,
2135                    slurmdb_assoc_cond_t *assoc_cond,
2136                    slurmdb_assoc_rec_t *assoc);
2137 
2138 /*
2139  * get info from the storage
2140  * IN:  slurmdb_user_cond_t *
2141  * IN:  params void *
2142  * returns List of slurmdb_user_rec_t *
2143  * note List needs to be freed with slurm_list_destroy() when called
2144  */
2145 extern List slurmdb_users_get(void *db_conn, slurmdb_user_cond_t *user_cond);
2146 
2147 /*
2148  * modify existing users in the accounting system
2149  * IN:  slurmdb_user_cond_t *user_cond
2150  * IN:  slurmdb_user_rec_t *user
2151  * RET: List containing (char *'s) else NULL on error
2152  * note List needs to be freed with slurm_list_destroy() when called
2153  */
2154 extern List slurmdb_users_modify(void *db_conn,
2155                  slurmdb_user_cond_t *user_cond,
2156                  slurmdb_user_rec_t *user);
2157 
2158 /*
2159  * remove users from accounting system
2160  * IN:  slurmdb_user_cond_t *user_cond
2161  * RET: List containing (char *'s) else NULL on error
2162  * note List needs to be freed with slurm_list_destroy() when called
2163  */
2164 extern List slurmdb_users_remove(void *db_conn,
2165                  slurmdb_user_cond_t *user_cond);
2166 
2167 
2168 /************** user report functions **************/
2169 
2170 
2171 /************** wckey functions **************/
2172 
2173 /*
2174  * add wckey's to accounting system
2175  * IN:  wckey_list List of slurmdb_wckey_rec_t *
2176  * RET: SLURM_SUCCESS on success SLURM_ERROR else
2177  */
2178 extern int slurmdb_wckeys_add(void *db_conn, List wckey_list);
2179 
2180 /*
2181  * get info from the storage
2182  * IN:  slurmdb_wckey_cond_t *
2183  * RET: List of slurmdb_wckey_rec_t *
2184  * note List needs to be freed with slurm_list_destroy() when called
2185  */
2186 extern List slurmdb_wckeys_get(void *db_conn,
2187                    slurmdb_wckey_cond_t *wckey_cond);
2188 
2189 /*
2190  * modify existing wckey in the accounting system
2191  * IN:  slurmdb_wckey_cond_t *wckey_cond
2192  * IN:  slurmdb_wckey_rec_t *wckey
2193  * RET: List containing (char *'s) else NULL on error
2194  * note List needs to be freed with slurm_list_destroy() when called
2195  */
2196 extern List slurmdb_wckeys_modify(void *db_conn,
2197                   slurmdb_wckey_cond_t *wckey_cond,
2198                   slurmdb_wckey_rec_t *wckey);
2199 
2200 /*
2201  * remove wckey from accounting system
2202  * IN:  slurmdb_wckey_cond_t *assoc_wckey
2203  * RET: List containing (char *'s) else NULL on error
2204  * note List needs to be freed with slurm_list_destroy() when called
2205  */
2206 extern List slurmdb_wckeys_remove(void *db_conn,
2207                   slurmdb_wckey_cond_t *wckey_cond);
2208 
2209 #ifdef __cplusplus
2210 }
2211 #endif
2212 
2213 #endif /* !_SLURMDB_H */