|
Lines 2836-2841
extern int cr_job_test(struct job_record *job_ptr, bitstr_t *node_bitmap,
Link Here
|
| 2836 |
uint16_t *layout_ptr = NULL; |
2836 |
uint16_t *layout_ptr = NULL; |
| 2837 |
bitstr_t *orig_map, *avail_cores, *free_cores, *part_core_map = NULL; |
2837 |
bitstr_t *orig_map, *avail_cores, *free_cores, *part_core_map = NULL; |
| 2838 |
bitstr_t *tmpcore = NULL, *reqmap = NULL; |
2838 |
bitstr_t *tmpcore = NULL, *reqmap = NULL; |
|
|
2839 |
bitstr_t *free_cores_tmp = NULL, *node_bitmap_tmp = NULL; |
| 2840 |
bitstr_t *free_cores_tmp2 = NULL, *node_bitmap_tmp2 = NULL; |
| 2839 |
bool test_only; |
2841 |
bool test_only; |
| 2840 |
uint32_t c, j, k, n, csize, total_cpus, save_mem = 0; |
2842 |
uint32_t c, j, k, n, csize, total_cpus, save_mem = 0; |
| 2841 |
int32_t build_cnt; |
2843 |
int32_t build_cnt; |
|
Lines 2843-2848
extern int cr_job_test(struct job_record *job_ptr, bitstr_t *node_bitmap,
Link Here
|
| 2843 |
struct job_details *details_ptr; |
2845 |
struct job_details *details_ptr; |
| 2844 |
struct part_res_record *p_ptr, *jp_ptr; |
2846 |
struct part_res_record *p_ptr, *jp_ptr; |
| 2845 |
uint16_t *cpu_count; |
2847 |
uint16_t *cpu_count; |
|
|
2848 |
uint16_t *cpu_count_tmp; |
| 2846 |
int i, first, last; |
2849 |
int i, first, last; |
| 2847 |
|
2850 |
|
| 2848 |
if (gang_mode == -1) { |
2851 |
if (gang_mode == -1) { |
|
Lines 3162-3167
extern int cr_job_test(struct job_record *job_ptr, bitstr_t *node_bitmap,
Link Here
|
| 3162 |
bit_and(free_cores, tmpcore); |
3165 |
bit_and(free_cores, tmpcore); |
| 3163 |
} |
3166 |
} |
| 3164 |
} |
3167 |
} |
|
|
3168 |
free_cores_tmp = bit_copy(free_cores); |
| 3169 |
node_bitmap_tmp = bit_copy(node_bitmap); |
| 3165 |
cpu_count = _select_nodes(job_ptr, min_nodes, max_nodes, req_nodes, |
3170 |
cpu_count = _select_nodes(job_ptr, min_nodes, max_nodes, req_nodes, |
| 3166 |
node_bitmap, cr_node_cnt, free_cores, |
3171 |
node_bitmap, cr_node_cnt, free_cores, |
| 3167 |
node_usage, cr_type, test_only, |
3172 |
node_usage, cr_type, test_only, |
|
Lines 3176-3181
extern int cr_job_test(struct job_record *job_ptr, bitstr_t *node_bitmap,
Link Here
|
| 3176 |
info("cons_res: cr_job_test: test 3 pass - " |
3181 |
info("cons_res: cr_job_test: test 3 pass - " |
| 3177 |
"found resources"); |
3182 |
"found resources"); |
| 3178 |
} |
3183 |
} |
|
|
3184 |
for (p_ptr = cr_part_ptr; p_ptr; p_ptr = p_ptr->next) { |
| 3185 |
if (p_ptr->part_ptr->priority >= |
| 3186 |
jp_ptr->part_ptr->priority) |
| 3187 |
continue; |
| 3188 |
if (!p_ptr->row) |
| 3189 |
continue; |
| 3190 |
for (i = 0; i < p_ptr->num_rows; i++) { |
| 3191 |
if (!p_ptr->row[i].row_bitmap) |
| 3192 |
continue; |
| 3193 |
bit_copybits(tmpcore, |
| 3194 |
p_ptr->row[i].row_bitmap); |
| 3195 |
bit_not(tmpcore); /* set bits now "free" resources */ |
| 3196 |
bit_and(free_cores_tmp, tmpcore); |
| 3197 |
} |
| 3198 |
if (job_ptr->details->whole_node == 1) { |
| 3199 |
_block_whole_nodes(node_bitmap_tmp, avail_cores, |
| 3200 |
free_cores_tmp); |
| 3201 |
} |
| 3202 |
|
| 3203 |
free_cores_tmp2 = bit_copy(free_cores_tmp); |
| 3204 |
node_bitmap_tmp2 = bit_copy(node_bitmap_tmp); |
| 3205 |
cpu_count_tmp = _select_nodes(job_ptr, min_nodes, |
| 3206 |
max_nodes, req_nodes, |
| 3207 |
node_bitmap_tmp, cr_node_cnt, |
| 3208 |
free_cores_tmp, node_usage, |
| 3209 |
cr_type, test_only, |
| 3210 |
part_core_map, |
| 3211 |
prefer_alloc_nodes); |
| 3212 |
if (!cpu_count_tmp) { |
| 3213 |
FREE_NULL_BITMAP(free_cores_tmp2); |
| 3214 |
FREE_NULL_BITMAP(node_bitmap_tmp2); |
| 3215 |
break; |
| 3216 |
} |
| 3217 |
if (select_debug_flags & DEBUG_FLAG_SELECT_TYPE) { |
| 3218 |
info("cons_res: cr_job_test: remove low-priority partition %s", |
| 3219 |
p_ptr->part_ptr->name); |
| 3220 |
} |
| 3221 |
bit_copybits(free_cores, free_cores_tmp); |
| 3222 |
bit_copybits(node_bitmap, node_bitmap_tmp); |
| 3223 |
bit_copybits(free_cores_tmp, free_cores_tmp2); |
| 3224 |
bit_copybits(node_bitmap_tmp, node_bitmap_tmp2); |
| 3225 |
FREE_NULL_BITMAP(free_cores_tmp2); |
| 3226 |
FREE_NULL_BITMAP(node_bitmap_tmp2); |
| 3227 |
xfree(cpu_count); |
| 3228 |
cpu_count = cpu_count_tmp; |
| 3229 |
} |
| 3179 |
goto alloc_job; |
3230 |
goto alloc_job; |
| 3180 |
} |
3231 |
} |
| 3181 |
if (select_debug_flags & DEBUG_FLAG_SELECT_TYPE) { |
3232 |
if (select_debug_flags & DEBUG_FLAG_SELECT_TYPE) { |
|
Lines 3291-3296
alloc_job:
Link Here
|
| 3291 |
FREE_NULL_BITMAP(avail_cores); |
3342 |
FREE_NULL_BITMAP(avail_cores); |
| 3292 |
FREE_NULL_BITMAP(tmpcore); |
3343 |
FREE_NULL_BITMAP(tmpcore); |
| 3293 |
FREE_NULL_BITMAP(part_core_map); |
3344 |
FREE_NULL_BITMAP(part_core_map); |
|
|
3345 |
FREE_NULL_BITMAP(free_cores_tmp); |
| 3346 |
FREE_NULL_BITMAP(node_bitmap_tmp); |
| 3294 |
if ((!cpu_count) || (!job_ptr->best_switch)) { |
3347 |
if ((!cpu_count) || (!job_ptr->best_switch)) { |
| 3295 |
/* we were sent here to cleanup and exit */ |
3348 |
/* we were sent here to cleanup and exit */ |
| 3296 |
FREE_NULL_BITMAP(free_cores); |
3349 |
FREE_NULL_BITMAP(free_cores); |