- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have 2 xeon CPUs in the PC, each has 4 cores. However, I can only set num_threads to 4. If I set it to a number > 4, I get a message:
OMP: Error #136: Cannot create thread.
OMP: System error #8: Not enough storage is available to process this command.
OMP: Error #178: Function GetExitCodeThread() failed:
OMP: System error #6: The handle is invalid.
Is it not possible to use all the cores in the system because they are distributed across 2 cpus or why is this happening?
(Compiler: Intel C++ 13.0
OS: Windows server 2008 R2)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you building for 32-bit mode? I suppose it can be difficult to use 8 cores if you inadvertently use that mode.
Did you try allowing more stack?
Did you note prior posts on this subject? Please tell us if you can rule out or follow any of the suggestions there (too many to repeat here).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you insert the call to GetLastError function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A common mistake is to link your program specifying "unlimited stack" or some unwieldy large stack size. It does not make sense to make such a request for multi-threaded programs. Assume you have 32-bit application and you specify 1GB of stack in the link line. Threads your app creates default to this size. Your application will run out of memory (run out of virtual address space). For 32-bit app, your working space for the app is either 2GB or 3GB (leaving 2GB or 1GB for the O/S).
Assuming you are running 64-bit app, While you will not run out of virtual address space, you may run out of swap file space. The corrective measure is to reduce the stack size and rely more on allocation from the heap. This will reduce the per-thread memory requirements.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
iliyapolak wrote:
Can you insert the call to GetLastError function?
the library puts the result of GetLastError
OMP: System error #8: Not enough storage is available to process this command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When your app is 32-bit and it is running inside WoW container process it can use up to 4GB of address space.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>> Assume you have 32-bit application and you specify 1GB of stack in the link line. Threads your app creates default to this size.>>>
IIRC each newly created thread will have overridden its default stack size so virtual memory allocated to this specific process will run out.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page