Re: [LTP] [PATCH] numa/numa01.sh: fixed errors under noncontinuous numa nodes list

Zhouping Liu
2013-01-14T01:55:31Z

----- Original Message -----
> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
> To: "Zhouping Liu" <zliu@redhat.com>
> Cc: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Monday, January 14, 2013 9:25:56 AM
> Subject: Re: [LTP] [PATCH] numa/numa01.sh: fixed errors under noncontinuous numa nodes list
>
> On 01/09/2013 07:58 PM, Zhouping Liu wrote:
> >
> > - col=2 #column represents node0
> > in numastat o/p
> > - numnodes=$(ls /sys/devices/system/node | grep -Ec
> > "node[0-9]*")
> > - Preferred_node=$[$[$numnodes/2]-1]
> > - col=$[$Preferred_node+2]
> > + if [ $COUNTER -eq $total_nodes ]; then
> > + Preferred_node=`echo $nodes_list | cut -d ' ' -f 1`
>
> On my non-numa system, it shows that
> $ numactl --show | grep nodebind | cut -d ':' -f 2
> 0
> $ numactl --show | grep nodebind | cut -d ':' -f 2 | cut -d ' ' -f 1
>
> Then the $Preferred_node is nothing. Right?

Hi Wanlong,

The command's result executing between inside terminate and file script is different.
here `echo` command eat the first blank space ' '

please try the following in non-numa:
$ nodes_list=`numactl --show | grep nodebind | cut -d ':' -f 2`
$ echo $nodes_list | cut -d ' ' -f 1
0

>
> Thanks,
> Wanlong Gao

--
Thanks,
Zhouping