Skip to content

Commit 65bd716

Browse files
committed
improved formatting; extended host and -x param...
improved formatting; extended host and -x parameters; changed cluster info getting way This commit was SVN r1358.
1 parent 9d6a75b commit 65bd716

File tree

8 files changed

+189
-69
lines changed

8 files changed

+189
-69
lines changed

client/breport.pl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ BEGIN
254254
@label_x=split(/,/,join(',',@opt_label_x)) if (@opt_label_x);
255255

256256
# Split the string into a list of label_y properties
257-
@label_y=split(/,/,join(',',@opt_label_y)) if (@opt_label_y);
258-
257+
@label_y=split(/,/,join(',',@opt_label_y)) if (@opt_label_y);
258+
259259
# Split the string into a list of chart_ex properties
260260
@chartex=split(/,/,join(',',@opt_chartex)) if (@opt_chartex);
261261

@@ -1041,51 +1041,51 @@ sub create_report
10411041
next;
10421042
}
10431043

1044-
if ($data)
1045-
{
1046-
my($filename, $directory, $suffix) = fileparse("$file", qr/\.[^.]*/);
1047-
my $temp_file = "$directory$filename.zip";
1044+
if ($data)
1045+
{
1046+
my($filename, $directory, $suffix) = fileparse("$file", qr/\.[^.]*/);
1047+
my $temp_file = "$directory$filename.zip";
10481048
$data->{file_name} = $filename;
10491049
$data->{file_path} = $directory;
1050-
$data->{raw_data} = (! -e $temp_file) ? 'none' : $temp_file;
1050+
$data->{raw_data} = (! -e $temp_file) ? 'none' : $temp_file;
10511051

10521052
my @legend_parameters = ();
10531053

1054-
# Construct legend
1054+
# Construct legend
10551055
$temp_str = '';
10561056
if (!${$report_conf->{legend}})
1057-
{
1057+
{
10581058
$temp_str = "$filename";
1059-
}
1060-
else
1061-
{
1059+
}
1060+
else
1061+
{
10621062
my $legend_template = ${$report_conf->{legend}};
10631063
my $legend = "";
10641064
while ($legend_template =~ m/(^[^\$]*)\$(\w+)(.*)$/g) {
10651065
my $replace_str = '?';
10661066
if (exists($data->{modules}->{TestRunPhase}->{$2}))
1067-
{
1067+
{
10681068
$replace_str = "$data->{modules}->{TestRunPhase}->{$2}";
1069-
}
1069+
}
10701070
elsif ($2 eq 'filename')
1071-
{
1071+
{
10721072
$replace_str = "$filename";
1073-
}
1073+
}
10741074
elsif ($2 eq 'id')
10751075
{
10761076
$replace_str = "$i";
1077-
}
1077+
}
10781078
push (@legend_parameters, $replace_str);
10791079
$legend = "$legend$1$replace_str";
10801080
$legend_template = $3;
10811081
}
10821082
$legend = "$legend$legend_template";
10831083

10841084
$temp_str = $legend;
1085-
}
1085+
}
10861086
$data->{legend} = $temp_str;
10871087
$data->{sort_parameters} = \@legend_parameters;
1088-
}
1088+
}
10891089

10901090
# Parse source file and save data in special structure
10911091
push (@a_data_object, $data);

