1 /*****************************************************************************\
2  *  acct_gather_energy_none.c - slurm energy accounting plugin for none.
3  *****************************************************************************
4  *  Copyright (C) 2005 Hewlett-Packard Development Company, L.P.
5  *  Written by Bull-HN-PHX/d.rusak,
6  *  CODE-OCEC-09-009. All rights reserved.
7  *
8  *  This file is part of Slurm, a resource management program.
9  *  For details, see <https://slurm.schedmd.com/>.
10  *  Please also read the included file: DISCLAIMER.
11  *
12  *  Slurm is free software; you can redistribute it and/or modify it under
13  *  the terms of the GNU General Public License as published by the Free
14  *  Software Foundation; either version 2 of the License, or (at your option)
15  *  any later version.
16  *
17  *  In addition, as a special exception, the copyright holders give permission
18  *  to link the code of portions of this program with the OpenSSL library under
19  *  certain conditions as described in each individual source file, and
20  *  distribute linked combinations including the two. You must obey the GNU
21  *  General Public License in all respects for all of the code used other than
22  *  OpenSSL. If you modify file(s) with this exception, you may extend this
23  *  exception to your version of the file(s), but you are not obligated to do
24  *  so. If you do not wish to do so, delete this exception statement from your
25  *  version.  If you delete this exception statement from all source files in
26  *  the program, then also delete it here.
27  *
28  *  Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
29  *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
30  *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
31  *  details.
32  *
33  *  You should have received a copy of the GNU General Public License along
34  *  with Slurm; if not, write to the Free Software Foundation, Inc.,
35  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
36  *
37  *  This file is patterned after jobcomp_linux.c, written by Morris Jette and
38  *  Copyright (C) 2002 The Regents of the University of California.
39 \*****************************************************************************/
40 
41 
42 /*   acct_gather_energy_none
43  * This plugin does not initiate a node-level thread.
44  * It is the acct_gather_energy stub.
45  */
46 
47 #include "src/common/slurm_xlator.h"
48 #include "src/common/slurm_jobacct_gather.h"
49 #include "src/common/slurm_protocol_api.h"
50 #include "src/common/slurm_protocol_defs.h"
51 #include "src/slurmd/common/proctrack.h"
52 
53 #include <fcntl.h>
54 #include <signal.h>
55 
56 #define _DEBUG 1
57 #define _DEBUG_ENERGY 1
58 
59 /*
60  * These variables are required by the generic plugin interface.  If they
61  * are not found in the plugin, the plugin loader will ignore it.
62  *
63  * plugin_name - a string giving a human-readable description of the
64  * plugin.  There is no maximum length, but the symbol must refer to
65  * a valid string.
66  *
67  * plugin_type - a string suggesting the type of the plugin or its
68  * applicability to a particular form of data or method of data handling.
69  * If the low-level plugin API is used, the contents of this string are
70  * unimportant and may be anything.  Slurm uses the higher-level plugin
71  * interface which requires this string to be of the form
72  *
73  *	<application>/<method>
74  *
75  * where <application> is a description of the intended application of
76  * the plugin (e.g., "jobacct" for Slurm job completion logging) and <method>
77  * is a description of how this plugin satisfies that application.  Slurm will
78  * only load job completion logging plugins if the plugin_type string has a
79  * prefix of "jobacct/".
80  *
81  * plugin_version - an unsigned 32-bit integer containing the Slurm version
82  * (major.minor.micro combined into a single number).
83  */
84 const char plugin_name[] = "AcctGatherEnergy NONE plugin";
85 const char plugin_type[] = "acct_gather_energy/none";
86 const uint32_t plugin_version = SLURM_VERSION_NUMBER;
87 
88 /*
89  * init() is called when the plugin is loaded, before any other functions
90  * are called.  Put global initialization here.
91  */
init(void)92 extern int init(void)
93 {
94 	debug("%s loaded", plugin_name);
95 	return SLURM_SUCCESS;
96 }
97 
fini(void)98 extern int fini(void)
99 {
100 	return SLURM_SUCCESS;
101 }
102 
acct_gather_energy_p_update_node_energy(void)103 extern int acct_gather_energy_p_update_node_energy(void)
104 {
105 	int rc = SLURM_SUCCESS;
106 
107 	return rc;
108 }
109 
acct_gather_energy_p_get_data(enum acct_energy_type data_type,acct_gather_energy_t * energy)110 extern int acct_gather_energy_p_get_data(enum acct_energy_type data_type,
111 					 acct_gather_energy_t *energy)
112 {
113 	return SLURM_SUCCESS;
114 }
115 
acct_gather_energy_p_set_data(enum acct_energy_type data_type,acct_gather_energy_t * energy)116 extern int acct_gather_energy_p_set_data(enum acct_energy_type data_type,
117 					 acct_gather_energy_t *energy)
118 {
119 	return SLURM_SUCCESS;
120 }
121 
acct_gather_energy_p_conf_options(s_p_options_t ** full_options,int * full_options_cnt)122 extern void acct_gather_energy_p_conf_options(s_p_options_t **full_options,
123 					      int *full_options_cnt)
124 {
125 	return;
126 }
127 
acct_gather_energy_p_conf_set(int context_id_in,s_p_hashtbl_t * tbl)128 extern void acct_gather_energy_p_conf_set(int context_id_in,
129 					  s_p_hashtbl_t *tbl)
130 {
131 	return;
132 }
133 
acct_gather_energy_p_conf_values(List * data)134 extern void acct_gather_energy_p_conf_values(List *data)
135 {
136 	return;
137 }
138