[ET Trac] [Einstein Toolkit] #1595: Is *) allowed as upper boundary for a parameter range?

Einstein Toolkit trac-noreply at einsteintoolkit.org
Fri May 29 02:41:36 CDT 2015


#1595: Is *) allowed as upper boundary for a parameter range?
-----------------------+----------------------------------------------------
  Reporter:  eschnett  |       Owner:  sbrandt            
      Type:  defect    |      Status:  assigned           
  Priority:  minor     |   Milestone:  ET_2015_05         
 Component:  Cactus    |     Version:  development version
Resolution:            |    Keywords:  postrelease        
-----------------------+----------------------------------------------------

Comment (by rhaas):

 > Sorry Roland, I meant to say quoted ranges not quoted strings.
 GaugeWave, KerrSchild, ML_BSSN, ML_CCZ4, ML_WaveToy, Minkowski, etc. all
 use "*:*" repeatedly in their param.ccl files. Even producing a warning
 for quoted ranges creates a lot of noise (nearly 350 messages from the
 ET).

 These still exist? As Frank said we had a ticket about them and I had
 assumed (incorrectly apparently :-) ) that this had been removed since
 they were all Kranc thorns (and I would expect Kranc to produce "nice"
 thorns).

 > My experiments indicate that "1::2" gives a range starting with 1 and a
 step of 2.
 That is very strange. I just tried
 {{{
 REAL xmin "Coordinate minimum in x-direction"
 {
  1::2 :: "Anything"
 } -1.0
 }}}
 myself with 0158f72 of the flesh and it fails with this error
 {{{
 CST error 1:
   -> Descrip0158f72tion of range for parameter xmin has misplaced quotes
 (2 :: "Anything") in param.ccl for thorn CartGrid3D
 }}}

 It also fails if I try to introduce the regex like this:
 {{{
 --- a/lib/sbin/parameter_parser.pl
 +++ b/lib/sbin/parameter_parser.pl
 @@ -396,7 +396,7 @@ sub parse_param_ccl
              if ($type eq 'REAL' && ! (
                  $new_ranges eq '*' ||
                  $new_ranges =~ /^$real$/ ||
 -                $new_ranges =~
 /^["(]?(\*|\(?$real)?:(\*|$real\)?)?(:$real)?[)"]?$/)) {
 +                $new_ranges =~
 /("|)[(\[]?(\*|$real)?:(\*|$real)?(:$real)?[)\]]?\1$/)) {
                # this will become a level 0 error in the fture
                &CST_error(1, "Invalid range '$new_ranges' for real " .
                           "parameter '$variable' of thorn '$thorn'. ".
 }}}

 Whatever we decide to do in the end (I don't really care very much what we
 do) we need to make sure that the C code parses the range string
 (unfortunately it is passed the string, the perl code does not pass the
 result of its own parsing to C) in the very same way.

 The only reason "*:*" works is that Cactus removes all quotes from ranges
 when creating the parameter C code in line 534 of
 lib/sbin/CreateParameterBindings.pl even though that line 381 of
 parameter_parser.pl would seem to only allow quotes for string parameters
 (also note that integer parameters never allowed "*:*" or any quotes
 around the range for that matter so we have some work to do to make this
 all consistent between parameter types).

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1595#comment:26>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list