http://www.tonysaad.net/wp/wp-content/uploads/2016/02/heat.cPlease note, that due to time constraints, I have not thoroughly debugged this code. So please make sure you understand the code very well before adapting it to your problem. I've put as much comments as possible so the code should be self explanatory.
I will try to put in some explanation of what's going on in there, but that may take a while.
[Table of Contents: Parallel Computing with MPI]