I don't think I can use a shared array. I usually get an out of resources error when I try. It is probably something I am doing wrong but I think it is because each workgroup would need its own shared copy of the dose array. The shared array needs to be the same size because the electrons can (possibly though unlikely) move through the entire volume the array defines. By entire volume I mean the extent of each dimension not every single voxel. As yet I have not been clever enough to redesign the algorithm. I thought of running on subsets of the volume which would fix the out of resources problem and then adding all the volumes at the end but then I need some way to follow/restart the electrons that wander off one sub-volume into the other. If anyone has some examples of this I'd love to see them. A short video of the simulation is here https://www.youtube.com/watch?v=IwGCgxveYeA
Nice catch about the 32 vs 64 workers being stuck. That completely passed my radar. As for removing the global atomic altogether on the FirePro the time to run with global atomic add is 344 second and with just *x+=y it is 341 seconds. On my intel hd graphics I get nearly identical times, 21 seconds (on a less demanding run). On my Xeon E5-1620 v2 CPU I get with atomic (140 seconds) and without atomics (139 seconds). On the NVIDIA 780 Ti the times are CUDA with atomic add (10) without atomic add (10) and pyOpenCL with atomic(11) without atomic (11). All have the same problem size 1000 particles per cell and 1 mm grid resolution. So it seems the global add isn't the problem after all. Maybe it is just older (AMD) versus newer (NVIDIA) gpu hardware. I didn't have a chance to do the other test. Thanks again Reese ************** > As used in the code > GAtomicAdd(&pdose[indz+indx*NZ+indy*NZ*NCOL],urn); > Is it impossible to work on a shared array or redesign the algorithm ? -- Jérôme Kieffer tel +33 476 882 445 _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl Confidentiality Notice: This e-mail, including any attachments is the property of Trinity Health and is intended for the sole use of the intended recipient(s). It may contain information that is privileged and confidential. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please delete this message, and reply to the sender regarding the error in a separate email. _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
