- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am running my code with Visual Studio Pro 2015 + parallel studio 2016 on Windows (machine : 16 GB , 64 bits). I get a problem of Stack overflow when using OpenMP associated to a call to the HDF4 function sfrdata (giving in return a large array). I got exactly the same problem on Unix and I was able to solve it thanks to the following post :
https://software.intel.com/fr-fr/forums/intel-clusters-and-hpc-technology/topic/299450
But I still don't understand how to do the same on windows ! where can I increase the STACKSIZE to avoid this problem with OpenMP. I should maybe note that the problem occurs only with the above mentioned HDF4 function, otherwise OpenMP works very well both on Windows and Unix.
Any help ? Thanks !
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Ines,
You should set KMP_STACKSIZE or OMP_STACKSIZE environment variables or call a kmp_set_stacksize_s(size_tsize) routine to set a stacksize of for your openMP threads.
Just like mentioned in the link you’ve provided.
In addition to this you should ask Windows to reserve a memory for stack.
You can do this by passing the stacksize to linker
icl /Qopenmp /F0x10000 test.cpp
https://software.intel.com/en-us/node/582163
or
icl test.cpp /Qopenmp /link /STACK:"1000000"
Regards,
Dmitry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Omp_stacksize or kmp_stacksize is the solution if that was what you used on Linux. If you need to increase overall program stack size as you would do with a linux shell command, this has to be built in the .exe by /link /stack setting or a compiler option which passes that setting, or it could be reset by editbin.
Default omp stack size for 64 bit is 4m so if you required an increase it might be to 9m (the most I ever needed). As Dmitry mentioned , that might require increasing overall stack, which can't be done while app is running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I apologize for answering that late and thank you for your comments ! it helped me a lot. thanks !
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page