diff --git a/NEWS b/NEWS index efafa6028796f467a1e89aa56e686d6df7d5ea18..6c9e56d81ac6ce1e614b0f4b9a85e8941f1fcef3 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,16 @@ documents those changes that are of interest to users and admins. -- Updates to node pinging for large numbers of unresponsive nodes -- Explicitly set default action for SIGTERM (action on Thunder was to ignore SIGTERM) + -- Sinfo "--exact" option only applies to fields actually displayed + -- Partition processor count not correctly computed for heterogeneous + clusters with FastSchedule=0 configuration + -- Only return DOWN nodes to service if the reason for them being in + that state is non-responsiveness and "ReturnToService=1" configuration + -- Partition processor count now correctly computed for heterogeneous + clusters with FastSchedule configured off + -- Only return DOWN nodes to service if the reason for them being in + that state is non-responsiveness and ReturnToService configured on + -- New macros and function to export SLURM version number * Changes in SLURM 0.3.0.0-pre5 =============================== diff --git a/acinclude.m4 b/acinclude.m4 index 3d6f6742e66c34c7fcc7576146fba9a7ceccc8d4..6fbf93b15c78620719133978298d77b423bb1f6a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -139,12 +139,12 @@ else SLURM_VERSION="$MAJOR.$MINOR.$MICRO" test $RELEASE = "1" || SLURM_VERSION="$SLURM_VERSION-$SLURM_RELEASE" fi -AC_DEFINE_UNQUOTED(SLURM_MAJOR, "$MAJOR", +AC_DEFINE_UNQUOTED(SLURM_MAJOR, $MAJOR, [Define the project's major version.]) -AC_DEFINE_UNQUOTED(SLURM_MINOR, "$MINOR", - [Define the project's minor version.]) -AC_DEFINE_UNQUOTED(SLURM_MICRO, "$MICRO", +AC_DEFINE_UNQUOTED(SLURM_MINOR, $MINOR, [Define the project's minor version.]) +AC_DEFINE_UNQUOTED(SLURM_MICRO, $MICRO, + [Define the project's micro version.]) AC_DEFINE_UNQUOTED(RELEASE, "$RELEASE", [Define the project's release.]) AC_DEFINE_UNQUOTED(SLURM_VERSION, "$SLURM_VERSION", [Define the project's version string.]) diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 0a83195940f5e92dfdbb18325af157bf921ed8b3..dcd95fbfd5abc14f448c0cc652d9feb320dc5de1 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -14,6 +14,7 @@ man3_MANS = man3/hostlist_create.3 \ man3/hostlist_shift.3 \ man3/slurm_allocate_resources.3 \ man3/slurm_allocate_resources_and_run.3 \ + man3/slurm_api_version.3 \ man3/slurm_complete_job.3 \ man3/slurm_complete_job_step.3 \ man3/slurm_confirm_allocation.3 \ diff --git a/doc/man/man3/slurm_api_version.3 b/doc/man/man3/slurm_api_version.3 new file mode 100644 index 0000000000000000000000000000000000000000..a267130db6e384a2d2274ba23d7c7891c64f5982 --- /dev/null +++ b/doc/man/man3/slurm_api_version.3 @@ -0,0 +1 @@ +.so man3/slurm_free_ctl_conf.3 diff --git a/doc/man/man3/slurm_free_ctl_conf.3 b/doc/man/man3/slurm_free_ctl_conf.3 index cddf4aad87aca16b35821f494e4f4c3bf5deed5a..a68dee0286ea481bc08d3f089e26a215fe6c1b3f 100644 --- a/doc/man/man3/slurm_free_ctl_conf.3 +++ b/doc/man/man3/slurm_free_ctl_conf.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "September 2003" "Morris Jette" "Slurm informational calls" +.TH "Slurm API" "3" "January 2004" "Morris Jette" "Slurm informational calls" .SH "NAME" slurm_free_ctl_conf, slurm_load_ctl_conf, slurm_print_ctl_conf\- Slurm information reporting functions @@ -7,6 +7,8 @@ slurm_print_ctl_conf\- Slurm information reporting functions #include <stdio.h> .br #include <slurm/slurm.h> +.LP +long \fBslurm_api_version\fR (); .LP void \fBslurm_free_ctl_conf\fR ( .br @@ -50,6 +52,8 @@ greater than the last time changes where made to that information, new informati is not returned. Otherwise all the configuration. job, node, or partition records are returned. .SH "DESCRIPTION" +.LP +\fBslurm_api_version\fR Return the SLURM API version number. .LP \fBslurm_free_ctl_conf\fR Release the storage generated by the \fBslurm_load_ctl_conf\fR function. @@ -61,8 +65,9 @@ Slurm configuration records. \fBslurm_load_ctl_conf\fR function. .SH "RETURN VALUE" .LP -On success, zero is returned. On error, -1 is returned, and Slurm error code -is set appropriately. +For \fBslurm_api_version\fR the SLURM API version number is returned. +All other functions return zero on success and -1 on error with the +SLURM error code set appropriately. .SH "ERRORS" .LP \fBSLURM_NO_CHANGE_IN_DATA\fR Data has not changed since \fBupdate_time\fR. @@ -84,6 +89,20 @@ int main (int argc, char *argv[]) { .br slurm_ctl_conf_info_msg_t * conf_info_msg_ptr = NULL; +.br + long version = slurm_api_version; +.LP + /* We can use the SLURM version number to determine how +.br + * API should be used */ +.br + printf("slurm_api_version: %ld, %ld.%ld.%ld\\n", version, +.br + SLURM_VERSION_MAJOR(version), +.br + SLURM_VERSION_MINOR(version), +.br + SLURM_VERSION_MICRO(version)); .LP /* get and print some configuration information */ .br diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index 5d3c9c068a4430f5343198f67fc61db9ae41da57..de970272f7877c3e763139530ae92ee06c46695a 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -92,6 +92,26 @@ BEGIN_C_DECLS typedef struct switch_jobinfo *switch_jobinfo_t; /* opaque data type */ #endif +/*****************************************************************************\ + * DEFINITIONS FOR VERSION MANAGEMENT +\*****************************************************************************/ + +#ifndef SLURM_MAJOR +/* Define the project's major version. */ +#undef SLURM_MAJOR + +/* Define the project's minor version. */ +#undef SLURM_MINOR + +/* Define the project's micro version. */ +#undef SLURM_MICRO +#endif + +#define SLURM_VERSION_NUM(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#define SLURM_VERSION_MAJOR(a) (((a) >> 16) & 0xff) +#define SLURM_VERSION_MINOR(a) (((a) >> 8) & 0xff) +#define SLURM_VERSION_MICRO(a) ((a) & 0xff) + /*****************************************************************************\ * DEFINITIONS FOR INPUT VALUES \*****************************************************************************/ @@ -607,6 +627,14 @@ extern int slurm_complete_job_step PARAMS(( * SLURM CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS \*****************************************************************************/ +/* + * slurm_api_version - Return a single number reflecting the SLURM API's + * version number. Use the macros SLURM_VERSION_NUM, SLURM_VERSION_MAJOR, + * SLURM_VERSION_MINOR, and SLURM_VERSION_MICRO to work with this value + * RET API's version number + */ +extern long slurm_api_version PARAMS((void)); + /* * make_time_str - convert time_t to string with "month/date hour:min:sec" * IN time - a time stamp diff --git a/src/api/config_info.c b/src/api/config_info.c index ab991af97fd614d390586a090d389121a9240d51..2a0b50d9fb5fbcf0ca536b239ce7b04f01c6e288 100644 --- a/src/api/config_info.c +++ b/src/api/config_info.c @@ -37,6 +37,17 @@ #include "src/api/job_info.h" #include "src/common/slurm_protocol_api.h" +/* + * slurm_api_version - Return a single number reflecting the SLURM API's + * version number. Use the macros SLURM_VERSION_NUM, SLURM_VERSION_MAJOR, + * SLURM_VERSION_MINOR, and SLURM_VERSION_MICRO to work with this value + * RET API's version number + */ +extern long slurm_api_version (void) +{ + return (long) SLURM_VERSION_NUM(SLURM_MAJOR, SLURM_MINOR, SLURM_MICRO); +} + /* * slurm_print_ctl_conf - output the contents of slurm control configuration * message as loaded using slurm_load_ctl_conf diff --git a/src/scontrol/scontrol.c b/src/scontrol/scontrol.c index bf1ae659b21eb68404bbb0e30cd846da4b3913c3..35a1a1f130653ed60fde3826705ceee83a78ba02 100644 --- a/src/scontrol/scontrol.c +++ b/src/scontrol/scontrol.c @@ -182,6 +182,13 @@ main (int argc, char *argv[]) static void _print_version(void) { printf("%s %s\n", PACKAGE, SLURM_VERSION); + if (quiet_flag == -1) { + long version = slurm_api_version(); + printf("slurm_api_version: %ld, %ld.%ld.%ld\n", version, + SLURM_VERSION_MAJOR(version), + SLURM_VERSION_MINOR(version), + SLURM_VERSION_MICRO(version)); + } }