MantisBT - JANA
View Issue Details
0000305JANABugpublic2013-03-07 10:202013-03-11 16:17
0000305: Configuration Parameters not consistent between threads + NaN
This is a bug exposed by some code Paul M. wrote. There are actually 2 issues:

1. The first thread to call SetDefaultParameter will not alter the contents of the reference variable so that it is left untouched. Subsequent threads will copy in a value that has undergone a conversion to and from a string so that it may not be identical to the original for floating point values. To fix this, the call that creates the parameter should also convert to/from a string so that the value returned is the same as is used by all other threads.
  Because this may change a value that the user has set to a high number of decimal places, a mechanism can be included to check that the converted value is exactly the same as original. If it is not, then an appropriate warning should be printed.

2. If the value passed in as the default value happens to be NaN or INF, then the conversion to and from a string will result in a value of "0". This should be handled by either treating these values as errors, or restoring them to a value of NaN or (INF).

No tags attached.
Issue History
2013-03-07 10:20davidlNew Issue
2013-03-11 16:17davidlNote Added: 0000465
2013-03-11 16:17davidlStatusnew => resolved
2013-03-11 16:17davidlResolutionopen => fixed
2013-03-11 16:17davidlAssigned To => davidl

2013-03-11 16:17   
This was fixed in revision 1244 and will appear in jana 0.0.6

The first call to SetDefaultParameter now converts the value to/from a string before returning so that the exact same value is used for all configuration parameters. A check is also made that the converted value exactly matches using the == operator for the data type passed in to the templated method. If it does not match, a warning is printed. This means that NaN and INF values will result in warnings only, but should alert the user something foul is occurring.