1 /*****************************************************************************\
2 * acct_gather_profile_none.c - slurm profile accounting plugin for none.
3 *****************************************************************************
4 * Copyright (C) 2013 Bull S. A. S.
5 * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois.
6 *
7 * Written by Rod Schultz <rod.schultz@bull.com>
8 *
9 * This file is part of Slurm, a resource management program.
10 * For details, see <https://slurm.schedmd.com>.
11 * Please also read the included file: DISCLAIMER.
12 *
13 * Slurm is free software; you can redistribute it and/or modify it under
14 * the terms of the GNU General Public License as published by the Free
15 * Software Foundation; either version 2 of the License, or (at your option)
16 * any later version.
17 *
18 * In addition, as a special exception, the copyright holders give permission
19 * to link the code of portions of this program with the OpenSSL library under
20 * certain conditions as described in each individual source file, and
21 * distribute linked combinations including the two. You must obey the GNU
22 * General Public License in all respects for all of the code used other than
23 * OpenSSL. If you modify file(s) with this exception, you may extend this
24 * exception to your version of the file(s), but you are not obligated to do
25 * so. If you do not wish to do so, delete this exception statement from your
26 * version. If you delete this exception statement from all source files in
27 * the program, then also delete it here.
28 *
29 * Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
30 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
31 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
32 * details.
33 *
34 * You should have received a copy of the GNU General Public License along
35 * with Slurm; if not, write to the Free Software Foundation, Inc.,
36 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
37 *
38 \*****************************************************************************/
39
40 /* acct_gather_profile_none
41 * This plugin does not initiate a node-level thread.
42 * It is the acct_gather_profile stub.
43 */
44
45 #include "src/common/slurm_xlator.h"
46 #include "src/common/slurm_jobacct_gather.h"
47 #include "src/common/slurm_protocol_api.h"
48 #include "src/common/slurm_protocol_defs.h"
49 #include "src/slurmd/common/proctrack.h"
50 #include "src/common/slurm_acct_gather_profile.h"
51
52 #include <fcntl.h>
53 #include <signal.h>
54
55 #define _DEBUG 1
56
57 /*
58 * These variables are required by the generic plugin interface. If they
59 * are not found in the plugin, the plugin loader will ignore it.
60 *
61 * plugin_name - a string giving a human-readable description of the
62 * plugin. There is no maximum length, but the symbol must refer to
63 * a valid string.
64 *
65 * plugin_type - a string suggesting the type of the plugin or its
66 * applicability to a particular form of data or method of data handling.
67 * If the low-level plugin API is used, the contents of this string are
68 * unimportant and may be anything. Slurm uses the higher-level plugin
69 * interface which requires this string to be of the form
70 *
71 * <application>/<method>
72 *
73 * where <application> is a description of the intended application of
74 * the plugin (e.g., "jobacct" for Slurm job completion logging) and <method>
75 * is a description of how this plugin satisfies that application. Slurm will
76 * only load job completion logging plugins if the plugin_type string has a
77 * prefix of "jobacct/".
78 *
79 * plugin_version - an unsigned 32-bit integer containing the Slurm version
80 * (major.minor.micro combined into a single number).
81 */
82 const char plugin_name[] = "AcctGatherProfile NONE plugin";
83 const char plugin_type[] = "acct_gather_Profile/none";
84 const uint32_t plugin_version = SLURM_VERSION_NUMBER;
85
86 /*
87 * init() is called when the plugin is loaded, before any other functions
88 * are called. Put global initialization here.
89 */
init(void)90 extern int init(void)
91 {
92 debug("%s loaded", plugin_name);
93 return SLURM_SUCCESS;
94 }
95
fini(void)96 extern int fini(void)
97 {
98 return SLURM_SUCCESS;
99 }
100
acct_gather_profile_p_conf_set(s_p_hashtbl_t * tbl)101 extern void acct_gather_profile_p_conf_set(s_p_hashtbl_t *tbl)
102 {
103 return;
104 }
105
acct_gather_profile_p_conf_options(s_p_options_t ** full_options,int * full_options_cnt)106 extern void acct_gather_profile_p_conf_options(s_p_options_t **full_options,
107 int *full_options_cnt)
108 {
109 return;
110 }
111
acct_gather_profile_p_get(enum acct_gather_profile_info info_type,void * data)112 extern void acct_gather_profile_p_get(enum acct_gather_profile_info info_type,
113 void *data)
114 {
115 uint32_t *uint32 = (uint32_t *) data;
116
117 switch (info_type) {
118 case ACCT_GATHER_PROFILE_DEFAULT:
119 case ACCT_GATHER_PROFILE_RUNNING:
120 *uint32 = ACCT_GATHER_PROFILE_NONE;
121 break;
122 default:
123 break;
124 }
125
126 return;
127 }
128
acct_gather_profile_p_node_step_start(stepd_step_rec_t * job)129 extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
130 {
131 return SLURM_SUCCESS;
132 }
133
acct_gather_profile_p_child_forked(void)134 extern int acct_gather_profile_p_child_forked(void)
135 {
136 return SLURM_SUCCESS;
137 }
138
acct_gather_profile_p_node_step_end(void)139 extern int acct_gather_profile_p_node_step_end(void)
140 {
141 return SLURM_SUCCESS;
142 }
143
acct_gather_profile_p_task_start(uint32_t taskid)144 extern int acct_gather_profile_p_task_start(uint32_t taskid)
145 {
146 return SLURM_SUCCESS;
147 }
148
acct_gather_profile_p_task_end(pid_t taskpid)149 extern int acct_gather_profile_p_task_end(pid_t taskpid)
150 {
151 return SLURM_SUCCESS;
152 }
153
acct_gather_profile_p_create_group(const char * name)154 extern int acct_gather_profile_p_create_group(const char* name)
155 {
156 return SLURM_SUCCESS;
157 }
158
acct_gather_profile_p_create_dataset(const char * name,int parent,acct_gather_profile_dataset_t * dataset)159 extern int acct_gather_profile_p_create_dataset(
160 const char* name, int parent, acct_gather_profile_dataset_t *dataset)
161 {
162 return SLURM_SUCCESS;
163 }
164
acct_gather_profile_p_add_sample_data(int dataset_id,void * data,time_t sample_time)165 extern int acct_gather_profile_p_add_sample_data(int dataset_id, void* data,
166 time_t sample_time)
167 {
168 return SLURM_SUCCESS;
169 }
170
acct_gather_profile_p_conf_values(List * data)171 extern void acct_gather_profile_p_conf_values(List *data)
172 {
173 return;
174 }
175
acct_gather_profile_p_is_active(uint32_t type)176 extern bool acct_gather_profile_p_is_active(uint32_t type)
177 {
178 return false;
179 }
180