You have a machines file. In this machines file you can write the patten in which you want to distribute the jobs, so for
example if you writing something like this
machine1
machine2
machine3
machine3
machine3
machine1
machine2
machine3
....
Then when running mpich it will assign from the top down so the first 2 goes to the two first machines then the next 3 will go to machine 3, then another one for machine 1, the one for machine2, and then again for machine 3.
You must then select a good pattern for you needs.