ports/sysutils/slurm-hpc/files/patch-src-plugins-select-cons_res-dist_tasks.c
Boris Samorodov 3110f294ef SLURM is an open-source resource manager designed for *nix clusters of all
sizes. It provides three key functions. First it allocates exclusive and/or
non-exclusive access to resources (computer nodes) to users for some duration
of time so they can perform work. Second, it provides a framework for starting,
executing, and monitoring work (typically a parallel job) on a set of allocated
nodes. Finally, it arbitrates contention for resources by managing a queue of
pending work.

WWW: https://computing.llnl.gov/linux/slurm/

PR:		ports/184215
Submitted by:	Jason Bacon <jwbacon@tds.net>
2013-11-24 20:23:02 +00:00

68 lines
1.7 KiB
C

--- src/plugins/select/cons_res/dist_tasks.c.orig 2013-09-10 16:44:33.000000000 -0500
+++ src/plugins/select/cons_res/dist_tasks.c 2013-11-14 10:23:02.000000000 -0600
@@ -271,6 +271,30 @@
return SLURM_SUCCESS;
}
+// These were nested below, which is not legal in standard C
+
+ /* qsort compare function for ascending int list */
+ int _cmp_int_ascend (const void *a, const void *b)
+ {
+ return (*(int*)a - *(int*)b);
+ }
+
+ /* qsort compare function for descending int list */
+ int _cmp_int_descend (const void *a, const void *b)
+ {
+ return (*(int*)b - *(int*)a);
+ }
+
+ int* sockets_cpu_cnt;
+
+ /* qsort compare function for board combination socket
+ * list */
+ int _cmp_sock (const void *a, const void *b)
+ {
+ return (sockets_cpu_cnt[*(int*)b] -
+ sockets_cpu_cnt[*(int*)a]);
+ }
+
/* sync up core bitmap with new CPU count using a best-fit approach
* on the available resources on each node
*
@@ -298,7 +322,6 @@
int elig_idx, comb_brd_idx, sock_list_idx, comb_min, board_num;
int* boards_cpu_cnt;
int* sort_brds_cpu_cnt;
- int* sockets_cpu_cnt;
int* board_combs;
int* socket_list;
int* elig_brd_combs;
@@ -316,26 +339,6 @@
uint64_t ncomb_brd;
bool sufficient,best_fit_sufficient;
- /* qsort compare function for ascending int list */
- int _cmp_int_ascend (const void *a, const void *b)
- {
- return (*(int*)a - *(int*)b);
- }
-
- /* qsort compare function for descending int list */
- int _cmp_int_descend (const void *a, const void *b)
- {
- return (*(int*)b - *(int*)a);
- }
-
- /* qsort compare function for board combination socket
- * list */
- int _cmp_sock (const void *a, const void *b)
- {
- return (sockets_cpu_cnt[*(int*)b] -
- sockets_cpu_cnt[*(int*)a]);
- }
-
if (!job_res)
return;