From 22e99e551b6186a5f7ffb7a11b3ca70da221b7e9 Mon Sep 17 00:00:00 2001 From: jjhua Date: Thu, 19 Apr 2012 10:30:09 +0000 Subject: [PATCH] performance improvement. collect the CEC/Frames' Children in preprocess_nodes() of PPC.pm, instead of getIPaddress() in Utils.pm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12273 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Utils.pm | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 0982a1de7..c2b6c6d4c 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -2949,24 +2949,25 @@ sub getIPaddress } else { return undef; } - my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']); - my $tmp_parent; - my $tmp_node; - my $tmp_type; + #my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']); + #my $tmp_parent; + #my $tmp_node; + #my $tmp_type; #search for $nodetocheck's children or brothers - for my $entry ( @ps ) { - $tmp_parent = $entry->{parent}; - $tmp_node = $entry->{node}; - $tmp_type = $entry->{nodetype}; - if ($tmp_parent and ($tmp_parent eq $parent) ) { - if (!defined($tmp_type)) { - $tmp_type = xCAT::DBobjUtils->getnodetype($tmp_node); - } - if ($tmp_type and ($tmp_type eq 'fsp' or $tmp_type eq 'bpa')) { - push @children, $tmp_node; - } - } - } + #for my $entry ( @ps ) { + # $tmp_parent = $entry->{parent}; + # $tmp_node = $entry->{node}; + # $tmp_type = $entry->{nodetype}; + # if ($tmp_parent and ($tmp_parent eq $parent) ) { + # if (!defined($tmp_type)) { + # $tmp_type = xCAT::DBobjUtils->getnodetype($tmp_node); + # } + # if ($tmp_type and ($tmp_type eq 'fsp' or $tmp_type eq 'bpa')) { + # push @children, $tmp_node; + # } + # } + #} + @children = split(/,/, $::CEC_FRAME_CHILDREN{$parent}); foreach my $tmp_n( @children) { my $ent = $vpdtab->getNodeAttribs($tmp_n, ['side']); if ($ent->{side} and $ent->{side} =~ /^$side-$port$/i) {