client/custom_launchers/hpcc/bcreate_conf.pl

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,28 @@
110110
sub Collect_Hosts_Info
111111
{
112112
my ($r_cpu,$r_mem,@hosts)=@_;
113-
foreach my $host (@hosts){
114-
my $tmp_cpu_info=`ssh $host \"cat /proc/cpuinfo\" | egrep \'processor\\s*:\' |wc -l`;
115-
chomp $tmp_cpu_info;
116-
push (@$r_cpu,$tmp_cpu_info);
117-
my $tmp_mem_info=`ssh $host \"cat /proc/meminfo |grep MemTotal\"`;
118-
chomp $tmp_mem_info;
119-
if($tmp_mem_info=~/(\d+)/){
120-
$tmp_mem_info=$1;
121-
}
122-
else {
123-
print ("Can't get info from $host\n");
124-
exit;
113+
foreach my $host (@hosts) {
114+
if ($host =~ /^([^:]+):(\d+)$/) {
115+
$host = $1; # for mem info
116+
my $ncpu = $2;
117+
push (@$r_cpu,$ncpu);
118+
} else {
119+
my $tmp_cpu_info=`ssh $host \"cat /proc/cpuinfo\" | egrep \'processor\\s*:\' |wc -l`;
120+
chomp $tmp_cpu_info;
121+
push (@$r_cpu,$tmp_cpu_info);
122+
}
123+
my $tmp_mem_info=`ssh $host \"cat /proc/meminfo | grep MemTotal\"`;
124+
chomp $tmp_mem_info;
125+
if($tmp_mem_info=~/(\d+)/) {
126+
$tmp_mem_info=$1;
127+
}
128+
else {
129+
print ("Can't get info from $host\n");
130+
exit;
131+
}
132+
push (@$r_mem,$tmp_mem_info);
125133
}
126-
push (@$r_mem,$tmp_mem_info);
127-
}
128-
129-
134+
130135
}
131136

132137
sub Calc_Np_Short

client/custom_launchers/hpl/bcreate_conf.pl

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,29 @@
1515

1616
sub Collect_Hosts_Info
1717
{
18-
my ($r_cpu,$r_mem,@hosts)=@_;
19-
foreach my $host (@hosts){
20-
my $tmp_cpu_info=`ssh $host \"cat /proc/cpuinfo\" | egrep \'processor\\s*:\' |wc -l`;
21-
chomp $tmp_cpu_info;
22-
push (@$r_cpu,$tmp_cpu_info);
23-
my $tmp_mem_info=`ssh $host \"cat /proc/meminfo |grep MemTotal\"`;
24-
chomp $tmp_mem_info;
25-
if($tmp_mem_info=~/(\d+)/){
26-
$tmp_mem_info=$1;
27-
} else {
28-
die ("Error: Can't get info from $host\n");
29-
}
30-
push (@$r_mem,$tmp_mem_info);
31-
}
32-
18+
my ($r_cpu,$r_mem,@hosts)=@_;
19+
foreach my $host (@hosts) {
20+
if ($host =~ /^([^:]+):(\d+)$/) {
21+
$host = $1; # for mem info
22+
my $ncpu = $2;
23+
push (@$r_cpu,$ncpu);
24+
} else {
25+
my $tmp_cpu_info=`ssh $host \"cat /proc/cpuinfo\" | egrep \'processor\\s*:\' |wc -l`;
26+
chomp $tmp_cpu_info;
27+
push (@$r_cpu,$tmp_cpu_info);
28+
}
29+
my $tmp_mem_info=`ssh $host \"cat /proc/meminfo | grep MemTotal\"`;
30+
chomp $tmp_mem_info;
31+
if($tmp_mem_info=~/(\d+)/) {
32+
$tmp_mem_info=$1;
33+
}
34+
else {
35+
print ("Can't get info from $host\n");
36+
exit;
37+
}
38+
push (@$r_mem,$tmp_mem_info);
39+
}
40+
3341
}
3442

3543
sub Calc_Np_Short

client/custom_launchers/pamcrash/vbench.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,16 @@ OMPI_HOSTS=`echo $HOSTS | sed 's/,/ /g'`
112112

113113
OMPI_NHOSTS=`echo $OMPI_HOSTS | wc -w`
114114
for host in $OMPI_HOSTS ; do
115-
CPUS_PER_HOST=`ssh $host cat /proc/cpuinfo | grep processor | wc -l`
116-
echo $host $CPUS_PER_HOST >> $WORKDIR/clusterfile
115+
HOST_INFO=`echo $host | sed 's/:/ /g'`
116+
HOST_ARR=(${HOST_INFO});
117+
HOST_ARR_SIZE=${#HOST_ARR[@]}
118+
echo $HOST_ARR_SIZE
119+
if [ "1" == "$HOST_ARR_SIZE" ]; then
120+
CPUS_PER_HOST=`ssh $host cat /proc/cpuinfo | grep processor | wc -l`
121+
echo $host $CPUS_PER_HOST >> $WORKDIR/clusterfile
122+
else
123+
echo $HOST_INFO >> $WORKDIR/clusterfile
124+
fi
117125
done
118126
echo `hostname` 0 >> $WORKDIR/clusterfile
119127

lib/MTT/Reporter/MTTGDS.pm

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ sub Init {
177177

178178
Debug("Collect cluster information...\n");
179179
my $clusterinfo_module = MTT::Values::Value($ini, "vbench", "clusterinfo_module");
180-
$clusterinfo_module = "ClusterInfo" if (!defined($clusterinfo_module) || $clusterinfo_module eq "");
180+
$clusterinfo_module = "UnknownCluster" if (!defined($clusterinfo_module) || $clusterinfo_module eq "");
181181
Debug("Use $clusterinfo_module module to collect information.\n");
182182

183183
$clusterInfo = MTT::Module::Run("MTT::Reporter::Utils::$clusterinfo_module", "get_cluster_info", MTT::Values::Functions::env_hosts(2));
@@ -540,19 +540,29 @@ sub _process_phase_test_run {
540540
# Special named export environment variables set in mpirun command line
541541
# should be stored as part of data in GDS datastore
542542
while ( $phase_form->{cmdline} =~ m/\s+-x\s+(custom_\w+)\=([^\s\"\']+)/g){
543-
$phase_form->{$1} = $2;
543+
my $value = $2;
544+
eval "\$value = \"$value\"";
545+
$phase_form->{$1} = $value;
544546
}
545547
while ( $phase_form->{cmdline} =~ m/\s+-x\s+(custom_\w+)\=\"([^\"]*)\"/g ){
546-
$phase_form->{$1} = $2;
548+
my $value = $2;
549+
eval "\$value = \"$value\"";
550+
$phase_form->{$1} = $value;
547551
}
548552
while ( $phase_form->{cmdline} =~ m/\s+-x\s+\"(custom_\w+)\=([^\"]*)\"/g){
549-
$phase_form->{$1} = $2;
553+
my $value = $2;
554+
eval "\$value = \"$value\"";
555+
$phase_form->{$1} = $value;
550556
}
551557
while ( $phase_form->{cmdline} =~ m/\s+-x\s+(custom_\w+)\=\'([^\']*)\'/g ){
552-
$phase_form->{$1} = $2;
558+
my $value = $2;
559+
eval "\$value = \"$value\"";
560+
$phase_form->{$1} = $value;
553561
}
554562
while ( $phase_form->{cmdline} =~ m/\s+-x\s+\'(custom_\w+)\=([^\']*)\'/g){
555-
$phase_form->{$1} = $2;
563+
my $value = $2;
564+
eval "\$value = \"$value\"";
565+
$phase_form->{$1} = $value;
556566
}
557567

558568
# filling cached fields with prefix "cached_"
@@ -803,7 +813,7 @@ sub _fill_submit_info {
803813
$info_form->{hostname} = $hostname;
804814
$info_form->{local_username} = $local_username;
805815
$info_form->{http_username} = $username;
806-
$info_form->{mtt_version} = "TODO";
816+
$info_form->{mtt_version} = $MTT::Version::Combined;
807817
}
808818
return $info_form;
809819
}

lib/MTT/Reporter/Utils/ClusterInfo.pm renamed to lib/MTT/Reporter/Utils/LinuxClusterInfo.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# $HEADER$
99
#
1010

11-
package MTT::Reporter::Utils::ClusterInfo;
11+
package MTT::Reporter::Utils::LinuxClusterInfo;
1212

1313
use strict;
1414
use Data::Dumper;
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env perl
2+
#
3+
# Copyright (c) 2010 Voltaire
4+
# $COPYRIGHT$
5+
#
6+
# Additional copyrights may follow
7+
#
8+
# $HEADER$
9+
#
10+
11+
package MTT::Reporter::Utils::UnknownCluster;
12+
13+
use strict;
14+
use Data::Dumper;
15+
use MTT::Messages;
16+
17+
sub _collect_hosts_info {
18+
my $hostList = shift @_;
19+
20+
my @hostarray = split( /,/, $hostList );
21+
my $hostName = @hostarray[0];
22+
my $node_count = scalar @hostarray;
23+
24+
my $info;
25+
26+
$info->{node_count} = $node_count;
27+
$info->{node_hostname} = $hostName;
28+
29+
$info->{node_arch} = 'unknown';
30+
31+
$info->{node_ncpu} = undef;
32+
$info->{node_nsocket} = undef;
33+
$info->{node_htt} = undef;
34+
$info->{node_cache} = undef;
35+
$info->{node_mhz} = undef;
36+
37+
$info->{total_mhz} = 1000; # Dummy value
38+
39+
$info->{node_mem} = undef;
40+
41+
$info->{node_os_kernel} = "";
42+
43+
$info->{node_os_vendor} = "";
44+
45+
$info->{node_os_release} = "";
46+
47+
$info->{net_pci} = "";
48+
49+
$info->{net_conf} = "";
50+
51+
my $ethernet = 'False';
52+
my $ethernet1000 = 'False';
53+
my $ethernet10G = 'False';
54+
my $ibddr = 'False';
55+
my $ibqdr = 'False';
56+
my $iwarp = 'False';
57+
58+
$info->{net_eth100} = $ethernet;
59+
$info->{net_eth1000} = $ethernet1000;
60+
$info->{net_eth10k} = $ethernet10G;
61+
62+
$info->{net_iwarp} = $iwarp;
63+
$info->{net_ibddr} = $ibddr;
64+
$info->{net_ibqdr} = $ibqdr;
65+
66+
return $info;
67+
}
68+
69+
sub get_cluster_info {
70+
my $hostList = shift @_;
71+
if (!defined($hostList) || $hostList eq "") {
72+
die "ERROR: Host list is empty.";
73+
}
74+
75+
my $hostInfo = _collect_hosts_info($hostList);
76+
77+
return $hostInfo;
78+
}
79+
80+
1;

lib/MTT/Values/Functions.pm

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,7 @@ sub env_max_hosts {
13021302
# Find the hosts that we can run with
13031303
# env_hosts(1) - returns uniq host list
13041304
# env_hosts(2) - returns uniq host list, keeps order of list items
1305+
# env_hosts(3) - returns uniq host list, group by hosts with number of cpu: host1:8,host2:8 and etc
13051306
#
13061307
sub env_hosts {
13071308
my ($want_unique) = @_;
@@ -1341,18 +1342,26 @@ sub env_hosts {
13411342
if ($want_unique) {
13421343
my @h = split(/,/, $ret);
13431344
my %hmap;
1344-
my @hlist;
1345+
my @hlist;
13451346
foreach my $h (@h) {
1346-
push( @hlist, $h ) if (!defined($hmap{$h}));
1347-
$hmap{$h} = 1;
1347+
push( @hlist, $h ) if (!defined($hmap{$h}));
1348+
$hmap{$h} = 0 unless defined($hmap{$h});
1349+
$hmap{$h} = $hmap{$h} + 1;
13481350
}
13491351

1350-
# Do we want to keep order of result?
1351-
if ( $want_unique == 2 ) {
1352-
$ret = join(',', @hlist);
1353-
} else {
1354-
$ret = join(',', keys(%hmap));
1355-
}
1352+
# Do we want to keep order of result?
1353+
if ( $want_unique == 3 ) {
1354+
my @hlist_with_cpu;
1355+
foreach my $h (@hlist) {
1356+
push ( @hlist_with_cpu, $h.":".$hmap{$h} );
1357+
}
1358+
$ret = join(',', @hlist_with_cpu);
1359+
}
1360+
elsif ( $want_unique == 2 ) {
1361+
$ret = join(',', @hlist);
1362+
} else {
1363+
$ret = join(',', keys(%hmap));
1364+
}
13561365
}
13571366

13581367
Debug("&env_hosts returning: $ret\n");

0 commit comments

Comments
 (0)