|
Lines 183-193
static List _list_dup(List license_list)
Link Here
|
| 183 |
return lic_list; |
183 |
return lic_list; |
| 184 |
|
184 |
|
| 185 |
lic_list = list_create(license_free_rec); |
185 |
lic_list = list_create(license_free_rec); |
| 186 |
if (lic_list == NULL) |
|
|
| 187 |
fatal("list_create malloc failure"); |
| 188 |
iter = list_iterator_create(license_list); |
186 |
iter = list_iterator_create(license_list); |
| 189 |
if (!iter) |
|
|
| 190 |
fatal("list_interator_create malloc failure"); |
| 191 |
while ((license_src = (licenses_t *) list_next(iter))) { |
187 |
while ((license_src = (licenses_t *) list_next(iter))) { |
| 192 |
license_dest = xmalloc(sizeof(licenses_t)); |
188 |
license_dest = xmalloc(sizeof(licenses_t)); |
| 193 |
license_dest->name = xstrdup(license_src->name); |
189 |
license_dest->name = xstrdup(license_src->name); |
|
Lines 548-555
static int _set_assoc_list(slurmctld_resv_t *resv_ptr)
Link Here
|
| 548 |
xfree(resv_ptr->assoc_list); /* clear for modify */ |
544 |
xfree(resv_ptr->assoc_list); /* clear for modify */ |
| 549 |
if (list_count(assoc_list_allow)) { |
545 |
if (list_count(assoc_list_allow)) { |
| 550 |
ListIterator itr = list_iterator_create(assoc_list_allow); |
546 |
ListIterator itr = list_iterator_create(assoc_list_allow); |
| 551 |
if (!itr) |
|
|
| 552 |
fatal("malloc: list_iterator_create"); |
| 553 |
while ((assoc_ptr = list_next(itr))) { |
547 |
while ((assoc_ptr = list_next(itr))) { |
| 554 |
if (resv_ptr->assoc_list) { |
548 |
if (resv_ptr->assoc_list) { |
| 555 |
xstrfmtcat(resv_ptr->assoc_list, "%u,", |
549 |
xstrfmtcat(resv_ptr->assoc_list, "%u,", |
|
Lines 563-570
static int _set_assoc_list(slurmctld_resv_t *resv_ptr)
Link Here
|
| 563 |
} |
557 |
} |
| 564 |
if (list_count(assoc_list_deny)) { |
558 |
if (list_count(assoc_list_deny)) { |
| 565 |
ListIterator itr = list_iterator_create(assoc_list_deny); |
559 |
ListIterator itr = list_iterator_create(assoc_list_deny); |
| 566 |
if (!itr) |
|
|
| 567 |
fatal("malloc: list_iterator_create"); |
| 568 |
while ((assoc_ptr = list_next(itr))) { |
560 |
while ((assoc_ptr = list_next(itr))) { |
| 569 |
if (resv_ptr->assoc_list) { |
561 |
if (resv_ptr->assoc_list) { |
| 570 |
xstrfmtcat(resv_ptr->assoc_list, "-%u,", |
562 |
xstrfmtcat(resv_ptr->assoc_list, "-%u,", |
|
Lines 686-694
static int _post_resv_update(slurmctld_resv_t *resv_ptr,
Link Here
|
| 686 |
* new start time of now. */ |
678 |
* new start time of now. */ |
| 687 |
if ((resv_ptr->start_time < now) |
679 |
if ((resv_ptr->start_time < now) |
| 688 |
&& (resv.assocs |
680 |
&& (resv.assocs |
| 689 |
|| resv.nodes |
681 |
|| resv.nodes |
| 690 |
|| (resv.flags != (uint16_t)NO_VAL) |
682 |
|| (resv.flags != (uint16_t)NO_VAL) |
| 691 |
|| (resv.cpus != (uint32_t)NO_VAL))) { |
683 |
|| (resv.cpus != (uint32_t)NO_VAL))) { |
| 692 |
resv_ptr->start_time_prev = resv_ptr->start_time; |
684 |
resv_ptr->start_time_prev = resv_ptr->start_time; |
| 693 |
resv_ptr->start_time = now; |
685 |
resv_ptr->start_time = now; |
| 694 |
} |
686 |
} |
|
Lines 1207-1213
static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer,
Link Here
|
| 1207 |
cnode_cnt = resv_ptr->node_cnt; |
1199 |
cnode_cnt = resv_ptr->node_cnt; |
| 1208 |
if (cnodes_per_bp && !internal) |
1200 |
if (cnodes_per_bp && !internal) |
| 1209 |
cnode_cnt *= cnodes_per_bp; |
1201 |
cnode_cnt *= cnodes_per_bp; |
| 1210 |
pack32(cnode_cnt, buffer); |
1202 |
pack32(cnode_cnt, buffer); |
| 1211 |
#else |
1203 |
#else |
| 1212 |
pack32(resv_ptr->node_cnt, buffer); |
1204 |
pack32(resv_ptr->node_cnt, buffer); |
| 1213 |
#endif |
1205 |
#endif |
|
Lines 1247-1253
static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer,
Link Here
|
| 1247 |
cnode_cnt = resv_ptr->node_cnt; |
1239 |
cnode_cnt = resv_ptr->node_cnt; |
| 1248 |
if (cnodes_per_bp && !internal) |
1240 |
if (cnodes_per_bp && !internal) |
| 1249 |
cnode_cnt *= cnodes_per_bp; |
1241 |
cnode_cnt *= cnodes_per_bp; |
| 1250 |
pack32(cnode_cnt, buffer); |
1242 |
pack32(cnode_cnt, buffer); |
| 1251 |
#else |
1243 |
#else |
| 1252 |
pack32(resv_ptr->node_cnt, buffer); |
1244 |
pack32(resv_ptr->node_cnt, buffer); |
| 1253 |
#endif |
1245 |
#endif |
|
Lines 1371-1378
static bool _job_overlap(time_t start_time, uint16_t flags,
Link Here
|
| 1371 |
return overlap; |
1363 |
return overlap; |
| 1372 |
|
1364 |
|
| 1373 |
job_iterator = list_iterator_create(job_list); |
1365 |
job_iterator = list_iterator_create(job_list); |
| 1374 |
if (!job_iterator) |
|
|
| 1375 |
fatal("malloc: list_iterator_create"); |
| 1376 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
1366 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
| 1377 |
if (IS_JOB_RUNNING(job_ptr) && |
1367 |
if (IS_JOB_RUNNING(job_ptr) && |
| 1378 |
(job_ptr->end_time > start_time) && |
1368 |
(job_ptr->end_time > start_time) && |
|
Lines 1407-1414
static bool _resv_overlap(time_t start_time, time_t end_time,
Link Here
|
| 1407 |
return rc; |
1397 |
return rc; |
| 1408 |
|
1398 |
|
| 1409 |
iter = list_iterator_create(resv_list); |
1399 |
iter = list_iterator_create(resv_list); |
| 1410 |
if (!iter) |
|
|
| 1411 |
fatal("malloc: list_iterator_create"); |
| 1412 |
|
1400 |
|
| 1413 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
1401 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 1414 |
if (resv_ptr == this_resv_ptr) |
1402 |
if (resv_ptr == this_resv_ptr) |
|
Lines 2121-2128
extern int update_resv(resv_desc_msg_t *resv_desc_ptr)
Link Here
|
| 2121 |
update_failure: |
2109 |
update_failure: |
| 2122 |
/* Restore backup reservation data */ |
2110 |
/* Restore backup reservation data */ |
| 2123 |
iter = list_iterator_create(resv_list); |
2111 |
iter = list_iterator_create(resv_list); |
| 2124 |
if (!iter) |
|
|
| 2125 |
fatal("list_iterator_create: malloc failure"); |
| 2126 |
while ((resv_next = (slurmctld_resv_t *) list_next(iter))) { |
2112 |
while ((resv_next = (slurmctld_resv_t *) list_next(iter))) { |
| 2127 |
if (resv_next == resv_ptr) { |
2113 |
if (resv_next == resv_ptr) { |
| 2128 |
list_delete_item(iter); |
2114 |
list_delete_item(iter); |
|
Lines 2144-2151
static bool _is_resv_used(slurmctld_resv_t *resv_ptr)
Link Here
|
| 2144 |
bool match = false; |
2130 |
bool match = false; |
| 2145 |
|
2131 |
|
| 2146 |
job_iterator = list_iterator_create(job_list); |
2132 |
job_iterator = list_iterator_create(job_list); |
| 2147 |
if (!job_iterator) |
|
|
| 2148 |
fatal("malloc: list_iterator_create"); |
| 2149 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
2133 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
| 2150 |
if ((!IS_JOB_FINISHED(job_ptr)) && |
2134 |
if ((!IS_JOB_FINISHED(job_ptr)) && |
| 2151 |
(job_ptr->resv_id == resv_ptr->resv_id)) { |
2135 |
(job_ptr->resv_id == resv_ptr->resv_id)) { |
|
Lines 2165-2172
static void _clear_job_resv(slurmctld_resv_t *resv_ptr)
Link Here
|
| 2165 |
struct job_record *job_ptr; |
2149 |
struct job_record *job_ptr; |
| 2166 |
|
2150 |
|
| 2167 |
job_iterator = list_iterator_create(job_list); |
2151 |
job_iterator = list_iterator_create(job_list); |
| 2168 |
if (!job_iterator) |
|
|
| 2169 |
fatal("malloc: list_iterator_create"); |
| 2170 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
2152 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
| 2171 |
if (job_ptr->resv_ptr != resv_ptr) |
2153 |
if (job_ptr->resv_ptr != resv_ptr) |
| 2172 |
continue; |
2154 |
continue; |
|
Lines 2194-2201
extern int delete_resv(reservation_name_msg_t *resv_desc_ptr)
Link Here
|
| 2194 |
info("delete_resv: Name=%s", resv_desc_ptr->name); |
2176 |
info("delete_resv: Name=%s", resv_desc_ptr->name); |
| 2195 |
|
2177 |
|
| 2196 |
iter = list_iterator_create(resv_list); |
2178 |
iter = list_iterator_create(resv_list); |
| 2197 |
if (!iter) |
|
|
| 2198 |
fatal("malloc: list_iterator_create"); |
| 2199 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
2179 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 2200 |
if (strcmp(resv_ptr->name, resv_desc_ptr->name)) |
2180 |
if (strcmp(resv_ptr->name, resv_desc_ptr->name)) |
| 2201 |
continue; |
2181 |
continue; |
|
Lines 2256-2263
extern void show_resv(char **buffer_ptr, int *buffer_size, uid_t uid,
Link Here
|
| 2256 |
|
2236 |
|
| 2257 |
/* write individual reservation records */ |
2237 |
/* write individual reservation records */ |
| 2258 |
iter = list_iterator_create(resv_list); |
2238 |
iter = list_iterator_create(resv_list); |
| 2259 |
if (!iter) |
|
|
| 2260 |
fatal("malloc: list_iterator_create"); |
| 2261 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
2239 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 2262 |
if ((slurmctld_conf.private_data & PRIVATE_DATA_RESERVATIONS) |
2240 |
if ((slurmctld_conf.private_data & PRIVATE_DATA_RESERVATIONS) |
| 2263 |
&& !validate_operator(uid)) { |
2241 |
&& !validate_operator(uid)) { |
|
Lines 2312-2319
extern int dump_all_resv_state(void)
Link Here
|
| 2312 |
/* write reservation records to buffer */ |
2290 |
/* write reservation records to buffer */ |
| 2313 |
lock_slurmctld(resv_read_lock); |
2291 |
lock_slurmctld(resv_read_lock); |
| 2314 |
iter = list_iterator_create(resv_list); |
2292 |
iter = list_iterator_create(resv_list); |
| 2315 |
if (!iter) |
|
|
| 2316 |
fatal("malloc: list_iterator_create"); |
| 2317 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) |
2293 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) |
| 2318 |
_pack_resv(resv_ptr, buffer, true, SLURM_PROTOCOL_VERSION); |
2294 |
_pack_resv(resv_ptr, buffer, true, SLURM_PROTOCOL_VERSION); |
| 2319 |
list_iterator_destroy(iter); |
2295 |
list_iterator_destroy(iter); |
|
Lines 2478-2485
static void _validate_all_reservations(void)
Link Here
|
| 2478 |
uint32_t res_num; |
2454 |
uint32_t res_num; |
| 2479 |
|
2455 |
|
| 2480 |
iter = list_iterator_create(resv_list); |
2456 |
iter = list_iterator_create(resv_list); |
| 2481 |
if (!iter) |
|
|
| 2482 |
fatal("malloc: list_iterator_create"); |
| 2483 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
2457 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 2484 |
if (!_validate_one_reservation(resv_ptr)) { |
2458 |
if (!_validate_one_reservation(resv_ptr)) { |
| 2485 |
error("Purging invalid reservation record %s", |
2459 |
error("Purging invalid reservation record %s", |
|
Lines 2500-2507
static void _validate_all_reservations(void)
Link Here
|
| 2500 |
|
2474 |
|
| 2501 |
/* Validate all job reservation pointers */ |
2475 |
/* Validate all job reservation pointers */ |
| 2502 |
iter = list_iterator_create(job_list); |
2476 |
iter = list_iterator_create(job_list); |
| 2503 |
if (!iter) |
|
|
| 2504 |
fatal("malloc: list_iterator_create"); |
| 2505 |
while ((job_ptr = (struct job_record *) list_next(iter))) { |
2477 |
while ((job_ptr = (struct job_record *) list_next(iter))) { |
| 2506 |
if (job_ptr->resv_name == NULL) |
2478 |
if (job_ptr->resv_name == NULL) |
| 2507 |
continue; |
2479 |
continue; |
|
Lines 2840-2847
static int _resize_resv(slurmctld_resv_t *resv_ptr, uint32_t node_cnt)
Link Here
|
| 2840 |
static void _create_cluster_core_bitmap(bitstr_t **core_bitmap) |
2812 |
static void _create_cluster_core_bitmap(bitstr_t **core_bitmap) |
| 2841 |
{ |
2813 |
{ |
| 2842 |
*core_bitmap = bit_alloc(cr_get_coremap_offset(node_record_count)); |
2814 |
*core_bitmap = bit_alloc(cr_get_coremap_offset(node_record_count)); |
| 2843 |
if (*core_bitmap == NULL) |
|
|
| 2844 |
fatal("bit_alloc: malloc failure"); |
| 2845 |
} |
2815 |
} |
| 2846 |
|
2816 |
|
| 2847 |
/* Given a reservation create request, select appropriate nodes for use */ |
2817 |
/* Given a reservation create request, select appropriate nodes for use */ |
|
Lines 2870-2877
static int _select_nodes(resv_desc_msg_t *resv_desc_ptr,
Link Here
|
| 2870 |
/* Don't use node already reserved */ |
2840 |
/* Don't use node already reserved */ |
| 2871 |
if (!(resv_desc_ptr->flags & RESERVE_FLAG_OVERLAP)) { |
2841 |
if (!(resv_desc_ptr->flags & RESERVE_FLAG_OVERLAP)) { |
| 2872 |
iter = list_iterator_create(resv_list); |
2842 |
iter = list_iterator_create(resv_list); |
| 2873 |
if (!iter) |
|
|
| 2874 |
fatal("malloc: list_iterator_create"); |
| 2875 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
2843 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 2876 |
if (resv_ptr->end_time <= now) |
2844 |
if (resv_ptr->end_time <= now) |
| 2877 |
_advance_resv_time(resv_ptr); |
2845 |
_advance_resv_time(resv_ptr); |
|
Lines 2907-2915
static int _select_nodes(resv_desc_msg_t *resv_desc_ptr,
Link Here
|
| 2907 |
ListIterator feature_iter; |
2875 |
ListIterator feature_iter; |
| 2908 |
bool match; |
2876 |
bool match; |
| 2909 |
|
2877 |
|
| 2910 |
if (feature_bitmap == NULL) |
|
|
| 2911 |
fatal("bit_copy malloc failure"); |
| 2912 |
|
| 2913 |
while (1) { |
2878 |
while (1) { |
| 2914 |
for (i=0; ; i++) { |
2879 |
for (i=0; ; i++) { |
| 2915 |
if (token[i] == '\0') { |
2880 |
if (token[i] == '\0') { |
|
Lines 2931-2938
static int _select_nodes(resv_desc_msg_t *resv_desc_ptr,
Link Here
|
| 2931 |
|
2896 |
|
| 2932 |
match = false; |
2897 |
match = false; |
| 2933 |
feature_iter = list_iterator_create(feature_list); |
2898 |
feature_iter = list_iterator_create(feature_list); |
| 2934 |
if (feature_iter == NULL) |
|
|
| 2935 |
fatal("list_iterator_create malloc failure"); |
| 2936 |
while ((feature_ptr = (struct features_record *) |
2899 |
while ((feature_ptr = (struct features_record *) |
| 2937 |
list_next(feature_iter))) { |
2900 |
list_next(feature_iter))) { |
| 2938 |
if (strcmp(token, feature_ptr->name)) |
2901 |
if (strcmp(token, feature_ptr->name)) |
|
Lines 3088-3095
static void _check_job_compatibility(struct job_record *job_ptr,
Link Here
|
| 3088 |
debug2("job coremap: %s", str); |
3051 |
debug2("job coremap: %s", str); |
| 3089 |
|
3052 |
|
| 3090 |
full_node_bitmap = bit_copy(job_res->node_bitmap); |
3053 |
full_node_bitmap = bit_copy(job_res->node_bitmap); |
| 3091 |
if (full_node_bitmap == NULL) |
|
|
| 3092 |
fatal("bit_alloc: malloc failure"); |
| 3093 |
|
3054 |
|
| 3094 |
debug2("Let's see core distribution for jobid: %u", |
3055 |
debug2("Let's see core distribution for jobid: %u", |
| 3095 |
job_ptr->job_id); |
3056 |
job_ptr->job_id); |
|
Lines 3163-3170
static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap,
Link Here
|
| 3163 |
save_bitmap = bit_copy(avail_bitmap); |
3124 |
save_bitmap = bit_copy(avail_bitmap); |
| 3164 |
bit_or(avail_bitmap, save_bitmap); /* restore avail_bitmap */ |
3125 |
bit_or(avail_bitmap, save_bitmap); /* restore avail_bitmap */ |
| 3165 |
job_iterator = list_iterator_create(job_list); |
3126 |
job_iterator = list_iterator_create(job_list); |
| 3166 |
if (job_iterator == NULL) |
|
|
| 3167 |
fatal("list_iterator_create: malloc failure"); |
| 3168 |
|
3127 |
|
| 3169 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
3128 |
while ((job_ptr = (struct job_record *) list_next(job_iterator))) { |
| 3170 |
if (!IS_JOB_RUNNING(job_ptr) && !IS_JOB_SUSPENDED(job_ptr)) |
3129 |
if (!IS_JOB_RUNNING(job_ptr) && !IS_JOB_SUSPENDED(job_ptr)) |
|
Lines 3194-3201
static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap,
Link Here
|
| 3194 |
* the unsorted job list. */ |
3153 |
* the unsorted job list. */ |
| 3195 |
if (resv_desc_ptr->flags & RESERVE_FLAG_IGN_JOBS) { |
3154 |
if (resv_desc_ptr->flags & RESERVE_FLAG_IGN_JOBS) { |
| 3196 |
job_iterator = list_iterator_create(job_list); |
3155 |
job_iterator = list_iterator_create(job_list); |
| 3197 |
if (!job_iterator) |
|
|
| 3198 |
fatal("list_iterator_create: malloc failure"); |
| 3199 |
while ((job_ptr = (struct job_record *) |
3156 |
while ((job_ptr = (struct job_record *) |
| 3200 |
list_next(job_iterator))) { |
3157 |
list_next(job_iterator))) { |
| 3201 |
if (!IS_JOB_RUNNING(job_ptr) && |
3158 |
if (!IS_JOB_RUNNING(job_ptr) && |
|
Lines 3395-3402
extern void job_time_adj_resv(struct job_record *job_ptr)
Link Here
|
| 3395 |
int32_t resv_begin_time; |
3352 |
int32_t resv_begin_time; |
| 3396 |
|
3353 |
|
| 3397 |
iter = list_iterator_create(resv_list); |
3354 |
iter = list_iterator_create(resv_list); |
| 3398 |
if (!iter) |
|
|
| 3399 |
fatal("malloc: list_iterator_create"); |
| 3400 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3355 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 3401 |
if (resv_ptr->end_time <= now) |
3356 |
if (resv_ptr->end_time <= now) |
| 3402 |
_advance_resv_time(resv_ptr); |
3357 |
_advance_resv_time(resv_ptr); |
|
Lines 3432-3439
static int _license_cnt(List license_list, char *lic_name)
Link Here
|
| 3432 |
return lic_cnt; |
3387 |
return lic_cnt; |
| 3433 |
|
3388 |
|
| 3434 |
iter = list_iterator_create(license_list); |
3389 |
iter = list_iterator_create(license_list); |
| 3435 |
if (!iter) |
|
|
| 3436 |
fatal("list_interator_create malloc failure"); |
| 3437 |
while ((license_ptr = list_next(iter))) { |
3390 |
while ((license_ptr = list_next(iter))) { |
| 3438 |
if (strcmp(license_ptr->name, lic_name) == 0) |
3391 |
if (strcmp(license_ptr->name, lic_name) == 0) |
| 3439 |
lic_cnt += license_ptr->total; |
3392 |
lic_cnt += license_ptr->total; |
|
Lines 3490-3497
extern int job_test_lic_resv(struct job_record *job_ptr, char *lic_name,
Link Here
|
| 3490 |
job_start_time = when; |
3443 |
job_start_time = when; |
| 3491 |
job_end_time = when + _get_job_duration(job_ptr); |
3444 |
job_end_time = when + _get_job_duration(job_ptr); |
| 3492 |
iter = list_iterator_create(resv_list); |
3445 |
iter = list_iterator_create(resv_list); |
| 3493 |
if (!iter) |
|
|
| 3494 |
fatal("malloc: list_iterator_create"); |
| 3495 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3446 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 3496 |
if (resv_ptr->end_time <= now) |
3447 |
if (resv_ptr->end_time <= now) |
| 3497 |
_advance_resv_time(resv_ptr); |
3448 |
_advance_resv_time(resv_ptr); |
|
Lines 3578-3585
extern int job_test_resv(struct job_record *job_ptr, time_t *when,
Link Here
|
| 3578 |
} |
3529 |
} |
| 3579 |
if (resv_ptr->flags & RESERVE_FLAG_LIC_ONLY) { |
3530 |
if (resv_ptr->flags & RESERVE_FLAG_LIC_ONLY) { |
| 3580 |
*node_bitmap = bit_alloc(node_record_count); |
3531 |
*node_bitmap = bit_alloc(node_record_count); |
| 3581 |
if (*node_bitmap == NULL) |
|
|
| 3582 |
fatal("bit_alloc: malloc failure"); |
| 3583 |
bit_nset(*node_bitmap, 0, (node_record_count - 1)); |
3532 |
bit_nset(*node_bitmap, 0, (node_record_count - 1)); |
| 3584 |
} else |
3533 |
} else |
| 3585 |
*node_bitmap = bit_copy(resv_ptr->node_bitmap); |
3534 |
*node_bitmap = bit_copy(resv_ptr->node_bitmap); |
|
Lines 3587-3594
extern int job_test_resv(struct job_record *job_ptr, time_t *when,
Link Here
|
| 3587 |
/* if there are any overlapping reservations, we need to |
3536 |
/* if there are any overlapping reservations, we need to |
| 3588 |
* prevent the job from using those nodes (e.g. MAINT nodes) */ |
3537 |
* prevent the job from using those nodes (e.g. MAINT nodes) */ |
| 3589 |
iter = list_iterator_create(resv_list); |
3538 |
iter = list_iterator_create(resv_list); |
| 3590 |
if (!iter) |
|
|
| 3591 |
fatal("malloc: list_iterator_create"); |
| 3592 |
while ((res2_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3539 |
while ((res2_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 3593 |
if ((resv_ptr->flags & RESERVE_FLAG_MAINT) || |
3540 |
if ((resv_ptr->flags & RESERVE_FLAG_MAINT) || |
| 3594 |
(resv_ptr->flags & RESERVE_FLAG_OVERLAP) || |
3541 |
(resv_ptr->flags & RESERVE_FLAG_OVERLAP) || |
|
Lines 3623-3630
extern int job_test_resv(struct job_record *job_ptr, time_t *when,
Link Here
|
| 3623 |
|
3570 |
|
| 3624 |
job_ptr->resv_ptr = NULL; /* should be redundant */ |
3571 |
job_ptr->resv_ptr = NULL; /* should be redundant */ |
| 3625 |
*node_bitmap = bit_alloc(node_record_count); |
3572 |
*node_bitmap = bit_alloc(node_record_count); |
| 3626 |
if (*node_bitmap == NULL) |
|
|
| 3627 |
fatal("bit_alloc: malloc failure"); |
| 3628 |
bit_nset(*node_bitmap, 0, (node_record_count - 1)); |
3573 |
bit_nset(*node_bitmap, 0, (node_record_count - 1)); |
| 3629 |
if (list_count(resv_list) == 0) |
3574 |
if (list_count(resv_list) == 0) |
| 3630 |
return SLURM_SUCCESS; |
3575 |
return SLURM_SUCCESS; |
|
Lines 3635-3642
extern int job_test_resv(struct job_record *job_ptr, time_t *when,
Link Here
|
| 3635 |
lic_resv_time = (time_t) 0; |
3580 |
lic_resv_time = (time_t) 0; |
| 3636 |
|
3581 |
|
| 3637 |
iter = list_iterator_create(resv_list); |
3582 |
iter = list_iterator_create(resv_list); |
| 3638 |
if (!iter) |
|
|
| 3639 |
fatal("malloc: list_iterator_create"); |
| 3640 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3583 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 3641 |
if (resv_ptr->end_time <= now) |
3584 |
if (resv_ptr->end_time <= now) |
| 3642 |
_advance_resv_time(resv_ptr); |
3585 |
_advance_resv_time(resv_ptr); |
|
Lines 3674-3680
extern int job_test_resv(struct job_record *job_ptr, time_t *when,
Link Here
|
| 3674 |
info("job_test_resv: %s reservation uses " |
3617 |
info("job_test_resv: %s reservation uses " |
| 3675 |
"partial nodes", resv_ptr->name); |
3618 |
"partial nodes", resv_ptr->name); |
| 3676 |
if (*exc_core_bitmap == NULL) { |
3619 |
if (*exc_core_bitmap == NULL) { |
| 3677 |
*exc_core_bitmap = |
3620 |
*exc_core_bitmap = |
| 3678 |
bit_copy(resv_ptr->core_bitmap); |
3621 |
bit_copy(resv_ptr->core_bitmap); |
| 3679 |
} else { |
3622 |
} else { |
| 3680 |
bit_or(*exc_core_bitmap, |
3623 |
bit_or(*exc_core_bitmap, |
|
Lines 3725-3732
extern time_t find_resv_end(time_t start_time)
Link Here
|
| 3725 |
return end_time; |
3668 |
return end_time; |
| 3726 |
|
3669 |
|
| 3727 |
iter = list_iterator_create(resv_list); |
3670 |
iter = list_iterator_create(resv_list); |
| 3728 |
if (!iter) |
|
|
| 3729 |
fatal("malloc: list_iterator_create"); |
| 3730 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3671 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 3731 |
if ((start_time < resv_ptr->start_time) || |
3672 |
if ((start_time < resv_ptr->start_time) || |
| 3732 |
(start_time > resv_ptr->end_time)) |
3673 |
(start_time > resv_ptr->end_time)) |
|
Lines 3757-3764
extern void begin_job_resv_check(void)
Link Here
|
| 3757 |
resv_over_run *= 60; |
3698 |
resv_over_run *= 60; |
| 3758 |
|
3699 |
|
| 3759 |
iter = list_iterator_create(resv_list); |
3700 |
iter = list_iterator_create(resv_list); |
| 3760 |
if (!iter) |
|
|
| 3761 |
fatal("malloc: list_iterator_create"); |
| 3762 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3701 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 3763 |
resv_ptr->job_pend_cnt = 0; |
3702 |
resv_ptr->job_pend_cnt = 0; |
| 3764 |
resv_ptr->job_run_cnt = 0; |
3703 |
resv_ptr->job_run_cnt = 0; |
|
Lines 3796-3802
extern int job_resv_check(struct job_record *job_ptr)
Link Here
|
| 3796 |
return SLURM_SUCCESS; |
3735 |
return SLURM_SUCCESS; |
| 3797 |
} |
3736 |
} |
| 3798 |
|
3737 |
|
| 3799 |
/* Advance a expired reservation's time stamps one day or one week |
3738 |
/* Advance a expired reservation's time stamps one day or one week |
| 3800 |
* as appropriate. */ |
3739 |
* as appropriate. */ |
| 3801 |
static void _advance_resv_time(slurmctld_resv_t *resv_ptr) |
3740 |
static void _advance_resv_time(slurmctld_resv_t *resv_ptr) |
| 3802 |
{ |
3741 |
{ |
|
Lines 3926-3933
extern void fini_job_resv_check(void)
Link Here
|
| 3926 |
return; |
3865 |
return; |
| 3927 |
|
3866 |
|
| 3928 |
iter = list_iterator_create(resv_list); |
3867 |
iter = list_iterator_create(resv_list); |
| 3929 |
if (!iter) |
|
|
| 3930 |
fatal("malloc: list_iterator_create"); |
| 3931 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3868 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 3932 |
if (!resv_ptr->run_prolog || !resv_ptr->run_epilog) |
3869 |
if (!resv_ptr->run_prolog || !resv_ptr->run_epilog) |
| 3933 |
continue; |
3870 |
continue; |
|
Lines 3965-3972
extern int send_resvs_to_accounting(void)
Link Here
|
| 3965 |
return SLURM_SUCCESS; |
3902 |
return SLURM_SUCCESS; |
| 3966 |
|
3903 |
|
| 3967 |
itr = list_iterator_create(resv_list); |
3904 |
itr = list_iterator_create(resv_list); |
| 3968 |
if (!itr) |
|
|
| 3969 |
fatal("malloc: list_iterator_create"); |
| 3970 |
while ((resv_ptr = list_next(itr))) { |
3905 |
while ((resv_ptr = list_next(itr))) { |
| 3971 |
_post_resv_create(resv_ptr); |
3906 |
_post_resv_create(resv_ptr); |
| 3972 |
} |
3907 |
} |
|
Lines 3996-4003
extern void set_node_maint_mode(bool reset_all)
Link Here
|
| 3996 |
} |
3931 |
} |
| 3997 |
} |
3932 |
} |
| 3998 |
iter = list_iterator_create(resv_list); |
3933 |
iter = list_iterator_create(resv_list); |
| 3999 |
if (!iter) |
|
|
| 4000 |
fatal("malloc: list_iterator_create"); |
| 4001 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3934 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 4002 |
if ((resv_ptr->start_time <= now) && !resv_ptr->run_prolog) { |
3935 |
if ((resv_ptr->start_time <= now) && !resv_ptr->run_prolog) { |
| 4003 |
resv_ptr->run_prolog = true; |
3936 |
resv_ptr->run_prolog = true; |
|
Lines 4038-4045
extern bool is_node_in_maint_reservation(int nodenum)
Link Here
|
| 4038 |
return false; |
3971 |
return false; |
| 4039 |
|
3972 |
|
| 4040 |
iter = list_iterator_create(resv_list); |
3973 |
iter = list_iterator_create(resv_list); |
| 4041 |
if (!iter) |
|
|
| 4042 |
fatal("malloc: list_iterator_create"); |
| 4043 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
3974 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 4044 |
if ((resv_ptr->flags & RESERVE_FLAG_MAINT) == 0) |
3975 |
if ((resv_ptr->flags & RESERVE_FLAG_MAINT) == 0) |
| 4045 |
continue; |
3976 |
continue; |
|
Lines 4062-4069
extern void update_assocs_in_resvs(void)
Link Here
|
| 4062 |
error("No reservation list given for updating associations"); |
3993 |
error("No reservation list given for updating associations"); |
| 4063 |
|
3994 |
|
| 4064 |
iter = list_iterator_create(resv_list); |
3995 |
iter = list_iterator_create(resv_list); |
| 4065 |
if (!iter) |
|
|
| 4066 |
fatal("malloc: list_iterator_create"); |
| 4067 |
while ((resv_ptr = list_next(iter))) { |
3996 |
while ((resv_ptr = list_next(iter))) { |
| 4068 |
_set_assoc_list(resv_ptr); |
3997 |
_set_assoc_list(resv_ptr); |
| 4069 |
} |
3998 |
} |
|
Lines 4078-4085
extern void update_part_nodes_in_resv(struct part_record *part_ptr)
Link Here
|
| 4078 |
xassert(part_ptr); |
4007 |
xassert(part_ptr); |
| 4079 |
|
4008 |
|
| 4080 |
iter = list_iterator_create(resv_list); |
4009 |
iter = list_iterator_create(resv_list); |
| 4081 |
if (!iter) |
|
|
| 4082 |
fatal("malloc: list_iterator_create"); |
| 4083 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
4010 |
while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) { |
| 4084 |
if ((resv_ptr->flags & RESERVE_FLAG_PART_NODES) && |
4011 |
if ((resv_ptr->flags & RESERVE_FLAG_PART_NODES) && |
| 4085 |
(resv_ptr->partition != NULL) && |
4012 |
(resv_ptr->partition != NULL) && |