include("../../include/msg-header.inc"); ?>
From: Ethan Mallove (ethan.mallove_at_[hidden])
Date: 2007-06-11 18:02:57
------------------------------------------------------
Question 1:
------------------------------------------------------
I have the below "exec" and "btls" params in my INI, but I
keep running into quoting issues. I'm trying to get an
if-else effect by putting the else block in as the third
argument to the &if() function, and I can't seem to manage
the levels of nested quoting. I keep getting bareword errors
(which is due to an incorrect number of wrapped quotes).
What am I doing wrong?
exec = mpirun --mca btl @btls@ @hosts@ -np &test_np() --prefix &test_prefix() &test_executable() &test_argv()
btls = &if("®exp("&shell("hostname")", "v440-2|v20z-2")", \
"&enumerate("self,sm,tcp")", \
"&if("®exp("&shell("hostname")", "v440-6")", \
"&enumerate("udapl")", \
"&enumerate("sm", "tcp", "sm,tcp", "udapl", "sm,udapl")"" \
) \
)
(The idea here is to use a different "--mca btl" option on
different clusters.)
------------------------------------------------------
Question 2:
------------------------------------------------------
How come EvaluateString() doesn't translate this:
btls = &if("®exp("&shell("hostname")", "v440-2|v20z-2")", \
"&enumerate("self,sm,tcp")", \
"&if("®exp("&shell("hostname")", "v440-6")", \
"&enumerate("udapl")", \
"&enumerate("sm", "tcp", "sm,tcp", "udapl", "sm,udapl")"" \
) \
)
Into one big eval block like this:
eval $btls = MTT::Functions::if(MTT::Functions::regexp(MTT::Functions::shell("hostname"), "v440-2|v20z-2"),
MTT::Functions::enumerate("self,sm,tcp"),
MTT::Functions::if("MTT::Functions::regexp("MTT::Functions::shell("hostname"), "v440-6"),
MTT::Functions::enumerate("udapl"),
MTT::Functions::enumerate("sm", "tcp", "sm,tcp", "udapl", "sm,udapl")
)
)
So we could put the burden of the nasty recursive
parenthesis/quote parsing on perl, rather than MTT. That
would seem to naturally make the INI funclet syntax more
Perl-like.
-Ethan