[ET Trac] [Einstein Toolkit] #1958: parfiles accept 1.0, 0.0, 1e3 for integer typed parameters

Einstein Toolkit trac-noreply at einsteintoolkit.org
Fri Sep 23 08:55:29 CDT 2016


#1958: parfiles accept 1.0, 0.0, 1e3 for integer typed parameters
-----------------------+----------------------------------------------------
  Reporter:  rhaas     |       Owner:                     
      Type:  defect    |      Status:  new                
  Priority:  optional  |   Milestone:                     
 Component:  Cactus    |     Version:  development version
Resolution:            |    Keywords:                     
-----------------------+----------------------------------------------------

Comment (by rhaas):

 Hmm, well, as Frank pointed out, the code will refuse actual non-integer
 values so there is no harm other than aesthetics. Are you sure that there
 are thorns out that use 1.0 instead of 1? I am asking because the pre-
 Piraha parser did have exactly the
 {{{strol}}} type check that I was suggesting in its ParamSet routine

 https://bitbucket.org/cactuscode/cactus/src/c365e508a8a971f6ff61ea7aca547eaec7002650/src/main/Parameters.c?at=parallel_testsuite&fileviewer
 =file-view-default#Parameters.c-2189

 and the parameter file parser would only parser parameters to strings.

 I think this is different from accepting 0 and 1 for bools since 0 and 1
 are actually what the bools look like in the code (CCTK_BOOLEAN parameters
 have integer values of 0 and 1 and eg in Fortran one needs to check for
 this and cannot check for truth).

 Frank: I am saying that there is a difference between 1.0 and 1 since only
 the latter fits the definition of what eg the C compiler will accept as an
 "int" variable. The conversion in integerize() is fine and is ok for the
 result of expressions that are assigned to integer parameters, this is
 about accepting the constant 1.0 for an integer parameter.

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


More information about the Trac mailing list