Here I will add templates/codes for Parallel programming.
An Introduction to Parallel Programming by Subodh Kumar
Introduction to Parallel Computing by Ananth Grama, George Karypis, Vipin Kumar, and Anshul Gupta
Parallel Programming in C with MPI and OpenMP by M J Quinn
Programming Massively Parallel Processors by D. Kirk and W. Hwu