Ticket 7306

Summary: sdiag --cluster option
Product: Slurm Reporter: Matt Ezell <ezellma>
Component: User CommandsAssignee: Brian Christiansen <brian>
Status: RESOLVED FIXED QA Contact:
Severity: C - Contributions    
Priority: ---    
Version: 18.08.6   
Hardware: Linux   
OS: Linux   
Site: NOAA Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: ORNL OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 20.02.0pre1 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---
Attachments: Refactor sdiag option handling
Add cluster option to sdiag
Refactor sdiag option handling

Description Matt Ezell 2019-06-27 09:11:20 MDT
sdiag currently only operates on the local cluster.  At NOAA/ORNL, we do not have login nodes in each cluster (the login nodes sit in an 'external' cluster), so there is no way for end users to run sdiag against the compute resource controllers.
Comment 1 Matt Ezell 2019-06-27 09:13:19 MDT
Created attachment 10727 [details]
Refactor sdiag option handling
Comment 2 Matt Ezell 2019-06-27 09:13:41 MDT
Created attachment 10728 [details]
Add cluster option to sdiag
Comment 3 Tim Wickberg 2019-06-27 14:34:31 MDT
(In reply to Matt Ezell from comment #1)
> Created attachment 10727 [details]
> Refactor sdiag option handling

Can you please fix the license block to reflect your authorship of this new header? BSC / Alejandro Lucero did not write any of that, you did...
Comment 4 Matt Ezell 2019-06-27 15:16:28 MDT
Created attachment 10731 [details]
Refactor sdiag option handling
Comment 6 Matt Ezell 2019-07-22 12:57:23 MDT
Anything else needed from our side before this could be merged to master?  Thanks.
Comment 7 Brian Christiansen 2019-07-22 22:35:03 MDT
Looks good. Thanks!

https://github.com/SchedMD/slurm/commit/209dbb02ec723a6c0790972cf6cb55c86531be2c

Thanks,
Brian


FYI. I made these small changes:

diff --git a/src/sdiag/opts.c b/src/sdiag/opts.c
index 923a58cc04..f66c23f707 100644
--- a/src/sdiag/opts.c
+++ b/src/sdiag/opts.c
@@ -42,6 +42,7 @@
 
 #include "src/common/xstring.h"
 #include "src/common/proc_args.h"
+
 #include "sdiag.h"
 
 #define OPT_LONG_USAGE 0x101
@@ -132,8 +133,7 @@ extern void parse_command_line(int argc, char **argv)
 
        if (params.clusters) {
                if (list_count(params.clusters) > 1) {
-                       fatal("Only one cluster can be used at a time with "
-                             "sdiag");
+                       fatal("Only one cluster can be used at a time with sdiag");
                }
                working_cluster_rec = list_peek(params.clusters);
        }
diff --git a/src/sdiag/sdiag.c b/src/sdiag/sdiag.c
index 99095f83d0..82a2caec96 100644
--- a/src/sdiag/sdiag.c
+++ b/src/sdiag/sdiag.c
@@ -47,6 +47,7 @@
 #include "src/common/uid.h"
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
+
 #include "sdiag.h"
 
 /********************
diff --git a/src/sdiag/sdiag.h b/src/sdiag/sdiag.h
index aeec647fb6..43b8ef6f54 100644
--- a/src/sdiag/sdiag.h
+++ b/src/sdiag/sdiag.h
@@ -35,8 +35,8 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
-#ifndef __SDIAG_H__
-#define __SDIAG_H__
+#ifndef _SDIAG_H
+#define _SDIAG_H
 
 struct sdiag_parameters {
        int mode;
@@ -48,7 +48,7 @@ typedef enum {
        SORT_COUNT,
        SORT_ID,
        SORT_TIME,
-       SORT_TIME2
+       SORT_TIME2,
 } sdiag_sort_types_t;
 
 /********************

diff --git a/doc/man/man1/sdiag.1 b/doc/man/man1/sdiag.1
index 609d54e072..7065d056f0 100644
--- a/doc/man/man1/sdiag.1
+++ b/doc/man/man1/sdiag.1
@@ -313,7 +313,7 @@ environment variables, along with their corresponding options, are listed below.
 (Note: commandline options will always override these settings)
 .TP 20
 \fBSLURM_CLUSTERS\fR
-The cluster to issue commands to.
+Same as \fB\-\-cluster\fR
 
 .TP 20
 \fBSLURM_CONF\fR