1
1
This commit was SVN r26509.
Этот коммит содержится в:
Ralph Castain 2012-05-29 15:21:44 +00:00
родитель 67d6275ed3
Коммит 3068438022
6 изменённых файлов: 167 добавлений и 0 удалений

15
contrib/scaling/Makefile Обычный файл
Просмотреть файл

@ -0,0 +1,15 @@
PROGS = orte_no_op mpi_no_op mpi_barrier
all: $(PROGS)
CC = mpicc
CFLAGS = -g
CFLAGS_INTERNAL = -I../../.. -I../../../orte/include -I../../../opal/include
CXX = mpic++
CXXFLAGS = -g
F77 = mpif77
FC = mpif90
FFLAGS = -g
clean:
rm -f $(PROGS) *~

26
contrib/scaling/Makefile.include Обычный файл
Просмотреть файл

@ -0,0 +1,26 @@
# -*- makefile -*-
#
# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Note that this file does not stand on its own. It is included by a
# higher-level Makefile so that Automake features such as "make dist"
# work properly (and include all the relevant files in this directory
# in the distribution tarball).
# If you are looking for the file that builds these examples, look at
# "Makefile" in this same directory (it is *NOT* generated by
# Automake).
EXTRA_DIST += \
contrib/scaling/Makefile \
contrib/scaling/mpi_barrier.c \
contrib/scaling/mpi_no_op.c \
contrib/scaling/orte_no_op.c \
scaling.pl

17
contrib/scaling/mpi_barrier.c Обычный файл
Просмотреть файл

@ -0,0 +1,17 @@
/* -*- C -*-
*
* $HEADER$
*
* The most basic of MPI applications
*/
#include <stdio.h>
#include "mpi.h"
int main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
return 0;
}

17
contrib/scaling/mpi_no_op.c Обычный файл
Просмотреть файл

@ -0,0 +1,17 @@
/* -*- C -*-
*
* $HEADER$
*
* The most basic of MPI applications
*/
#include <stdio.h>
#include "mpi.h"
int main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
MPI_Finalize();
return 0;
}

24
contrib/scaling/orte_no_op.c Обычный файл
Просмотреть файл

@ -0,0 +1,24 @@
/* -*- C -*-
*
* $HEADER$
*
* The most basic of applications
*/
#include <stdio.h>
#include "orte/constants.h"
#include "orte/runtime/runtime.h"
int main(int argc, char* argv[])
{
if (ORTE_SUCCESS != orte_init(&argc, &argv, ORTE_PROC_NON_MPI)) {
fprintf(stderr, "Failed orte_init\n");
exit(1);
}
if (ORTE_SUCCESS != orte_finalize()) {
fprintf(stderr, "Failed orte_finalize\n");
exit(1);
}
return 0;
}

68
contrib/scaling/scaling.pl Обычный файл
Просмотреть файл

@ -0,0 +1,68 @@
#!/usr/bin/env perl
#
# Copyright (c) 2012 Los Alamos National Security, Inc.
# All rights reserved.
use strict;
# globals
my $showme_arg = 0;
my $num_nodes = 0;
my $my_arg;
my @tests = qw(/bin/true ./orte_no_op ./mpi_no_op ./mpi_barrier);
# Cannot use the usual GetOpts library as the user might
# be passing -options to us! So have to
# parse the options ourselves to look for help and showme
my $i = 0;
foreach $my_arg (@ARGV) {
if ($my_arg eq "-h" ||
$my_arg eq "--h" ||
$my_arg eq "-help" ||
$my_arg eq "--help") {
print "Options:
--showme Show the actual commands without executing them
--nodes Number of nodes to run the test across
--help | -h This help list\n";
exit;
} elsif ($my_arg eq "-showme" ||
$my_arg eq "--showme") {
$showme_arg = 1;
} elsif ($my_arg eq "-nodes" ||
$my_arg eq "--nodes") {
$num_nodes = @ARGV[$i+1];
}
$i++;
}
my $n = 1;
my $cmd;
my $test;
foreach $test (@tests) {
if (-e $test) {
$n = 1;
while ($n <= $num_nodes) {
$cmd = "time mpirun -npernode 1 -max-vm-size " . $n . " $test";
print $cmd . "\n";
if (0 == $showme_arg) {
system $cmd;
print "\n";
}
$n = 2 * $n;
}
if ($n != (2 * $num_nodes)) {
$cmd = "time mpirun -npernode 1 $test";
if (1 == $showme_arg) {
print $cmd . "\n";
} else {
system $cmd;
print "\n";
}
}
print "\n\n";
} else {
print "Test " . $test . " was not found - test skipped\n\n";
}
}