- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been getting memory corruption and segmentation faults calling some mkl functions inside separate threads created with pthreads. If I disable mkl's fast memory management, everything seems to work. I have had this problem with dgetrf, specifically. I am setting OMP_NUM_THREADS=1 when I run mkl functions in separate threads.
I believe that the problem is a stack overflow; I have been using the default stack size with pthreads. Assuming my diagnosis is correct (please correct me if I am wrong):
How can I determine the size to set for the stack in each pthread I create?
Thanks
I believe that the problem is a stack overflow; I have been using the default stack size with pthreads. Assuming my diagnosis is correct (please correct me if I am wrong):
How can I determine the size to set for the stack in each pthread I create?
Thanks
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are no specifiec MKL's routines to do that.
Try ulimit -s to increase the size in each thread.
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using an MKL OpenMP threaded function, the KMP_STACKSIZE environment variable, or the equivalent call to the OpenMP library, would allow you to set the thread stack size limit. As Gennady mentioned, you would still require attention to the overall stack size limit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the quick response!
My question is not how to increase the stack size of my threads. My question is: how large does the mkl library need the stack for any given thread to be if I am to use the fast memory management feature? I have not found found any specifics in the docs.
BTW, I am passing all of my data to the mkl functions as double pointers on the heap rather than arrays on the stack.
Jason
My question is not how to increase the stack size of my threads. My question is: how large does the mkl library need the stack for any given thread to be if I am to use the fast memory management feature? I have not found found any specifics in the docs.
BTW, I am passing all of my data to the mkl functions as double pointers on the heap rather than arrays on the stack.
Jason
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page