Use nonblocking sends/receives on the master, and blocking ones on the slaves. Basically:
Master:
- Send jobs via nonblocking sends.
- Post a nonblocking receive for each result
- Periodically check if any of the results have arrived. If so, send a new job and post a nonblocking receive for it.
- Repeat step 3. until all results have arrived.
Slave:
- Wait for a job with a blocking receive
- Send the result with a blocking send
- Go to 1.