byzhang / cudpp

Automatically exported from code.google.com/p/cudpp
Other
0 stars 0 forks source link

CUDPP Errors with OpenMP and Multi-GPU #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
==============================================
1) Extract attachment
2) Open cudpp/cudpp.sln in Visual Studio 2008
3) Rebuild Debug solution
4) Open apps/simpleCUDPP_openMP/simpleCUDPP.sln
5) Rebuild Debug solution
6) Start debugging simpleCUDPP

What is the expected output?
==============================================
All tests should pass

What do you see instead?
==============================================
---------
- Run 1:
---------
Windows has triggered a breakpoint in simpleCUDPP.exe.

This may be due to a corruption of the heap, which indicates a bug in
simpleCUDPP.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while simpleCUDPP.exe has focus.

The output window may have more diagnostic information.

---------
- Run 2:
---------
Error destroying CUDPPPlan

---------
- Run 3:
---------
Unhandled exception at 0x006ca87e (cudpp32d.dll) in simpleCUDPP.exe:
0xC0000005: Access violation writing location 0xddddddf1.

---------
- Run 4:
---------
Unhandled exception at 0x007c32e4 (cudpp32d.dll) in simpleCUDPP.exe:
0xC0000005: Access violation reading location 0xfeeefee8.

---------
- Run 5:
---------
Error creating CUDPPPlan

What version of the product are you using? On what operating system?
==============================================
CUDPP 1.1 with CUDA 2.3 beta, Windows XP 32 bit, Visual Studio 2008, GTX 295

Please provide any additional information below.
==============================================
- Running with OpenMP with 2 GPUs. It will occasionally work but generally
fail.
- See the original query at
http://groups.google.co.uk/group/cudpp/browse_thread/thread/507fba92fac36b1e?hl=
en

Original issue reported on code.google.com by jph4...@gmail.com on 29 Jul 2009 at 11:01

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by harr...@gmail.com on 29 Jul 2009 at 11:15

GoogleCodeExporter commented 9 years ago
Comment from John Stone:

A quick look through the code didn't show anything bad until I ran across the 
use of
std::map and associated iterators in the plan management code. FYI, STL 
templates and 
accessors are generally not thread safe. I think if that code was replaced by a 
simple 
hand-written linked list or growable array, it would likely become thread safe.

Original comment by harr...@gmail.com on 20 Sep 2009 at 10:39

GoogleCodeExporter commented 9 years ago
Revision 22 (r22) fixes this.  

I tested the attached simpleCUDPP_OpenMP and all tests pass.

Note that r22 adds interface changes to CUDPP.  See the simpleCUDPP example for 
details, but basically each thread must create its own instance of the CUDPP 
library 
object with cudppCreate(), and shut it down with cudppDestroy().  The handle 
returned 
by cudppCreate() must be passed to any call to cudppPlan().

Original comment by harr...@gmail.com on 19 Nov 2009 at 1:51