Avoid printing an error when the rank for a communicator is negative.
Avoid printing an error when the rank for a communicator is negative.

This can happen for MPI_COMM_NULL, there was already a check in the code
for this case however a cast was missing from the test.

ashleypittman/padb,ashleypittman/padb,ashleypittman/padb