-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KineticsAddSpecies.add_species_sequential test fails due to strict floating-point value comparison? #433
Comments
@bryanwweber I don't see any solutions being mentioned there? The changed tests that should provide more information are included in Cantera v2.3.0, are they not? #367 is about building/testing Cantera on POWER, while in my case it's about regular 64-bit x86. I am using the Intel compilers to compile Cantera, which may explain why this hasn't popped up before. This issue occurring at two very different platforms seems to confirm that the strict comparison of the floating-point values is the problem here? |
@boegel I believe that this may be related to an issue I had with the intel compilers (not the system itself) What version of ICC, etc. are you using? |
Although you are correct that the discrepancies you see are of much smaller magnitude, suggesting that perhaps it's an issue due to floating point comparison. Maybe try supplying the |
@boegel Thanks, and sorry I didn't read this issue closely enough. In addition to what @arghdos suggested, do you get the same errors if you use GCC? One question that might be useful from the other issue is
Thanks! |
Obviously this test would succeed if we allowed for inexact floating point comparison. As I mentioned in the other issue, the problem is that this is a case where I think that the two values being compared should in fact be identical, since they should be computed by running through exactly the same functions, The usual reasons for variations in floating point results like how operations are grouped or when/if intermediate variables are truncated should not apply. I'll second the question about exactly which version of the Intel compiler is being used. Cantera is regularly tested with ICPC 14.0.1 (2013), so it's not a general issue with the Intel compiler. I would also be interested to know whether or there's an issue with using GCC on the same system, to see if the problem is related to any of the system libraries. |
The Intel compilers being used are:
This is the first time I build Cantera 2.3.0, so no success with earlier builds with this version. I am already using I'll try also building Cantera 2.3.0 with GCC v5.4.0; I'll get back to you on that. We try to take control over all dependencies (e.g. Boost, SUNDIALS, Eigen, ...) via EasyBuild (http://hpcugent.github.io/easybuild/), which also get built with the same compilers & libraries as Cantera is. |
Exact floating point equality can be assured only in the case where the species are added in the same order, since this affects summations involved in calculating the mixture molecular weight. This resulted in test failures with certain versions of the Intel compiler. Resolves Cantera#433.
I believe the issue with this test should be resolved by this commit: 11a0727, if you would like to confirm. SCons does not use environment variables such as |
Cantera version
2.3.0
Operating System
CentOS 7.3
Python/MATLAB version
Expected Behavior
test passes
Actual Behavior
test fails:
The test seems to fail because the received values are slightly off, but since they are very close I wonder whether this is a problem caused by direct comparison of floating-point values rather than anything else.
Steps to reproduce
scons install env_vars=all CC="icc" CXX="icpc" blas_lapack_libs=mkl_rt blas_lapack_dir=$BLAS_LAPACK_LIB_DIR sundials_include=$EBROOTSUNDIALS/include sundials_libdir=$EBROOTSUNDIALS/lib prefix=$PREFIX
scons test env_vars=all CC="icc" CXX="icpc" blas_lapack_libs=mkl_rt blas_lapack_dir=$BLAS_LAPACK_LIB_DIR sundials_include=$EBROOTSUNDIALS/include sundials_libdir=$EBROOTSUNDIALS/lib
The text was updated successfully, but these errors were encountered: