Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all MTT Devel mailing list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2007-10-01 11:39:15


Ethan --

Don't forget to document all these new fields / funclets on the wiki...

On Sep 29, 2007, at 12:27 AM, emallove_at_[hidden] wrote:

> Author: emallove
> Date: 2007-09-28 18:27:54 EDT (Fri, 28 Sep 2007)
> New Revision: 1066
> URL: https://svn.open-mpi.org/trac/mtt/changeset/1066
>
> Log:
> * Added five `Noop.pm` modules (enables one to simply use the MTT
> as a run
> engine in conjunction with an ''MPI'' Details section)
> * Added `@PROGRAM_NAME@` as an INI predefined
> * Added `--clean-start` option to run MTT using a fresh scratch dir
> * Added `&mpi_details_simple_name()` funclet
> * Use `Util::does_hash_key_exist()` in `Test/Build.pm`
> * Typo (missing `$`) in `MPI/Install.pm`
>
> Added:
> trunk/lib/MTT/MPI/Get/Noop.pm
> trunk/lib/MTT/MPI/Install/Noop.pm
> trunk/lib/MTT/Test/Build/Noop.pm
> trunk/lib/MTT/Test/Get/Noop.pm
> trunk/lib/MTT/Test/Specify/Noop.pm
> Text files modified:
> trunk/client/mtt | 11 +++++++++++
> trunk/lib/MTT/INI.pm | 7 +++++++
> trunk/lib/MTT/MPI/Install.pm | 2 +-
> trunk/lib/MTT/Test/Build.pm | 9 +++++----
> trunk/lib/MTT/Test/Run.pm | 1 +
> trunk/lib/MTT/Values/Functions.pm | 5 +++++
> 6 files changed, 30 insertions(+), 5 deletions(-)
>
> Modified: trunk/client/mtt
> ======================================================================
> ========
> --- trunk/client/mtt (original)
> +++ trunk/client/mtt 2007-09-28 18:27:54 EDT (Fri, 28 Sep 2007)
> @@ -117,6 +117,7 @@
> my $verbose_arg;
> my $no_execute_arg;
> my $force_arg;
> +my $clean_start_arg;
> my $mpi_get_arg;
> my $mpi_install_arg;
> my $test_get_arg;
> @@ -141,6 +142,7 @@
> "verbose|v" => \$verbose_arg,
> "no-execute|n" => \$no_execute_arg,
> "force" => \$force_arg,
> + "clean-start" => \$clean_start_arg,
> "mpi-get!" => \$mpi_get_arg,
> "mpi-install!" => \
> $mpi_install_arg,
> "test-get!" => \$test_get_arg,
> @@ -204,6 +206,8 @@
> --print-time|-p Display the amount of time taken in
> each phase
> --force Do steps even if they would not
> normally
> be executed
> +--clean-start Clean the scratch directory from
> + past MTT invocations before running
> --[no-]trial Use when testing your MTT client setup;
> results that are generated and
> submitted
> to the database are marked as
> \"trials\"
> @@ -353,6 +357,13 @@
> my $runs_data_dir =
> MTT::Files::mkdir("$scratch_arg/$MTT::Defaults::System_config->
> {runs_data_subdir}");
>
> +# If requested, do a clean start
> +if ($clean_start_arg) {
> + MTT::DoCommand::Cmd("rm -rf $source_dir");
> + MTT::DoCommand::Cmd("rm -rf $install_dir");
> + MTT::DoCommand::Cmd("rm -rf $runs_data_dir");
> +}
> +
> # Load up all the MPI sources that this system has previously
> obtained
> MTT::MPI::LoadSources($source_dir)
> if ($mpi_get || $mpi_install || $test_build || $test_run ||
> $trim);
>
> Modified: trunk/lib/MTT/INI.pm
> ======================================================================
> ========
> --- trunk/lib/MTT/INI.pm (original)
> +++ trunk/lib/MTT/INI.pm 2007-09-28 18:27:54 EDT (Fri, 28 Sep 2007)
> @@ -247,6 +247,13 @@
> }
> }
>
> + foreach my $section ($ini->Sections) {
> + if (! defined($ini->val($section, "PROGRAM_NAME"))) {
> + $ini->delval($section, "PROGRAM_NAME");
> + $ini->newval($section, "PROGRAM_NAME", $0);
> + }
> + }
> +
> return $ini;
> }
>
>
> Added: trunk/lib/MTT/MPI/Get/Noop.pm
> ======================================================================
> ========
> --- (empty file)
> +++ trunk/lib/MTT/MPI/Get/Noop.pm 2007-09-28 18:27:54 EDT (Fri, 28
> Sep 2007)
> @@ -0,0 +1,36 @@
> +#!/usr/bin/env perl
> +#
> +# Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
> +# $COPYRIGHT$
> +#
> +# Additional copyrights may follow
> +#
> +# $HEADER$
> +#
> +
> +package MTT::MPI::Get::Noop;
> +my $package = __PACKAGE__;
> +
> +use strict;
> +use MTT::Values;
> +use Cwd;
> +
> +#--------------------------------------------------------------------
> ------
> +
> +sub Get {
> + my $ret;
> + $ret->{version} = MTT::Values::RandomString(10);
> + $ret->{test_result} = MTT::Values::PASS;
> + $ret->{have_new} = 1;
> + $ret->{result_message} = "Success";
> + $ret->{prepare_for_install} = "${package}::PrepareForInstall";
> + return $ret;
> +}
> +
> +#--------------------------------------------------------------------
> ------
> +
> +sub PrepareForInstall {
> + return cwd();
> +}
> +
> +1;
>
> Modified: trunk/lib/MTT/MPI/Install.pm
> ======================================================================
> ========
> --- trunk/lib/MTT/MPI/Install.pm (original)
> +++ trunk/lib/MTT/MPI/Install.pm 2007-09-28 18:27:54 EDT (Fri, 28
> Sep 2007)
> @@ -217,7 +217,7 @@
>
> Debug("Checking for [$mpi_get_key] /
> [$mpi_version_key] / [$simple_section]\n");
> if (!$force &&
> - defined
> (MTT::Util::does_hash_key_exist($MTT::MPI::installs, qw/mpi_get_key
> $mpi_version_key $simple_section/))) {
> + defined
> (MTT::Util::does_hash_key_exist($MTT::MPI::installs, qw/
> $mpi_get_key $mpi_version_key $simple_section/))) {
> Verbose(" Already have an
> install for [$mpi_get_key] / [$mpi_version_key] / [$simple_section]
> \n");
> } else {
> Verbose(" Installing MPI:
> [$mpi_get_key] / [$mpi_version_key] / [$simple_section]...\n");
>
> Added: trunk/lib/MTT/MPI/Install/Noop.pm
> ======================================================================
> ========
> --- (empty file)
> +++ trunk/lib/MTT/MPI/Install/Noop.pm 2007-09-28 18:27:54 EDT (Fri,
> 28 Sep 2007)
> @@ -0,0 +1,32 @@
> +#!/usr/bin/env perl
> +#
> +# Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
> +# $COPYRIGHT$
> +#
> +# Additional copyrights may follow
> +#
> +# $HEADER$
> +#
> +
> +package MTT::MPI::Install::Noop;
> +
> +use strict;
> +
> +#--------------------------------------------------------------------
> ------
> +
> +sub Install {
> + my $ret;
> + $ret->{have_new} = 1;
> + $ret->{test_result} = MTT::Values::PASS;
> + $ret->{exit_status} = 0;
> + $ret->{installdir} = "/dev/null";
> + $ret->{bindir} = "/dev/null";
> + $ret->{libdir} = "/dev/null";
> + $ret->{c_bindings} = 1;
> + $ret->{cxx_bindings} = 1;
> + $ret->{f77_bindings} = 1;
> + $ret->{f90_bindings} = 1;
> + return $ret;
> +}
> +
> +1;
>
> Modified: trunk/lib/MTT/Test/Build.pm
> ======================================================================
> ========
> --- trunk/lib/MTT/Test/Build.pm (original)
> +++ trunk/lib/MTT/Test/Build.pm 2007-09-28 18:27:54 EDT (Fri, 28
> Sep 2007)
> @@ -164,10 +164,11 @@
> # create each intermediate key.
>
> if (!$force &&
> - exists($MTT::Test::builds->
> {$mpi_get_key}) &&
> - exists($MTT::Test::builds->
> {$mpi_get_key}->{$mpi_version_key}) &&
> - exists($MTT::Test::builds->
> {$mpi_get_key}->{$mpi_version_key}->{$mpi_install_key}) &&
> - exists($MTT::Test::builds->
> {$mpi_get_key}->{$mpi_version_key}->{$mpi_install_key}->
> {$simple_section})) {
> + defined
> (MTT::Util::does_hash_key_exist($MTT::Test::builds,
> +
> qw/$mpi_get_key
> +
> $mpi_version_key
> +
> $mpi_install_key
> +
> $simple_section/))) {
> Verbose(" Already have a
> build for [$mpi_get_key] / [$mpi_version_key] /
> [$mpi_install_key] / [$simple_section]\n");
> next;
> }
>
> Added: trunk/lib/MTT/Test/Build/Noop.pm
> ======================================================================
> ========
> --- (empty file)
> +++ trunk/lib/MTT/Test/Build/Noop.pm 2007-09-28 18:27:54 EDT (Fri,
> 28 Sep 2007)
> @@ -0,0 +1,25 @@
> +#!/usr/bin/env perl
> +#
> +# Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
> +# $COPYRIGHT$
> +#
> +# Additional copyrights may follow
> +#
> +# $HEADER$
> +#
> +
> +package MTT::Test::Build::Noop;
> +
> +use strict;
> +
> +#--------------------------------------------------------------------
> ------
> +
> +sub Build {
> + my $ret;
> + $ret->{test_result} = MTT::Values::PASS;
> + $ret->{exit_status} = 0;
> + $ret->{result_message} = "Success";
> + return $ret;
> +}
> +
> +1;
>
> Added: trunk/lib/MTT/Test/Get/Noop.pm
> ======================================================================
> ========
> --- (empty file)
> +++ trunk/lib/MTT/Test/Get/Noop.pm 2007-09-28 18:27:54 EDT (Fri, 28
> Sep 2007)
> @@ -0,0 +1,32 @@
> +#!/usr/bin/env perl
> +#
> +# Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
> +# $COPYRIGHT$
> +#
> +# Additional copyrights may follow
> +#
> +# $HEADER$
> +#
> +
> +package MTT::Test::Get::Noop;
> +
> +use strict;
> +
> +#--------------------------------------------------------------------
> ------
> +
> +sub Get {
> + my $ret;
> + $ret->{have_new} = 1;
> + $ret->{test_result} = MTT::Values::PASS;
> + $ret->{result_message} = "Success";
> + $ret->{prepare_for_install} =
> "MTT::Common::Copytree::PrepareForInstall";
> + return $ret;
> +}
> +
> +#--------------------------------------------------------------------
> ------
> +
> +sub PrepareForInstall {
> + return cwd();
> +}
> +
> +1;
>
> Modified: trunk/lib/MTT/Test/Run.pm
> ======================================================================
> ========
> --- trunk/lib/MTT/Test/Run.pm (original)
> +++ trunk/lib/MTT/Test/Run.pm 2007-09-28 18:27:54 EDT (Fri, 28 Sep
> 2007)
> @@ -218,6 +218,7 @@
> if ($search eq $mpi_details_simple) {
> $match = 1;
> $MTT::Globals::Internals->{mpi_details_name} =
> $s;
> + $MTT::Globals::Internals->
> {mpi_details_simple_name} = $mpi_details_simple;
> last;
> }
> }
>
> Added: trunk/lib/MTT/Test/Specify/Noop.pm
> ======================================================================
> ========
> --- (empty file)
> +++ trunk/lib/MTT/Test/Specify/Noop.pm 2007-09-28 18:27:54 EDT
> (Fri, 28 Sep 2007)
> @@ -0,0 +1,30 @@
> +#!/usr/bin/env perl
> +#
> +# Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
> +# $COPYRIGHT$
> +#
> +# Additional copyrights may follow
> +#
> +# $HEADER$
> +#
> +
> +package MTT::Test::Specify::Noop;
> +
> +use strict;
> +
> +#--------------------------------------------------------------------
> ------
> +
> +sub Specify {
> + my ($x, $x, $x, $x, $config) = @_;
> + my $ret;
> + my $one;
> + %{$one} = %{$config};
> + $one->{executable} = "";
> + $one->{tests} = [""];
> + push(@{$ret->{tests}}, $one);
> + $ret->{test_result} = 1;
> + $ret->{np_ok} = 1;
> + return $ret;
> +}
> +
> +1;
>
> Modified: trunk/lib/MTT/Values/Functions.pm
> ======================================================================
> ========
> --- trunk/lib/MTT/Values/Functions.pm (original)
> +++ trunk/lib/MTT/Values/Functions.pm 2007-09-28 18:27:54 EDT (Fri,
> 28 Sep 2007)
> @@ -2030,6 +2030,11 @@
> return $MTT::Globals::Internals->{mpi_details_name};
> }
>
> +sub mpi_details_simple_name {
> + Debug("&mpi_details_simple_name returning:
> $MTT::Globals::Internals->{mpi_details_simple_name}\n");
> + return $MTT::Globals::Internals->{mpi_details_simple_name};
> +}
> +
>
> #---------------------------------------------------------------------
> -----
>
> #---------------------------------------------------------------------
> -----
>
> #---------------------------------------------------------------------
> -----
> _______________________________________________
> mtt-svn mailing list
> mtt-svn_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn

-- 
Jeff Squyres
Cisco Systems