Introduction to Parallel Computing
computing.llnl.gov
computing.llnl.gov
* Pthreads: https://computing.llnl.gov/tutorials/pthreads/
Also, isn't copying everything to the GPGPU memory and then performing tasks there (and when it is completed copying it to main memory) a bit stupid? What happens in a cluster setup when two or more hosts work on the same dataset? Won't this result in a needless amount of copying? Double memory requirements?
1) OpenCL is an industry standard supported by many vendors (although not all support it fully currently, since it's a relatively new standard). OTOH, CUDA is a proprietary system developed by NVIDIA for its GPUs. CUDA is much more mature since it has been in use for quite some time now.
2) While CUDA addresses GPUs, the aim of OpenCL is more general. It's a "heterogeneous" language/platform, aimed by design at various computing devices: CPUs, GPUs, special CPUs like Cell, accelerators (FPGA, etc.), DSPs and so on
* OpenCL / CUDA
* Pthreads
* MPI
* TBB
* OpenMPMPI applications can be a little bit harder algorithmically, but a concept of Collective Communications (i.e. send/recv/scatter/gather/bcast/reduce) is easier to understand than threading and locking.
The whole concept of Shared/Distributed memory models doesn't mutter in this case.
My point, in case it is not clear: having to explicitly send and receive data and achieve scalability is inherently more difficult than relying on shared memory. Getting a working program may not be difficult relying only on message passing. But getting a working program that scales requires a deep understanding of the data needs of your algorithms.
Of course, message passing programs have the potential for higher performance because they're not limited to a single node. But realizing that potential is harder. And I'm not including debugging, where I agree that shared memory is rife with problems.
It uses the llnl tutorials for most of the reading.