-/* Copyright (c) 2007-2013. The SimGrid Team.
+/* Copyright (c) 2007-2014. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
#include "private.h"
#include "smpi_mpi_dt_private.h"
if (*request == MPI_REQUEST_NULL) {
retval = MPI_ERR_ARG;
} else {
- if((*request)->flags & PERSISTENT)(*request)->refcount--;
smpi_mpi_request_free(request);
retval = MPI_SUCCESS;
}
#ifdef HAVE_TRACING
//the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
- if(status!=MPI_STATUS_IGNORE)src_traced = smpi_group_index(smpi_comm_group(comm), status->MPI_SOURCE);
+ if(status!=MPI_STATUS_IGNORE){
+ src_traced = smpi_group_index(smpi_comm_group(comm), status->MPI_SOURCE);
+ TRACE_smpi_recv(rank, src_traced, rank);
+ }
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
- TRACE_smpi_recv(rank, src_traced, rank);
#endif
}
int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
{
- int retval = 0;
+ if (index == NULL)
+ return MPI_ERR_ARG;
smpi_bench_end();
#ifdef HAVE_TRACING
TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__,extra);
#endif
- if (index == NULL) {
- retval = MPI_ERR_ARG;
- } else {
- *index = smpi_mpi_waitany(count, requests, status);
- retval = MPI_SUCCESS;
- }
+ *index = smpi_mpi_waitany(count, requests, status);
#ifdef HAVE_TRACING
if(*index!=MPI_UNDEFINED){
int src_traced = srcs[*index];
}
#endif
smpi_bench_begin();
- return retval;
+ return MPI_SUCCESS;
}
int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])