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
Assert vs AssertThrow in the testsuite #598
Comments
While I haven't seen/fixed any bug by running the release mode tests, I do think it would be useful to have better coverage in release mode. This is because I had problems with the Intel compiler generating wrong optimized code in the past (hey, that is why we are disabling vectorization...). But yes, there are several tests that expect exceptions/asserts to trigger so we need to be careful there. |
I checked in the testsuite and, for the Intel compiler, there are tests that fail only in release mode. So the Intel compiler is probably in worse shape that we think. I will go through the testsuite and change Assert to AssertThrow when I think it's appropriate. |
That might also be due to different output/rounding. What tests do you refer to? |
These two tests fail in release mode with nan: |
Urgh. That boils down to
forgetting the last element. Has anybody looked into this further? |
(otherwise we need to blacklist DEAL_II_HAVE_OPENMP_SIMD) |
We could but that's kinda sad that we have to disable vectorization on the only compiler that supports Xeon Phi. |
Is this reproducible on a smaller, self-contained testcase? It's a common enough operation, and a common enough compiler, that it worries me :-( |
Vectorization is already disabled on intel (see check_03_compiler_bugs):
So Xeon Phi compilations do not use vectorization. I should probably revisit this with Intel 15... |
@bangerth I will take a look. |
Yeah but that's the autovectorization. DEAL_II_HAVE_OPENMP_SIMD is the vectorization through OpenMP 4 that's another flag. |
see #607. |
So it is a combination of TBB and SIMD and only for |
That's strange, long double should be 128 bits which means that only Haswell and Broadwell can use the SIMD instructions. Well if it only affects long double that's a good news. |
Apparently vectorization is not supported for long double. I guess we can specialize the template so we don't use SIMD for long double. |
I thought long double uses the crazy and ill-conceived 80-bit floating point format on Intel. Or did they fix this wart in the x86_64 ABI? |
It is 80-bit plus padding to get 128-bit... But I found a post on Intel forum where they say that you cannot use vectorization for either long double or quad precision. |
Sure would have been nice if they just disabled it in that case... |
So what do we do, add this as a compiler check and disable SIMD conditionally? |
I like Bruno's suggestion of using an explicit specialization for this one function. |
Just one more comment on long double and vectorization to extend on @Rombur : For 80-bit calculations, legacy x87 instructions are used instead of the SSE2 or AVX instructions that get used for double and single precision. Before SSE2/SSE, all computations were done with 80 bit internally but got truncated/rounded before saved to memory. Now the hardware for float and double has introduced vectorization but not for other floating point types. This is well documented in all manuals on SSE2/AVX/AVX512 etc. But back to the topic: thanks for finding the reason and I also favor @Rombur suggestion. |
Okay, easy enough. I will prepare a patch. |
Disable long double SIMD instructions on ICC. This is to work around a bug that generates wrong code at least up to intel 15 (see tests/lac /vector-vector, tests/lac/intel-15-bug, and the discussion at dealii#598).
This also addresses dealii#598.
@Rombur writes:
...................
I checked in the testsuite and we use Assert 2644 times and AssertThrow 63 times. I found several tests that do nothing in release in mode :( Should we just change all of the Assert to AssertThrow or go through all the tests and see what's appropriate ?
...................
It's a good question. I don't know what to do. We could:
Assert
but that I think they can only (and probably do) only run in debug mode.The text was updated successfully, but these errors were encountered: