- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
During the C++ application execution one of the variables dies for no reason. I think that the causes of this problem are connected to memory. However, I don't have any ideas how to solve this problem. What could be the cause of this problem?
- Tags:
- CC++
- Development Tools
- General Support
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that site doesn't work correctly so I have to continue here:
Hi!
I discovered that some simple arithmetic OpenMP parallel programs runs faster with using icpc compiler instead of g++.
However, when I have tried to compile big OpenMP application (which works correctly with g++) with icpc, it has broken. Using manual code debugging I have discovered that the issue is that one of the variables dies for no reason. I have faced this issue earlier with this application and g++ compiler, but in different mode. It works like:
//no parallel code before this problem
cout<<"var is alive"<<endl;//all works correctly
cout<<var<<endl;
var2 = 0;
cout<<"var is dead"<<endl;
cout<<var<<endl;//program dies
I face this problem on a completely different devices, so I think that it doesn't matter. Are there any general causes of such phenomena? What should I do to solve this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Grigorii Vasilev wrote:I have faced this issue earlier with this application and g++ compiler, but in different mode. It works like:
...
You have the answer in this sentence - something is wrong in your code. it looks one thread has overwritten a stack of another thread
1. is "program dies" segfault, kill, illegal instruction or what? what is the back trace?
2. is the problem appears in serial block or in parallel section?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Problem is solved. In my particular case the cause of the problem was that absolutely another variable was changed by different threads/functions, so I have made that variable const.
So, if you have similar problem you should check all code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Since your problem is solved, can we close this thread?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Yes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the confirmation.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page