Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
819005cc
Commit
819005cc
authored
15 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Add support for scontrol show part <name> for a switch or node name.
parent
40ff5f01
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/man/man1/scontrol.1
+4
-0
4 additions, 0 deletions
doc/man/man1/scontrol.1
slurm/slurm.h.in
+11
-0
11 additions, 0 deletions
slurm/slurm.h.in
src/scontrol/info_node.c
+37
-1
37 additions, 1 deletion
src/scontrol/info_node.c
with
52 additions
and
1 deletion
doc/man/man1/scontrol.1
+
4
−
0
View file @
819005cc
...
@@ -225,6 +225,10 @@ entity: the configuration parameter name, job ID, node name, partition name,
...
@@ -225,6 +225,10 @@ entity: the configuration parameter name, job ID, node name, partition name,
reservation name, or job step ID for \fIconfig\fP, \fIjob\fP, \fInode\fP,
reservation name, or job step ID for \fIconfig\fP, \fIjob\fP, \fInode\fP,
\fIpartition\fP, or \fIstep\fP respectively.
\fIpartition\fP, or \fIstep\fP respectively.
For an \fIENTITY\fP of \fItopology\fP, the \fIID\fP may be a node or switch name.
For an \fIENTITY\fP of \fItopology\fP, the \fIID\fP may be a node or switch name.
If one node name is specified, all switches connected to that node (and
their parent switches) will be shown.
If more than one node name is specified, only switches that connect to all
named nodes will be shown.
\fIhostnames\fP takes an optional hostlist expression as input and
\fIhostnames\fP takes an optional hostlist expression as input and
writes a list of individual host names to standard output (one per
writes a list of individual host names to standard output (one per
line). If no hostlist expression is supplied, the contents of the
line). If no hostlist expression is supplied, the contents of the
...
...
This diff is collapsed.
Click to expand it.
slurm/slurm.h.in
+
11
−
0
View file @
819005cc
...
@@ -1999,6 +1999,17 @@ extern void slurm_free_topo_info_msg PARAMS(( topo_info_response_msg_t *msg ));
...
@@ -1999,6 +1999,17 @@ extern void slurm_free_topo_info_msg PARAMS(( topo_info_response_msg_t *msg ));
extern void slurm_print_topo_info_msg PARAMS((
extern void slurm_print_topo_info_msg PARAMS((
FILE * out, topo_info_response_msg_t *topo_info_msg_ptr, int one_liner )) ;
FILE * out, topo_info_response_msg_t *topo_info_msg_ptr, int one_liner )) ;
/*
* slurm_print_topo_record - output information about a specific Slurm topology
* record based upon message as loaded using slurm_load_topo
* IN out - file to write to
* IN topo_ptr - an individual switch information record pointer
* IN one_liner - print as a single line if not zero
* RET out - char * containing formatted output (must be freed after call)
* NULL is returned on failure.
*/
extern void slurm_print_topo_record PARAMS((FILE * out, topo_info_t *topo_ptr,
int one_liner ));
/*****************************************************************************\
/*****************************************************************************\
* SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
* SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
\*****************************************************************************/
\*****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
src/scontrol/info_node.c
+
37
−
1
View file @
819005cc
...
@@ -192,6 +192,8 @@ scontrol_print_node_list (char *node_list)
...
@@ -192,6 +192,8 @@ scontrol_print_node_list (char *node_list)
extern
void
scontrol_print_topo
(
char
*
node_list
)
extern
void
scontrol_print_topo
(
char
*
node_list
)
{
{
static
topo_info_response_msg_t
*
topo_info_msg
=
NULL
;
static
topo_info_response_msg_t
*
topo_info_msg
=
NULL
;
int
i
,
match
,
match_cnt
=
0
;
hostset_t
hs
;
if
((
topo_info_msg
==
NULL
)
&&
if
((
topo_info_msg
==
NULL
)
&&
slurm_load_topo
(
&
topo_info_msg
))
{
slurm_load_topo
(
&
topo_info_msg
))
{
...
@@ -199,5 +201,39 @@ extern void scontrol_print_topo (char *node_list)
...
@@ -199,5 +201,39 @@ extern void scontrol_print_topo (char *node_list)
return
;
return
;
}
}
slurm_print_topo_info_msg
(
stdout
,
topo_info_msg
,
one_liner
);
if
((
node_list
==
NULL
)
||
(
node_list
[
0
]
==
'\0'
))
{
slurm_print_topo_info_msg
(
stdout
,
topo_info_msg
,
one_liner
);
return
;
}
/* Search for matching switch name */
for
(
i
=
0
;
i
<
topo_info_msg
->
record_count
;
i
++
)
{
if
(
strcmp
(
topo_info_msg
->
topo_array
[
i
].
name
,
node_list
))
continue
;
slurm_print_topo_record
(
stdout
,
&
topo_info_msg
->
topo_array
[
i
],
one_liner
);
return
;
}
/* Search for matching node name */
for
(
i
=
0
;
i
<
topo_info_msg
->
record_count
;
i
++
)
{
if
((
topo_info_msg
->
topo_array
[
i
].
nodes
==
NULL
)
||
(
topo_info_msg
->
topo_array
[
i
].
nodes
[
0
]
==
'\0'
))
continue
;
hs
=
hostset_create
(
topo_info_msg
->
topo_array
[
i
].
nodes
);
if
(
hs
==
NULL
)
fatal
(
"hostset_create: memory allocation failure"
);
match
=
hostset_within
(
hs
,
node_list
);
hostset_destroy
(
hs
);
if
(
!
match
)
continue
;
match_cnt
++
;
slurm_print_topo_record
(
stdout
,
&
topo_info_msg
->
topo_array
[
i
],
one_liner
);
}
if
(
match_cnt
==
0
)
{
error
(
"Topology information contains no switch or "
"node named %s"
,
node_list
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment