diff --git a/contribs/perlapi/libslurm/perl/node.c b/contribs/perlapi/libslurm/perl/node.c index 1b25255e0716d8930fc7a1a00a1cdbe060fce533..e59694f893303d208f8136a9a1036bc7f024d5e3 100644 --- a/contribs/perlapi/libslurm/perl/node.c +++ b/contribs/perlapi/libslurm/perl/node.c @@ -57,6 +57,7 @@ node_info_to_hv(node_info_t *node_info, uint16_t node_scaling, HV *hv) STORE_FIELD(hv, node_info, reason_time, time_t); STORE_FIELD(hv, node_info, reason_uid, uint32_t); STORE_FIELD(hv, node_info, slurmd_start_time, time_t); + STORE_FIELD(hv, node_info, boards, uint16_t); STORE_FIELD(hv, node_info, sockets, uint16_t); STORE_FIELD(hv, node_info, threads, uint16_t); STORE_FIELD(hv, node_info, tmp_disk, uint32_t); @@ -112,6 +113,7 @@ hv_to_node_info(HV *hv, node_info_t *node_info) FETCH_FIELD(hv, node_info, reason_time, time_t, TRUE); FETCH_FIELD(hv, node_info, reason_uid, uint32_t, TRUE); FETCH_FIELD(hv, node_info, slurmd_start_time, time_t, TRUE); + FETCH_FIELD(hv, node_info, boards, uint16_t, TRUE); FETCH_FIELD(hv, node_info, sockets, uint16_t, TRUE); FETCH_FIELD(hv, node_info, threads, uint16_t, TRUE); FETCH_FIELD(hv, node_info, tmp_disk, uint32_t, TRUE); diff --git a/doc/html/cpu_management.shtml b/doc/html/cpu_management.shtml index 7d57f1148c71f2b9f2ececfdf77a327c5a40dc03..7ef79ca61d362170e601850a7bfcd7da20dcaedf 100644 --- a/doc/html/cpu_management.shtml +++ b/doc/html/cpu_management.shtml @@ -18,7 +18,7 @@ is divided into the following sections:</p> chosen by the SLURM administrator. The interactions between different CPU management options are complex and often difficult to predict. Some experimentation may be required to discover the exact combination of options needed to produce a desired outcome. Users and administrators should refer to the man pages -for <a href="slurm.conf.html">slurm.conf</a>, <a href="cgroup.conf.html">cgroup.conf</a> +for <a href="slurm.conf.html">slurm.conf</a>, <a href="cgroup.conf.html">cgroup.conf</a>, <a href="salloc.html">salloc</a>, <a href="sbatch.html">sbatch</a> and <a href="srun.html">srun</a> for detailed explanations of each option. The following html documents may also be useful:</p> @@ -32,7 +32,7 @@ Architectures</a><br> <p>This document describes SLURM CPU management for conventional Linux clusters only. For information on Cray and IBM BlueGene systems, please refer to the appropriate documents.</p> -<p>The information and examples in this document have been verified on SLURM version 2.3.0. Some +<p>The information and examples in this document have been verified on SLURM version 2.4.0. Some information may not be valid for previous SLURM versions.</p><br> <a name="Section1"></a> <h2>CPU Management Steps performed by SLURM</h2> @@ -88,7 +88,7 @@ Step 1 is performed by slurmctld and the select plugin. </td> <td width="60%"> <p align="LEFT"><font style="font-size: 8pt" size="1">Defines - a node. This includes the number and layout of sockets, cores, + a node. This includes the number and layout of boards, sockets, cores, threads and processors (logical CPUs) on the node.</font></p> </td> </tr> @@ -525,7 +525,7 @@ Step 2 is performed by slurmctld and the select plugin. </td> <td width="60%"> <p align="LEFT"><font style="font-size: 8pt" size="1">Defines - a node. This includes the number and layout of sockets, cores, + a node. This includes the number and layout of boards, sockets, cores, threads and processors (logical CPUs) on the node.</font></p> </td> </tr> @@ -3538,6 +3538,6 @@ and binding for this job. For example, task id 2 is bound to CPU id 2. <p class="footer"><a href="#top">top</a></p> -<p style="text-align:center;">Last modified 26 September 2011</p> +<p style="text-align:center;">Last modified 7 February 2012</p> <!--#include virtual="footer.txt"--> diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5 index fe844e8e3f1e8079fa8dd17890f28e136311eb41..a14829e4e460af6c6b24f61361bb58e9576770a9 100644 --- a/doc/man/man5/slurm.conf.5 +++ b/doc/man/man5/slurm.conf.5 @@ -1624,7 +1624,10 @@ Without this option, by default one task will be allocated per thread on nodes with more than one \fBThreadsPerCore\fR configured. .TP \fBCR_CORE_DEFAULT_DIST_BLOCK\fR -Allocate cores using block distribution by default. +Allocate cores within a node using block distribution by default. +This is a pseudo-best-fit algorithm that minimizes the number of +boards and minimizes the number of sockets (within minimum boards) +used for the allocation. This default behavior can be overridden specifying a particular "\-m" parameter with srun/salloc/sbatch. Without this option, cores will be allocated cyclicly across the sockets. @@ -2349,6 +2352,14 @@ they must exactly match the entries in the \fBNodeName\fR By default, the \fBNodeAddr\fR will be identical in value to \fBNodeHostname\fR. +.TP +\fBBoards\fR +Number of Baseboards in nodes with a baseboard controller. +Note that when Boards is specified, SocketsPerBoard, +CoresPerSocket, and ThreadsPerCore should be specified. +Boards and CPUs are mutully exclusive. +The default value is 1. + .TP \fBCoresPerSocket\fR Number of cores in a single physical processor socket (e.g. "2"). @@ -2363,6 +2374,7 @@ The default value is 1. Number of logical processors on the node (e.g. "2"). If \fBCPUs\fR is omitted, it will set equal to the product of \fBSockets\fR, \fBCoresPerSocket\fR, and \fBThreadsPerCore\fR. +CPUs and Boards are mutually exclusive. The default value is 1. .TP @@ -2419,6 +2431,15 @@ If Sockets is omitted, it will be inferred from \fBCPUs\fR, \fBCoresPerSocket\fR, and \fBThreadsPerCore\fR. \fBNOTE\fR: If you have multi\-core processors, you will likely need to specify these parameters. +Sockets and SocketsPerBoard are mutually exclusive. +If Sockets is specified when Boards is also used, +Sockets is interpreted as SocketsPerBoard rather than total sockets. +The default value is 1. + +.TP +\fBSocketsPerBoard\fR +Number of physical processor sockets/chips on a baseboard. +Sockets and SocketsPerBoard are mutually exclusive. The default value is 1. .TP diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index de2756be372780b97eb1e2e5ffc6893e905610eb..0392c48fd5fc853996cdb3dd44176fef8d0ff72d 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -422,7 +422,8 @@ enum jobacct_data_type { JOBACCT_DATA_TOT_PAGES, /* data-> uint32_t psize */ JOBACCT_DATA_MIN_CPU, /* data-> uint32_t psize */ JOBACCT_DATA_MIN_CPU_ID, /* data-> jobacct_id_t psize */ - JOBACCT_DATA_TOT_CPU /* data-> uint32_t psize */ + JOBACCT_DATA_TOT_CPU, /* data-> uint32_t psize */ + JOBACCT_DATA_CPU_CYCLES /* data-> uint32_t psize */ }; /* Possible task distributions across the nodes */ @@ -458,6 +459,7 @@ typedef enum cpu_bind_type { /* cpu binding type from --cpu_bind=... */ CPU_BIND_TO_CORES = 0x04, /* =cores */ CPU_BIND_TO_SOCKETS= 0x08, /* =sockets */ CPU_BIND_TO_LDOMS = 0x10, /* locality domains */ + CPU_BIND_TO_BOARDS = 0x1000, /* =boards */ /* the following manual binding flags are mutually exclusive */ /* CPU_BIND_NONE needs to be the lowest value among manual bindings */ CPU_BIND_NONE = 0x20, /* =no */ @@ -561,6 +563,9 @@ enum ctx_keys { #define CR_CORE 0x0004 /* Resources are shared down to the core level. * Jobs will not be co-allocated within a * core. */ +#define CR_BOARD 0x0008 /* Resources are shared down to the board + * level. Jobs will not be co-allocated + * within a board. */ #define CR_MEMORY 0x0010 /* Memory as consumable resources. Memory is * not over-commited when selected as a CR. */ @@ -1004,6 +1009,8 @@ typedef struct job_descriptor { /* For submit, allocate, and update requests */ * default=0 */ uint32_t max_nodes; /* maximum number of nodes usable by job, * default=0 */ + uint16_t boards_per_node; /* boards per node required by job */ + uint16_t sockets_per_board;/* sockets per board required by job */ uint16_t sockets_per_node;/* sockets per node required by job */ uint16_t cores_per_socket;/* cores per socket required by job */ uint16_t threads_per_core;/* threads per core required by job */ @@ -1011,6 +1018,7 @@ typedef struct job_descriptor { /* For submit, allocate, and update requests */ uint16_t ntasks_per_socket;/* number of tasks to invoke on * each socket */ uint16_t ntasks_per_core;/* number of tasks to invoke on each core */ + uint16_t ntasks_per_board;/* number of tasks to invoke on each board */ uint16_t pn_min_cpus; /* minimum # CPUs per node, default=0 */ uint32_t pn_min_memory; /* minimum real memory per node OR * real memory per CPU | MEM_PER_CPU, @@ -1075,9 +1083,11 @@ typedef struct job_info { char *licenses; /* licenses required by the job */ uint32_t max_cpus; /* maximum number of cpus usable by job */ uint32_t max_nodes; /* maximum number of nodes usable by job */ - uint16_t sockets_per_node;/* sockets per node required by job */ - uint16_t cores_per_socket;/* cores per socket required by job */ - uint16_t threads_per_core;/* threads per core required by job */ + uint16_t boards_per_node; /* boards per node required by job */ + uint16_t sockets_per_board;/* sockets per board required by job */ + uint16_t sockets_per_node; /* sockets per node required by job */ + uint16_t cores_per_socket; /* cores per socket required by job */ + uint16_t threads_per_core; /* threads per core required by job */ char *name; /* name of the job */ char *network; /* network specification */ char *nodes; /* list of nodes allocated to job */ @@ -1087,7 +1097,8 @@ typedef struct job_info { * start_range_2, .., -1 */ uint16_t ntasks_per_core;/* number of tasks to invoke on each core */ uint16_t ntasks_per_node;/* number of tasks to invoke on each node */ - uint16_t ntasks_per_socket;/* number of tasks to invoke on each socket */ + uint16_t ntasks_per_socket;/* number of tasks to invoke on each socket*/ + uint16_t ntasks_per_board; /* number of tasks to invoke on each board */ uint32_t num_nodes; /* minimum number of nodes required by job */ uint32_t num_cpus; /* minimum number of cpus required by job */ @@ -1414,8 +1425,9 @@ typedef struct { typedef struct node_info { char *arch; /* computer architecture */ + uint16_t boards; /* total number of boards per node */ time_t boot_time; /* time of node boot */ - uint16_t cores; /* number of cores per CPU */ + uint16_t cores; /* number of cores per socket */ uint16_t cpus; /* configured count of cpus running on * the node */ char *features; /* list of a node's features */ @@ -1432,7 +1444,7 @@ typedef struct node_info { uint32_t reason_uid; /* User that set the reason, ignore if * no reason is set. */ time_t slurmd_start_time;/* time of slurmd startup */ - uint16_t sockets; /* number of sockets per node */ + uint16_t sockets; /* total number of sockets per node */ uint16_t threads; /* number of threads per core */ uint32_t tmp_disk; /* configured MB of total disk in TMP_FS */ uint32_t weight; /* arbitrary priority of node for scheduling */ @@ -1852,6 +1864,8 @@ typedef struct slurm_ctl_conf { * inactive resource allocation is released */ uint16_t job_acct_gather_freq; /* poll frequency for job accounting * gather plugins */ + uint16_t xres_access_freq; /* poll frequency for + * external-resource-access thread */ char *job_acct_gather_type; /* job accounting gather type */ char *job_ckpt_dir; /* directory saving job record checkpoint */ char *job_comp_host; /* job completion logging host */ @@ -2003,8 +2017,9 @@ typedef struct slurmd_status_msg { time_t last_slurmctld_msg; /* time of last slurmctld message */ uint16_t slurmd_debug; /* logging level */ uint16_t actual_cpus; /* actual logical processor count */ - uint16_t actual_sockets; /* actual sockets count */ - uint16_t actual_cores; /* actual core count */ + uint16_t actual_boards; /* actual total boards count */ + uint16_t actual_sockets; /* actual total sockets count */ + uint16_t actual_cores; /* actual core per socket count */ uint16_t actual_threads; /* actual thread per core count */ uint32_t actual_real_mem; /* actual real memory in MB */ uint32_t actual_tmp_disk; /* actual temp disk space in MB */ diff --git a/src/api/config_info.c b/src/api/config_info.c index 34ecb8429ec13f0655478aeb2cf4de98d2fcdb12..1f93ca5357ac6dfe6f65b06854189193f92c4886 100644 --- a/src/api/config_info.c +++ b/src/api/config_info.c @@ -1243,6 +1243,8 @@ void slurm_print_slurmd_status (FILE* out, fprintf(out, "Actual CPUs = %u\n", slurmd_status_ptr->actual_cpus); + fprintf(out, "Actual Boards = %u\n", + slurmd_status_ptr->actual_boards); fprintf(out, "Actual sockets = %u\n", slurmd_status_ptr->actual_sockets); fprintf(out, "Actual cores = %u\n", diff --git a/src/api/node_info.c b/src/api/node_info.c index bf25e8e04cb633dc3b30b93cde7f0394a7adb1fe..d04482038633ca20138b5e3241e1187c7168d824 100644 --- a/src/api/node_info.c +++ b/src/api/node_info.c @@ -239,8 +239,9 @@ slurm_sprint_node_table (node_info_t * node_ptr, snprintf(tmp_line, sizeof(tmp_line), "OS=%s ", node_ptr->os); xstrcat(out, tmp_line); } - snprintf(tmp_line, sizeof(tmp_line), "RealMemory=%u Sockets=%u", - node_ptr->real_memory, node_ptr->sockets); + snprintf(tmp_line, sizeof(tmp_line), + "RealMemory=%u Sockets=%u Boards=%u", + node_ptr->real_memory, node_ptr->sockets,node_ptr->boards); xstrcat(out, tmp_line); if (one_liner) xstrcat(out, " "); diff --git a/src/common/node_conf.c b/src/common/node_conf.c index 213cc0b174313d7db51f679c9ecad396056cdd40..397598b4c878ea27fa6b34968d26f4dca0166f67 100644 --- a/src/common/node_conf.c +++ b/src/common/node_conf.c @@ -644,6 +644,7 @@ extern int build_all_nodeline_info (bool set_bitmap) config_ptr = create_config_record(); config_ptr->nodes = xstrdup(node->nodenames); config_ptr->cpus = node->cpus; + config_ptr->boards = node->boards; config_ptr->sockets = node->sockets; config_ptr->cores = node->cores; config_ptr->threads = node->threads; @@ -778,6 +779,7 @@ extern struct node_record *create_node_record ( node_ptr->config_ptr = config_ptr; /* these values will be overwritten when the node actually registers */ node_ptr->cpus = config_ptr->cpus; + node_ptr->boards = config_ptr->boards; node_ptr->sockets = config_ptr->sockets; node_ptr->cores = config_ptr->cores; node_ptr->threads = config_ptr->threads; diff --git a/src/common/node_conf.h b/src/common/node_conf.h index 8eb96d5d3f0d8a778218cfc37198e3c0fcf91de9..49107f9cefd739710bb5805f79dd8f0e6f05cf25 100644 --- a/src/common/node_conf.h +++ b/src/common/node_conf.h @@ -66,6 +66,7 @@ struct config_record { uint32_t magic; /* magic cookie to test data integrity */ uint16_t cpus; /* count of processors running on the node */ + uint16_t boards; /* count of boards configured */ uint16_t sockets; /* number of sockets per node */ uint16_t cores; /* number of cores per CPU */ uint16_t threads; /* number of threads per core */ @@ -105,6 +106,7 @@ struct node_record { time_t last_response; /* last response from the node */ time_t last_idle; /* time node last become idle */ uint16_t cpus; /* count of processors on the node */ + uint16_t boards; /* count of boards configured */ uint16_t sockets; /* number of sockets per node */ uint16_t cores; /* number of cores per CPU */ uint16_t threads; /* number of threads per core */ diff --git a/src/common/read_config.c b/src/common/read_config.c index e6cf62ae9bebb9ae384e75d4d8470ba75a55cee5..256fdf874af2f29a238407b7b40552262d232865 100644 --- a/src/common/read_config.c +++ b/src/common/read_config.c @@ -5,6 +5,7 @@ * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Portions Copyright (C) 2008 Vijay Ramasubramanian. * Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>. + * Portions (boards) copyright (C) 2012 Bull, <rod.schultz@bull.com> * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov>. * CODE-OCEC-09-009. All rights reserved. @@ -113,6 +114,7 @@ typedef struct names_ll_s { char *address; /* NodeAddr */ uint16_t port; uint16_t cpus; + uint16_t boards; uint16_t sockets; uint16_t cores; uint16_t threads; @@ -500,6 +502,7 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, slurm_conf_node_t *n; int computed_procs; static s_p_options_t _nodename_options[] = { + {"Boards", S_P_UINT16}, {"CoresPerSocket", S_P_UINT16}, {"CPUs", S_P_UINT16}, {"Feature", S_P_STRING}, @@ -511,6 +514,7 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, {"RealMemory", S_P_UINT32}, {"Reason", S_P_STRING}, {"Sockets", S_P_UINT16}, + {"SocketsPerBoard", S_P_UINT16}, {"State", S_P_STRING}, {"ThreadsPerCore", S_P_UINT16}, {"TmpDisk", S_P_UINT32}, @@ -547,9 +551,12 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, return 0; } else { bool no_cpus = false; + bool no_boards = false; bool no_sockets = false; bool no_cores = false; bool no_threads = false; + bool no_sockets_per_board = false; + uint16_t sockets_per_board = 0; n = xmalloc(sizeof(slurm_conf_node_t)); dflt = default_nodename_tbl; @@ -565,6 +572,12 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, if (!s_p_get_string(&n->addresses, "NodeAddr", tbl)) n->addresses = xstrdup(n->hostnames); + if (!s_p_get_uint16(&n->boards, "Boards", tbl) + && !s_p_get_uint16(&n->boards, "Boards", dflt)) { + n->boards = 1; + no_boards = true; + } + if (!s_p_get_uint16(&n->cores, "CoresPerSocket", tbl) && !s_p_get_uint16(&n->cores, "CoresPerSocket", dflt)) { n->cores = 1; @@ -605,6 +618,13 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, no_sockets = true; } + if (!s_p_get_uint16(&sockets_per_board, "SocketsPerBoard", tbl) + && !s_p_get_uint16(&sockets_per_board, "SocketsPerBoard", + dflt)) { + sockets_per_board = 1; + no_sockets_per_board = true; + } + if (!s_p_get_string(&n->state, "State", tbl) && !s_p_get_string(&n->state, "State", dflt)) n->state = NULL; @@ -636,44 +656,107 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, n->threads = 1; } + if (!no_sockets_per_board && sockets_per_board==0) { + /* make sure sockets_per_boards is non-zero */ + error("NodeNames=%s SocketsPerBoards=0 is invalid, " + "reset to 1", n->nodenames); + sockets_per_board = 1; + } + + if (no_boards) { + /* This case is exactly like if was without boards, + * Except SocketsPerBoard=# can be used, + * But it can't be used with Sockets=# */ + n->boards = 1; + if (!no_sockets && !no_sockets_per_board) { + error("NodeNames=%s Sockets=# and " + "SocketsPerBoard=# is invalid" + ", using SocketsPerBoard", + n->nodenames); + n->sockets = sockets_per_board; + } + if (!no_sockets_per_board) { + n->sockets = sockets_per_board; + } if (!no_cpus && /* infer missing Sockets= */ no_sockets) { n->sockets = n->cpus / (n->cores * n->threads); } - - if (n->sockets == 0) { /* make sure sockets is non-zero */ + if (n->sockets == 0) { + /* make sure sockets is non-zero */ error("NodeNames=%s Sockets=0 is invalid, " "reset to 1", n->nodenames); n->sockets = 1; } - if (no_cpus) { /* infer missing CPUs= */ n->cpus = n->sockets * n->cores * n->threads; } - - /* if only CPUs= and Sockets= specified check for match */ + /* if only CPUs= and Sockets= + * specified check for match */ if (!no_cpus && !no_sockets && no_cores && no_threads) { if (n->cpus != n->sockets) { n->sockets = n->cpus; - error("NodeNames=%s CPUs doesn't match " - "Sockets, setting Sockets to %d", + error("NodeNames=%s CPUs " + "doesn't match Sockets, " + "setting Sockets to %d", n->nodenames, n->sockets); } } - computed_procs = n->sockets * n->cores * n->threads; if ((n->cpus != n->sockets) && (n->cpus != n->sockets * n->cores) && (n->cpus != computed_procs)) { error("NodeNames=%s CPUs=%d doesn't match " - "Sockets*CoresPerSocket*ThreadsPerCore (%d), " - "resetting CPUs", + "Sockets*CoresPerSocket*ThreadsPerCore " + "(%d), resetting CPUs", n->nodenames, n->cpus, computed_procs); n->cpus = computed_procs; } + } else { + /* In this case Boards=# is used. + * CPUs=# or Procs=# are ignored. + */ + if (!no_cpus) { + error("NodeNames=%s CPUs=# or Procs=# " + "with Boards=# is invalid and " + "is ignored.", n->nodenames); + } + if (n->boards == 0) { + /* make sure boards is non-zero */ + error("NodeNames=%s Boards=0 is " + "invalid, reset to 1", + n->nodenames); + n->boards = 1; + } + if (!no_sockets && !no_sockets_per_board) { + error("NodeNames=%s Sockets=# and " + "SocketsPerBoard=# is invalid, " + "using SocketsPerBoard", n->nodenames); + n->sockets = n->boards * sockets_per_board; + } else if (!no_sockets_per_board) { + n->sockets = n->boards * sockets_per_board; + } else if (!no_sockets) { + error("NodeNames=%s Sockets=# with Boards=# is" + " not recommended, assume " + "SocketsPerBoard was meant", + n->nodenames); + if (n->sockets == 0) { + /* make sure sockets is non-zero */ + error("NodeNames=%s Sockets=0 is " + "invalid, reset to 1", + n->nodenames); + n->sockets = 1; + } + n->sockets = n->boards * n->sockets; + } else { + n->sockets = n->boards; + } + // Node boards factored into sockets + n->cpus = n->sockets * n->cores * n->threads; + } *dest = (void *)n; @@ -1186,8 +1269,9 @@ static int _get_hash_idx(const char *name) static void _push_to_hashtbls(char *alias, char *hostname, char *address, uint16_t port, - uint16_t cpus, uint16_t sockets, - uint16_t cores, uint16_t threads) + uint16_t cpus, uint16_t boards, + uint16_t sockets, uint16_t cores, + uint16_t threads) { int hostname_idx, alias_idx; names_ll_t *p, *new; @@ -1225,6 +1309,7 @@ static void _push_to_hashtbls(char *alias, char *hostname, new->address = xstrdup(address); new->port = port; new->cpus = cpus; + new->boards = boards; new->sockets = sockets; new->cores = cores; new->threads = threads; @@ -1371,8 +1456,9 @@ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr) port = port_int; } _push_to_hashtbls(alias, hostname, address, port, - node_ptr->cpus, node_ptr->sockets, - node_ptr->cores, node_ptr->threads); + node_ptr->cpus, node_ptr->boards, + node_ptr->sockets, node_ptr->cores, + node_ptr->threads); free(alias); if (address_count > 1) { address_count--; @@ -1446,7 +1532,7 @@ static int _register_front_ends(slurm_conf_frontend_t *front_end_ptr) address = hostlist_shift(address_list); _push_to_hashtbls(hostname, hostname, address, - front_end_ptr->port, 1, 1, 1, 1); + front_end_ptr->port, 1, 1, 1, 1, 1); free(hostname); free(address); } @@ -1822,13 +1908,15 @@ extern int slurm_conf_get_addr(const char *node_name, slurm_addr_t *address) } /* - * slurm_conf_get_cpus_sct - - * Return the cpus, sockets, cores, and threads for a given NodeName + * slurm_conf_get_cpus_bsct - + * Return the cpus, boards, sockets, cores, and threads configured for a + * given NodeName * Returns SLURM_SUCCESS on success, SLURM_FAILURE on failure. */ -extern int slurm_conf_get_cpus_sct(const char *node_name, - uint16_t *cpus, uint16_t *sockets, - uint16_t *cores, uint16_t *threads) +extern int slurm_conf_get_cpus_bsct(const char *node_name, + uint16_t *cpus, uint16_t *boards, + uint16_t *sockets, uint16_t *cores, + uint16_t *threads) { int idx; names_ll_t *p; @@ -1842,6 +1930,8 @@ extern int slurm_conf_get_cpus_sct(const char *node_name, if (strcmp(p->alias, node_name) == 0) { if (cpus) *cpus = p->cpus; + if (boards) + *boards = p->boards; if (sockets) *sockets = p->sockets; if (cores) @@ -2201,7 +2291,7 @@ static void _init_slurm_conf(const char *file_name) if (name == NULL) name = default_slurm_config_file; } - if (conf_initialized) { + if(conf_initialized) { error("the conf_hashtbl is already inited"); } conf_hashtbl = s_p_hashtbl_create(slurm_conf_options); @@ -2426,7 +2516,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) * the cluster name is lower case since sacctmgr makes sure * this is the case as well. */ - if (conf->cluster_name) { + if(conf->cluster_name) { int i; for (i = 0; conf->cluster_name[i] != '\0'; i++) conf->cluster_name[i] = @@ -3296,6 +3386,11 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) fatal("Bad TaskPluginParam: %s", tok); set_unit = true; conf->task_plugin_param |= CPU_BIND_NONE; + } else if (strcasecmp(tok, "boards") == 0) { + if (set_unit) + fatal("Bad TaskPluginParam: %s", tok); + set_unit = true; + conf->task_plugin_param |= CPU_BIND_TO_BOARDS; } else if (strcasecmp(tok, "sockets") == 0) { if (set_unit) fatal("Bad TaskPluginParam: %s", tok); diff --git a/src/common/read_config.h b/src/common/read_config.h index 3edf23b6a65e810efd96894b2a13286facf5f0fd..38367ffb901869bce94f774f9a72e03915c4d149 100644 --- a/src/common/read_config.h +++ b/src/common/read_config.h @@ -178,6 +178,7 @@ typedef struct slurm_conf_node { char *feature; /* arbitrary list of node's features */ char *port_str; uint16_t cpus; /* count of cpus running on the node */ + uint16_t boards; /* number of boards per node */ uint16_t sockets; /* number of sockets per node */ uint16_t cores; /* number of cores per CPU */ uint16_t threads; /* number of threads per core */ @@ -402,15 +403,17 @@ extern uint16_t slurm_conf_get_port(const char *node_name); extern int slurm_conf_get_addr(const char *node_name, slurm_addr_t *address); /* - * slurm_conf_get_cpus_sct - - * Return the cpus, sockets, cores, and threads configured for a given NodeName + * slurm_conf_get_cpus_bsct - + * Return the cpus, boards, sockets, cores, and threads configured for a + * given NodeName * Returns SLURM_SUCCESS on success, SLURM_FAILURE on failure. * * NOTE: Caller must NOT be holding slurm_conf_lock(). */ -extern int slurm_conf_get_cpus_sct(const char *node_name, - uint16_t *procs, uint16_t *sockets, - uint16_t *cores, uint16_t *threads); +extern int slurm_conf_get_cpus_bsct(const char *node_name, + uint16_t *cpus, uint16_t *boards, + uint16_t *sockets, uint16_t *cores, + uint16_t *threads); /* * init_slurm_conf - initialize or re-initialize the slurm configuration diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h index a993f11debe6a0ef571e105811c98b0e98639bf3..27134488d9e91e01bf9332080010fa1819b1b6c4 100644 --- a/src/common/slurm_protocol_defs.h +++ b/src/common/slurm_protocol_defs.h @@ -888,10 +888,13 @@ typedef struct file_bcast_msg { } file_bcast_msg_t; typedef struct multi_core_data { + uint16_t boards_per_node; /* boards per node required by job */ + uint16_t sockets_per_board; /* sockets per board required by job */ uint16_t sockets_per_node; /* sockets per node required by job */ uint16_t cores_per_socket; /* cores per cpu required by job */ uint16_t threads_per_core; /* threads per core required by job */ + uint16_t ntasks_per_board; /* number of tasks to invoke on each board*/ uint16_t ntasks_per_socket; /* number of tasks to invoke on each socket */ uint16_t ntasks_per_core; /* number of tasks to invoke on each core */ uint16_t plane_size; /* plane size when task_dist = SLURM_DIST_PLANE */ @@ -929,6 +932,7 @@ typedef struct slurm_node_registration_status_msg { uint32_t job_count; /* number of associate job_id's */ uint32_t *job_id; /* IDs of running job (if any) */ char *node_name; + uint16_t boards; char *os; uint32_t real_memory; time_t slurmd_start_time; diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index b42035fec7b911119f2427dd7dfb5242c11296a2..c37401f7155d6569d7c735521840c29ebca3b2a9 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -2394,7 +2394,41 @@ _pack_node_registration_status_msg(slurm_node_registration_status_msg_t * uint32_t gres_info_size = 0; xassert(msg != NULL); - if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + if(protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack_time(msg->timestamp, buffer); + pack_time(msg->slurmd_start_time, buffer); + pack32(msg->status, buffer); + packstr(msg->node_name, buffer); + packstr(msg->arch, buffer); + packstr(msg->os, buffer); + pack16(msg->cpus, buffer); + pack16(msg->boards, buffer); + pack16(msg->sockets, buffer); + pack16(msg->cores, buffer); + pack16(msg->threads, buffer); + pack32(msg->real_memory, buffer); + pack32(msg->tmp_disk, buffer); + pack32(msg->up_time, buffer); + pack32(msg->hash_val, buffer); + + pack32(msg->job_count, buffer); + for (i = 0; i < msg->job_count; i++) { + pack32(msg->job_id[i], buffer); + } + for (i = 0; i < msg->job_count; i++) { + pack32(msg->step_id[i], buffer); + } + pack16(msg->startup, buffer); + if (msg->startup) + switch_g_pack_node_info(msg->switch_nodeinfo, buffer); + if (msg->gres_info) + gres_info_size = get_buf_offset(msg->gres_info); + pack32(gres_info_size, buffer); + if (gres_info_size) { + packmem(get_buf_data(msg->gres_info), gres_info_size, + buffer); + } + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { pack_time(msg->timestamp, buffer); pack_time(msg->slurmd_start_time, buffer); pack32(msg->status, buffer); @@ -2469,7 +2503,56 @@ _unpack_node_registration_status_msg(slurm_node_registration_status_msg_t node_reg_ptr = xmalloc(sizeof(slurm_node_registration_status_msg_t)); *msg = node_reg_ptr; - if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + if(protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + /* unpack timestamp of snapshot */ + safe_unpack_time(&node_reg_ptr->timestamp, buffer); + safe_unpack_time(&node_reg_ptr->slurmd_start_time, buffer); + /* load the data values */ + safe_unpack32(&node_reg_ptr->status, buffer); + safe_unpackstr_xmalloc(&node_reg_ptr->node_name, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_reg_ptr->arch, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_reg_ptr->os, &uint32_tmp, buffer); + safe_unpack16(&node_reg_ptr->cpus, buffer); + safe_unpack16(&node_reg_ptr->boards, buffer); + safe_unpack16(&node_reg_ptr->sockets, buffer); + safe_unpack16(&node_reg_ptr->cores, buffer); + safe_unpack16(&node_reg_ptr->threads, buffer); + safe_unpack32(&node_reg_ptr->real_memory, buffer); + safe_unpack32(&node_reg_ptr->tmp_disk, buffer); + safe_unpack32(&node_reg_ptr->up_time, buffer); + safe_unpack32(&node_reg_ptr->hash_val, buffer); + + safe_unpack32(&node_reg_ptr->job_count, buffer); + node_reg_ptr->job_id = + xmalloc(sizeof(uint32_t) * node_reg_ptr->job_count); + for (i = 0; i < node_reg_ptr->job_count; i++) { + safe_unpack32(&node_reg_ptr->job_id[i], buffer); + } + node_reg_ptr->step_id = + xmalloc(sizeof(uint32_t) * node_reg_ptr->job_count); + for (i = 0; i < node_reg_ptr->job_count; i++) { + safe_unpack32(&node_reg_ptr->step_id[i], buffer); + } + + safe_unpack16(&node_reg_ptr->startup, buffer); + if (node_reg_ptr->startup + && (switch_g_alloc_node_info( + &node_reg_ptr->switch_nodeinfo) + || switch_g_unpack_node_info( + node_reg_ptr->switch_nodeinfo, buffer))) + goto unpack_error; + + safe_unpack32(&gres_info_size, buffer); + if (gres_info_size) { + safe_unpackmem_xmalloc(&gres_info, &uint32_tmp, buffer); + if (gres_info_size != uint32_tmp) + goto unpack_error; + node_reg_ptr->gres_info = create_buf(gres_info, + gres_info_size); + } + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { /* unpack timestamp of snapshot */ safe_unpack_time(&node_reg_ptr->timestamp, buffer); safe_unpack_time(&node_reg_ptr->slurmd_start_time, buffer); @@ -2889,7 +2972,36 @@ _unpack_node_info_members(node_info_t * node, Buf buffer, xassert(node != NULL); - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpackstr_xmalloc(&node->name, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->node_hostname, &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&node->node_addr, &uint32_tmp, buffer); + safe_unpack16(&node->node_state, buffer); + safe_unpack16(&node->cpus, buffer); + safe_unpack16(&node->boards, buffer); + safe_unpack16(&node->sockets, buffer); + safe_unpack16(&node->cores, buffer); + safe_unpack16(&node->threads, buffer); + + safe_unpack32(&node->real_memory, buffer); + safe_unpack32(&node->tmp_disk, buffer); + safe_unpack32(&node->weight, buffer); + safe_unpack32(&node->reason_uid, buffer); + + safe_unpack_time(&node->boot_time, buffer); + safe_unpack_time(&node->reason_time, buffer); + safe_unpack_time(&node->slurmd_start_time, buffer); + + select_g_select_nodeinfo_unpack(&node->select_nodeinfo, buffer, + protocol_version); + + safe_unpackstr_xmalloc(&node->arch, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->gres, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->os, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->reason, &uint32_tmp, buffer); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { safe_unpackstr_xmalloc(&node->name, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&node->node_hostname, &uint32_tmp, buffer); @@ -4369,7 +4481,122 @@ _unpack_job_info_members(job_info_t * job, Buf buffer, char *node_inx_str; multi_core_data_t *mc_ptr; - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack32(&job->assoc_id, buffer); + safe_unpack32(&job->job_id, buffer); + safe_unpack32(&job->user_id, buffer); + safe_unpack32(&job->group_id, buffer); + + safe_unpack16(&job->job_state, buffer); + safe_unpack16(&job->batch_flag, buffer); + safe_unpack16(&job->state_reason, buffer); + safe_unpack16(&job->restart_cnt, buffer); + safe_unpack16(&job->show_flags, buffer); + + safe_unpack32(&job->alloc_sid, buffer); + safe_unpack32(&job->time_limit, buffer); + safe_unpack32(&job->time_min, buffer); + + safe_unpack16(&job->nice, buffer); + + safe_unpack_time(&job->submit_time, buffer); + safe_unpack_time(&job->eligible_time, buffer); + safe_unpack_time(&job->start_time, buffer); + safe_unpack_time(&job->end_time, buffer); + safe_unpack_time(&job->suspend_time, buffer); + safe_unpack_time(&job->pre_sus_time, buffer); + safe_unpack_time(&job->resize_time, buffer); + safe_unpack_time(&job->preempt_time, buffer); + safe_unpack32(&job->priority, buffer); + safe_unpackstr_xmalloc(&job->nodes, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->partition, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->account, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->network, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->comment, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->gres, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->batch_host, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->batch_script, &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&job->qos, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->licenses, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->state_desc, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->resv_name, &uint32_tmp, buffer); + + safe_unpack32(&job->exit_code, buffer); + safe_unpack32(&job->derived_ec, buffer); + unpack_job_resources(&job->job_resrcs, buffer, + protocol_version); + + safe_unpackstr_xmalloc(&job->name, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->wckey, &uint32_tmp, buffer); + safe_unpack32(&job->req_switch, buffer); + safe_unpack32(&job->wait4switch, buffer); + + safe_unpackstr_xmalloc(&job->alloc_node, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + if (node_inx_str == NULL) + job->node_inx = bitfmt2int(""); + else { + job->node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + } + + if (select_g_select_jobinfo_unpack(&job->select_jobinfo, + buffer, protocol_version)) + goto unpack_error; + + /*** unpack default job details ***/ + safe_unpackstr_xmalloc(&job->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->work_dir, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->dependency, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->command, &uint32_tmp, buffer); + + safe_unpack32(&job->num_cpus, buffer); + safe_unpack32(&job->max_cpus, buffer); + safe_unpack32(&job->num_nodes, buffer); + safe_unpack32(&job->max_nodes, buffer); + safe_unpack16(&job->requeue, buffer); + + /*** unpack pending job details ***/ + safe_unpack16(&job->shared, buffer); + safe_unpack16(&job->contiguous, buffer); + safe_unpack16(&job->cpus_per_task, buffer); + safe_unpack16(&job->pn_min_cpus, buffer); + + safe_unpack32(&job->pn_min_memory, buffer); + safe_unpack32(&job->pn_min_tmp_disk, buffer); + + safe_unpackstr_xmalloc(&job->req_nodes, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + if (node_inx_str == NULL) + job->req_node_inx = bitfmt2int(""); + else { + job->req_node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + } + safe_unpackstr_xmalloc(&job->exc_nodes, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + if (node_inx_str == NULL) + job->exc_node_inx = bitfmt2int(""); + else { + job->exc_node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + } + + if (unpack_multi_core_data(&mc_ptr, buffer, protocol_version)) + goto unpack_error; + if (mc_ptr) { + job->boards_per_node = mc_ptr->boards_per_node; + job->sockets_per_board = mc_ptr->sockets_per_board; + job->sockets_per_node = mc_ptr->sockets_per_node; + job->cores_per_socket = mc_ptr->cores_per_socket; + job->threads_per_core = mc_ptr->threads_per_core; + job->ntasks_per_board = mc_ptr->ntasks_per_board; + job->ntasks_per_socket = mc_ptr->ntasks_per_socket; + job->ntasks_per_core = mc_ptr->ntasks_per_core; + xfree(mc_ptr); + } + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { safe_unpack32(&job->assoc_id, buffer); safe_unpack32(&job->job_id, buffer); safe_unpack32(&job->user_id, buffer); @@ -7095,7 +7322,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, uint16_t protocol_version) { /* load the data values */ - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { pack16(job_desc_ptr->contiguous, buffer); pack16(job_desc_ptr->task_dist, buffer); pack16(job_desc_ptr->kill_on_node_fail, buffer); @@ -7144,6 +7371,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, pack16(job_desc_ptr->shared, buffer); pack16(job_desc_ptr->cpus_per_task, buffer); pack16(job_desc_ptr->ntasks_per_node, buffer); + pack16(job_desc_ptr->ntasks_per_board, buffer); pack16(job_desc_ptr->ntasks_per_socket, buffer); pack16(job_desc_ptr->ntasks_per_core, buffer); @@ -7159,6 +7387,8 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, pack32(job_desc_ptr->max_cpus, buffer); pack32(job_desc_ptr->min_nodes, buffer); pack32(job_desc_ptr->max_nodes, buffer); + pack16(job_desc_ptr->boards_per_node, buffer); + pack16(job_desc_ptr->sockets_per_board, buffer); pack16(job_desc_ptr->sockets_per_node, buffer); pack16(job_desc_ptr->cores_per_socket, buffer); pack16(job_desc_ptr->threads_per_core, buffer); @@ -7238,7 +7468,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, job_desc_ptr->select_jobinfo = NULL; } pack16(job_desc_ptr->wait_all_nodes, buffer); - } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { pack16(job_desc_ptr->contiguous, buffer); pack16(job_desc_ptr->task_dist, buffer); pack16(job_desc_ptr->kill_on_node_fail, buffer); @@ -7321,6 +7551,8 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, pack16(job_desc_ptr->warn_signal, buffer); pack16(job_desc_ptr->warn_time, buffer); packstr(job_desc_ptr->wckey, buffer); + pack32(job_desc_ptr->req_switch, buffer); + pack32(job_desc_ptr->wait4switch, buffer); if (job_desc_ptr->select_jobinfo) { select_g_select_jobinfo_pack( @@ -7379,11 +7611,12 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, job_desc_ptr->select_jobinfo = NULL; } pack16(job_desc_ptr->wait_all_nodes, buffer); - } else if (protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + } else if (protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { pack16(job_desc_ptr->contiguous, buffer); pack16(job_desc_ptr->task_dist, buffer); pack16(job_desc_ptr->kill_on_node_fail, buffer); packstr(job_desc_ptr->features, buffer); + packstr(job_desc_ptr->gres, buffer); pack32(job_desc_ptr->job_id, buffer); packstr(job_desc_ptr->name, buffer); @@ -7437,7 +7670,9 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, packstr(job_desc_ptr->mem_bind, buffer); pack32(job_desc_ptr->time_limit, buffer); + pack32(job_desc_ptr->time_min, buffer); pack32(job_desc_ptr->min_cpus, buffer); + pack32(job_desc_ptr->max_cpus, buffer); pack32(job_desc_ptr->min_nodes, buffer); pack32(job_desc_ptr->max_nodes, buffer); pack16(job_desc_ptr->sockets_per_node, buffer); @@ -7460,14 +7695,13 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, pack16(job_desc_ptr->warn_time, buffer); packstr(job_desc_ptr->wckey, buffer); - if(job_desc_ptr->select_jobinfo) { + if (job_desc_ptr->select_jobinfo) { select_g_select_jobinfo_pack( job_desc_ptr->select_jobinfo, buffer, protocol_version); } else { job_desc_ptr->select_jobinfo = select_g_select_jobinfo_alloc(); - if(job_desc_ptr->geometry[0] != (uint16_t) NO_VAL) select_g_select_jobinfo_set( job_desc_ptr->select_jobinfo, @@ -7517,16 +7751,155 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, job_desc_ptr->select_jobinfo); job_desc_ptr->select_jobinfo = NULL; } - } -} + pack16(job_desc_ptr->wait_all_nodes, buffer); + } else if (protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + pack16(job_desc_ptr->contiguous, buffer); + pack16(job_desc_ptr->task_dist, buffer); + pack16(job_desc_ptr->kill_on_node_fail, buffer); + packstr(job_desc_ptr->features, buffer); + pack32(job_desc_ptr->job_id, buffer); + packstr(job_desc_ptr->name, buffer); -/* _unpack_job_desc_msg - * unpacks a job_desc struct - * OUT job_desc_buffer_ptr - place to put pointer to allocated job desc struct - * IN/OUT buffer - source of the unpack, contains pointers that are - * automatically updated - */ -static int + packstr(job_desc_ptr->alloc_node, buffer); + pack32(job_desc_ptr->alloc_sid, buffer); + pack16(job_desc_ptr->pn_min_cpus, buffer); + pack32(job_desc_ptr->pn_min_memory, buffer); + pack32(job_desc_ptr->pn_min_tmp_disk, buffer); + + packstr(job_desc_ptr->partition, buffer); + pack32(job_desc_ptr->priority, buffer); + packstr(job_desc_ptr->dependency, buffer); + packstr(job_desc_ptr->account, buffer); + packstr(job_desc_ptr->comment, buffer); + pack16(job_desc_ptr->nice, buffer); + packstr(job_desc_ptr->qos, buffer); + + pack8(job_desc_ptr->open_mode, buffer); + pack8(job_desc_ptr->overcommit, buffer); + pack16(job_desc_ptr->acctg_freq, buffer); + pack32(job_desc_ptr->num_tasks, buffer); + pack16(job_desc_ptr->ckpt_interval, buffer); + + packstr(job_desc_ptr->req_nodes, buffer); + packstr(job_desc_ptr->exc_nodes, buffer); + packstr_array(job_desc_ptr->environment, + job_desc_ptr->env_size, buffer); + packstr_array(job_desc_ptr->spank_job_env, + job_desc_ptr->spank_job_env_size, buffer); + packstr(job_desc_ptr->script, buffer); + packstr_array(job_desc_ptr->argv, job_desc_ptr->argc, buffer); + + packstr(job_desc_ptr->std_err, buffer); + packstr(job_desc_ptr->std_in, buffer); + packstr(job_desc_ptr->std_out, buffer); + packstr(job_desc_ptr->work_dir, buffer); + packstr(job_desc_ptr->ckpt_dir, buffer); + + pack16(job_desc_ptr->immediate, buffer); + pack16(job_desc_ptr->requeue, buffer); + pack16(job_desc_ptr->shared, buffer); + pack16(job_desc_ptr->cpus_per_task, buffer); + pack16(job_desc_ptr->ntasks_per_node, buffer); + pack16(job_desc_ptr->ntasks_per_socket, buffer); + pack16(job_desc_ptr->ntasks_per_core, buffer); + + pack16(job_desc_ptr->plane_size, buffer); + pack16(job_desc_ptr->cpu_bind_type, buffer); + pack16(job_desc_ptr->mem_bind_type, buffer); + packstr(job_desc_ptr->cpu_bind, buffer); + packstr(job_desc_ptr->mem_bind, buffer); + + pack32(job_desc_ptr->time_limit, buffer); + pack32(job_desc_ptr->min_cpus, buffer); + pack32(job_desc_ptr->min_nodes, buffer); + pack32(job_desc_ptr->max_nodes, buffer); + pack16(job_desc_ptr->sockets_per_node, buffer); + pack16(job_desc_ptr->cores_per_socket, buffer); + pack16(job_desc_ptr->threads_per_core, buffer); + pack32(job_desc_ptr->user_id, buffer); + pack32(job_desc_ptr->group_id, buffer); + + pack16(job_desc_ptr->alloc_resp_port, buffer); + pack16(job_desc_ptr->other_port, buffer); + packstr(job_desc_ptr->network, buffer); + pack_time(job_desc_ptr->begin_time, buffer); + pack_time(job_desc_ptr->end_time, buffer); + + packstr(job_desc_ptr->licenses, buffer); + pack16(job_desc_ptr->mail_type, buffer); + packstr(job_desc_ptr->mail_user, buffer); + packstr(job_desc_ptr->reservation, buffer); + pack16(job_desc_ptr->warn_signal, buffer); + pack16(job_desc_ptr->warn_time, buffer); + packstr(job_desc_ptr->wckey, buffer); + + if(job_desc_ptr->select_jobinfo) { + select_g_select_jobinfo_pack( + job_desc_ptr->select_jobinfo, + buffer, protocol_version); + } else { + job_desc_ptr->select_jobinfo = + select_g_select_jobinfo_alloc(); + + if(job_desc_ptr->geometry[0] != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_GEOMETRY, + job_desc_ptr->geometry); + + if (job_desc_ptr->conn_type[0] != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_CONN_TYPE, + &(job_desc_ptr->conn_type)); + if (job_desc_ptr->reboot != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_REBOOT, + &(job_desc_ptr->reboot)); + if (job_desc_ptr->rotate != (uint16_t) NO_VAL) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_ROTATE, + &(job_desc_ptr->rotate)); + if (job_desc_ptr->blrtsimage) { + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_BLRTS_IMAGE, + job_desc_ptr->blrtsimage); + } + if (job_desc_ptr->linuximage) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_LINUX_IMAGE, + job_desc_ptr->linuximage); + if (job_desc_ptr->mloaderimage) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_MLOADER_IMAGE, + job_desc_ptr->mloaderimage); + if (job_desc_ptr->ramdiskimage) + select_g_select_jobinfo_set( + job_desc_ptr->select_jobinfo, + SELECT_JOBDATA_RAMDISK_IMAGE, + job_desc_ptr->ramdiskimage); + select_g_select_jobinfo_pack( + job_desc_ptr->select_jobinfo, + buffer, protocol_version); + select_g_select_jobinfo_free( + job_desc_ptr->select_jobinfo); + job_desc_ptr->select_jobinfo = NULL; + } + } +} + +/* _unpack_job_desc_msg + * unpacks a job_desc struct + * OUT job_desc_buffer_ptr - place to put pointer to allocated job desc struct + * IN/OUT buffer - source of the unpack, contains pointers that are + * automatically updated + */ +static int _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer, uint16_t protocol_version) { @@ -7534,7 +7907,142 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer, job_desc_msg_t *job_desc_ptr; /* alloc memory for structure */ - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + job_desc_ptr = xmalloc(sizeof(job_desc_msg_t)); + *job_desc_buffer_ptr = job_desc_ptr; + + /* load the data values */ + safe_unpack16(&job_desc_ptr->contiguous, buffer); + safe_unpack16(&job_desc_ptr->task_dist, buffer); + safe_unpack16(&job_desc_ptr->kill_on_node_fail, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->features, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->gres, &uint32_tmp,buffer); + safe_unpack32(&job_desc_ptr->job_id, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->name, + &uint32_tmp, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->alloc_node, + &uint32_tmp, buffer); + safe_unpack32(&job_desc_ptr->alloc_sid, buffer); + safe_unpack16(&job_desc_ptr->pn_min_cpus, buffer); + safe_unpack32(&job_desc_ptr->pn_min_memory, buffer); + safe_unpack32(&job_desc_ptr->pn_min_tmp_disk, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->partition, + &uint32_tmp, buffer); + safe_unpack32(&job_desc_ptr->priority, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->dependency, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->account, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->comment, + &uint32_tmp, buffer); + safe_unpack16(&job_desc_ptr->nice, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->qos, &uint32_tmp, + buffer); + + safe_unpack8(&job_desc_ptr->open_mode, buffer); + safe_unpack8(&job_desc_ptr->overcommit, buffer); + safe_unpack16(&job_desc_ptr->acctg_freq, buffer); + safe_unpack32(&job_desc_ptr->num_tasks, buffer); + safe_unpack16(&job_desc_ptr->ckpt_interval, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->req_nodes, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->exc_nodes, + &uint32_tmp, buffer); + safe_unpackstr_array(&job_desc_ptr->environment, + &job_desc_ptr->env_size, buffer); + safe_unpackstr_array(&job_desc_ptr->spank_job_env, + &job_desc_ptr->spank_job_env_size, + buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->script, + &uint32_tmp, buffer); + safe_unpackstr_array(&job_desc_ptr->argv, + &job_desc_ptr->argc, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->std_err, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->std_in, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->std_out, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->work_dir, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->ckpt_dir, + &uint32_tmp, buffer); + + safe_unpack16(&job_desc_ptr->immediate, buffer); + safe_unpack16(&job_desc_ptr->requeue, buffer); + safe_unpack16(&job_desc_ptr->shared, buffer); + safe_unpack16(&job_desc_ptr->cpus_per_task, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_node, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_board, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_socket, buffer); + safe_unpack16(&job_desc_ptr->ntasks_per_core, buffer); + + safe_unpack16(&job_desc_ptr->plane_size, buffer); + safe_unpack16(&job_desc_ptr->cpu_bind_type, buffer); + safe_unpack16(&job_desc_ptr->mem_bind_type, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->cpu_bind, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->mem_bind, + &uint32_tmp, buffer); + + safe_unpack32(&job_desc_ptr->time_limit, buffer); + safe_unpack32(&job_desc_ptr->time_min, buffer); + safe_unpack32(&job_desc_ptr->min_cpus, buffer); + safe_unpack32(&job_desc_ptr->max_cpus, buffer); + safe_unpack32(&job_desc_ptr->min_nodes, buffer); + safe_unpack32(&job_desc_ptr->max_nodes, buffer); + safe_unpack16(&job_desc_ptr->boards_per_node, buffer); + safe_unpack16(&job_desc_ptr->sockets_per_board, buffer); + safe_unpack16(&job_desc_ptr->sockets_per_node, buffer); + safe_unpack16(&job_desc_ptr->cores_per_socket, buffer); + safe_unpack16(&job_desc_ptr->threads_per_core, buffer); + safe_unpack32(&job_desc_ptr->user_id, buffer); + safe_unpack32(&job_desc_ptr->group_id, buffer); + + safe_unpack16(&job_desc_ptr->alloc_resp_port, buffer); + safe_unpack16(&job_desc_ptr->other_port, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->network, + &uint32_tmp, buffer); + safe_unpack_time(&job_desc_ptr->begin_time, buffer); + safe_unpack_time(&job_desc_ptr->end_time, buffer); + + safe_unpackstr_xmalloc(&job_desc_ptr->licenses, + &uint32_tmp, buffer); + safe_unpack16(&job_desc_ptr->mail_type, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->mail_user, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->reservation, + &uint32_tmp, buffer); + safe_unpack16(&job_desc_ptr->warn_signal, buffer); + safe_unpack16(&job_desc_ptr->warn_time, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->wckey, + &uint32_tmp, buffer); + safe_unpack32(&job_desc_ptr->req_switch, buffer); + safe_unpack32(&job_desc_ptr->wait4switch, buffer); + + if (select_g_select_jobinfo_unpack( + &job_desc_ptr->select_jobinfo, + buffer, protocol_version)) + goto unpack_error; + + /* These are set so we don't confuse them later for what is + * set in the select_jobinfo structure. + */ + job_desc_ptr->geometry[0] = (uint16_t)NO_VAL; + job_desc_ptr->conn_type[0] = (uint16_t)NO_VAL; + job_desc_ptr->reboot = (uint16_t)NO_VAL; + job_desc_ptr->rotate = (uint16_t)NO_VAL; + job_desc_ptr->blrtsimage = NULL; + job_desc_ptr->linuximage = NULL; + job_desc_ptr->mloaderimage = NULL; + job_desc_ptr->ramdiskimage = NULL; + safe_unpack16(&job_desc_ptr->wait_all_nodes, buffer); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { job_desc_ptr = xmalloc(sizeof(job_desc_msg_t)); *job_desc_buffer_ptr = job_desc_ptr; @@ -11598,13 +12106,26 @@ pack_multi_core_data (multi_core_data_t *multi_core, Buf buffer, pack8((uint8_t) 0xff, buffer); /* flag as Full */ - pack16(multi_core->sockets_per_node, buffer); - pack16(multi_core->cores_per_socket, buffer); - pack16(multi_core->threads_per_core, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack16(multi_core->boards_per_node, buffer); + pack16(multi_core->sockets_per_board, buffer); + pack16(multi_core->sockets_per_node, buffer); + pack16(multi_core->cores_per_socket, buffer); + pack16(multi_core->threads_per_core, buffer); + + pack16(multi_core->ntasks_per_board, buffer); + pack16(multi_core->ntasks_per_socket, buffer); + pack16(multi_core->ntasks_per_core, buffer); + pack16(multi_core->plane_size, buffer); + } else { + pack16(multi_core->sockets_per_node, buffer); + pack16(multi_core->cores_per_socket, buffer); + pack16(multi_core->threads_per_core, buffer); - pack16(multi_core->ntasks_per_socket, buffer); - pack16(multi_core->ntasks_per_core, buffer); - pack16(multi_core->plane_size, buffer); + pack16(multi_core->ntasks_per_socket, buffer); + pack16(multi_core->ntasks_per_core, buffer); + pack16(multi_core->plane_size, buffer); + } } extern int @@ -11623,14 +12144,24 @@ unpack_multi_core_data (multi_core_data_t **mc_ptr, Buf buffer, multi_core = xmalloc(sizeof(multi_core_data_t)); - safe_unpack16(&multi_core->sockets_per_node, buffer); - safe_unpack16(&multi_core->cores_per_socket, buffer); - safe_unpack16(&multi_core->threads_per_core, buffer); - - safe_unpack16(&multi_core->ntasks_per_socket, buffer); - safe_unpack16(&multi_core->ntasks_per_core, buffer); - safe_unpack16(&multi_core->plane_size, buffer); - + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack16(&multi_core->boards_per_node, buffer); + safe_unpack16(&multi_core->sockets_per_board, buffer); + safe_unpack16(&multi_core->sockets_per_node, buffer); + safe_unpack16(&multi_core->cores_per_socket, buffer); + safe_unpack16(&multi_core->threads_per_core, buffer); + safe_unpack16(&multi_core->ntasks_per_board, buffer); + safe_unpack16(&multi_core->ntasks_per_socket, buffer); + safe_unpack16(&multi_core->ntasks_per_core, buffer); + safe_unpack16(&multi_core->plane_size, buffer); + } else { + safe_unpack16(&multi_core->sockets_per_node, buffer); + safe_unpack16(&multi_core->cores_per_socket, buffer); + safe_unpack16(&multi_core->threads_per_core, buffer); + safe_unpack16(&multi_core->ntasks_per_socket, buffer); + safe_unpack16(&multi_core->ntasks_per_core, buffer); + safe_unpack16(&multi_core->plane_size, buffer); + } *mc_ptr = multi_core; return SLURM_SUCCESS; @@ -11644,23 +12175,44 @@ static void _pack_slurmd_status(slurmd_status_t *msg, Buf buffer, { xassert(msg); - pack_time(msg->booted, buffer); - pack_time(msg->last_slurmctld_msg, buffer); - - pack16(msg->slurmd_debug, buffer); - pack16(msg->actual_cpus, buffer); - pack16(msg->actual_sockets, buffer); - pack16(msg->actual_cores, buffer); - pack16(msg->actual_threads, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + pack_time(msg->booted, buffer); + pack_time(msg->last_slurmctld_msg, buffer); - pack32(msg->actual_real_mem, buffer); - pack32(msg->actual_tmp_disk, buffer); - pack32(msg->pid, buffer); + pack16(msg->slurmd_debug, buffer); + pack16(msg->actual_cpus, buffer); + pack16(msg->actual_boards, buffer); + pack16(msg->actual_sockets, buffer); + pack16(msg->actual_cores, buffer); + pack16(msg->actual_threads, buffer); + + pack32(msg->actual_real_mem, buffer); + pack32(msg->actual_tmp_disk, buffer); + pack32(msg->pid, buffer); + + packstr(msg->hostname, buffer); + packstr(msg->slurmd_logfile, buffer); + packstr(msg->step_list, buffer); + packstr(msg->version, buffer); + } else { + pack_time(msg->booted, buffer); + pack_time(msg->last_slurmctld_msg, buffer); - packstr(msg->hostname, buffer); - packstr(msg->slurmd_logfile, buffer); - packstr(msg->step_list, buffer); - packstr(msg->version, buffer); + pack16(msg->slurmd_debug, buffer); + pack16(msg->actual_cpus, buffer); + pack16(msg->actual_sockets, buffer); + pack16(msg->actual_cores, buffer); + pack16(msg->actual_threads, buffer); + + pack32(msg->actual_real_mem, buffer); + pack32(msg->actual_tmp_disk, buffer); + pack32(msg->pid, buffer); + + packstr(msg->hostname, buffer); + packstr(msg->slurmd_logfile, buffer); + packstr(msg->step_list, buffer); + packstr(msg->version, buffer); + } } static int _unpack_slurmd_status(slurmd_status_t **msg_ptr, Buf buffer, @@ -11673,23 +12225,48 @@ static int _unpack_slurmd_status(slurmd_status_t **msg_ptr, Buf buffer, msg = xmalloc(sizeof(slurmd_status_t)); - safe_unpack_time(&msg->booted, buffer); - safe_unpack_time(&msg->last_slurmctld_msg, buffer); - - safe_unpack16(&msg->slurmd_debug, buffer); - safe_unpack16(&msg->actual_cpus, buffer); - safe_unpack16(&msg->actual_sockets, buffer); - safe_unpack16(&msg->actual_cores, buffer); - safe_unpack16(&msg->actual_threads, buffer); + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpack_time(&msg->booted, buffer); + safe_unpack_time(&msg->last_slurmctld_msg, buffer); - safe_unpack32(&msg->actual_real_mem, buffer); - safe_unpack32(&msg->actual_tmp_disk, buffer); - safe_unpack32(&msg->pid, buffer); + safe_unpack16(&msg->slurmd_debug, buffer); + safe_unpack16(&msg->actual_cpus, buffer); + safe_unpack16(&msg->actual_boards, buffer); + safe_unpack16(&msg->actual_sockets, buffer); + safe_unpack16(&msg->actual_cores, buffer); + safe_unpack16(&msg->actual_threads, buffer); + + safe_unpack32(&msg->actual_real_mem, buffer); + safe_unpack32(&msg->actual_tmp_disk, buffer); + safe_unpack32(&msg->pid, buffer); + + safe_unpackstr_xmalloc(&msg->hostname, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->slurmd_logfile, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->step_list, + &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->version, + &uint32_tmp, buffer); + } else { + safe_unpack_time(&msg->booted, buffer); + safe_unpack_time(&msg->last_slurmctld_msg, buffer); - safe_unpackstr_xmalloc(&msg->hostname, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&msg->slurmd_logfile, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&msg->step_list, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&msg->version, &uint32_tmp, buffer); + safe_unpack16(&msg->slurmd_debug, buffer); + safe_unpack16(&msg->actual_cpus, buffer); + safe_unpack16(&msg->actual_sockets, buffer); + safe_unpack16(&msg->actual_cores, buffer); + safe_unpack16(&msg->actual_threads, buffer); + + safe_unpack32(&msg->actual_real_mem, buffer); + safe_unpack32(&msg->actual_tmp_disk, buffer); + safe_unpack32(&msg->pid, buffer); + + safe_unpackstr_xmalloc(&msg->hostname, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->slurmd_logfile, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->step_list, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&msg->version, &uint32_tmp, buffer); + } *msg_ptr = msg; return SLURM_SUCCESS; diff --git a/src/common/xcpuinfo.c b/src/common/xcpuinfo.c index fc27ac967a6c5a9ad3471c821b0a53c142a636a2..c1fe1ccb8000f0c38928b3e12245a23d646cee8d 100644 --- a/src/common/xcpuinfo.c +++ b/src/common/xcpuinfo.c @@ -2,6 +2,7 @@ * xcpuinfo.c - cpuinfo related primitives ***************************************************************************** * Copyright (C) 2009 CEA/DAM/DIF + * Portions (hwloc) copyright (C) 2012 Bull, <rod.schultz@bull.com> * Written by Matthieu Hautreux <matthieu.hautreux@cea.fr> * * This file is part of SLURM, a resource management program. @@ -60,6 +61,10 @@ #include "src/common/xstring.h" #include "src/slurmd/slurmd/get_mach_stat.h" +#ifdef HAVE_HWLOC +#include <hwloc.h> +#endif + #include "xcpuinfo.h" static char* _cpuinfo_path = "/proc/cpuinfo"; @@ -75,7 +80,7 @@ static int _range_to_map(char* range, uint16_t *map, uint16_t map_size, static int _map_to_range(uint16_t *map, uint16_t map_size, char** prange); bool initialized = false; -uint16_t procs, sockets, cores, threads=1; +uint16_t procs, boards, sockets, cores, threads=1; uint16_t block_map_size; uint16_t *block_map, *block_map_inv; @@ -135,7 +140,8 @@ get_procs(uint16_t *procs) /* * get_cpuinfo - Return detailed cpuinfo on this system * Input: numproc - number of processors on the system - * Output: p_sockets - number of physical processor sockets + * Output: p_boards - number of baseboards (containing sockets) + * p_sockets - number of physical processor sockets * p_cores - total number of physical CPU cores * p_threads - total number of hardware execution threads * block_map - asbtract->physical block distribution map @@ -143,6 +149,117 @@ get_procs(uint16_t *procs) * return code - 0 if no error, otherwise errno * NOTE: User must xfree block_map and block_map_inv */ +#ifdef HAVE_HWLOC +#if DEBUG_DETAIL +static void hwloc_children(hwloc_topology_t topology, hwloc_obj_t obj, + int depth) +{ + char string[128]; + unsigned i; + + hwloc_obj_snprintf(string, sizeof(string), topology, obj, "#", 0); + debug3("%*s%s", 2*depth, "", string); + for (i = 0; i < obj->arity; i++) { + hwloc_children(topology, obj->children[i], depth + 1); + } +} +#endif + +extern int +get_cpuinfo(uint16_t numproc, uint16_t *p_boards, + uint16_t *p_sockets, uint16_t *p_cores, uint16_t *p_threads, + uint16_t *block_map_size, + uint16_t **block_map, uint16_t **block_map_inv) +{ + hwloc_topology_t topology; + hwloc_obj_t obj; + int depth; + /* Allocate and initialize topology object. */ + hwloc_topology_init(&topology); + /* Perform the topology detection. */ + hwloc_topology_load(topology); + + int boards = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_GROUP); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + boards = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_boards = boards; + + int nsockets = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_SOCKET); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + nsockets = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_sockets = nsockets; + + int ncores = 1; + *p_cores = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_CORE); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + ncores = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_cores = ncores / nsockets; + + int npu = 1; + depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + npu = hwloc_get_nbobjs_by_depth(topology, depth); + } + *p_threads = npu / ncores; + + *block_map_size = npu; + /* See notes on _compute_block_map for details + * retval = _compute_block_map(*block_map_size, + * block_map, block_map_inv); */ + + uint16_t i; + /* Compute abstract->machine block mapping (and inverse) */ + if (block_map) { + *block_map = xmalloc(npu * sizeof(uint16_t)); + for (i=0; i<npu; i++) + { + obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, i); + (*block_map)[i] = obj->os_index; + } + if (block_map_inv) { + *block_map_inv = xmalloc(npu * sizeof(uint16_t)); + for (i = 0; i < npu; i++) { + uint16_t idx = (*block_map)[i]; + (*block_map_inv)[idx] = i; + } + } + } + +#if DEBUG_DETAIL + /*** Display raw data ***/ + debug3(" "); + debug3("Boards: %u", *p_sockets); + debug3("Sockets: %u", *p_sockets); + debug3("Cores per socket: %u", *p_cores); + debug3("Threads per core: %u", *p_threads); + debug3(" "); + hwloc_children(topology, hwloc_get_root_obj(topology), 0); + + /* Display the mapping tables */ + if (block_map && block_map_inv) { + debug3(""); + debug3("Abstract -> Machine logical CPU ID block mapping:"); + debug3("(AbstractId PhysicalId Inverse"); + for (i = 0; i < numproc; i++) { + debug3(" %4d %4u %4u", + i, (*block_map)[i], (*block_map_inv)[i]); + } + debug3(""); + } + debug3(""); +#endif + hwloc_topology_destroy(topology); + return 0; + +} +#else + typedef struct cpuinfo { uint16_t seen; uint32_t cpuid; @@ -156,12 +273,15 @@ typedef struct cpuinfo { static cpuinfo_t *cpuinfo = NULL; /* array of CPU information for get_cpuinfo */ /* Note: file static for qsort/_compare_cpus*/ extern int -get_cpuinfo(uint16_t numproc, +get_cpuinfo(uint16_t numproc, uint16_t *p_boards, uint16_t *p_sockets, uint16_t *p_cores, uint16_t *p_threads, uint16_t *block_map_size, uint16_t **block_map, uint16_t **block_map_inv) { int retval; + + *p_boards = 1; /* Boards not identified from /proc/cpuinfo */ + uint16_t numcpu = 0; /* number of cpus seen */ uint16_t numphys = 0; /* number of unique "physical id"s */ uint16_t numcores = 0; /* number of unique "cores id"s */ @@ -458,7 +578,6 @@ get_cpuinfo(uint16_t numproc, return retval; } - /* _chk_cpuinfo_str * check a line of cpuinfo data (buffer) for a keyword. If it * exists, return the string value for that keyword in *valptr. @@ -601,7 +720,6 @@ static int _compute_block_map(uint16_t numproc, (*block_map_inv)[idx] = i; } } - #if DEBUG_DETAIL /* Display the mapping tables */ @@ -659,6 +777,7 @@ static int _compute_block_map(uint16_t numproc, #endif return 0; } +#endif int _ranges_conv(char* lrange,char** prange,int mode); @@ -679,7 +798,7 @@ xcpuinfo_init(void) if ( get_procs(&procs) ) return XCPUINFO_ERROR; - if ( get_cpuinfo(procs,&sockets,&cores,&threads, + if ( get_cpuinfo(procs,&boards,&sockets,&cores,&threads, &block_map_size,&block_map,&block_map_inv) ) return XCPUINFO_ERROR; diff --git a/src/common/xcpuinfo.h b/src/common/xcpuinfo.h index 0c93b84ebd51ae5603affe4e8b9ef7c22b600224..416298a2882d344545c07d34827c7e1380455392 100644 --- a/src/common/xcpuinfo.h +++ b/src/common/xcpuinfo.h @@ -45,7 +45,7 @@ #define XCPUINFO_SUCCESS 0 extern int get_procs(uint16_t *procs); -extern int get_cpuinfo(uint16_t numproc, +extern int get_cpuinfo(uint16_t numproc, uint16_t *boards, uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *block_map_size, uint16_t **block_map, uint16_t **block_map_inv); diff --git a/src/plugins/select/cons_res/dist_tasks.c b/src/plugins/select/cons_res/dist_tasks.c index 3feafe8501816baa38b845308611ec3c8af343f1..730bc6fe87bd016818bf7ddbcb86d488451ebca0 100644 --- a/src/plugins/select/cons_res/dist_tasks.c +++ b/src/plugins/select/cons_res/dist_tasks.c @@ -5,6 +5,8 @@ * Copyright (C) 2006-2008 Hewlett-Packard Development Company, L.P. * Written by Susanne M. Balle, <susanne.balle@hp.com> * CODE-OCEC-09-009. All rights reserved. + * Portions copyright (C) 2012 Bull + * Written by Martin Perry <martin.perry@bull.com> * * This file is part of SLURM, a resource management program. * For details, see <http://www.schedmd.com/slurmdocs/>. @@ -48,6 +50,68 @@ #define ALLOCATE_FULL_SOCKET 1 #endif +/* Max boards supported for best-fit across boards */ +/* Larger board configurations may require new algorithm */ +/* for acceptable performance */ +#define MAX_BOARDS 8 + +/* Combination counts + * comb_counts[n-1][k-1] = number of combinations of + * k items from a set of n items + * + * Formula is n!/k!(n-k)! + */ +uint32_t comb_counts[MAX_BOARDS][MAX_BOARDS] = + {{1,0,0,0,0,0,0,0}, + {2,1,0,0,0,0,0,0}, + {3,3,1,0,0,0,0,0}, + {4,6,4,1,0,0,0,0}, + {5,10,10,5,1,0,0,0}, + {6,15,20,15,6,1,0,0}, + {7,21,35,35,21,7,1,0}, + {8,28,56,70,56,28,8,1}}; + +/* Generate all combinations of k integers from the + * set of integers 0 to n-1. + * Return combinations in comb_list. + * + * Example: For k = 2 and n = 4, there are six + * combinations: + * {0,1},{0,2},{0,3},{1,2},{1,3},{2,3} + * + */ +void _gen_combs(int *comb_list, int n, int k) +{ + int *comb = xmalloc(k * sizeof(int)); + + /* Setup comb for the initial combination */ + int i, b; + for (i = 0; i < k; ++i) + comb[i] = i; + b = 0; + + /* Generate all the other combinations */ + while (1) { + for (i=0; i < k; i++) { + comb_list[b+i] = comb[i]; + } + b+=k; + i = k - 1; + ++comb[i]; + while ((i >= 0) && (comb[i] >= n - k + 1 + i)) { + --i; + ++comb[i]; + } + + if (comb[0] > n - k) + break; /* No more combinations */ + + for (i = i + 1; i < k; ++i) + comb[i] = comb[i - 1] + 1; + } + xfree(comb); +} + /* _compute_task_c_b_task_dist - compute the number of tasks on each * of the node for the cyclic and block distribution. We need to do * this in the case of consumable resources so that we have an exact @@ -95,7 +159,6 @@ static int _compute_c_b_task_dist(struct job_record *job_ptr) "setting to 1"); maxtasks = 1; } - if (job_ptr->details->cpus_per_task == 0) job_ptr->details->cpus_per_task = 1; for (tid = 0, i = job_ptr->details->cpus_per_task ; (tid < maxtasks); @@ -194,7 +257,16 @@ static int _compute_plane_dist(struct job_record *job_ptr) } /* sync up core bitmap with new CPU count using a best-fit approach - * on the available sockets + * on the available resources on each node + * + * "Best-fit" means: + * 1st priority: Use smallest number of boards with sufficient + * available CPUs + * 2nd priority: Use smallest number of sockets with sufficient + * available CPUs + * 3rd priority: Use board combination with the smallest number + * of available CPUs + * 4th priority: Use higher-numbered boards/sockets/cores first * * The CPU array contains the distribution of CPUs, which can include * virtual CPUs (hyperthreads) @@ -202,20 +274,53 @@ static int _compute_plane_dist(struct job_record *job_ptr) static void _block_sync_core_bitmap(struct job_record *job_ptr, const uint16_t cr_type) { - uint32_t c, s, i, j, n, size, csize, core_cnt; + uint32_t c, s, i, j, n, b, z, size, csize, core_cnt; uint16_t cpus, num_bits, vpus = 1; job_resources_t *job_res = job_ptr->job_resrcs; bool alloc_cores = false, alloc_sockets = false; uint16_t ntasks_per_core = 0xffff; + int count, cpu_min, b_min, elig, s_min, comb_idx, sock_idx; + 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; + int* elig_cpu_cnt; bool* sockets_used; + uint16_t boards_nb; + uint16_t nboards_nb; uint16_t sockets_nb; uint16_t ncores_nb; uint16_t nsockets_nb; + uint16_t sock_per_brd; + uint16_t sock_per_comb; uint16_t req_cpus,best_fit_cpus = 0; uint32_t best_fit_location = 0; + 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; @@ -246,6 +351,9 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, sockets_nb = select_node_record[0].sockets; sockets_cpu_cnt = xmalloc(sockets_nb * sizeof(int)); sockets_used = xmalloc(sockets_nb * sizeof(bool)); + boards_nb = select_node_record[0].boards; + boards_cpu_cnt = xmalloc(boards_nb * sizeof(int)); + sort_brds_cpu_cnt = xmalloc(boards_nb * sizeof(int)); for (c = 0, i = 0, n = 0; n < size; n++) { @@ -255,33 +363,163 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, core_cnt = 0; ncores_nb = select_node_record[n].cores; nsockets_nb = select_node_record[n].sockets; + nboards_nb = select_node_record[n].boards; num_bits = nsockets_nb * ncores_nb; if ((c + num_bits) > csize) - fatal ("cons_res: _block_sync_core_bitmap index error"); + fatal("cons_res: _block_sync_core_bitmap index error"); cpus = job_res->cpus[i]; vpus = MIN(select_node_record[n].vpus, ntasks_per_core); + if (nboards_nb > MAX_BOARDS) { + debug3("cons_res: node[%u]: exceeds max boards; " + "doing best-fit across sockets only", n); + nboards_nb = 1; + } + if ( nsockets_nb > sockets_nb) { sockets_nb = nsockets_nb; xrealloc(sockets_cpu_cnt, sockets_nb * sizeof(int)); xrealloc(sockets_used,sockets_nb * sizeof(bool)); } - /* count cores provided by each socket */ + if ( nboards_nb > boards_nb) { + boards_nb = nboards_nb; + xrealloc(boards_cpu_cnt, boards_nb * sizeof(int)); + xrealloc(sort_brds_cpu_cnt, boards_nb * sizeof(int)); + } + + /* Count available cores on each socket and board */ + sock_per_brd = nsockets_nb / nboards_nb; + for (b = 0; b < nboards_nb; b++) { + boards_cpu_cnt[b] = 0; + sort_brds_cpu_cnt[b] = 0; + } for (s = 0; s < nsockets_nb; s++) { sockets_cpu_cnt[s]=0; sockets_used[s]=false; + b = s/sock_per_brd; for ( j = c + (s * ncores_nb) ; j < c + ((s+1) * ncores_nb) ; j++ ) { - if ( bit_test(job_res->core_bitmap,j) ) + if ( bit_test(job_res->core_bitmap,j) ) { sockets_cpu_cnt[s]++; + boards_cpu_cnt[b]++; + sort_brds_cpu_cnt[b]++; + } } } - /* select cores in the sockets using a best-fit approach */ + /* Sort boards in descending order of available core count */ + qsort(sort_brds_cpu_cnt, nboards_nb, sizeof (int), + _cmp_int_descend); + /* Determine minimum number of boards required for the + * allocation (b_min) */ + count = 0; + for (b = 0; b < nboards_nb; b++) { + count+=sort_brds_cpu_cnt[b]; + if (count >= cpus) + break; + } + b_min = b+1; + sock_per_comb = b_min * sock_per_brd; + + /* Allocate space for list of board combinations */ + ncomb_brd = comb_counts[nboards_nb-1][b_min-1]; + board_combs = xmalloc(ncomb_brd * b_min * sizeof(int)); + /* Generate all combinations of b_min boards on the node */ + _gen_combs(board_combs, nboards_nb, b_min); + + /* Determine which combinations have enough available cores + * for the allocation (eligible board combinations) + */ + elig_brd_combs = xmalloc(ncomb_brd * sizeof(int)); + elig_cpu_cnt = xmalloc(ncomb_brd * sizeof(int)); + elig = 0; + for (comb_idx = 0; comb_idx < ncomb_brd; comb_idx++) { + count = 0; + for (comb_brd_idx = 0; comb_brd_idx < b_min; + comb_brd_idx++) { + board_num = board_combs[(comb_idx * b_min) + + comb_brd_idx]; + count += boards_cpu_cnt[board_num]; + } + if (count >= cpus) { + elig_brd_combs[elig] = comb_idx; + elig_cpu_cnt[elig] = count; + elig++; + } + } + + /* Allocate space for list of sockets for each eligible board + * combination */ + socket_list = xmalloc(elig * sock_per_comb * sizeof(int)); + + /* Generate sorted list of sockets for each eligible board + * combination, and find combination with minimum number + * of sockets and minimum number of cpus required for the + * allocation + */ + s_min = sock_per_comb; + comb_min = 0; + cpu_min = sock_per_comb * ncores_nb; + for (elig_idx = 0; elig_idx < elig; elig_idx++) { + comb_idx = elig_brd_combs[elig_idx]; + for (comb_brd_idx = 0; comb_brd_idx < b_min; + comb_brd_idx++) { + board_num = board_combs[(comb_idx * b_min) + + comb_brd_idx]; + sock_list_idx = (elig_idx * sock_per_comb) + + (comb_brd_idx * sock_per_brd); + for (sock_idx = 0; sock_idx < sock_per_brd; + sock_idx++) { + socket_list[sock_list_idx + sock_idx] + = (board_num * sock_per_brd) + + sock_idx; + } + } + /* Sort this socket list in descending order of + * available core count */ + qsort(&socket_list[elig_idx*sock_per_comb], + sock_per_comb, sizeof (int), _cmp_sock); + /* Determine minimum number of sockets required for + * the allocation from this socket list */ + count = 0; + for (b = 0; b < sock_per_comb; b++) { + sock_idx = + socket_list[(int)((elig_idx*sock_per_comb)+b)]; + count+=sockets_cpu_cnt[sock_idx]; + if (count >= cpus) + break; + } + b++; + /* Use board combination with minimum number + * of required sockets and minimum number of CPUs + */ + if ((b < s_min) || + (b == s_min && elig_cpu_cnt[elig_idx] + <= cpu_min)) { + s_min = b; + comb_min = elig_idx; + cpu_min = elig_cpu_cnt[elig_idx]; + } + } + debug3("cons_res: best_fit: node[%u]: required cpus: %u, " + "min req boards: %u,", n, cpus, b_min); + debug3("cons_res: best_fit: node[%u]: min req sockets: %u, " + "min avail cpus: %u", n, s_min, cpu_min); + /* Re-sort socket list for best-fit board combination in + * ascending order of socket number */ + qsort(&socket_list[comb_min * sock_per_comb], sock_per_comb, + sizeof (int), _cmp_int_ascend); + + xfree(board_combs); + xfree(elig_brd_combs); + xfree(elig_cpu_cnt); + + /* select cores from the sockets of the best-fit board + * combination using a best-fit approach */ while( cpus > 0 ) { best_fit_cpus = 0; @@ -295,7 +533,8 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, /* search for the best socket, */ /* starting from the last one to let more room */ /* in the first one for system usage */ - for ( s = nsockets_nb - 1 ; (int) s >= (int) 0 ; s-- ) { + for ( z = sock_per_comb-1; (int) z >= (int) 0; z-- ) { + s = socket_list[(comb_min*sock_per_comb)+z]; sufficient = sockets_cpu_cnt[s] >= req_cpus ; if ( (best_fit_cpus == 0) || (sufficient && !best_fit_sufficient ) || @@ -313,9 +552,10 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, if ( best_fit_cpus == 0 ) break; - debug3("dist_task: best_fit : using node[%u]:" - "socket[%u] : %u cores available", - n, best_fit_location, + debug3("cons_res: best_fit: using node[%u]: " + "board[%u]: socket[%u]: %u cores available", + n, best_fit_location/sock_per_brd, + best_fit_location, sockets_cpu_cnt[best_fit_location]); /* select socket cores from last to first */ @@ -373,6 +613,7 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, } + xfree(socket_list); if (cpus > 0) { /* cpu count should NEVER be greater than the number * of set bits in the core bitmap for a given node */ @@ -392,11 +633,12 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr, } + xfree(boards_cpu_cnt); + xfree(sort_brds_cpu_cnt); xfree(sockets_cpu_cnt); xfree(sockets_used); } - /* Sync up the core_bitmap with the CPU array using cyclic distribution * * The CPU array contains the distribution of CPUs, which can include diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c index c3604a9bcf41c091601c9d86686308ab1f5a53bb..e9cffa42f2630f9749a53461bce467d370e1852f 100644 --- a/src/plugins/select/cons_res/select_cons_res.c +++ b/src/plugins/select/cons_res/select_cons_res.c @@ -1933,6 +1933,7 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt) struct config_record *config_ptr; config_ptr = node_ptr[i].config_ptr; select_node_record[i].cpus = config_ptr->cpus; + select_node_record[i].boards = config_ptr->boards; select_node_record[i].sockets = config_ptr->sockets; select_node_record[i].cores = config_ptr->cores; select_node_record[i].vpus = config_ptr->threads; @@ -1940,6 +1941,7 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt) real_memory; } else { select_node_record[i].cpus = node_ptr[i].cpus; + select_node_record[i].boards = node_ptr[i].boards; select_node_record[i].sockets = node_ptr[i].sockets; select_node_record[i].cores = node_ptr[i].cores; select_node_record[i].vpus = node_ptr[i].threads; diff --git a/src/plugins/select/cons_res/select_cons_res.h b/src/plugins/select/cons_res/select_cons_res.h index 4cd80f06724d3aa7ee35da716fd5cfab592e34c3..8fa6bb33a22afa56cbc7c6c87c814385bc755442 100644 --- a/src/plugins/select/cons_res/select_cons_res.h +++ b/src/plugins/select/cons_res/select_cons_res.h @@ -104,6 +104,7 @@ struct part_res_record { struct node_res_record { struct node_record *node_ptr; /* ptr to the actual node */ uint16_t cpus; /* count of processors configured */ + uint16_t boards; /* count of boards configured */ uint16_t sockets; /* count of sockets configured */ uint16_t cores; /* count of cores configured */ uint16_t vpus; /* count of virtual cpus (hyperthreads) diff --git a/src/plugins/select/linear/select_linear.c b/src/plugins/select/linear/select_linear.c index d2e8364c2d18b6f2bd4dfe0d0553adab65f3c1ac..7bc1922b05d1b1fe45f10d7978103c4aecfcb0a3 100644 --- a/src/plugins/select/linear/select_linear.c +++ b/src/plugins/select/linear/select_linear.c @@ -452,7 +452,7 @@ static uint16_t _get_avail_cpus(struct job_record *job_ptr, int index) { struct node_record *node_ptr; uint16_t avail_cpus; - uint16_t cpus, sockets, cores, threads; + uint16_t cpus, boards, sockets, cores, threads; uint16_t cpus_per_task = 1; uint16_t ntasks_per_node = 0, ntasks_per_socket, ntasks_per_core; uint16_t min_sockets, min_cores, min_threads; @@ -482,19 +482,21 @@ static uint16_t _get_avail_cpus(struct job_record *job_ptr, int index) node_ptr = select_node_ptr + index; if (select_fast_schedule) { /* don't bother checking each node */ cpus = node_ptr->config_ptr->cpus; + boards = node_ptr->config_ptr->boards; sockets = node_ptr->config_ptr->sockets; cores = node_ptr->config_ptr->cores; threads = node_ptr->config_ptr->threads; } else { cpus = node_ptr->cpus; + boards = node_ptr->boards; sockets = node_ptr->sockets; cores = node_ptr->cores; threads = node_ptr->threads; } #if SELECT_DEBUG - info("host %s HW_ cpus %u sockets %u cores %u threads %u ", - node_ptr->name, cpus, sockets, cores, threads); + info("host %s HW_ cpus %u boards %u sockets %u cores %u threads %u ", + node_ptr->name, cpus, boards, sockets, cores, threads); #endif avail_cpus = slurm_get_avail_procs( diff --git a/src/sacct/Makefile.am b/src/sacct/Makefile.am index d203aaf3d8136d693e7b6e49408333963db6cd33..7acfcb86704c491d755ece97fed43b7854772465 100644 --- a/src/sacct/Makefile.am +++ b/src/sacct/Makefile.am @@ -9,7 +9,8 @@ bin_PROGRAMS = sacct sacct_LDADD = $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) -sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) noinst_HEADERS = sacct.c sacct_SOURCES = \ diff --git a/src/sacct/Makefile.in b/src/sacct/Makefile.in index 49a681156d748a04fd94c83b695703727c8a54e1..75b11a1df1e750d36fd3319492693242957fdc29 100644 --- a/src/sacct/Makefile.in +++ b/src/sacct/Makefile.in @@ -321,7 +321,9 @@ AUTOMAKE_OPTIONS = foreign CLEANFILES = core.* INCLUDES = -I$(top_srcdir) sacct_LDADD = $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) -sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacct_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + noinst_HEADERS = sacct.c sacct_SOURCES = \ options.c \ diff --git a/src/sacctmgr/Makefile.am b/src/sacctmgr/Makefile.am index 584b4b5856c1eff4f3c5c2d6275958b18eabe270..9a887d4e6fe7120c44d472aac8bb5e3f5764748d 100644 --- a/src/sacctmgr/Makefile.am +++ b/src/sacctmgr/Makefile.am @@ -27,7 +27,8 @@ sacctmgr_SOURCES = \ wckey_functions.c \ problem_functions.c -sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(sacctmgr_LDADD) : force diff --git a/src/sacctmgr/Makefile.in b/src/sacctmgr/Makefile.in index b8c78fd02f0412a3649c429684f4c3f9ed3fb3e6..3d0aab24b5f355c65500956cb98a3f0efdd1d481 100644 --- a/src/sacctmgr/Makefile.in +++ b/src/sacctmgr/Makefile.in @@ -343,7 +343,9 @@ sacctmgr_SOURCES = \ wckey_functions.c \ problem_functions.c -sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sacctmgr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/salloc/Makefile.am b/src/salloc/Makefile.am index 4ef6a74a514efe33b51eff78d40fee8072479bc8..885818538a15507441699f6f34d04257853ff28b 100644 --- a/src/salloc/Makefile.am +++ b/src/salloc/Makefile.am @@ -18,7 +18,8 @@ if HAVE_REAL_CRAY salloc_LDADD += -ljob endif -salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/salloc/Makefile.in b/src/salloc/Makefile.in index a5a8c5ef09e598694fb4ea80422f6d3dbda2faeb..cf83a3adbcb94fc107aba93793a721386a8dc91a 100644 --- a/src/salloc/Makefile.in +++ b/src/salloc/Makefile.in @@ -321,7 +321,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) salloc_SOURCES = salloc.c salloc.h opt.c opt.h convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) salloc_LDADD = $(convenience_libs) $(am__append_1) -salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +salloc_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sattach/Makefile.am b/src/sattach/Makefile.am index 1f6b88518f36b3fcbec85315094d899e836c72e9..4ca5a0b3f3ce39192e54182d01d409d349263357 100644 --- a/src/sattach/Makefile.am +++ b/src/sattach/Makefile.am @@ -17,7 +17,8 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sattach_LDADD = \ $(convenience_libs) -sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/sattach/Makefile.in b/src/sattach/Makefile.in index b37d95d9da05f066a2a7efc94c4f49c927fb8b56..c6a4ad49eb95e3da85fc84ebdcffe772661604e5 100644 --- a/src/sattach/Makefile.in +++ b/src/sattach/Makefile.in @@ -327,7 +327,9 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sattach_LDADD = \ $(convenience_libs) -sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sattach_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sbatch/Makefile.am b/src/sbatch/Makefile.am index 9b88be83fecc3ce0010670c1608d0e5c41f7ba19..929c22bb3c3a2e08a424bf0a7f70f5dbbfc13baf 100644 --- a/src/sbatch/Makefile.am +++ b/src/sbatch/Makefile.am @@ -13,7 +13,8 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sbatch_LDADD = $(convenience_libs) -sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/sbatch/Makefile.in b/src/sbatch/Makefile.in index 88fa9e2897f2ba3adc08550bdd28dc3b43f69979..80127584c0f53024b10ce506698ee996ae026749 100644 --- a/src/sbatch/Makefile.in +++ b/src/sbatch/Makefile.in @@ -321,7 +321,9 @@ INCLUDES = -I$(top_srcdir) sbatch_SOURCES = sbatch.c mult_cluster.c mult_cluster.h opt.c opt.h convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sbatch_LDADD = $(convenience_libs) -sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbatch_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sbcast/Makefile.am b/src/sbcast/Makefile.am index 6ec2083e5e2968121d7b2271203caeb8acc16bf9..166f66f80e68bcb1a06f8168d60da6b968eb8683 100644 --- a/src/sbcast/Makefile.am +++ b/src/sbcast/Makefile.am @@ -15,5 +15,6 @@ force: $(sbcast_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sbcast/Makefile.in b/src/sbcast/Makefile.in index 271955d3a671dda2ddcf789cc7019fb15fe311b1..1e3e5dba44de596b885386402b17b2c34e7a40a6 100644 --- a/src/sbcast/Makefile.in +++ b/src/sbcast/Makefile.in @@ -322,7 +322,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) sbcast_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) -lm noinst_HEADERS = sbcast.h sbcast_SOURCES = agent.c sbcast.c opts.c -sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/scancel/Makefile.am b/src/scancel/Makefile.am index f8aa1d75bdee4ee5aff3d34ac9f186cb6648e885..7bd9beef046d4f259d66c080755d447757028490 100644 --- a/src/scancel/Makefile.am +++ b/src/scancel/Makefile.am @@ -11,7 +11,8 @@ scancel_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = scancel.h scancel_SOURCES = scancel.c opt.c -scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(scancel_LDADD) : force diff --git a/src/scancel/Makefile.in b/src/scancel/Makefile.in index 75843922ab4ccc30e278c9d735a3e71e186c7f60..131a7c944d6cd6edda99de348b4d126d0617a376 100644 --- a/src/scancel/Makefile.in +++ b/src/scancel/Makefile.in @@ -321,7 +321,9 @@ INCLUDES = -I$(top_srcdir) scancel_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = scancel.h scancel_SOURCES = scancel.c opt.c -scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scancel_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/scontrol/Makefile.am b/src/scontrol/Makefile.am index af1c41183aa7b952ce07a31c5f4a5cafc5d57f91..316506270abcff645aacefca3d3ee11316aa92e5 100644 --- a/src/scontrol/Makefile.am +++ b/src/scontrol/Makefile.am @@ -27,7 +27,8 @@ scontrol_LDADD = \ $(convenience_libs) \ $(READLINE_LIBS) -scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/scontrol/Makefile.in b/src/scontrol/Makefile.in index 34ced407f7732a735b3c725c66a78a0130254c2b..3091c3a888b5dfc081342eff653fb33390068b0d 100644 --- a/src/scontrol/Makefile.in +++ b/src/scontrol/Makefile.in @@ -339,7 +339,9 @@ scontrol_LDADD = \ $(convenience_libs) \ $(READLINE_LIBS) -scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +scontrol_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sdiag/Makefile.am b/src/sdiag/Makefile.am index 2f111e8a623a8b39422534c9336cb51c1430ef51..4b1a92c796271687ad31bcfe79531156c69a9293 100644 --- a/src/sdiag/Makefile.am +++ b/src/sdiag/Makefile.am @@ -14,5 +14,6 @@ force: $(sdiag_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sdiag/Makefile.in b/src/sdiag/Makefile.in index bb3185235c50f11185dfeba35577e88d71569cfc..5128c731a738bbca88c892d55fa5bab16c200ca0 100644 --- a/src/sdiag/Makefile.in +++ b/src/sdiag/Makefile.in @@ -318,7 +318,9 @@ AUTOMAKE_OPTIONS = foreign INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) sdiag_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) sdiag_SOURCES = sdiag.c opts.c -sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sdiag_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sinfo/Makefile.am b/src/sinfo/Makefile.am index 96e06a97cb7bcc2ba2f6d2740e8ed7667b27b821..aef1c160efb69feed1c086e13eab05e05311f0d6 100644 --- a/src/sinfo/Makefile.am +++ b/src/sinfo/Makefile.am @@ -15,5 +15,6 @@ force: $(sinfo_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sinfo/Makefile.in b/src/sinfo/Makefile.in index 58d61f6a589e1f861f26cba20b7e0de81bd44993..63f70c9950947e8f7914117364dec02d279778ff 100644 --- a/src/sinfo/Makefile.in +++ b/src/sinfo/Makefile.in @@ -323,7 +323,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) sinfo_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = sinfo.h print.h sinfo_SOURCES = sinfo.c opts.c print.c sort.c -sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sinfo_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/slurmctld/Makefile.am b/src/slurmctld/Makefile.am index 67b463114d67766e965cc89e17339733fe557076..db271915bd27e99fdf6c6894174f08e1dce61237 100644 --- a/src/slurmctld/Makefile.am +++ b/src/slurmctld/Makefile.am @@ -66,7 +66,8 @@ sbin_PROGRAMS = slurmctld slurmctld_LDADD = \ $(top_builddir)/src/common/libdaemonize.la \ $(top_builddir)/src/api/libslurm.o $(DL_LIBS) -slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(slurmctld_LDADD) : force diff --git a/src/slurmctld/Makefile.in b/src/slurmctld/Makefile.in index 6ec439aeab6fafd06eeccda7ea1543b452d01b37..2c08a1cac2a4083569b43a28f602c59c38295cf9 100644 --- a/src/slurmctld/Makefile.in +++ b/src/slurmctld/Makefile.in @@ -386,7 +386,9 @@ slurmctld_LDADD = \ $(top_builddir)/src/common/libdaemonize.la \ $(top_builddir)/src/api/libslurm.o $(DL_LIBS) -slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmctld_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 5a16bd32452ffc8778982818c5eb870556606cdc..6bd8656db5caeac174734482853f00182d1e7570 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -101,7 +101,8 @@ #define JOB_HASH_INX(_job_id) (_job_id % hash_table_size) /* Change JOB_STATE_VERSION value when changing the state save format */ -#define JOB_STATE_VERSION "VER012" +#define JOB_STATE_VERSION "VER013" +#define JOB_2_5_STATE_VERSION "VER013" /* SLURM version 2.5 */ #define JOB_2_4_STATE_VERSION "VER012" /* SLURM version 2.4 */ #define JOB_2_3_STATE_VERSION "VER011" /* SLURM version 2.3 */ #define JOB_2_2_STATE_VERSION "VER010" /* SLURM version 2.2 */ @@ -624,6 +625,8 @@ extern int load_all_job_state(void) if (ver_str) { if (!strcmp(ver_str, JOB_STATE_VERSION)) { protocol_version = SLURM_PROTOCOL_VERSION; + } else if (!strcmp(ver_str, JOB_2_4_STATE_VERSION)) { + protocol_version = SLURM_2_4_PROTOCOL_VERSION; } else if (!strcmp(ver_str, JOB_2_3_STATE_VERSION)) { protocol_version = SLURM_2_3_PROTOCOL_VERSION; } else if (!strcmp(ver_str, JOB_2_2_STATE_VERSION)) { @@ -3491,6 +3494,7 @@ static int _part_access_check(struct part_record *part_ptr, { uint32_t total_nodes; + if ((part_ptr->flags & PART_FLAG_REQ_RESV) && (!job_desc->reservation || !strlen(job_desc->reservation))) { info("_part_access_check: uid %u access to partition %s " diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c index 714e3cfe9f40a55a86de3f64c95b9fc5617402e1..2595de55a328ae0d8eeab872a7a7a7818229323f 100644 --- a/src/slurmctld/node_mgr.c +++ b/src/slurmctld/node_mgr.c @@ -82,7 +82,8 @@ #define MAX_RETRIES 10 /* Change NODE_STATE_VERSION value when changing the state save format */ -#define NODE_STATE_VERSION "VER005" +#define NODE_STATE_VERSION "VER006" +#define NODE_2_5_STATE_VERSION "VER006" /* SLURM version 2.5 */ #define NODE_2_4_STATE_VERSION "VER005" /* SLURM version 2.4 */ #define NODE_2_2_STATE_VERSION "VER004" /* SLURM version 2.2 & 2.3 */ #define NODE_2_1_STATE_VERSION "VER003" /* SLURM version 2.1 */ @@ -222,6 +223,7 @@ _dump_node_state (struct node_record *dump_node_ptr, Buf buffer) packstr (dump_node_ptr->gres, buffer); pack16 (dump_node_ptr->node_state, buffer); pack16 (dump_node_ptr->cpus, buffer); + pack16 (dump_node_ptr->boards, buffer); pack16 (dump_node_ptr->sockets, buffer); pack16 (dump_node_ptr->cores, buffer); pack16 (dump_node_ptr->threads, buffer); @@ -279,7 +281,7 @@ extern int load_all_node_state ( bool state_only ) char *features = NULL, *gres = NULL; int data_allocated, data_read = 0, error_code = 0, node_cnt = 0; uint16_t node_state; - uint16_t cpus = 1, sockets = 1, cores = 1, threads = 1; + uint16_t cpus = 1, boards = 1, sockets = 1, cores = 1, threads = 1; uint32_t real_memory, tmp_disk, data_size = 0, name_len; uint32_t reason_uid = NO_VAL; time_t reason_time = 0; @@ -334,6 +336,8 @@ extern int load_all_node_state ( bool state_only ) if (ver_str) { if (!strcmp(ver_str, NODE_STATE_VERSION)) { protocol_version = SLURM_PROTOCOL_VERSION; + } else if (!strcmp(ver_str, NODE_2_4_STATE_VERSION)) { + protocol_version = SLURM_2_4_PROTOCOL_VERSION; } else if (!strcmp(ver_str, NODE_2_2_STATE_VERSION)) { protocol_version = SLURM_2_2_PROTOCOL_VERSION; } else if (!strcmp(ver_str, NODE_2_1_STATE_VERSION)) { @@ -358,7 +362,30 @@ extern int load_all_node_state ( bool state_only ) while (remaining_buf (buffer) > 0) { uint16_t base_state; - if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + safe_unpackstr_xmalloc (&comm_name, &name_len, buffer); + safe_unpackstr_xmalloc (&node_name, &name_len, buffer); + safe_unpackstr_xmalloc (&node_hostname, + &name_len, buffer); + safe_unpackstr_xmalloc (&reason, &name_len, buffer); + safe_unpackstr_xmalloc (&features, &name_len, buffer); + safe_unpackstr_xmalloc (&gres, &name_len, buffer); + safe_unpack16 (&node_state, buffer); + safe_unpack16 (&cpus, buffer); + safe_unpack16 (&boards, buffer); + safe_unpack16 (&sockets, buffer); + safe_unpack16 (&cores, buffer); + safe_unpack16 (&threads, buffer); + safe_unpack32 (&real_memory, buffer); + safe_unpack32 (&tmp_disk, buffer); + safe_unpack32 (&reason_uid, buffer); + safe_unpack_time (&reason_time, buffer); + if (gres_plugin_node_state_unpack( + &gres_list, buffer, node_name, + protocol_version) != SLURM_SUCCESS) + goto unpack_error; + base_state = node_state & NODE_STATE_BASE; + } else if (protocol_version >= SLURM_2_4_PROTOCOL_VERSION) { safe_unpackstr_xmalloc (&comm_name, &name_len, buffer); safe_unpackstr_xmalloc (&node_name, &name_len, buffer); safe_unpackstr_xmalloc (&node_hostname, @@ -418,13 +445,14 @@ extern int load_all_node_state ( bool state_only ) /* validity test as possible */ if ((cpus == 0) || + (boards == 0) || (sockets == 0) || (cores == 0) || (threads == 0) || (base_state >= NODE_STATE_END)) { - error ("Invalid data for node %s: procs=%u, " - "sockets=%u, cores=%u, threads=%u, state=%u", - node_name, cpus, + error ("Invalid data for node %s: procs=%u, boards=%u," + " sockets=%u, cores=%u, threads=%u, state=%u", + node_name, cpus, boards, sockets, cores, threads, node_state); error ("No more node data will be processed from the " "checkpoint file"); @@ -497,6 +525,7 @@ extern int load_all_node_state ( bool state_only ) /* Recover hardware state for powered * down nodes */ node_ptr->cpus = cpus; + node_ptr->boards = boards; node_ptr->sockets = sockets; node_ptr->cores = cores; node_ptr->threads = threads; @@ -743,7 +772,56 @@ extern void pack_all_node (char **buffer_ptr, int *buffer_size, static void _pack_node (struct node_record *dump_node_ptr, Buf buffer, uint16_t protocol_version) { - if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { + if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { + packstr (dump_node_ptr->name, buffer); + packstr (dump_node_ptr->node_hostname, buffer); + packstr (dump_node_ptr->comm_name, buffer); + pack16 (dump_node_ptr->node_state, buffer); + /* On a bluegene system always use the regular node + * infomation not what is in the config_ptr. + */ +#ifndef HAVE_BG + if (slurmctld_conf.fast_schedule) { + /* Only data from config_record used for scheduling */ + pack16(dump_node_ptr->config_ptr->cpus, buffer); + pack16(dump_node_ptr->config_ptr->boards, buffer); + pack16(dump_node_ptr->config_ptr->sockets, buffer); + pack16(dump_node_ptr->config_ptr->cores, buffer); + pack16(dump_node_ptr->config_ptr->threads, buffer); + pack32(dump_node_ptr->config_ptr->real_memory, buffer); + pack32(dump_node_ptr->config_ptr->tmp_disk, buffer); + } else { +#endif + /* Individual node data used for scheduling */ + pack16(dump_node_ptr->cpus, buffer); + pack16(dump_node_ptr->boards, buffer); + pack16(dump_node_ptr->sockets, buffer); + pack16(dump_node_ptr->cores, buffer); + pack16(dump_node_ptr->threads, buffer); + pack32(dump_node_ptr->real_memory, buffer); + pack32(dump_node_ptr->tmp_disk, buffer); +#ifndef HAVE_BG + } +#endif + pack32(dump_node_ptr->config_ptr->weight, buffer); + pack32(dump_node_ptr->reason_uid, buffer); + + pack_time(dump_node_ptr->boot_time, buffer); + pack_time(dump_node_ptr->reason_time, buffer); + pack_time(dump_node_ptr->slurmd_start_time, buffer); + + select_g_select_nodeinfo_pack(dump_node_ptr->select_nodeinfo, + buffer, protocol_version); + + packstr(dump_node_ptr->arch, buffer); + packstr(dump_node_ptr->features, buffer); + if (dump_node_ptr->gres) + packstr(dump_node_ptr->gres, buffer); + else + packstr(dump_node_ptr->config_ptr->gres, buffer); + packstr(dump_node_ptr->os, buffer); + packstr(dump_node_ptr->reason, buffer); + } else if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { packstr (dump_node_ptr->name, buffer); packstr (dump_node_ptr->node_hostname, buffer); packstr (dump_node_ptr->comm_name, buffer); @@ -1288,6 +1366,7 @@ struct config_record * _dup_config(struct config_record *config_ptr) new_config_ptr = create_config_record(); new_config_ptr->magic = config_ptr->magic; new_config_ptr->cpus = config_ptr->cpus; + new_config_ptr->boards = config_ptr->boards; new_config_ptr->sockets = config_ptr->sockets; new_config_ptr->cores = config_ptr->cores; new_config_ptr->threads = config_ptr->threads; @@ -1717,13 +1796,16 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) gres_plugin_node_state_log(node_ptr->gres_list, node_ptr->name); if (slurmctld_conf.fast_schedule != 2) { + int boards1, boards2; /* total boards on node */ int sockets1, sockets2; /* total sockets on node */ int cores1, cores2; /* total cores on node */ int threads1, threads2; /* total threads on node */ + boards1 = reg_msg->boards; sockets1 = reg_msg->sockets; cores1 = sockets1 * reg_msg->cores; threads1 = cores1 * reg_msg->threads; + boards2 = config_ptr->boards; sockets2 = config_ptr->sockets; cores2 = sockets2 * config_ptr->cores; threads2 = cores2 * config_ptr->threads; @@ -1780,6 +1862,7 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) } } if (error_code == SLURM_SUCCESS) { + node_ptr->boards = reg_msg->boards; node_ptr->sockets = reg_msg->sockets; node_ptr->cores = reg_msg->cores; node_ptr->threads = reg_msg->threads; @@ -2101,6 +2184,7 @@ extern int validate_nodes_via_front_end( } } + /* purge orphan batch jobs */ job_iterator = list_iterator_create(job_list); while ((job_ptr = (struct job_record *) list_next(job_iterator))) { diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c index 266dd0693645515633610d8eb927a32b60f1d82b..3cd547ac074a7ed07e9109b6616f42c22f212d45 100644 --- a/src/slurmctld/read_config.c +++ b/src/slurmctld/read_config.c @@ -1053,6 +1053,7 @@ static int _restore_node_state(int recover, node_ptr->cpus = old_node_ptr->cpus; node_ptr->cores = old_node_ptr->cores; node_ptr->last_idle = old_node_ptr->last_idle; + node_ptr->boards = old_node_ptr->boards; node_ptr->sockets = old_node_ptr->sockets; node_ptr->threads = old_node_ptr->threads; node_ptr->real_memory = old_node_ptr->real_memory; diff --git a/src/slurmd/common/slurmstepd_init.c b/src/slurmd/common/slurmstepd_init.c index a9d5982cb8d87dfc10f6a1c27aef9780a071facb..3264db053c02eb2b945be8878e7c118efcd356a9 100644 --- a/src/slurmd/common/slurmstepd_init.c +++ b/src/slurmd/common/slurmstepd_init.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble <da@llnl.gov> * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://www.schedmd.com/slurmdocs/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -42,6 +42,7 @@ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer) { xassert(conf != NULL); packstr(conf->hostname, buffer); + pack16(conf->boards, buffer); pack16(conf->sockets, buffer); pack16(conf->cores, buffer); pack16(conf->threads, buffer); @@ -55,6 +56,7 @@ extern void pack_slurmd_conf_lite(slurmd_conf_t *conf, Buf buffer) packstr(conf->task_prolog, buffer); packstr(conf->task_epilog, buffer); pack16(conf->job_acct_gather_freq, buffer); + packstr(conf->job_acct_gather_type, buffer); pack16(conf->propagate_prio, buffer); pack32(conf->debug_flags, buffer); pack32(conf->debug_level, buffer); @@ -72,6 +74,7 @@ extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer) uint32_t uint32_tmp; safe_unpackstr_xmalloc(&conf->hostname, &uint32_tmp, buffer); + safe_unpack16(&conf->boards, buffer); safe_unpack16(&conf->sockets, buffer); safe_unpack16(&conf->cores, buffer); safe_unpack16(&conf->threads, buffer); @@ -85,6 +88,7 @@ extern int unpack_slurmd_conf_lite_no_alloc(slurmd_conf_t *conf, Buf buffer) safe_unpackstr_xmalloc(&conf->task_prolog, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&conf->task_epilog, &uint32_tmp, buffer); safe_unpack16(&conf->job_acct_gather_freq, buffer); + safe_unpackstr_xmalloc(&conf->job_acct_gather_type, &uint32_tmp, buffer); safe_unpack16(&conf->propagate_prio, buffer); safe_unpack32(&conf->debug_flags, buffer); safe_unpack32(&uint32_tmp, buffer); diff --git a/src/slurmd/slurmd/Makefile.am b/src/slurmd/slurmd/Makefile.am index 7d81740c4f266f0e480f13b87307772f33fb5aff..a9f6ff2d0cf71c5d53c02ee961984b0ffe68e8af 100644 --- a/src/slurmd/slurmd/Makefile.am +++ b/src/slurmd/slurmd/Makefile.am @@ -27,9 +27,11 @@ slurmd_SOURCES = $(SLURMD_SOURCES) if HAVE_AIX # We need to set maxdata back to 0 because this effects the "max memory size" # ulimit, and the ulimit is inherited by child processes. -slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0 +slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 else -slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) endif force: diff --git a/src/slurmd/slurmd/Makefile.in b/src/slurmd/slurmd/Makefile.in index c76d154ab0ccf61a33a7bf440ea5a71f90d70619..43158aa140da4e0ca317b0b2922d0204a3f1dcc0 100644 --- a/src/slurmd/slurmd/Makefile.in +++ b/src/slurmd/slurmd/Makefile.in @@ -336,11 +336,15 @@ SLURMD_SOURCES = \ xcpu.c xcpu.h slurmd_SOURCES = $(SLURMD_SOURCES) -@HAVE_AIX_FALSE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +@HAVE_AIX_FALSE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_FALSE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + # We need to set maxdata back to 0 because this effects the "max memory size" # ulimit, and the ulimit is inherited by child processes. -@HAVE_AIX_TRUE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0 +@HAVE_AIX_TRUE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 + all: all-am .SUFFIXES: diff --git a/src/slurmd/slurmd/req.c b/src/slurmd/slurmd/req.c index bbf066249db6686c7c22861f02dfc51f442e0280..0220d127cfe4e0d137457e1d407bb202bf1ea35d 100644 --- a/src/slurmd/slurmd/req.c +++ b/src/slurmd/slurmd/req.c @@ -838,6 +838,7 @@ _check_job_credential(launch_tasks_request_msg_t *req, uid_t uid, } host_index = hostset_find(j_hset, conf->node_name); hostset_destroy(j_hset); + if ((host_index < 0) || (host_index >= arg.job_nhosts)) { error("job cr credential invalid host_index %d for " "job %u", host_index, arg.jobid); @@ -2208,6 +2209,7 @@ _rpc_daemon_status(slurm_msg_t *msg) resp = xmalloc(sizeof(slurmd_status_t)); resp->actual_cpus = conf->actual_cpus; + resp->actual_boards = conf->actual_boards; resp->actual_sockets = conf->actual_sockets; resp->actual_cores = conf->actual_cores; resp->actual_threads = conf->actual_threads; diff --git a/src/slurmd/slurmd/slurmd.c b/src/slurmd/slurmd/slurmd.c index 669907a6ae432a4d546f7a94091d8402bb445403..64e4028b97745f3d266d6ad16e5739b61aa783c1 100644 --- a/src/slurmd/slurmd/slurmd.c +++ b/src/slurmd/slurmd/slurmd.c @@ -579,6 +579,7 @@ _fill_registration_msg(slurm_node_registration_status_msg_t *msg) msg->node_name = xstrdup (conf->node_name); msg->cpus = conf->cpus; + msg->boards = conf->boards; msg->sockets = conf->sockets; msg->cores = conf->cores; msg->threads = conf->threads; @@ -600,15 +601,17 @@ _fill_registration_msg(slurm_node_registration_status_msg_t *msg) if (first_msg) { first_msg = false; - info("CPUs=%u Sockets=%u Cores=%u Threads=%u " + info("Procs=%u Boards=%u Sockets=%u Cores=%u Threads=%u " "Memory=%u TmpDisk=%u Uptime=%u", - msg->cpus, msg->sockets, msg->cores, msg->threads, - msg->real_memory, msg->tmp_disk, msg->up_time); + msg->cpus, msg->boards, msg->sockets, msg->cores, + msg->threads, msg->real_memory, msg->tmp_disk, + msg->up_time); } else { - debug3("CPUs=%u Sockets=%u Cores=%u Threads=%u " + debug3("Procs=%u Boards=%u Sockets=%u Cores=%u Threads=%u " "Memory=%u TmpDisk=%u Uptime=%u", - msg->cpus, msg->sockets, msg->cores, msg->threads, - msg->real_memory, msg->tmp_disk, msg->up_time); + msg->cpus, msg->boards, msg->sockets, msg->cores, + msg->threads, msg->real_memory, msg->tmp_disk, + msg->up_time); } uname(&buf); if ((arch = getenv("SLURM_ARCH"))) @@ -662,7 +665,6 @@ _fill_registration_msg(slurm_node_registration_status_msg_t *msg) } list_iterator_destroy(i); list_destroy(steps); - msg->timestamp = time(NULL); return; @@ -881,9 +883,10 @@ _read_config(void) } conf->port = slurm_conf_get_port(conf->node_name); - slurm_conf_get_cpus_sct(conf->node_name, - &conf->conf_cpus, &conf->conf_sockets, - &conf->conf_cores, &conf->conf_threads); + slurm_conf_get_cpus_bsct(conf->node_name, + &conf->conf_cpus, &conf->conf_boards, + &conf->conf_sockets, &conf->conf_cores, + &conf->conf_threads); /* store hardware properties in slurmd_config */ xfree(conf->block_map); @@ -904,6 +907,7 @@ _read_config(void) #else get_procs(&conf->actual_cpus); get_cpuinfo(conf->actual_cpus, + &conf->actual_boards, &conf->actual_sockets, &conf->actual_cores, &conf->actual_threads, @@ -918,6 +922,7 @@ _read_config(void) * Report actual hardware configuration, irrespective of FastSchedule. */ conf->cpus = conf->actual_cpus; + conf->boards = conf->actual_boards; conf->sockets = conf->actual_sockets; conf->cores = conf->actual_cores; conf->threads = conf->actual_threads; @@ -932,11 +937,13 @@ _read_config(void) ((cf->fast_schedule == 1) && (conf->actual_cpus < conf->conf_cpus))) { conf->cpus = conf->actual_cpus; + conf->boards = conf->actual_boards; conf->sockets = conf->actual_sockets; conf->cores = conf->actual_cores; conf->threads = conf->actual_threads; } else { conf->cpus = conf->conf_cpus; + conf->boards = conf->conf_boards; conf->sockets = conf->conf_sockets; conf->cores = conf->conf_cores; conf->threads = conf->conf_threads; @@ -1109,6 +1116,10 @@ _print_conf(void) conf->cpus, conf->conf_cpus, conf->actual_cpus); + debug3("Boards = %-2u (CF: %2u, HW: %2u)", + conf->boards, + conf->conf_boards, + conf->actual_boards); debug3("Sockets = %-2u (CF: %2u, HW: %2u)", conf->sockets, conf->conf_sockets, @@ -1251,6 +1262,7 @@ _print_config(void) #else get_procs(&conf->actual_cpus); get_cpuinfo(conf->actual_cpus, + &conf->actual_boards, &conf->actual_sockets, &conf->actual_cores, &conf->actual_threads, diff --git a/src/slurmd/slurmd/slurmd.h b/src/slurmd/slurmd/slurmd.h index b2554300602754fc6c44351fbb7d77c98db50d67..124f97bf4f2f2762882deca3c7e2762ebdf60cf3 100644 --- a/src/slurmd/slurmd/slurmd.h +++ b/src/slurmd/slurmd/slurmd.h @@ -77,14 +77,17 @@ typedef struct slurmd_config { int *argc; /* pointer to argument count */ char *hostname; /* local hostname */ uint16_t cpus; /* lowest-level logical processors */ - uint16_t sockets; /* sockets count */ - uint16_t cores; /* core count */ + uint16_t boards; /* total boards count */ + uint16_t sockets; /* total sockets count */ + uint16_t cores; /* core per socket count */ uint16_t threads; /* thread per core count */ uint16_t conf_cpus; /* conf file logical processors */ + uint16_t conf_boards; /* conf file boards count */ uint16_t conf_sockets; /* conf file sockets count */ uint16_t conf_cores; /* conf file core count */ uint16_t conf_threads; /* conf file thread per core count */ uint16_t actual_cpus; /* actual logical processors */ + uint16_t actual_boards; /* actual boards count */ uint16_t actual_sockets; /* actual sockets count */ uint16_t actual_cores; /* actual core count */ uint16_t actual_threads; /* actual thread per core count */ @@ -120,7 +123,7 @@ typedef struct slurmd_config { pid_t pid; /* server pid */ log_options_t log_opts; /* current logging options */ int debug_level; /* logging detail level */ - uint32_t debug_flags; /* DebugFlags configured */ + uint32_t debug_flags; /* DebugFlags configured */ int daemonize:1; /* daemonize flag */ int cleanstart:1; /* clean start requested (-c) */ int mlock_pages:1; /* mlock() slurmd */ @@ -131,6 +134,7 @@ typedef struct slurmd_config { uid_t slurm_user_id; /* UID that slurmctld runs as */ pthread_mutex_t config_mutex; /* lock for slurmd_config access */ uint16_t job_acct_gather_freq; + char *job_acct_gather_type; /* job accounting gather type */ uint16_t use_pam; uint16_t task_plugin_param; /* TaskPluginParams, expressed * using cpu_bind_type_t flags */ diff --git a/src/slurmd/slurmstepd/Makefile.am b/src/slurmd/slurmstepd/Makefile.am index 31d7b1ae532ee206dca7539be66fe61d10aac712..38794ef49c27484cc406fd470787448ae3e7af6b 100644 --- a/src/slurmd/slurmstepd/Makefile.am +++ b/src/slurmd/slurmstepd/Makefile.am @@ -30,9 +30,11 @@ slurmstepd_SOURCES = \ if HAVE_AIX # We need to set maxdata back to 0 because this effects the "max memory size" # ulimit, and the ulimit is inherited by child processes. -slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0 +slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 else -slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) endif force: diff --git a/src/slurmd/slurmstepd/Makefile.in b/src/slurmd/slurmstepd/Makefile.in index 2bed7c4ab042922afe62d309029f17b23772401b..9126d0a77d87bdadae9e532680a658e8d0cfe70a 100644 --- a/src/slurmd/slurmstepd/Makefile.in +++ b/src/slurmd/slurmstepd/Makefile.in @@ -342,11 +342,15 @@ slurmstepd_SOURCES = \ multi_prog.c multi_prog.h \ step_terminate_monitor.c step_terminate_monitor.h -@HAVE_AIX_FALSE@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +@HAVE_AIX_FALSE@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_FALSE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + # We need to set maxdata back to 0 because this effects the "max memory size" # ulimit, and the ulimit is inherited by child processes. -@HAVE_AIX_TRUE@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0 +@HAVE_AIX_TRUE@slurmstepd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@HAVE_AIX_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) -Wl,-bmaxdata:0x0 + all: all-am .SUFFIXES: diff --git a/src/slurmdbd/Makefile.am b/src/slurmdbd/Makefile.am index 15a91a5727aac873dd7ec50ddb0e6fa7f3885d85..caac3a1e10cbfc2118a77d3cefe4ed1db1a12eac 100644 --- a/src/slurmdbd/Makefile.am +++ b/src/slurmdbd/Makefile.am @@ -27,7 +27,8 @@ slurmdbd_SOURCES = \ slurmdbd.c \ slurmdbd.h -slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(slurmdbd_LDADD) : force diff --git a/src/slurmdbd/Makefile.in b/src/slurmdbd/Makefile.in index 2824dee0a9281a6b2c1025797028722ef72d863e..2c090e71ed81a49279cf1a0643f19640d9dbe9d3 100644 --- a/src/slurmdbd/Makefile.in +++ b/src/slurmdbd/Makefile.in @@ -337,7 +337,9 @@ slurmdbd_SOURCES = \ slurmdbd.c \ slurmdbd.h -slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +slurmdbd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/smap/Makefile.am b/src/smap/Makefile.am index 67438cfbc93a9217b99dc5cd8bf34dc5173387e7..4b8ff3c6535a806c8a3209e7342c883480a02a3a 100644 --- a/src/smap/Makefile.am +++ b/src/smap/Makefile.am @@ -33,7 +33,8 @@ force: $(smap_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) else diff --git a/src/smap/Makefile.in b/src/smap/Makefile.in index bf332c58e4b0ae858ba34834ab6866bdcb019291..3c836f7f7f98bdd8e947e7d066c68c4509838237 100644 --- a/src/smap/Makefile.in +++ b/src/smap/Makefile.in @@ -346,7 +346,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) @BUILD_SMAP_TRUE@smap_LDADD = $(top_builddir)/src/api/libslurm.o \ @BUILD_SMAP_TRUE@ $(DL_LIBS) $(am__append_1) @BLUEGENE_LOADED_TRUE@@BUILD_SMAP_TRUE@bg_dir = $(top_builddir)/src/plugins/select/bluegene -@BUILD_SMAP_TRUE@smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +@BUILD_SMAP_TRUE@smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ +@BUILD_SMAP_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + @BUILD_SMAP_FALSE@EXTRA_smap_SOURCES = smap.h smap.c \ @BUILD_SMAP_FALSE@ job_functions.c partition_functions.c \ @BUILD_SMAP_FALSE@ configure_functions.c grid_functions.c \ diff --git a/src/sprio/Makefile.am b/src/sprio/Makefile.am index a2d2abe194551856d6f3cf54926308841a5c741d..c7d76bd21439500ee405438bb03651b18fa2aba3 100644 --- a/src/sprio/Makefile.am +++ b/src/sprio/Makefile.am @@ -16,5 +16,6 @@ force: $(sprio_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sprio/Makefile.in b/src/sprio/Makefile.in index dd51693a8ee5acee47d4c22e4a0f82031856145b..1da78935b40961a512c73cf47e1e0e7a9360e9b1 100644 --- a/src/sprio/Makefile.in +++ b/src/sprio/Makefile.in @@ -322,7 +322,9 @@ INCLUDES = -I$(top_srcdir) sprio_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = sprio.h print.h sprio_SOURCES = sprio.c print.c opts.c -sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sprio_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/squeue/Makefile.am b/src/squeue/Makefile.am index ee56435c1110e2c944a626144abf0fa0712d8dd7..9ce4fbcf6dee05b7bed49cc5de6786993ecf9d7c 100644 --- a/src/squeue/Makefile.am +++ b/src/squeue/Makefile.am @@ -16,5 +16,6 @@ force: $(squeue_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/squeue/Makefile.in b/src/squeue/Makefile.in index c52b9254bcb4191bca4bf1ebfb0260faada6e5f8..6bbbccc5218e5776f1f2d4429908a1cc4fcf51cf 100644 --- a/src/squeue/Makefile.in +++ b/src/squeue/Makefile.in @@ -323,7 +323,9 @@ INCLUDES = -I$(top_srcdir) squeue_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = squeue.h print.h squeue_SOURCES = squeue.c print.c opts.c sort.c -squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +squeue_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sreport/Makefile.am b/src/sreport/Makefile.am index cfec9b4caec3c66c4f3b039e976df1a5233a309f..d648f745e9270792993b3ab12a8cd90d3ff3c245 100644 --- a/src/sreport/Makefile.am +++ b/src/sreport/Makefile.am @@ -20,7 +20,8 @@ sreport_LDADD = \ $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) \ $(READLINE_LIBS) -sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(sreport_LDADD) : force diff --git a/src/sreport/Makefile.in b/src/sreport/Makefile.in index 7e05ef0171e65efba5a28fe6015c38afa08c3ccd..46de7be61d3b081d19c1532d16d3345ae1dba825 100644 --- a/src/sreport/Makefile.in +++ b/src/sreport/Makefile.in @@ -331,7 +331,9 @@ sreport_LDADD = \ $(top_builddir)/src/db_api/libslurmdb.o $(DL_LIBS) \ $(READLINE_LIBS) -sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sreport_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/srun/Makefile.am b/src/srun/Makefile.am index 2098245a26eb92176f5261293c8f6ffd164a4133..6cf3e306f7b593e88b77c40e436cca959b487ef6 100644 --- a/src/srun/Makefile.am +++ b/src/srun/Makefile.am @@ -18,7 +18,8 @@ srun_SOURCES = \ srun.wrapper.c srun_LDADD = $(convenience_libs) $(DL_LIBS) -srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) if BGQ_LOADED # because totalview needs the libraries on load we link in srun diff --git a/src/srun/Makefile.in b/src/srun/Makefile.in index 65f0fd6cc1395daec2fa5289f09b7be03e045eac..53c17081c1a41c771edd735923aa058a8f52f965 100644 --- a/src/srun/Makefile.in +++ b/src/srun/Makefile.in @@ -368,7 +368,8 @@ srun_SOURCES = \ srun.wrapper.c srun_LDADD = $(convenience_libs) $(DL_LIBS) -srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(am__append_1) +srun_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(HWLOC_LDFLAGS) \ + $(HWLOC_LIBS) $(am__append_1) all: all-recursive .SUFFIXES: diff --git a/src/srun_cr/Makefile.am b/src/srun_cr/Makefile.am index f4f3ec90384eae3b95292df5788c6c33a3cea020..baffd46287fa719d8ca285236d87f512e288ddd2 100644 --- a/src/srun_cr/Makefile.am +++ b/src/srun_cr/Makefile.am @@ -13,7 +13,8 @@ convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) srun_cr_LDADD = $(convenience_libs) $(BLCR_LIBS) -srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) +srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(convenience_libs) : force diff --git a/src/srun_cr/Makefile.in b/src/srun_cr/Makefile.in index b49e9095d39914a5f779d0c56418bd749ec4e1f6..c4305d467ba2ce7d57eb67a38a467119d16cea5b 100644 --- a/src/srun_cr/Makefile.in +++ b/src/srun_cr/Makefile.in @@ -320,7 +320,9 @@ INCLUDES = -I$(top_srcdir) $(BLCR_CPPFLAGS) srun_cr_SOURCES = srun_cr.c convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) srun_cr_LDADD = $(convenience_libs) $(BLCR_LIBS) -srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) +srun_cr_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BLCR_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sshare/Makefile.am b/src/sshare/Makefile.am index 805f758484b2b849a21089ca78150e10bd32423b..59c3d566e76af5d2ca8c28c1377df3e38ec88de1 100644 --- a/src/sshare/Makefile.am +++ b/src/sshare/Makefile.am @@ -15,7 +15,8 @@ sshare_SOURCES = \ process.c \ sshare.c sshare.h -sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) force: $(sshare_LDADD) : force diff --git a/src/sshare/Makefile.in b/src/sshare/Makefile.in index 2e7b0b7b8d492f68b4468dd68a745f943162a34b..f825a825885694727af041a39380b937518cd902 100644 --- a/src/sshare/Makefile.in +++ b/src/sshare/Makefile.in @@ -324,7 +324,9 @@ sshare_SOURCES = \ process.c \ sshare.c sshare.h -sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sshare_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sstat/Makefile.am b/src/sstat/Makefile.am index b01ba0b0b7981e1c0737415a0795784deef53fa4..e84a6aeaef55ea72cc53130784c5391678e660ab 100644 --- a/src/sstat/Makefile.am +++ b/src/sstat/Makefile.am @@ -19,5 +19,6 @@ force: $(sstat_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/sstat/Makefile.in b/src/sstat/Makefile.in index 5c6c2908af9794475331a73ecfd8644aa36c9ee3..fcdd90b2abfa308cf3e8a216df661b289ccd3d81 100644 --- a/src/sstat/Makefile.in +++ b/src/sstat/Makefile.in @@ -324,7 +324,9 @@ sstat_SOURCES = \ sstat.c \ sstat.h -sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +sstat_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/strigger/Makefile.am b/src/strigger/Makefile.am index 90ddadcddb339d7529db5edcbe95ec94a8549411..d8816ac5fc9f30aa84586dd51da83bb19eeb8108 100644 --- a/src/strigger/Makefile.am +++ b/src/strigger/Makefile.am @@ -15,5 +15,6 @@ force: $(strigger_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) diff --git a/src/strigger/Makefile.in b/src/strigger/Makefile.in index 8e20bba94e32d49bbca859f2e2ac25ace2e5c9e7..4346da8df876afe2e95b771034d264a051831a8f 100644 --- a/src/strigger/Makefile.in +++ b/src/strigger/Makefile.in @@ -322,7 +322,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) strigger_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) noinst_HEADERS = strigger.h strigger_SOURCES = strigger.c opts.c -strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) +strigger_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + all: all-am .SUFFIXES: diff --git a/src/sview/Makefile.am b/src/sview/Makefile.am index 289638270619371d1cb61b2fff538222dd30a995..3e767db2b202cb37c20b680136c4d5ae4cef425d 100644 --- a/src/sview/Makefile.am +++ b/src/sview/Makefile.am @@ -21,7 +21,8 @@ force: $(sview_LDADD) : force @cd `dirname $@` && $(MAKE) `basename $@` -sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) +sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) \ + $(HWLOC_LDFLAGS) $(HWLOC_LIBS) sview_CFLAGS = $(GTK_CFLAGS) else diff --git a/src/sview/Makefile.in b/src/sview/Makefile.in index e76217f2093a3fe8d75117dc65bda7433656c06f..3651b257fffa01b41116f2269c669f3dea5e5471 100644 --- a/src/sview/Makefile.in +++ b/src/sview/Makefile.in @@ -350,7 +350,9 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) @BUILD_SVIEW_TRUE@ submit_info.c admin_info.c common.c \ @BUILD_SVIEW_TRUE@ config_info.c defaults.c -@BUILD_SVIEW_TRUE@sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) +@BUILD_SVIEW_TRUE@sview_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BG_LDFLAGS) $(GTK_LIBS) \ +@BUILD_SVIEW_TRUE@ $(HWLOC_LDFLAGS) $(HWLOC_LIBS) + @BUILD_SVIEW_TRUE@sview_CFLAGS = $(GTK_CFLAGS) @BUILD_SVIEW_FALSE@EXTRA_sview_SOURCES = sview.h sview.c popups.c grid.c part_info.c job_info.c \ @BUILD_SVIEW_FALSE@ block_info.c front_end_info.c node_info.c resv_info.c \ diff --git a/src/sview/node_info.c b/src/sview/node_info.c index cbaa3347bcb33076dfb72811fe9f4aee606ffd42..b5ed2d7728a8ea94b67a550f2d17215816263270 100644 --- a/src/sview/node_info.c +++ b/src/sview/node_info.c @@ -42,6 +42,7 @@ int g_node_scaling = 1; enum { SORTID_POS = POS_LOC, SORTID_ARCH, + SORTID_BOARDS, SORTID_BOOT_TIME, SORTID_COLOR, SORTID_CPUS, @@ -108,10 +109,12 @@ static display_data_t display_data_node[] = { EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_STRING, SORTID_ERR_CPUS, "Error CPU Count", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, - {G_TYPE_INT, SORTID_CORES, "CoresPerSocket", FALSE, + {G_TYPE_INT, SORTID_BOARDS, "Boards", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_INT, SORTID_SOCKETS, "Sockets", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, + {G_TYPE_INT, SORTID_CORES, "CoresPerSocket", FALSE, + EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_INT, SORTID_THREADS, "ThreadsPerCore", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_STRING, SORTID_MEMORY, "Real Memory", FALSE, @@ -256,12 +259,11 @@ static void _layout_node_record(GtkTreeView *treeview, lower); xfree(lower); - - convert_num_unit((float)node_ptr->cores, tmp_cnt, sizeof(tmp_cnt), + convert_num_unit((float)node_ptr->boards, tmp_cnt, sizeof(tmp_cnt), UNIT_NONE); add_display_treestore_line(update, treestore, &iter, find_col_name(display_data_node, - SORTID_CORES), + SORTID_BOARDS), tmp_cnt); convert_num_unit((float)node_ptr->sockets, tmp_cnt, sizeof(tmp_cnt), @@ -271,6 +273,13 @@ static void _layout_node_record(GtkTreeView *treeview, SORTID_SOCKETS), tmp_cnt); + convert_num_unit((float)node_ptr->cores, tmp_cnt, sizeof(tmp_cnt), + UNIT_NONE); + add_display_treestore_line(update, treestore, &iter, + find_col_name(display_data_node, + SORTID_CORES), + tmp_cnt); + convert_num_unit((float)node_ptr->threads, tmp_cnt, sizeof(tmp_cnt), UNIT_NONE); add_display_treestore_line(update, treestore, &iter, @@ -382,6 +391,7 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr, /* Combining these records provides a slight performance improvement */ gtk_tree_store_set(treestore, &sview_node_info_ptr->iter_ptr, SORTID_ARCH, node_ptr->arch, + SORTID_BOARDS, node_ptr->boards, SORTID_BOOT_TIME, sview_node_info_ptr->boot_time, SORTID_COLOR, sview_colors[sview_node_info_ptr->pos