if ((*request)->action != NULL) { // this is not a detached send
simcall_comm_wait((*request)->action, -1.0);
if ((*request)->action != NULL) { // this is not a detached send
simcall_comm_wait((*request)->action, -1.0);
finish_wait(request, status);
*request = MPI_REQUEST_NULL;
finish_wait(request, status);
*request = MPI_REQUEST_NULL;