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

« back to all changes in this revision

Viewing changes to src/common/assoc_mgr.h

  • 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:
5
5
 *  Copyright (C) 2008 Lawrence Livermore National Security.
6
6
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
7
 *  Written by Danny Auble <da@llnl.gov>
8
 
 *  LLNL-CODE-402394.
 
8
 *  CODE-OCEC-09-009. All rights reserved.
9
9
 *  
10
10
 *  This file is part of SLURM, a resource management program.
11
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
11
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
12
 *  Please also read the included file: DISCLAIMER.
12
13
 *  
13
14
 *  SLURM is free software; you can redistribute it and/or modify it under
14
15
 *  the terms of the GNU General Public License as published by the Free
62
63
        void (*remove_assoc_notify) (acct_association_rec_t *rec);
63
64
} assoc_init_args_t;
64
65
 
 
66
extern List assoc_mgr_association_list;
 
67
extern List assoc_mgr_qos_list;
 
68
extern List assoc_mgr_user_list;
 
69
extern List assoc_mgr_wckey_list;
 
70
 
 
71
extern acct_association_rec_t *assoc_mgr_root_assoc;
65
72
extern pthread_mutex_t assoc_mgr_association_lock;
 
73
extern pthread_mutex_t assoc_mgr_qos_lock;
 
74
extern pthread_mutex_t assoc_mgr_user_lock;
 
75
extern pthread_mutex_t assoc_mgr_file_lock;
 
76
extern pthread_mutex_t assoc_mgr_wckey_lock;
 
77
 
 
78
/* 
 
79
 * get info from the storage 
 
80
 * IN:  assoc - acct_association_rec_t with at least cluster and
 
81
 *                  account set for account association.  To get user
 
82
 *                  association set user, and optional partition.
 
83
 *                  Sets "id" field with the association ID.
 
84
 * IN: enforce - return an error if no such association exists
 
85
 * IN/OUT: assoc_list - contains a list of assoc_rec ptrs to
 
86
 *                      associations this user has in the list.  This
 
87
 *                      list should be created with list_create(NULL)
 
88
 *                      since we are putting pointers to memory used elsewhere.
 
89
 * RET: SLURM_SUCCESS on success, else SLURM_ERROR
 
90
 */
 
91
extern int assoc_mgr_get_user_assocs(void *db_conn,
 
92
                                     acct_association_rec_t *assoc,
 
93
                                     int enforce, 
 
94
                                     List assoc_list);
66
95
 
67
96
/* 
68
97
 * get info from the storage 
73
102
 * IN: enforce - return an error if no such association exists
74
103
 * IN/OUT: assoc_pptr - if non-NULL then return a pointer to the 
75
104
 *                      acct_association record in cache on success
 
105
 *                      DO NOT FREE.
76
106
 * RET: SLURM_SUCCESS on success, else SLURM_ERROR
77
107
 */
78
108
extern int assoc_mgr_fill_in_assoc(void *db_conn,
85
115
 * IN/OUT:  user - acct_user_rec_t with the name set of the user.
86
116
 *                 "default_account" will be filled in on
87
117
 *                 successful return DO NOT FREE.
 
118
 * IN/OUT: user_pptr - if non-NULL then return a pointer to the 
 
119
 *                     acct_user record in cache on success
 
120
 *                     DO NOT FREE.
88
121
 * RET: SLURM_SUCCESS on success SLURM_ERROR else
89
122
 */
90
123
extern int assoc_mgr_fill_in_user(void *db_conn, acct_user_rec_t *user,
91
 
                                  int enforce);
 
124
                                  int enforce,
 
125
                                  acct_user_rec_t **user_pptr);
92
126
 
93
127
/* 
94
128
 * get info from the storage 
 
129
 * IN/OUT:  qos - acct_qos_rec_t with the id set of the qos.
 
130
 * IN/OUT:  qos_pptr - if non-NULL then return a pointer to the 
 
131
 *                     acct_qos record in cache on success
 
132
 *                     DO NOT FREE.
 
133
 * RET: SLURM_SUCCESS on success SLURM_ERROR else
 
134
 */
 
135
extern int assoc_mgr_fill_in_qos(void *db_conn, acct_qos_rec_t *qos,
 
136
                                 int enforce,
 
137
                                 acct_qos_rec_t **qos_pptr);
 
138
/* 
 
139
 * get info from the storage 
95
140
 * IN/OUT:  wckey - acct_wckey_rec_t with the name, cluster and user
96
141
 *                  for the wckey association. 
97
142
 *                  Sets "id" field with the wckey ID.
125
170
extern int assoc_mgr_init(void *db_conn, assoc_init_args_t *args);
126
171
extern int assoc_mgr_fini(char *state_save_location);
127
172
 
128
 
/* 
129
 
 * update associations in local cache 
130
 
 * IN:  acct_update_object_t *object
131
 
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
132
 
 */
133
 
extern int assoc_mgr_update_local_assocs(acct_update_object_t *update);
134
 
 
135
 
/* 
136
 
 * update wckeys in local cache 
137
 
 * IN:  acct_update_object_t *object
138
 
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
139
 
 */
140
 
extern int assoc_mgr_update_local_wckeys(acct_update_object_t *update);
141
 
 
142
 
/* 
143
 
 * update qos in local cache 
144
 
 * IN:  acct_update_object_t *object
145
 
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
146
 
 */
147
 
extern int assoc_mgr_update_local_qos(acct_update_object_t *update);
148
 
 
149
 
/* 
150
 
 * update users in local cache 
151
 
 * IN:  acct_update_object_t *object
152
 
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
153
 
 */
154
 
extern int assoc_mgr_update_local_users(acct_update_object_t *update);
 
173
/*
 
174
 * get the share information from the association list in the form of
 
175
 * a list containing association_share_object_t's 
 
176
 * IN: uid: uid_t of user issuing the request
 
177
 * IN: acct_list: char * list of accounts you want (NULL for all)
 
178
 * IN: user_list: char * list of user names you want (NULL for all)
 
179
 */
 
180
extern List assoc_mgr_get_shares(
 
181
        void *db_conn, uid_t uid, List acct_list, List user_list);
 
182
 
 
183
/* 
 
184
 * update associations in cache 
 
185
 * IN:  acct_update_object_t *object
 
186
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
 
187
 */
 
188
extern int assoc_mgr_update_assocs(acct_update_object_t *update);
 
189
 
 
190
/* 
 
191
 * update wckeys in cache 
 
192
 * IN:  acct_update_object_t *object
 
193
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
 
194
 */
 
195
extern int assoc_mgr_update_wckeys(acct_update_object_t *update);
 
196
 
 
197
/* 
 
198
 * update qos in cache 
 
199
 * IN:  acct_update_object_t *object
 
200
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
 
201
 */
 
202
extern int assoc_mgr_update_qos(acct_update_object_t *update);
 
203
 
 
204
/* 
 
205
 * update users in cache 
 
206
 * IN:  acct_update_object_t *object
 
207
 * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else
 
208
 */
 
209
extern int assoc_mgr_update_users(acct_update_object_t *update);
155
210
 
156
211
/* 
157
212
 * validate that an association ID is still valid 
178
233
extern int dump_assoc_mgr_state(char *state_save_location);
179
234
 
180
235
/*
 
236
 * Read in the usage for association if the database
 
237
 * is up when starting.
 
238
 */
 
239
extern int load_assoc_usage(char *state_save_location);
 
240
 
 
241
/*
181
242
 * Read in the information of the association mgr if the database
182
243
 * isn't up when starting.
183
244
 */