diff --git a/NEWS b/NEWS index 914f53d09043007fe3a7585982c18c22bd65648a..74e8b7b26be232dd64ce906dfa4e0ef0b3a5f2d4 100644 --- a/NEWS +++ b/NEWS @@ -7,10 +7,13 @@ documents those changes that are of interest to users and admins. -- Add ability to change a node's features via "scontrol update". NOTE: Update slurm.conf also to preserve changes over slurmctld restart or reconfig. + NOTE: Node state information can not be preserved from earlier versions. -- Added new slurm.conf parameter TaskPluginParam. -- Fix for job requeue and credential revoke logic from Hongjia Cao (NUDT). -- Fix for incorrectly generated masks for task/affinity plugin patch.1.2.0-pre9.061207.bitfmthex from Dan Palermo (HP). + -- Make mask_cpu options of srun and slaunch commands not requeue prefix + of "0x". patch.1.2.0-pre9.061208.srun_maskparse from Dan Palermo (HP). * Changes in SLURM 1.2.0-pre9 ============================= diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1 index ebb464e4ef470744cdf67abe86d8149cea84aa5d..6b44f3eb2a961a162b8fa8784535aa9670216817 100644 --- a/doc/man/man1/srun.1 +++ b/doc/man/man1/srun.1 @@ -630,9 +630,8 @@ with '0x' in which case they interpreted as hexadecimal values. .B mask_cpu:<list> bind by setting CPU masks on tasks as specified where <list> is <mask1>,<mask2>,...<maskN>. -CPU masks are \fBalways\fR interpreted as hexadecimal values. -Note that masks must be preceded with a '0x' if they don't begin -with [0-9] so they are seen as numerical values by srun. +CPU masks are \fBalways\fR interpreted as hexadecimal values but can be +preceded with an optional '0x'. .TP .B sockets auto\-generated masks bind to sockets diff --git a/src/slaunch/opt.c b/src/slaunch/opt.c index e742c486f8f6d0ef442fa253176a94703b64db3e..e866c6614b2bbaaa2d1ddbf88d68b709494d516e 100644 --- a/src/slaunch/opt.c +++ b/src/slaunch/opt.c @@ -190,6 +190,25 @@ static void _print_version(void) printf("%s %s\n", PACKAGE, SLURM_VERSION); } +/* + * _isvalue + * returns 1 is the argument appears to be a value, 0 otherwise + */ +static int _isvalue(char *arg) { + if (isdigit(*arg)) { /* decimal values and 0x... hex values */ + return 1; + } + + while (isxdigit(*arg)) { /* hex values not preceded by 0x */ + arg++; + } + if (*arg == ',' || *arg == '\0') { /* end of field or string */ + return 1; + } + + return 0; /* not a value */ +} + /* * verify cpu_bind arguments * returns -1 on error, 0 otherwise @@ -216,7 +235,7 @@ static int _verify_cpu_bind(const char *arg, char **cpu_bind, /* change all ',' delimiters not followed by a digit to ';' */ /* simplifies parsing tokens while keeping map/mask together */ while (p[0] != '\0') { - if ((p[0] == ',') && (!isdigit(p[1]))) + if ((p[0] == ',') && (!_isvalue(&(p[1])))) p[0] = ';'; p++; } @@ -342,7 +361,7 @@ static int _verify_mem_bind(const char *arg, char **mem_bind, /* change all ',' delimiters not followed by a digit to ';' */ /* simplifies parsing tokens while keeping map/mask together */ while (p[0] != '\0') { - if ((p[0] == ',') && (!isdigit(p[1]))) + if ((p[0] == ',') && (!_isvalue(&(p[1])))) p[0] = ';'; p++; } diff --git a/src/srun/opt.c b/src/srun/opt.c index 65279b9e96d4ae330bc13d794eb665ad8e822c4e..3589b087c1bbffa6dfb8a87700b66ecd9fa951c7 100644 --- a/src/srun/opt.c +++ b/src/srun/opt.c @@ -407,6 +407,25 @@ static int _verify_geometry(const char *arg, uint16_t *geometry) return rc; } +/* + * _isvalue + * returns 1 is the argument appears to be a value, 0 otherwise + */ +static int _isvalue(char *arg) { + if (isdigit(*arg)) { /* decimal values and 0x... hex values */ + return 1; + } + + while (isxdigit(*arg)) { /* hex values not preceded by 0x */ + arg++; + } + if (*arg == ',' || *arg == '\0') { /* end of field or string */ + return 1; + } + + return 0; /* not a value */ +} + /* * verify cpu_bind arguments * returns -1 on error, 0 otherwise @@ -433,7 +452,7 @@ static int _verify_cpu_bind(const char *arg, char **cpu_bind, /* change all ',' delimiters not followed by a digit to ';' */ /* simplifies parsing tokens while keeping map/mask together */ while (p[0] != '\0') { - if ((p[0] == ',') && (!isdigit(p[1]))) + if ((p[0] == ',') && (!_isvalue(&(p[1])))) p[0] = ';'; p++; } @@ -559,7 +578,7 @@ static int _verify_mem_bind(const char *arg, char **mem_bind, /* change all ',' delimiters not followed by a digit to ';' */ /* simplifies parsing tokens while keeping map/mask together */ while (p[0] != '\0') { - if ((p[0] == ',') && (!isdigit(p[1]))) + if ((p[0] == ',') && (!_isvalue(&(p[1])))) p[0] = ';'; p++; }