On 08/22/2012 05:26 PM, Jerry Smith wrote:
> Michel,
>
> That functionality is actually for compressing and uncompressing host
> strings ie;
>
> [root@chama-rps1 syslog-ng]# scontrol show hostnames node[1-4]
> node1
> node2
> node3
> node4
>
> and
>
> [root@chama-rps1 syslog-ng]# scontrol show hostlist "node1 node2 node3
> node4"
> node[1-4]
>
>
Yeah. Understood. But the doc is essentially nebulous, imo. It says:
hostnames takes an optional hostlist expression as input and
writes a list of individual host names to
standard output (one per line)
So, I gather a mechanism ( describe below ) is lacking, ie an enhancement:
-n output NodeName ( default )
-h output NodeHostName
-a ( ? ) output NodeAddr ( not sure it's useful but ... )
Else, one have to go thru parsing 'scontrol show node' to get it.
2.2 does not show those NodeHostName and NodeAddr. 2.3.x do.
Customer we have ( black site ) is at 2.2.7, in acceptance ( yes, it's
been rocky and a long story ),
and, then I have to supply my own compiled quick WAR "shostname" made of:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <slurm/slurm.h>
extern char *slurm_conf_get_hostname(const char *node_name);
int
main( int argc, char *argv[]) {
if( argc <= 1
|| !strncmp(argv[1], "-h" ,2)
|| !strncmp(argv[1], "--h",3) ) {
fprintf(stderr,"Usage: %s Node1 Node2 ... \n", argv[0]);
fprintf(stderr,"\n");
fprintf(stderr,"%s shows the NodeHostName value(s)
corresponding to each\n", argv[0]);
fprintf(stderr,"SLURM NodeName supplied on the
command-line.\n");
exit(0);
}
while( *++argv ) fprintf(stdout,
"NodeName=%s NodeHostName=%s\n"
, *argv
, slurm_conf_get_hostname(*argv)
);
exit(0);
}
Nevertheless, still at 2.3.x and up, I have to end up ( w/o using
"shostname" ) parsing scontrol show node output.
Imo, it should be made easier and more consistent.
Cheers
> --Jerry
>
> Michel Bourget wrote:
>> Hi,
>>
>> I must be 'dense" ( but hope not ) but, given this slurm.conf entry:
>> NodeName=n[1-4] NodeHostname=r1i3n[0-3]
>>
>> I would expect scontrol show hostnames n1' to return r1i3n0. Sounds like
>> not, ie.:
>>
>> # scontrol show hostnames n1
>> n1
>>
>> This is slurm 2.3.4. Digging back to 2.2.7, our customer have,
>> 'scontrol show node<node>' , it does not have a NodeHostName output.
>> In fact, I am trying to solve the issue:
>> Gimme the NodeHostName given a NodeName.
>> I see nno places in 2.2.7 , 2.3.4 where slurm_conf_get_hostname()
>> is used.
>>
>> For 2.2.7, I will end up writing a very small .c program.
>> But, for 2.3.X and above, a bug ?
>>
>> Am I missing something ?
>>
>> Thanks in advance.
>>
>>
--
-----------------------------------------------------------
Michel Bourget - SGI - Linux Software Engineering
"Past BIOS POST, everything else is extra" (travis)
-----------------------------------------------------------