slurm_errno.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. /*****************************************************************************\
  2. * slurm_errno.h - error codes and functions for slurm
  3. ******************************************************************************
  4. * Copyright (C) 2002-2007 The Regents of the University of California.
  5. * Copyright (C) 2008-2009 Lawrence Livermore National Security.
  6. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  7. * Written by Kevin Tew <tew1@llnl.gov>,
  8. * Jim Garlick <garlick@llnl.gov>, et. al.
  9. * CODE-OCEC-09-009. All rights reserved.
  10. *
  11. * This file is part of Slurm, a resource management program.
  12. * For details, see <https://slurm.schedmd.com/>.
  13. * Please also read the included file: DISCLAIMER.
  14. *
  15. * Slurm is free software; you can redistribute it and/or modify it under
  16. * the terms of the GNU General Public License as published by the Free
  17. * Software Foundation; either version 2 of the License, or (at your option)
  18. * any later version.
  19. *
  20. * In addition, as a special exception, the copyright holders give permission
  21. * to link the code of portions of this program with the OpenSSL library under
  22. * certain conditions as described in each individual source file, and
  23. * distribute linked combinations including the two. You must obey the GNU
  24. * General Public License in all respects for all of the code used other than
  25. * OpenSSL. If you modify file(s) with this exception, you may extend this
  26. * exception to your version of the file(s), but you are not obligated to do
  27. * so. If you do not wish to do so, delete this exception statement from your
  28. * version. If you delete this exception statement from all source files in
  29. * the program, then also delete it here.
  30. *
  31. * Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
  32. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  33. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  34. * details.
  35. *
  36. * You should have received a copy of the GNU General Public License along
  37. * with Slurm; if not, write to the Free Software Foundation, Inc.,
  38. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  39. \*****************************************************************************/
  40. #ifndef _SLURM_ERRNO_H
  41. #define _SLURM_ERRNO_H
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #include <errno.h>
  46. /* set errno to the specified value - then return -1 */
  47. #define slurm_seterrno_ret(errnum) do { \
  48. slurm_seterrno(errnum); \
  49. return (errnum ? -1 : 0); \
  50. } while (0)
  51. /* general return codes */
  52. #define SLURM_SUCCESS 0
  53. #define SLURM_ERROR -1
  54. enum {
  55. /* General Message error codes */
  56. SLURM_UNEXPECTED_MSG_ERROR = 1000,
  57. SLURM_COMMUNICATIONS_CONNECTION_ERROR,
  58. SLURM_COMMUNICATIONS_SEND_ERROR,
  59. SLURM_COMMUNICATIONS_RECEIVE_ERROR,
  60. SLURM_COMMUNICATIONS_SHUTDOWN_ERROR,
  61. SLURM_PROTOCOL_VERSION_ERROR,
  62. SLURM_PROTOCOL_IO_STREAM_VERSION_ERROR,
  63. SLURM_PROTOCOL_AUTHENTICATION_ERROR,
  64. SLURM_PROTOCOL_INSANE_MSG_LENGTH,
  65. SLURM_MPI_PLUGIN_NAME_INVALID,
  66. SLURM_MPI_PLUGIN_PRELAUNCH_SETUP_FAILED,
  67. SLURM_PLUGIN_NAME_INVALID,
  68. SLURM_UNKNOWN_FORWARD_ADDR,
  69. /* communication failures to/from slurmctld */
  70. SLURMCTLD_COMMUNICATIONS_CONNECTION_ERROR = 1800,
  71. SLURMCTLD_COMMUNICATIONS_SEND_ERROR,
  72. SLURMCTLD_COMMUNICATIONS_RECEIVE_ERROR,
  73. SLURMCTLD_COMMUNICATIONS_SHUTDOWN_ERROR,
  74. /* _info.c/communication layer RESPONSE_SLURM_RC message codes */
  75. SLURM_NO_CHANGE_IN_DATA = 1900,
  76. /* slurmctld error codes */
  77. ESLURM_INVALID_PARTITION_NAME = 2000,
  78. ESLURM_DEFAULT_PARTITION_NOT_SET,
  79. ESLURM_ACCESS_DENIED,
  80. ESLURM_JOB_MISSING_REQUIRED_PARTITION_GROUP,
  81. ESLURM_REQUESTED_NODES_NOT_IN_PARTITION,
  82. ESLURM_TOO_MANY_REQUESTED_CPUS,
  83. ESLURM_INVALID_NODE_COUNT,
  84. ESLURM_ERROR_ON_DESC_TO_RECORD_COPY,
  85. ESLURM_JOB_MISSING_SIZE_SPECIFICATION,
  86. ESLURM_JOB_SCRIPT_MISSING,
  87. ESLURM_USER_ID_MISSING = 2010,
  88. ESLURM_DUPLICATE_JOB_ID,
  89. ESLURM_PATHNAME_TOO_LONG,
  90. ESLURM_NOT_TOP_PRIORITY,
  91. ESLURM_REQUESTED_NODE_CONFIG_UNAVAILABLE,
  92. ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE,
  93. ESLURM_NODES_BUSY,
  94. ESLURM_INVALID_JOB_ID,
  95. ESLURM_INVALID_NODE_NAME,
  96. ESLURM_WRITING_TO_FILE,
  97. ESLURM_TRANSITION_STATE_NO_UPDATE = 2020,
  98. ESLURM_ALREADY_DONE,
  99. ESLURM_INTERCONNECT_FAILURE,
  100. ESLURM_BAD_DIST,
  101. ESLURM_JOB_PENDING,
  102. ESLURM_BAD_TASK_COUNT,
  103. ESLURM_INVALID_JOB_CREDENTIAL,
  104. ESLURM_IN_STANDBY_MODE,
  105. ESLURM_INVALID_NODE_STATE,
  106. ESLURM_INVALID_FEATURE,
  107. ESLURM_INVALID_AUTHTYPE_CHANGE = 2030,
  108. ESLURM_ACTIVE_FEATURE_NOT_SUBSET,
  109. ESLURM_INVALID_SCHEDTYPE_CHANGE,
  110. ESLURM_INVALID_SELECTTYPE_CHANGE,
  111. ESLURM_INVALID_SWITCHTYPE_CHANGE,
  112. ESLURM_FRAGMENTATION,
  113. ESLURM_NOT_SUPPORTED,
  114. ESLURM_DISABLED,
  115. ESLURM_DEPENDENCY,
  116. ESLURM_BATCH_ONLY,
  117. ESLURM_TASKDIST_ARBITRARY_UNSUPPORTED = 2040,
  118. ESLURM_TASKDIST_REQUIRES_OVERCOMMIT,
  119. ESLURM_JOB_HELD,
  120. ESLURM_INVALID_CRED_TYPE_CHANGE,
  121. ESLURM_INVALID_TASK_MEMORY,
  122. ESLURM_INVALID_ACCOUNT,
  123. ESLURM_INVALID_PARENT_ACCOUNT,
  124. ESLURM_SAME_PARENT_ACCOUNT,
  125. ESLURM_INVALID_LICENSES,
  126. ESLURM_NEED_RESTART,
  127. ESLURM_ACCOUNTING_POLICY = 2050,
  128. ESLURM_INVALID_TIME_LIMIT,
  129. ESLURM_RESERVATION_ACCESS,
  130. ESLURM_RESERVATION_INVALID,
  131. ESLURM_INVALID_TIME_VALUE,
  132. ESLURM_RESERVATION_BUSY,
  133. ESLURM_RESERVATION_NOT_USABLE,
  134. ESLURM_INVALID_WCKEY,
  135. ESLURM_RESERVATION_OVERLAP,
  136. ESLURM_PORTS_BUSY,
  137. ESLURM_PORTS_INVALID = 2060,
  138. ESLURM_PROLOG_RUNNING,
  139. ESLURM_NO_STEPS,
  140. ESLURM_INVALID_BLOCK_STATE,
  141. ESLURM_INVALID_BLOCK_LAYOUT,
  142. ESLURM_INVALID_BLOCK_NAME,
  143. ESLURM_INVALID_QOS,
  144. ESLURM_QOS_PREEMPTION_LOOP,
  145. ESLURM_NODE_NOT_AVAIL,
  146. ESLURM_INVALID_CPU_COUNT,
  147. ESLURM_PARTITION_NOT_AVAIL = 2070,
  148. ESLURM_CIRCULAR_DEPENDENCY,
  149. ESLURM_INVALID_GRES,
  150. ESLURM_JOB_NOT_PENDING,
  151. ESLURM_QOS_THRES,
  152. ESLURM_PARTITION_IN_USE,
  153. ESLURM_STEP_LIMIT,
  154. ESLURM_JOB_SUSPENDED,
  155. ESLURM_CAN_NOT_START_IMMEDIATELY,
  156. ESLURM_INTERCONNECT_BUSY,
  157. ESLURM_RESERVATION_EMPTY = 2080,
  158. ESLURM_INVALID_ARRAY,
  159. ESLURM_RESERVATION_NAME_DUP,
  160. ESLURM_JOB_STARTED,
  161. ESLURM_JOB_FINISHED,
  162. ESLURM_JOB_NOT_RUNNING,
  163. ESLURM_JOB_NOT_PENDING_NOR_RUNNING,
  164. ESLURM_JOB_NOT_SUSPENDED,
  165. ESLURM_JOB_NOT_FINISHED,
  166. ESLURM_TRIGGER_DUP,
  167. ESLURM_INTERNAL = 2090,
  168. ESLURM_INVALID_BURST_BUFFER_CHANGE,
  169. ESLURM_BURST_BUFFER_PERMISSION,
  170. ESLURM_BURST_BUFFER_LIMIT,
  171. ESLURM_INVALID_BURST_BUFFER_REQUEST,
  172. ESLURM_PRIO_RESET_FAIL,
  173. ESLURM_POWER_NOT_AVAIL,
  174. ESLURM_POWER_RESERVED,
  175. ESLURM_INVALID_POWERCAP,
  176. ESLURM_INVALID_MCS_LABEL,
  177. ESLURM_BURST_BUFFER_WAIT = 2100,
  178. ESLURM_PARTITION_DOWN,
  179. ESLURM_DUPLICATE_GRES,
  180. ESLURM_JOB_SETTING_DB_INX,
  181. ESLURM_RSV_ALREADY_STARTED,
  182. ESLURM_SUBMISSIONS_DISABLED,
  183. ESLURM_NOT_HET_JOB,
  184. ESLURM_NOT_HET_JOB_LEADER,
  185. ESLURM_NOT_WHOLE_HET_JOB,
  186. ESLURM_CORE_RESERVATION_UPDATE,
  187. ESLURM_DUPLICATE_STEP_ID = 2110,
  188. ESLURM_INVALID_CORE_CNT,
  189. ESLURM_X11_NOT_AVAIL,
  190. ESLURM_GROUP_ID_MISSING,
  191. ESLURM_BATCH_CONSTRAINT,
  192. ESLURM_INVALID_TRES,
  193. ESLURM_INVALID_TRES_BILLING_WEIGHTS,
  194. ESLURM_INVALID_JOB_DEFAULTS,
  195. ESLURM_RESERVATION_MAINT,
  196. ESLURM_INVALID_GRES_TYPE,
  197. ESLURM_REBOOT_IN_PROGRESS = 2120,
  198. ESLURM_MULTI_KNL_CONSTRAINT,
  199. ESLURM_UNSUPPORTED_GRES,
  200. ESLURM_INVALID_NICE,
  201. ESLURM_INVALID_TIME_MIN_LIMIT,
  202. ESLURM_DEFER,
  203. ESLURM_CONFIGLESS_DISABLED,
  204. ESLURM_ENVIRONMENT_MISSING,
  205. /* slurmd error codes */
  206. ESLURMD_PIPE_ERROR_ON_TASK_SPAWN = 4000,
  207. ESLURMD_KILL_TASK_FAILED,
  208. ESLURMD_KILL_JOB_ALREADY_COMPLETE,
  209. ESLURMD_INVALID_ACCT_FREQ,
  210. ESLURMD_INVALID_JOB_CREDENTIAL,
  211. ESLURMD_UID_NOT_FOUND,
  212. ESLURMD_GID_NOT_FOUND,
  213. ESLURMD_CREDENTIAL_EXPIRED,
  214. ESLURMD_CREDENTIAL_REVOKED,
  215. ESLURMD_CREDENTIAL_REPLAYED,
  216. ESLURMD_CREATE_BATCH_DIR_ERROR = 4010,
  217. ESLURMD_MODIFY_BATCH_DIR_ERROR,
  218. ESLURMD_CREATE_BATCH_SCRIPT_ERROR,
  219. ESLURMD_MODIFY_BATCH_SCRIPT_ERROR,
  220. ESLURMD_SETUP_ENVIRONMENT_ERROR,
  221. ESLURMD_SHARED_MEMORY_ERROR,
  222. ESLURMD_SET_UID_OR_GID_ERROR,
  223. ESLURMD_SET_SID_ERROR,
  224. ESLURMD_CANNOT_SPAWN_IO_THREAD,
  225. ESLURMD_FORK_FAILED,
  226. ESLURMD_EXECVE_FAILED = 4020,
  227. ESLURMD_IO_ERROR,
  228. ESLURMD_PROLOG_FAILED,
  229. ESLURMD_EPILOG_FAILED,
  230. ESLURMD_SESSION_KILLED,
  231. ESLURMD_TOOMANYSTEPS,
  232. ESLURMD_STEP_EXISTS,
  233. ESLURMD_JOB_NOTRUNNING,
  234. ESLURMD_STEP_SUSPENDED,
  235. ESLURMD_STEP_NOTSUSPENDED,
  236. ESLURMD_INVALID_SOCKET_NAME_LEN = 4030,
  237. /* slurmd errors in user batch job */
  238. ESCRIPT_CHDIR_FAILED = 4100,
  239. ESCRIPT_OPEN_OUTPUT_FAILED,
  240. ESCRIPT_NON_ZERO_RETURN,
  241. /* socket specific Slurm communications error */
  242. SLURM_PROTOCOL_SOCKET_IMPL_ZERO_RECV_LENGTH = 5000,
  243. SLURM_PROTOCOL_SOCKET_IMPL_NEGATIVE_RECV_LENGTH,
  244. SLURM_PROTOCOL_SOCKET_IMPL_NOT_ALL_DATA_SENT,
  245. ESLURM_PROTOCOL_INCOMPLETE_PACKET ,
  246. SLURM_PROTOCOL_SOCKET_IMPL_TIMEOUT ,
  247. SLURM_PROTOCOL_SOCKET_ZERO_BYTES_SENT,
  248. /* slurm_auth errors */
  249. ESLURM_AUTH_CRED_INVALID = 6000,
  250. ESLURM_AUTH_FOPEN_ERROR,
  251. ESLURM_AUTH_NET_ERROR,
  252. ESLURM_AUTH_UNABLE_TO_SIGN,
  253. ESLURM_AUTH_BADARG,
  254. ESLURM_AUTH_MEMORY,
  255. ESLURM_AUTH_INVALID,
  256. ESLURM_AUTH_UNPACK,
  257. /* accounting errors */
  258. ESLURM_DB_CONNECTION = 7000,
  259. ESLURM_JOBS_RUNNING_ON_ASSOC,
  260. ESLURM_CLUSTER_DELETED,
  261. ESLURM_ONE_CHANGE,
  262. ESLURM_BAD_NAME,
  263. ESLURM_OVER_ALLOCATE,
  264. ESLURM_RESULT_TOO_LARGE,
  265. ESLURM_DB_QUERY_TOO_WIDE,
  266. /* Federation Errors */
  267. ESLURM_FED_CLUSTER_MAX_CNT = 7100,
  268. ESLURM_FED_CLUSTER_MULTIPLE_ASSIGNMENT,
  269. ESLURM_INVALID_CLUSTER_FEATURE,
  270. ESLURM_JOB_NOT_FEDERATED,
  271. ESLURM_INVALID_CLUSTER_NAME,
  272. ESLURM_FED_JOB_LOCK,
  273. ESLURM_FED_NO_VALID_CLUSTERS,
  274. /* plugin and custom errors */
  275. ESLURM_MISSING_TIME_LIMIT = 8000,
  276. ESLURM_INVALID_KNL
  277. };
  278. /* look up an errno value */
  279. char * slurm_strerror(int errnum);
  280. /* set an errno value */
  281. void slurm_seterrno(int errnum);
  282. /* get an errno value */
  283. int slurm_get_errno(void);
  284. /* print message: error string for current errno value */
  285. void slurm_perror(const char *msg);
  286. #ifdef __cplusplus
  287. }
  288. #endif
  289. #endif /* !_SLURM_ERRNO_H */