1
/*****************************************************************************\
2
* accounting_storage_none.c - account interface to none.
4
* $Id: accounting_storage_none.c 13061 2008-01-22 21:23:56Z da $
5
*****************************************************************************
6
* Copyright (C) 2004-2007 The Regents of the University of California.
7
* Copyright (C) 2008 Lawrence Livermore National Security.
8
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
9
* Written by Danny Auble <da@llnl.gov>
11
* This file is part of SLURM, a resource management program.
12
* For details, see <http://www.llnl.gov/linux/slurm/>.
14
* SLURM is free software; you can redistribute it and/or modify it under
15
* the terms of the GNU General Public License as published by the Free
16
* Software Foundation; either version 2 of the License, or (at your option)
19
* In addition, as a special exception, the copyright holders give permission
20
* to link the code of portions of this program with the OpenSSL library under
21
* certain conditions as described in each individual source file, and
22
* distribute linked combinations including the two. You must obey the GNU
23
* General Public License in all respects for all of the code used other than
24
* OpenSSL. If you modify file(s) with this exception, you may extend this
25
* exception to your version of the file(s), but you are not obligated to do
26
* so. If you do not wish to do so, delete this exception statement from your
27
* version. If you delete this exception statement from all source files in
28
* the program, then also delete it here.
30
* SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
31
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
32
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
35
* You should have received a copy of the GNU General Public License along
36
* with SLURM; if not, write to the Free Software Foundation, Inc.,
37
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
38
\*****************************************************************************/
40
#include "src/common/slurm_accounting_storage.h"
43
* These variables are required by the generic plugin interface. If they
44
* are not found in the plugin, the plugin loader will ignore it.
46
* plugin_name - a string giving a human-readable description of the
47
* plugin. There is no maximum length, but the symbol must refer to
50
* plugin_type - a string suggesting the type of the plugin or its
51
* applicability to a particular form of data or method of data handling.
52
* If the low-level plugin API is used, the contents of this string are
53
* unimportant and may be anything. SLURM uses the higher-level plugin
54
* interface which requires this string to be of the form
56
* <application>/<method>
58
* where <application> is a description of the intended application of
59
* the plugin (e.g., "jobacct" for SLURM job completion logging) and <method>
60
* is a description of how this plugin satisfies that application. SLURM will
61
* only load job completion logging plugins if the plugin_type string has a
62
* prefix of "jobacct/".
64
* plugin_version - an unsigned 32-bit integer giving the version number
65
* of the plugin. If major and minor revisions are desired, the major
66
* version number may be multiplied by a suitable magnitude constant such
67
* as 100 or 1000. Various SLURM versions will likely require a certain
68
* minimum versions for their plugins as the job accounting API
71
const char plugin_name[] = "Accounting storage NOT INVOKED plugin";
72
const char plugin_type[] = "accounting_storage/none";
73
const uint32_t plugin_version = 100;
76
* init() is called when the plugin is loaded, before any other functions
77
* are called. Put global initialization here.
79
extern int init ( void )
81
verbose("%s loaded", plugin_name);
85
extern int fini ( void )
90
extern void * acct_storage_p_get_connection(bool make_agent, bool rollback)
95
extern int acct_storage_p_close_connection(void **db_conn)
100
extern int acct_storage_p_commit(void *db_conn, bool commit)
102
return SLURM_SUCCESS;
105
extern int acct_storage_p_add_users(void *db_conn, uint32_t uid,
108
return SLURM_SUCCESS;
111
extern int acct_storage_p_add_coord(void *db_conn, uint32_t uid,
112
char *acct, acct_user_cond_t *user_q)
114
return SLURM_SUCCESS;
117
extern int acct_storage_p_add_accts(void *db_conn, uint32_t uid,
120
return SLURM_SUCCESS;
123
extern int acct_storage_p_add_clusters(void *db_conn, uint32_t uid,
126
return SLURM_SUCCESS;
129
extern int acct_storage_p_add_associations(void *db_conn, uint32_t uid,
130
List association_list)
132
return SLURM_SUCCESS;
135
extern List acct_storage_p_modify_users(void *db_conn, uint32_t uid,
136
acct_user_cond_t *user_q,
137
acct_user_rec_t *user)
139
return SLURM_SUCCESS;
142
extern List acct_storage_p_modify_accts(void *db_conn, uint32_t uid,
143
acct_account_cond_t *acct_q,
144
acct_account_rec_t *acct)
146
return SLURM_SUCCESS;
149
extern List acct_storage_p_modify_clusters(void *db_conn, uint32_t uid,
150
acct_cluster_cond_t *cluster_q,
151
acct_cluster_rec_t *cluster)
153
return SLURM_SUCCESS;
156
extern List acct_storage_p_modify_associations(void *db_conn, uint32_t uid,
157
acct_association_cond_t *assoc_q,
158
acct_association_rec_t *assoc)
160
return SLURM_SUCCESS;
163
extern List acct_storage_p_remove_users(void *db_conn, uint32_t uid,
164
acct_user_cond_t *user_q)
166
return SLURM_SUCCESS;
169
extern List acct_storage_p_remove_coord(void *db_conn, uint32_t uid,
170
char *acct, acct_user_cond_t *user_q)
172
return SLURM_SUCCESS;
175
extern List acct_storage_p_remove_accts(void *db_conn, uint32_t uid,
176
acct_account_cond_t *acct_q)
178
return SLURM_SUCCESS;
181
extern List acct_storage_p_remove_clusters(void *db_conn, uint32_t uid,
182
acct_account_cond_t *cluster_q)
184
return SLURM_SUCCESS;
187
extern List acct_storage_p_remove_associations(void *db_conn, uint32_t uid,
188
acct_association_cond_t *assoc_q)
190
return SLURM_SUCCESS;
193
extern List acct_storage_p_get_users(void *db_conn,
194
acct_user_cond_t *user_q)
199
extern List acct_storage_p_get_accts(void *db_conn,
200
acct_account_cond_t *acct_q)
205
extern List acct_storage_p_get_clusters(void *db_conn,
206
acct_account_cond_t *cluster_q)
211
extern List acct_storage_p_get_associations(void *db_conn,
212
acct_association_cond_t *assoc_q)
217
extern int acct_storage_p_get_usage(void *db_conn,
218
acct_association_rec_t *acct_assoc,
219
time_t start, time_t end)
221
int rc = SLURM_SUCCESS;
226
extern int acct_storage_p_roll_usage(void *db_conn,
229
int rc = SLURM_SUCCESS;
234
extern int clusteracct_storage_p_node_down(void *db_conn,
236
struct node_record *node_ptr,
237
time_t event_time, char *reason)
239
return SLURM_SUCCESS;
241
extern int clusteracct_storage_p_node_up(void *db_conn,
243
struct node_record *node_ptr,
246
return SLURM_SUCCESS;
249
extern int clusteracct_storage_p_register_ctld(char *cluster,
252
return SLURM_SUCCESS;
255
extern int clusteracct_storage_p_cluster_procs(void *db_conn,
260
return SLURM_SUCCESS;
263
extern int clusteracct_storage_p_get_usage(
265
acct_cluster_rec_t *cluster_rec, time_t start, time_t end)
268
return SLURM_SUCCESS;
272
* load into the storage the start of a job
274
extern int jobacct_storage_p_job_start(void *db_conn,
275
struct job_record *job_ptr)
277
return SLURM_SUCCESS;
281
* load into the storage the end of a job
283
extern int jobacct_storage_p_job_complete(void *db_conn,
284
struct job_record *job_ptr)
286
return SLURM_SUCCESS;
290
* load into the storage the start of a job step
292
extern int jobacct_storage_p_step_start(void *db_conn,
293
struct step_record *step_ptr)
295
return SLURM_SUCCESS;
299
* load into the storage the end of a job step
301
extern int jobacct_storage_p_step_complete(void *db_conn,
302
struct step_record *step_ptr)
304
return SLURM_SUCCESS;
308
* load into the storage a suspention of a job
310
extern int jobacct_storage_p_suspend(void *db_conn,
311
struct job_record *job_ptr)
313
return SLURM_SUCCESS;
317
* get info from the storage
318
* returns List of job_rec_t *
319
* note List needs to be freed when called
321
extern List jobacct_storage_p_get_jobs(void *db_conn,
330
* expire old info from the storage
332
extern void jobacct_storage_p_archive(void *db_conn,
339
extern int acct_storage_p_update_shares_used(void *db_conn,
342
return SLURM_SUCCESS;
345
extern int acct_storage_p_flush_jobs_on_cluster(
346
void *db_conn, char *cluster, time_t event_time)
348
return SLURM_SUCCESS;