~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to doc/man/man3/slurm_load_reservations.3

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH "Slurm API" "3" "January 2009" "David Bremer" "Slurm reservation information reporting functions"
 
2
.SH "NAME"
 
3
slurm_load_reservations, slurm_free_reservation_info_msg, 
 
4
slurm_print_reservation_info, slurm_sprint_reservation_info,
 
5
slurm_print_reservation_info_msg
 
6
\- Slurm reservation information reporting functions
 
7
.SH "SYNTAX"
 
8
.LP
 
9
#include <stdio.h>
 
10
.br
 
11
#include <slurm/slurm.h>
 
12
.LP 
 
13
int \fBslurm_load_reservations\fR (
 
14
.br 
 
15
        time_t \fIupdate_time\fR, 
 
16
.br 
 
17
        reserve_info_msg_t **\fIreservation_info_msg_pptr\fP
 
18
.br 
 
19
 );
 
20
.LP
 
21
void \fBslurm_free_reservation_info_msg\fR (
 
22
.br 
 
23
        reserve_info_msg_t *\fIreservation_info_msg_ptr\fP
 
24
.br 
 
25
);
 
26
.LP 
 
27
void \fBslurm_print_reservation_info\fR (
 
28
.br
 
29
        FILE *\fIout_file\fP, 
 
30
.br
 
31
        reserve_info_t *\fIreservation_ptr\fP,
 
32
.br
 
33
        int \fIone_liner\fP
 
34
.br 
 
35
);
 
36
.LP 
 
37
char * \fBslurm_sprint_reservation_info\fR (
 
38
.br
 
39
        reserve_info_t *\fIreservation_ptr\fP,
 
40
.br
 
41
        int \fIone_liner\fP
 
42
.br 
 
43
);
 
44
.LP 
 
45
void \fBslurm_print_reservation_info_msg\fR (
 
46
.br
 
47
        FILE *\fIout_file\fP,
 
48
.br
 
49
        reserve_info_msg_t *\fIreservation_info_msg_ptr\fP,
 
50
.br
 
51
        int \fIone_liner\fP
 
52
.br 
 
53
);
 
54
.SH "ARGUMENTS"
 
55
.LP 
 
56
.TP 
 
57
\fIone_liner\fP
 
58
Print one record per line if non\-zero.
 
59
.TP 
 
60
\fIout_file\fP
 
61
Specifies the file to print data to.
 
62
.TP
 
63
\fIreservation_info_msg_pptr\fP
 
64
Specifies the double pointer to the structure to be created and filled 
 
65
with the time of the last reservation update, a record count, and detailed 
 
66
information about each reservation.  Detailed reservation information is 
 
67
written to fixed sized records and includes:  reservation name, time limits, 
 
68
access restrictions, etc.  See slurm.h for full details on the data 
 
69
structure's contents. 
 
70
.TP 
 
71
\fIreservation_info_msg_ptr\fP
 
72
Specifies the pointer to the structure created by \fBslurm_load_reservations\fP. 
 
73
.TP
 
74
\fIupdate_time\fP
 
75
For all of the following informational calls, if update_time is equal to or greater 
 
76
than the last time changes where made to that information, new information is 
 
77
not returned.  Otherwise all the configuration. job, node, or reservation records 
 
78
are returned.
 
79
.SH "DESCRIPTION"
 
80
.LP 
 
81
\fBslurm_load_reservations\fR Returns a reserve_info_msg_t that contains an 
 
82
update time, record count, and array of reservation_table records for all reservations.
 
83
.LP 
 
84
\fBslurm_free_reservation_info_msg\fR Release the storage generated by the 
 
85
\fBslurm_load_reservations\fR function.
 
86
.LP 
 
87
\fBslurm_print_reservation_info\fR  Prints the contents of the data structure 
 
88
describing one of the reservation records from the data loaded by the 
 
89
\fBslurm_load_reservations\fR function.
 
90
.LP 
 
91
\fBslurm_sprint_reservation_info\fR  Prints the sames info as 
 
92
\fBslurm_print_reservation_info\fR, but prints to a string that must be freed 
 
93
by the caller, rather than printing to a file.
 
94
.LP 
 
95
\fBslurm_print_reservation_info_msg\fR Prints the contents of the data 
 
96
structure describing all reservation records loaded by the 
 
97
\fBslurm_load_reservations\fR function.
 
98
.SH "RETURN VALUE"
 
99
.LP
 
100
On success, zero is returned. On error, \-1 is returned, and Slurm error code 
 
101
is set appropriately.
 
