Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [MTT devel] [MTT svn] svn:mtt-svn r1377
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2011-01-03 07:54:18


Mike --

Can you explain this one a little? I don't understand the example you gave in the comment.

Also, are you adding all the new funclets to the wiki documentation?

On Dec 29, 2010, at 3:52 AM, miked_at_[hidden] wrote:

> Author: miked
> Date: 2010-12-29 03:52:24 EST (Wed, 29 Dec 2010)
> New Revision: 1377
> URL: https://svn.open-mpi.org/trac/mtt/changeset/1377
>
> Log:
> added mtt_switch to simplify if-then-else cases in ini files
>
> Text files modified:
> trunk/lib/MTT/Values/Functions.pm | 21 +++++++++++++++++++++
> 1 files changed, 21 insertions(+), 0 deletions(-)
>
> Modified: trunk/lib/MTT/Values/Functions.pm
> ==============================================================================
> --- trunk/lib/MTT/Values/Functions.pm (original)
> +++ trunk/lib/MTT/Values/Functions.pm 2010-12-29 03:52:24 EST (Wed, 29 Dec 2010)
> @@ -3163,4 +3163,25 @@
> return $x->{result_stdout};
> }
>
> +#
> +# Poor man switch statement
> +# Example: mtt_switch(@np@, 9, "return1", 100, return2", "default", 0);
> +#
> +
> +sub mtt_switch
> +{
> + my ($var, %cases) = @_;
> +
> + if ($cases{$var}) {
> + return $cases{$var};
> + }
> +
> + if ($cases{'default'}) {
> + return $cases{'default'};
> + }
> +
> + Debug("ERROR: Not found case for $var\n");
> +}
> +
> +
> 1;
> _______________________________________________
> mtt-svn mailing list
> mtt-svn_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/