Visual Studio 2019 C++ with OpenMP produces total different results on both debug and release versions
Hello, I got very strange problem with my Visual Studio 2019. We purchased VS 2019 a few year ago. Right now I use it to do a OpenMP programming to improve our legacy finite element analysis VC++ codes. I modified the codes with OpenMP clauses and constructs. I integrated VS with Intel C++ 2023 compiler because I want to use latest OpenMP version from this compiler. I compiled, built and released the exe file. I ran my release version of the program. The results are totally different every time I ran. Also the release version is totally different from debug version. I also built the debug version. The debug version produced the very close results to my original program. But release versions didn't produce accurate results. That is very strange. What happened to the Visual Studio 2019? Attachments are some pictures showing different results from release versions.
I understood that using OpenMP may cause some shared memory issues during the calculations and computations of matrix and equation, which might cause the different results during different runs. But why my debug version always obtained very stable results but release versions DO NOT. I checked the project setting for both debug and release version. Both settings are the same. Sorry I can not provide detail of the source codes as it may involve some copyright issues. I wonder if you can tell me what approximate reasons can cause this uncertain results from release versions. how to fix or resolve this? Thank you very much.