102
.SH "ERRORS"
 
103
.LP
 
104
\fBSLURM_NO_CHANGE_IN_DATA\fR Data has not changed since \fBupdate_time\fR.
 
105
.LP
 
106
\fBSLURM_PROTOCOL_VERSION_ERROR\fR Protocol version has changed, re\-link 
 
107
your code.
 
108
.LP
 
109
\fBSLURM_PROTOCOL_SOCKET_IMPL_TIMEOUT\fR Timeout in communicating with 
 
110
SLURM controller.
 
111
.SH "EXAMPLE"
 
112
.LP 
 
113
#include <stdio.h>
 
114
.br
 
115
#include <stdlib.h>
 
116
.br
 
117
#include <slurm/slurm.h>
 
118
.br
 
119
#include <slurm/slurm_errno.h>
 
120
.LP 
 
121
int main (int argc, char *argv[])
 
122
.br 
 
123
{
 
124
.br
 
125
        int i;
 
126
.br
 
127
        reserve_info_msg_t *res_info_ptr = NULL;
 
128
.br
 
129
        reserve_info_t *res_ptr;
 
130
.LP
 
131
        /* get and dump all reservation information */
 
132
.br
 
133
        if (slurm_load_reservations((time_t)NULL,
 
134
.br
 
135
                                    &res_info_ptr)) {
 
136
.br
 
137
                slurm_perror ("slurm_load_reservations error");
 
138
.br
 
139
                exit (1);
 
140
.br
 
141
        }
 
142
.LP
 
143
        /* The easy way to print... */
 
144
.br
 
145
        slurm_print_reservation_info_msg(stdout, 
 
146
.br
 
147
                                         res_info_ptr, 0);
 
148
.LP
 
149
        /* A harder way.. */
 
150
.br
 
151
        for (i = 0; i < res_info_ptr\->record_count; i++) {
 
152
.br
 
153
                res_ptr = &res_info_ptr\->reservation_array[i];
 
154
.br
 
155
                slurm_print_reservation_info(stdout, res_ptr, 0);
 
156
.br
 
157
        }
 
158
.LP
 
159
        /* The hardest way. */
 
160
.br
 
161
        printf("reservations updated at %lx, records=%d\\n",
 
162
.br
 
163
               res_info_ptr\->last_update, 
 
164
.br
 
165
               res_info_ptr\->record_count);
 
166
.br
 
167
        for (i = 0; i < res_info_ptr\->record_count; i++) {
 
168
.br
 
169
                printf ("reservationName=%s Nodes=%s\\n", 
 
170
.br
 
171
                        res_info_ptr\->reservation_array[i].name, 
 
172
.br
 
173
                        res_info_ptr\->reservation_array[i].node_list );
 
174
.br
 
175
        }
 
176
.LP
 
177
        slurm_free_reservation_info_msg (res_info_ptr);
 
178
.br
 
179
        return 0;
 
180
.br 
 
181
}
 
182
 
 
183
.SH "NOTES"
 
184
These functions are included in the libslurm library, 
 
185
which must be linked to your process for use
 
186
(e.g. "cc \-lslurm myprog.c").
 
187
.LP
 
188
The \fBslurm_hostlist_\fR functions can be used to convert SLURM node list
 
189
expressions into a collection of individual node names.
 
190
 
 
191
.SH "COPYING"
 
192
Copyright (C) 2002\-2006 The Regents of the University of California.
 
193
Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 
194
CODE\-OCEC\-09\-009. All rights reserved.
 
195
.LP
 
196
This file is part of SLURM, a resource management program.
 
197
For details, see <https://computing.llnl.gov/linux/slurm/>.
 
198
.LP
 
199
SLURM is free software; you can redistribute it and/or modify it under
 
200
the terms of the GNU General Public License as published by the Free
 
201
Software Foundation; either version 2 of the License, or (at your option)
 
202
any later version.
 
203
.LP
 
204
SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
 
205
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
206
FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
207
details.
 
208
 
 
209
.SH "SEE ALSO"
 
210
.LP 
 
211
\fBscontrol\fR(1), \fBsinfo\fR(1), \fBsqueue\fR(1), 
 
212
\fBslurm_hostlist_create\fR(3), \fBslurm_hostlist_shift\fR(3), 
 
213
\fBslurm_hostlist_destroy\fR(3),
 
214
\fBslurm_get_errno\fR(3), \fBslurm_load_node\fR(3), 
 
215
\fBslurm_perror\fR(3), \fBslurm_strerror\fR(3)
 
216