slurm_errno.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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 <http://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. #define SLURM_FAILURE -1
  55. /* general communication layer return codes */
  56. #define SLURM_SOCKET_ERROR -1
  57. #define SLURM_PROTOCOL_SUCCESS 0
  58. #define SLURM_PROTOCOL_ERROR -1
  59. enum {
  60. /* General Message error codes */
  61. SLURM_UNEXPECTED_MSG_ERROR = 1000,
  62. SLURM_COMMUNICATIONS_CONNECTION_ERROR,
  63. SLURM_COMMUNICATIONS_SEND_ERROR,
  64. SLURM_COMMUNICATIONS_RECEIVE_ERROR,
  65. SLURM_COMMUNICATIONS_SHUTDOWN_ERROR,
  66. SLURM_PROTOCOL_VERSION_ERROR,
  67. SLURM_PROTOCOL_IO_STREAM_VERSION_ERROR,
  68. SLURM_PROTOCOL_AUTHENTICATION_ERROR,
  69. SLURM_PROTOCOL_INSANE_MSG_LENGTH,
  70. SLURM_MPI_PLUGIN_NAME_INVALID,
  71. SLURM_MPI_PLUGIN_PRELAUNCH_SETUP_FAILED,
  72. SLURM_PLUGIN_NAME_INVALID,
  73. SLURM_UNKNOWN_FORWARD_ADDR,
  74. /* communication failures to/from slurmctld */
  75. SLURMCTLD_COMMUNICATIONS_CONNECTION_ERROR = 1800,
  76. SLURMCTLD_COMMUNICATIONS_SEND_ERROR,
  77. SLURMCTLD_COMMUNICATIONS_RECEIVE_ERROR,
  78. SLURMCTLD_COMMUNICATIONS_SHUTDOWN_ERROR,
  79. /* _info.c/communication layer RESPONSE_SLURM_RC message codes */
  80. SLURM_NO_CHANGE_IN_DATA = 1900,
  81. /* slurmctld error codes */
  82. ESLURM_INVALID_PARTITION_NAME = 2000,
  83. ESLURM_DEFAULT_PARTITION_NOT_SET,
  84. ESLURM_ACCESS_DENIED,
  85. ESLURM_JOB_MISSING_REQUIRED_PARTITION_GROUP,
  86. ESLURM_REQUESTED_NODES_NOT_IN_PARTITION,
  87. ESLURM_TOO_MANY_REQUESTED_CPUS,
  88. ESLURM_INVALID_NODE_COUNT,
  89. ESLURM_ERROR_ON_DESC_TO_RECORD_COPY,
  90. ESLURM_JOB_MISSING_SIZE_SPECIFICATION,
  91. ESLURM_JOB_SCRIPT_MISSING,
  92. ESLURM_USER_ID_MISSING = 2010,
  93. ESLURM_DUPLICATE_JOB_ID,
  94. ESLURM_PATHNAME_TOO_LONG,
  95. ESLURM_NOT_TOP_PRIORITY,
  96. ESLURM_REQUESTED_NODE_CONFIG_UNAVAILABLE,
  97. ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE,
  98. ESLURM_NODES_BUSY,
  99. ESLURM_INVALID_JOB_ID,
  100. ESLURM_INVALID_NODE_NAME,
  101. ESLURM_WRITING_TO_FILE,
  102. ESLURM_TRANSITION_STATE_NO_UPDATE = 2020,
  103. ESLURM_ALREADY_DONE,
  104. ESLURM_INTERCONNECT_FAILURE,
  105. ESLURM_BAD_DIST,
  106. ESLURM_JOB_PENDING,
  107. ESLURM_BAD_TASK_COUNT,
  108. ESLURM_INVALID_JOB_CREDENTIAL,
  109. ESLURM_IN_STANDBY_MODE,
  110. ESLURM_INVALID_NODE_STATE,
  111. ESLURM_INVALID_FEATURE,
  112. ESLURM_INVALID_AUTHTYPE_CHANGE = 2030,
  113. ESLURM_INVALID_CHECKPOINT_TYPE_CHANGE,
  114. ESLURM_INVALID_SCHEDTYPE_CHANGE,
  115. ESLURM_INVALID_SELECTTYPE_CHANGE,
  116. ESLURM_INVALID_SWITCHTYPE_CHANGE,
  117. ESLURM_FRAGMENTATION,
  118. ESLURM_NOT_SUPPORTED,
  119. ESLURM_DISABLED,
  120. ESLURM_DEPENDENCY,
  121. ESLURM_BATCH_ONLY,
  122. ESLURM_TASKDIST_ARBITRARY_UNSUPPORTED = 2040,
  123. ESLURM_TASKDIST_REQUIRES_OVERCOMMIT,
  124. ESLURM_JOB_HELD,
  125. ESLURM_INVALID_CRYPTO_TYPE_CHANGE,
  126. ESLURM_INVALID_TASK_MEMORY,
  127. ESLURM_INVALID_ACCOUNT,
  128. ESLURM_INVALID_PARENT_ACCOUNT,
  129. ESLURM_SAME_PARENT_ACCOUNT,
  130. ESLURM_INVALID_LICENSES,
  131. ESLURM_NEED_RESTART,
  132. ESLURM_ACCOUNTING_POLICY = 2050,
  133. ESLURM_INVALID_TIME_LIMIT,
  134. ESLURM_RESERVATION_ACCESS,
  135. ESLURM_RESERVATION_INVALID,
  136. ESLURM_INVALID_TIME_VALUE,
  137. ESLURM_RESERVATION_BUSY,
  138. ESLURM_RESERVATION_NOT_USABLE,
  139. ESLURM_INVALID_WCKEY,
  140. ESLURM_RESERVATION_OVERLAP,
  141. ESLURM_PORTS_BUSY,
  142. ESLURM_PORTS_INVALID = 2060,
  143. ESLURM_PROLOG_RUNNING,
  144. ESLURM_NO_STEPS,
  145. ESLURM_INVALID_BLOCK_STATE,
  146. ESLURM_INVALID_BLOCK_LAYOUT,
  147. ESLURM_INVALID_BLOCK_NAME,
  148. ESLURM_INVALID_QOS,
  149. ESLURM_QOS_PREEMPTION_LOOP,
  150. ESLURM_NODE_NOT_AVAIL,
  151. ESLURM_INVALID_CPU_COUNT,
  152. ESLURM_PARTITION_NOT_AVAIL = 2070,
  153. ESLURM_CIRCULAR_DEPENDENCY,
  154. ESLURM_INVALID_GRES,
  155. ESLURM_JOB_NOT_PENDING,
  156. ESLURM_QOS_THRES,
  157. ESLURM_PARTITION_IN_USE,
  158. ESLURM_STEP_LIMIT,
  159. ESLURM_JOB_SUSPENDED,
  160. ESLURM_CAN_NOT_START_IMMEDIATELY,
  161. ESLURM_INTERCONNECT_BUSY,
  162. ESLURM_RESERVATION_EMPTY = 2080,
  163. ESLURM_INVALID_ARRAY,
  164. ESLURM_RESERVATION_NAME_DUP,
  165. ESLURM_JOB_STARTED,
  166. ESLURM_JOB_FINISHED,
  167. ESLURM_JOB_NOT_RUNNING,
  168. ESLURM_JOB_NOT_PENDING_NOR_RUNNING,
  169. ESLURM_JOB_NOT_SUSPENDED,
  170. ESLURM_JOB_NOT_FINISHED,
  171. ESLURM_TRIGGER_DUP,
  172. ESLURM_INTERNAL = 2090,
  173. ESLURM_INVALID_BURST_BUFFER_CHANGE,
  174. ESLURM_BURST_BUFFER_PERMISSION,
  175. ESLURM_BURST_BUFFER_LIMIT,
  176. ESLURM_INVALID_BURST_BUFFER_REQUEST,
  177. ESLURM_PRIO_RESET_FAIL,
  178. ESLURM_POWER_NOT_AVAIL,
  179. ESLURM_POWER_RESERVED,
  180. ESLURM_INVALID_POWERCAP,
  181. ESLURM_INVALID_MCS_LABEL,
  182. ESLURM_BURST_BUFFER_WAIT = 2100,
  183. /* switch specific error codes, specific values defined in plugin module */
  184. ESLURM_SWITCH_MIN = 3000,
  185. ESLURM_SWITCH_MAX = 3099,
  186. ESLURM_JOBCOMP_MIN = 3100,
  187. ESLURM_JOBCOMP_MAX = 3199,
  188. ESLURM_SCHED_MIN = 3200,
  189. ESLURM_SCHED_MAX = 3299,
  190. /* reserved for other plugin specific error codes up to 3999 */
  191. /* slurmd error codes */
  192. ESLRUMD_PIPE_ERROR_ON_TASK_SPAWN = 4000,
  193. ESLURMD_KILL_TASK_FAILED,
  194. ESLURMD_KILL_JOB_ALREADY_COMPLETE,
  195. ESLURMD_INVALID_ACCT_FREQ,
  196. ESLURMD_INVALID_JOB_CREDENTIAL,
  197. ESLURMD_UID_NOT_FOUND,
  198. ESLURMD_GID_NOT_FOUND,
  199. ESLURMD_CREDENTIAL_EXPIRED,
  200. ESLURMD_CREDENTIAL_REVOKED,
  201. ESLURMD_CREDENTIAL_REPLAYED,
  202. ESLURMD_CREATE_BATCH_DIR_ERROR = 4010,
  203. ESLURMD_MODIFY_BATCH_DIR_ERROR,
  204. ESLURMD_CREATE_BATCH_SCRIPT_ERROR,
  205. ESLURMD_MODIFY_BATCH_SCRIPT_ERROR,
  206. ESLURMD_SETUP_ENVIRONMENT_ERROR,
  207. ESLURMD_SHARED_MEMORY_ERROR,
  208. ESLURMD_SET_UID_OR_GID_ERROR,
  209. ESLURMD_SET_SID_ERROR,
  210. ESLURMD_CANNOT_SPAWN_IO_THREAD,
  211. ESLURMD_FORK_FAILED,
  212. ESLURMD_EXECVE_FAILED = 4020,
  213. ESLURMD_IO_ERROR,
  214. ESLURMD_PROLOG_FAILED,
  215. ESLURMD_EPILOG_FAILED,
  216. ESLURMD_SESSION_KILLED,
  217. ESLURMD_TOOMANYSTEPS,
  218. ESLURMD_STEP_EXISTS,
  219. ESLURMD_JOB_NOTRUNNING,
  220. ESLURMD_STEP_SUSPENDED,
  221. ESLURMD_STEP_NOTSUSPENDED,
  222. /* slurmd errors in user batch job */
  223. ESCRIPT_CHDIR_FAILED = 4100,
  224. ESCRIPT_OPEN_OUTPUT_FAILED,
  225. ESCRIPT_NON_ZERO_RETURN,
  226. /* socket specific SLURM communications error */
  227. SLURM_PROTOCOL_SOCKET_IMPL_ZERO_RECV_LENGTH = 5000,
  228. SLURM_PROTOCOL_SOCKET_IMPL_NEGATIVE_RECV_LENGTH,
  229. SLURM_PROTOCOL_SOCKET_IMPL_NOT_ALL_DATA_SENT,
  230. ESLURM_PROTOCOL_INCOMPLETE_PACKET ,
  231. SLURM_PROTOCOL_SOCKET_IMPL_TIMEOUT ,
  232. SLURM_PROTOCOL_SOCKET_ZERO_BYTES_SENT,
  233. /* slurm_auth errors */
  234. ESLURM_AUTH_CRED_INVALID = 6000,
  235. ESLURM_AUTH_FOPEN_ERROR,
  236. ESLURM_AUTH_NET_ERROR,
  237. ESLURM_AUTH_UNABLE_TO_SIGN,
  238. /* accounting errors */
  239. ESLURM_DB_CONNECTION = 7000,
  240. ESLURM_JOBS_RUNNING_ON_ASSOC,
  241. ESLURM_CLUSTER_DELETED,
  242. ESLURM_ONE_CHANGE,
  243. ESLURM_BAD_NAME,
  244. ESLURM_OVER_ALLOCATE,
  245. /* plugin and custom errors */
  246. ESLURM_MISSING_TIME_LIMIT = 8000,
  247. ESLURM_INVALID_KNL
  248. };
  249. /* look up an errno value */
  250. char * slurm_strerror(int errnum);
  251. /* set an errno value */
  252. void slurm_seterrno(int errnum);
  253. /* get an errno value */
  254. int slurm_get_errno(void);
  255. /* print message: error string for current errno value */
  256. void slurm_perror(char *msg);
  257. #ifdef __cplusplus
  258. }
  259. #endif
  260. #endif /* !_SLURM_ERRNO_H */