It is always the last argument. This routine associates error handler errhandler with communicator comm . The association is local. MPI will use the specified error handling routine for any exception that takes place during a call on this communicator.
Different tasks can attach different error handlers to the same communicator.
An error handler that does not end in the MPI job being terminated, creates undefined risks. Some errors are harmless, while others are catastrophic. For example, an error detected by one member of a collective operation can result in other members waiting indefinitely for an operation which will never occur. It is also important to note that the MPI standard does not specify the state the MPI library should be in after an error occurs. MPI does not provide a way for users to determine how much, if any, damage has been done to the MPI state by a particular error.