1
1
openmpi/config/opal_mca_priority_sort.pl

32 lines
702 B
Perl
Raw Normal View History

#!/usr/bin/env perl
#
# Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
#
# $COPYRIGHT$
2015-06-24 06:59:57 +03:00
#
# Additional copyrights may follow
2015-06-24 06:59:57 +03:00
#
# $HEADER$
#
my $components;
my @result;
while (@ARGV) {
my $component;
$component->{"name"} = shift(@ARGV);
$component->{"value"} = shift(@ARGV);
push(@{$components}, $component);
}
foreach my $component (sort { $b->{value} <=> $a->{value} } @{$components}) {
push(@result, $component->{name});
}
sub commify_series {
(@_ == 0) ? '' :
(@_ == 1) ? $_[0] :
join(", ", @_[0 .. ($#_-1)], "$_[-1]");
}
print commify_series(@result);