Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Repair Jira Macros

2 computers x 1 model = 2 different results = ####

This has been a major problem for a small (but important!) group of Source users.

eWater is pleased to announce we’ve worked it out the issue and fixed it!

The changes in this beta will be available in the 4.9 production release, due out at the end of June 2019. 

Highlights of this release include fixing the problem of different machines giving different results (for two models), a 'removal' script for plugins and improvements to the Map tool and the /wiki/spaces/SD50/pages/50137341 plugin.

Beta 4.8.3 also has improvements to:

  • recorder sets
  • editing constituent models
  • ownership recorders in weirs and off allocation
  • saved run information in the Results Manager
  • validation of supply point options
  • orders are now redistributed at extraction time for use debit accounts.  

Firstly, the problem of different results on different machines has been fixed!

Image Added

Technical Details:

Source uses the Microsoft .NET framework, the problem was caused by 2 functions in the System.Math library. Both System.Math.Pow() and System.Math.Exp() can give different results for some number combinations on different machines. For individual function calls, different results occurred at 0.09% of the time with our randomly generated test data. We believe the issue is from different CPU’s implementing different optimisations to perform the operations as efficiently as possible. The functions are not implemented directly within the Microsoft .NET framework, instead, they are implemented in the Microsoft C run-time libraries which are used by the .NET framework, as well as by a number of other languages including C++. So the nature of the .NET framework, which is an interpreted language, wasn’t part of the issue and the same results would have been obtained if implemented in C++. We have since tested all available System.Math functions and these are the only two we have found that can produce different results on different machines. The vast majority of models don’t see the issue since the differences are very minor and for an individual operation, the difference is only at the last decimal place. However, for very large models with lots of feedback in the model, when the issue occurs it can snowball into meaningful result differences.

To fix it, we implemented new versions of the two functions that produce consistent results on different machines. The problem has only been detected in 2 Source models, which happen to be 2 of the largest and most complicated. With the fix, we are now getting consistent results for both models, across different machines that were previously giving different results. There will be changes for Plugin developers to use the same functions we are using, instead of the inbuilt System.Math functions when using Pow or Exp.

We have approached Microsoft about the issue and they are yet to respond: 

https://developercommunity.visualstudio.com/content/problem/502519/mathpow-and-mathexp-produce-inconsistent-results.html

We  We recommend plugin developers to use the new implementations of the functions which are in the TIME.Science.ConsistentMaths class within the TIME assembly.

Words from Trudy: 

Jira Legacy
serverJIRA
serverIdc4ca6e0f-9f42-3d1a-879c-870abe699ab1
keyRM-17341

Plugins can now "unload" themselves from projects 

Jira Legacy
serverJIRA
serverIdc4ca6e0f-9f42-3d1a-879c-870abe699ab1
keyRM-18236

Recorder sets are better at picking up "not recorded" elements

...

We have approached Microsoft about the issue and they are yet to respond: Microsoft Developer Community: Math.Pow and Math.Exp produce inconsistent results

This was a really difficult problem to isolate and fix. We are VERY happy that we worked it out!!

Plugin removal

Plugins that need persistence can now include a removal script so plugins can remove themselves from a project when they are not needed or have been added accidentally.  The tool is available in: Tools \ Remove Plugin from Project File.

Image Added

There is an example provided in the Example Node model plugin.

Map tool improvements

The tool is available under Tools > Analysis Windows > Map... It now works better for constituents and comparing multiple runs.

Image Added

Lascam Plugin

The /wiki/spaces/SD50/pages/50137341plugin now includes better value ranges to help determine appropriate ranges to use when calibrating.

Plugin Developers

We are planning on moving to C# 7, Visual Studio

...

2019 and .NET 4.8.0 soon, so you will need to make sure you have updated Visual Studio to continue developing plugins in the beta versions.

Regression Testing

Insert excerpt
4.8.3 Regression Test Changes
4.8.3 Regression Test Changes
nopaneltrue

Details here: 4.8.3 Regression Test Changes

Insight

To run Insight, you also need to install the 32bit version of Microsoft Visual C++ 2010 Redistributable Package.
This installer is for both 32bit machines and 64bit machines since the library we use is 32bit: Microsoft Visual C++ 2010 Redistributable Package (x86).

Full Release Documentation

Jira Legacy
serverSystem JIRA
columnstype,key,status,summary,assignee,reporter
maximumIssues150
jqlQueryproject in (RM, Insight) AND fixVersion = 4.8.3beta AND status not in (open, Reopened, "In Progress") ORDER BY type Desc, status DESC
serverIdc4ca6e0fa22b5711-9f422728-3d1a3bcc-879c860f-870abe699ab12832d905a432