1Slurm API(3) Slurm error handling functions Slurm API(3)
2
3
4
6 slurm_get_errno, slurm_perror, slurm_strerror - Slurm error handling
7 functions
8
10 #include <slurm/slurm_errno.h>
11
12 int slurm_get_errno ( );
13
14 void slurm_perror (
15 char *header
16 );
17
18 char * slurm_strerror (
19 int errnum
20 );
21
23 errnum A Slurm error code.
24
25 header A pointer to a string used as a message header for printing
26 along with an error description.
27
29 slurm_get_errno Return the error code as set by the Slurm API function
30 executed.
31
32 slurm_perror Print to standard error the supplied header followed by a
33 colon followed by a text description of the last Slurm error code gen‐
34 erated.
35
36 slurm_strerror Given a Slurm error code, return a pointer to a text
37 description of the error's meaning.
38
40 slurm_get_errno returns an error code or zero if no error was generated
41 by the last Slurm function call executed. slurm_strerror returns a
42 pointer to a text string, which is empty if no error was generated by
43 the last Slurm function call executed.
44
46 #include <stdio.h>
47 #include <slurm/slurm.h>
48 #include <slurm/slurm_errno.h>
49
50 int main (int argc, char *argv[])
51 {
52 /* assume Slurm API function failed here */
53 fprintf (stderr, "Slurm function errno = %d\n",
54 slurm_get_errno ());
55 fprintf (stderr, "Slurm function errno = %d %s\n",
56 slurm_get_errno (),
57 slurm_strerror (slurm_get_errno ()));
58 slurm_perror ("Slurm function");
59 exit (1);
60 }
61
62
64 These functions are included in the libslurm library, which must be
65 linked to your process for use (e.g. "cc -lslurm myprog.c").
66
67
69 Copyright (C) 2002 The Regents of the University of California. Pro‐
70 duced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
71 CODE-OCEC-09-009. All rights reserved.
72
73 This file is part of Slurm, a resource management program. For
74 details, see <https://slurm.schedmd.com/>.
75
76 Slurm is free software; you can redistribute it and/or modify it under
77 the terms of the GNU General Public License as published by the Free
78 Software Foundation; either version 2 of the License, or (at your
79 option) any later version.
80
81 Slurm is distributed in the hope that it will be useful, but WITHOUT
82 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
83 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
84 for more details.
85
87 slurm_allocate_resources(3), slurm_complete_job(3), slurm_com‐
88 plete_job_step(3), slurm_allocation_lookup(3), slurm_free_ctl_conf(3),
89 slurm_free_job_info_msg(3), slurm_free_job_step_create_response_msg(3),
90 slurm_free_node_info(3), slurm_free_partition_info(3),
91 slurm_free_resource_allocation_response_msg(3), slurm_free_sub‐
92 mit_response_response_msg(3), slurm_get_job_steps(3),
93 slurm_init_job_desc_msg(3), slurm_init_part_desc_msg(3),
94 slurm_job_step_create(3), slurm_job_will_run(3), slurm_kill_job(3),
95 slurm_kill_job_step(3), slurm_load_ctl_conf(3), slurm_load_jobs(3),
96 slurm_load_node(3), slurm_load_partitions(3), slurm_pid2jobid(3),
97 slurm_reconfigure(3), slurm_shutdown(3), slurm_submit_batch_job(3),
98 slurm_update_job(3), slurm_update_node(3), slurm_update_partition(3)
99
100
101
102
103
104April 2015 Slurm error handling functions Slurm API(3)