#1307: Default output directory is '$parfile' ----------------------+----------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: critical | Milestone: ET_2013_05 Component: Other | Version: Keywords: | ----------------------+----------------------------------------------------- The default output directory is currently '$parfile', but this parameter value is not replaced by the name of the parameter file.
It seems that default parameter values are not run through the parser, which would expand "$parfile"?
#1307: Default output directory is '$parfile' -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: critical | Milestone: ET_2013_05 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by knarf):
Steve: how difficult would it be to run the default parameter values through the parser as well?
#1307: Default output directory is '$parfile' -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: critical | Milestone: ET_2013_05 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by sbrandt):
What I can do is add
extern "C" void *CCTK_EvaluateExpr(const char *expr,int *type);
This function attempts to match "expr" against the grammar rule of the same name, and if it succeeds evaluates the parse tree according to the rules used to evaluate parameters.
I have a protytype if you'd like to try it.
#1307: Default output directory is '$parfile' -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: critical | Milestone: ET_2013_05 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by eschnett):
This seems too invasive just before the release. I suggest instead to change the default value of IO::out_dir to be something else but $parfile. Since the value $parfile never actually worked, no one is relying on this default.
#1307: Default output directory is '$parfile' -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: critical | Milestone: ET_2013_05 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by knarf):
I agree, and changed the default back. Leaving the ticket open, to get it into the dev-version eventually.
#1307: Default output directory is '$parfile' -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: critical | Milestone: ET_2013_05 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by knarf):
Steve: can you try your prototype and see if it works (with the default being $parfile)? If it does: please post the patch here.
#1307: Support/Evaluate expressions also in default values within param.ccl (e.g. $parfile) -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: minor | Milestone: ET_2013_11 Component: Other | Version: Resolution: | Keywords: -----------------------+---------------------------------------------------- Changes (by knarf):
* priority: critical => minor * milestone: ET_2013_05 => ET_2013_11
Old description:
The default output directory is currently '$parfile', but this parameter value is not replaced by the name of the parameter file.
It seems that default parameter values are not run through the parser, which would expand "$parfile"?
New description:
It seems that default parameter values are not run through the parser, which would expand "$parfile", but currently doesn't.
--
#1307: Support/Evaluate expressions also in default values within param.ccl (e.g. $parfile) -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: minor | Milestone: ET_2013_11 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by rhaas):
extern "C" void *CCTK_EvaluateExpr(const char *expr,int *type);
It might be good to add the word "Parameter" somwhere in the function name. For the trigger thorn (ticket ) we also wanted to expose a flesh function to evaluate expressions containing both parameters and grid scalars as variables. The later one might be all fancy and allow the user to choose which variables to expand (parameters, grid scalars, both, none) and even let the caller pass in an extra list of name-value pairs for private variables that one wants to use.
Should the routine CCTK_EvaluateExpr be public or flesh internal (ie CCTK or CCTKi)?
#1307: Support/Evaluate expressions also in default values within param.ccl (e.g. $parfile) -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: minor | Milestone: ET_2013_11 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by eschnett):
I assume this function would call malloc to store the return value, and expect the caller to free it?
I assume this function is (or will be) also used by the scheduler to evaluate WHILE and IF expressions?
This function seems quite useful; it should be public.
#1307: Support/Evaluate expressions also in default values within param.ccl (e.g. $parfile) -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: new Priority: minor | Milestone: ET_2013_11 Component: Other | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by sbrandt):
Adding parameter to the name did occur to me after posting this :) , and yes it does require the user to call free().
I'm not sure that the scheduler needs this, as it can take equations and directly from the CCL file and insert them into C code. I have included CCTK_EvaluateParamExpr available on the Piraha branch.
If you are interested, I have been working on the Piraha interface a bit in general. In the Piraha branch (https://svn.cactuscode.org/flesh/branches/piraha_schedule) there's a file called Piraha.html which shows, side by side, how to use Piraha in C++, C, and Java. Basically, if you know regex's, it shouldn't be too hard to concoct grammars and parse them.
#1307: Support/Evaluate expressions also in default values within param.ccl (e.g. $parfile) -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: knarf@… Type: defect | Status: closed Priority: minor | Milestone: ET_2013_11 Component: Other | Version: Resolution: fixed | Keywords: -----------------------+---------------------------------------------------- Changes (by sbrandt):
* status: new => closed * resolution: => fixed
Comment:
Sorry, this was handled a while ago.
trac@lists.einsteintoolkit.org