|
From: | Fischlin Andreas |
Subject: | Re: [Gm2] Numerical library - update |
Date: | Sun, 3 Jun 2018 14:22:45 +0000 |
Dear Michael,
I guess I already contacted you once on our test suite we developed while developing RAMSES.
However, for numerics to work well, integer arithmetic needs to be considered as well. Our numerics test programs test therefore not only real, but also integer arithmetic for single and double precision, notably for conforming to IEEE floating point standards.
Moreover, the design of math libs is not without issues whatever your approach, in particular not trivial if your aim is to obtain a portable version (our case where RAMSES should give you identical results regardless of the hardware or OS).
Unfortunately, our design – I would be happy to share with you – is rather complex for many reasons (ease of maintenance, portability, use of several compilers, use of several libraries). As one consequence we are using several implementation variants
for many modules that interface with the underlying system, including real arithmetic modules, while keeping a simple common basis of as few non-portable modules as possible. This approach has evolved due to the need to obtain identical results on several
platforms. Since we nevertheless tried to make good use of existing approaches, e.g. a well tested C library, we needed also the flexibility to switch between our own BatchDM variant and some external approach, may that be provided via hardware (e.g. math
(co-)processor) or via software (e.g. the aforementioned C library). A typical release of the RAMSES libraries contains then several implementation variants of the very same module that need to be made available for the linker via renaming of the object file.
Here some illustrative examples:
All these variants having different efficiency and numerics. To keep things as portable as possible we use for real arithmetics FloatPortab, our own implementation of the IEEE floating point standard.
To make sure during each release that all numerics work reliably, we have developed test suites that check many properties of the resulting arithmetic, including NAN operations.
None of these modules would work right away in another environment, since aforementioned variants depend on compiler and/or platform, thus the actual code of these modules is automatically switched by a few global flags using scripts contained in our release
machinery. Yet, perhaps one or the other element might be of interest.
Let me know whether you are interested or not.
Regards,
Andreas
P.S.: BTW SANE stands for Standard Apple Numerics Environment, available on many Apple machines since Apple II, which was an excellent and very strict implementation of the
IEEE floating point standard. Unfortunately Apple has given up on SANE. We still support it mostly.
ETH Zurich Prof. em. Dr. Andreas Fischlin IPCC Vice-Chair WGII Systems Ecology - Institute of Biogeochemistry and Pollutant Dynamics Universitaetstrasse 16, CHN E 24 8092 Zurich SWITZERLAND address@hidden www.sysecol.ethz.ch/people/andreas.fischlin.html +41 44 633-6090 phone +41 79 595-4050 mobile Make it as simple as possible, but distrust it! ________________________________________________________________________ On 03/06/2018, at 12:51, Michael Riedl <address@hidden> wrote:
Hallo all, |
[Prev in Thread] | Current Thread | [Next in Thread] |