Tom: Comments are changed. It is better to set rank and size together. 
Nori: rank and size can  come from other communicators, and the function is a general function.