Anyone try MS VS2010 C++ parallel pattern libray to do SMP ?
Moderators: hgm, Rebel, chrisw
-
- Posts: 34
- Joined: Mon Nov 17, 2008 6:58 am
Anyone try MS VS2010 C++ parallel pattern libray to do SMP ?
I found that the MS VS2010 C++ parallel pattern library is supported in 2010 C++ Express also. However, the overhead is very big, making SMP program run slower than single serial one. I try parallel_for for those nodes in Search_nonpv. Anyone try?
-
- Posts: 224
- Joined: Mon Mar 12, 2007 7:31 pm
- Location: Bonn, Germany
Re: Anyone try MS VS2010 C++ parallel pattern libray to do S
No. But before I started to parallelize Onno, I evaluated different frameworks (also because I need to know different techniques for my job). I considered OpenMP, Intel TBB, MPI, pthreads on Linux + Windows native, pthreads on Linux + pthreads for Windows.edwardyu wrote:Anyone try?
I think the parallel pattern library is meant as a competetor to Intel TBB?
After all I found that pthreads on Linux + Windows native is probably the best solution. OpenMP and Intel TBB are designed to take the effort to control the parallelization away from the user, but for chess we want as much control as possible.
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Anyone try MS VS2010 C++ parallel pattern libray to do S
Any generalized thread package will be slower than a low level approach like Posix pthreads. This includes Apple's Grand Central which is essentially a package of wrappers and some OS/X specific support.
What is gained in portability is lost in speed. No surprise there.
I use a subset of pthreads which is supported in both Mac OS/X and Ubuntu Linux. This works for me as I don't care about ever running my code under Windows. For those who do code for Windows, I'd suggest using conditional compilation that selects either pthreads or Windows thread routines.
All of my code using C++ has the class header files be entirely platform independent with any platform specific code placed in the implementation sources. The idea is to prevent uncontrolled creeping dependencies.
What is gained in portability is lost in speed. No surprise there.
I use a subset of pthreads which is supported in both Mac OS/X and Ubuntu Linux. This works for me as I don't care about ever running my code under Windows. For those who do code for Windows, I'd suggest using conditional compilation that selects either pthreads or Windows thread routines.
All of my code using C++ has the class header files be entirely platform independent with any platform specific code placed in the implementation sources. The idea is to prevent uncontrolled creeping dependencies.
-
- Posts: 224
- Joined: Mon Mar 12, 2007 7:31 pm
- Location: Bonn, Germany
Re: Anyone try MS VS2010 C++ parallel pattern libray to do S
ACKsje wrote:Any generalized thread package will be slower than a low level approach like Posix pthreads. This includes Apple's Grand Central which is essentially a package of wrappers and some OS/X specific support.
What is gained in portability is lost in speed. No surprise there.
Same with me. I use a subset of pthreads and a subset of Windows native.I use a subset of pthreads which is supported in both Mac OS/X and Ubuntu Linux.
Implementing pthreads on Windows native is possible but this would been a huge overkill, make me depend on the pthreads for Windows package by a third party. Determining sufficiently large equivalent subsets of pthreads and Windows native was not a big deal.
Same with my code.All of my code using C++ has the class header files be entirely platform independent with any platform specific code placed in the implementation sources. The idea is to prevent uncontrolled creeping dependencies.