On Fri, Sep/25/2009 04:59:11PM, Jeff Squyres wrote:
> I'm not sure what you mean -- I thought they added a funclect, not a 
> field...?

I was commenting on both r1304 and r1319. 

These INI params:

  on_start
  on_stop

are very similar to these INI params: 

  after_each_exec
  before_any_exec
  after_all_exec

My thought was that it would make sense for them to use a similar
naming scheme and implementation (e.g., use suffix "_exec" and be
passed to DoCommand::Cmd()).

-Ethan

>
> On Sep 24, 2009, at 3:09 PM, Ethan Mallove wrote:
>
>> I think on_stop should conform more to these params:
>>
>>   after_each_exec
>>   before_any_exec
>>   after_all_exec
>>
>> E.g.,
>>
>>   before_mtt_start_exec
>>   after_mtt_start_exec
>>
>> Then have &_process_get_value_option() call DoCommand. Note, DoCommand
>> is aware of hashbangs (see &_contains_shell_script_characters()), so
>> &shell_script() might be redundant.
>>
>> -Ethan
>>
>>
>> On Thu, Sep/24/2009 07:46:40PM, Mike Dubman wrote:
>> >    Hey Jeff,
>> >
>> >    On Thu, Sep 24, 2009 at 4:02 PM, Jeff Squyres <jsquy...@cisco.com> 
>> wrote:
>> >
>> >      The DoCommand.pm sub added ":\n" to the beginning to force the 
>> Bourne
>> >      shell interpreter. *This is necessary for some cases where an
>> >      interpreter is not otherwise specified.
>> >
>> >    Im not familiar with :\n semantics, how does it force Bourne shell 
>> and
>> >    what it actually does :)? (seems like leftovers from 1960....)
>> >    I think when interpreter is not explicitly specified - the default 
>> user`s
>> >    shell is used.
>> >    see in the DoCommand::Cmd() ..... it check the buffer`s* first line 
>> for
>> >    #!/... semantic and if found - saves buffer to file, adds +x perm,* 
>> and
>> >    just executes it as a regular script.
>> >
>> >    When I passed a buffer with shell commands but 1st line was not 
>> #!/bin/sh
>> >    - it* failed with syntax errors.
>> >
>> >    *
>> >
>> >      I see why you did it -- you want the ability to add your own 
>> interpreter
>> >      in &shell_script(). *Why not either make a parameter to add the 
>> ":\n" or
>> >      not, or better yet, have DoCommand.pm analyze the beginning of the
>> >      string and if it contains "^:\n" or "^#!", then don't add anything. 
>> *But
>> >      if it doesn't contain either of those, then prefix it with ":\n".*
>> >
>> >      How does that sound?
>> >
>> >    sounds good!
>> >
>> >      Also, is "&shell_script()" a good name? *If you can specify your 
>> own
>> >      interpreter, it might not be a shell script. *How about 
>> &executable()?
>> >
>> >    ok - &executable() it will be!
>> >    *
>> >
>> >    regards
>> >
>> >    Mike
>> >
>> >      On Sep 24, 2009, at 8:06 AM, mi...@osl.iu.edu wrote:
>> >
>> >        Author: miked
>> >        Date: 2009-09-24 08:06:04 EDT (Thu, 24 Sep 2009)
>> >        New Revision: 1319
>> >        URL: https://svn.open-mpi.org/trac/mtt/changeset/1319
>> >
>> >        Log:
>> >        bug fix: CmdScript() - no need to add extra chars "\n:" to the 
>> start
>> >        of shell script file
>> >        new funclet: shell_script(section,param)
>> >
>> >        Text files modified:
>> >        *trunk/lib/MTT/DoCommand.pm * * * *| * * 2 +-
>> >        *trunk/lib/MTT/Values/Functions.pm | * *19 +++++++++++++++++++
>> >        *2 files changed, 20 insertions(+), 1 deletions(-)
>> >
>> >        Modified: trunk/lib/MTT/DoCommand.pm
>> >        
>> ==============================================================================
>> >        --- trunk/lib/MTT/DoCommand.pm *(original)
>> >        +++ trunk/lib/MTT/DoCommand.pm *2009-09-24 08:06:04 EDT (Thu, 24 
>> Sep
>> >        2009)
>> >        @@ -797,7 +797,7 @@
>> >        * *$cmds =~ s/\"$//
>> >        * * * *if ($cmds =~ s/^\"//);
>> >
>> >        - * *print $fh ":\n$cmds\n";
>> >        + * *print $fh "$cmds\n";
>> >        * *close($fh);
>> >        * *chmod(0700, $filename);
>> >
>> >        Modified: trunk/lib/MTT/Values/Functions.pm
>> >        
>> ==============================================================================
>> >        --- trunk/lib/MTT/Values/Functions.pm * (original)
>> >        +++ trunk/lib/MTT/Values/Functions.pm * 2009-09-24 08:06:04 EDT 
>> (Thu,
>> >        24 Sep 2009)
>> >        @@ -3026,4 +3026,23 @@
>> >        * *return md5_hex($str);
>> >        }
>> >
>> >        +# Run shell commands as a script, i.e
>> >        +#
>> >        +# [mtt]
>> >        +# myscript=<<EOT
>> >        +# #!/bin/sh
>> >        +# pwd
>> >        +# ls
>> >        +# EOT
>> >        +# on_stop=&shell_script("mtt",myscript)
>> >        +#
>> >        +#
>> >        +
>> >        +sub shell_script {
>> >        + * * * my ($cmd_section, $cmd_param) = @_;
>> >        + * * * my $cmd = &get_ini_val($cmd_section, $cmd_param);
>> >        + * * * my $x = MTT::DoCommand::CmdScript(1, $cmd);
>> >        + * * * return $x->{result_stdout};
>> >        +}
>> >        +
>> >        1;
>> >        _______________________________________________
>> >        mtt-svn mailing list
>> >        mtt-...@open-mpi.org
>> >        http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn
>> >
>> >      --
>> >      Jeff Squyres
>> >      jsquy...@cisco.com
>> >
>> >      _______________________________________________
>> >      mtt-devel mailing list
>> >      mtt-de...@open-mpi.org
>> >      http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel
>> >
>> > References
>> >
>> >    Visible links
>> >    . mailto:jsquy...@cisco.com
>> >    . mailto:mi...@osl.iu.edu
>> >    . https://svn.open-mpi.org/trac/mtt/changeset/1319
>> >    . mailto:mtt-...@open-mpi.org
>> >    . http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn
>> >    . mailto:jsquy...@cisco.com
>> >    . mailto:mtt-de...@open-mpi.org
>> >    . http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel
>>
>> > _______________________________________________
>> > mtt-devel mailing list
>> > mtt-de...@open-mpi.org
>> > http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel
>>
>> _______________________________________________
>> mtt-devel mailing list
>> mtt-de...@open-mpi.org
>> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel
>>
>
>
> -- 
> Jeff Squyres
> jsquy...@cisco.com
>
> _______________________________________________
> mtt-devel mailing list
> mtt-de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel

Reply via email to