From: Julian Seward Date: Thu, 29 May 2008 12:17:03 +0000 (+0000) Subject: Merge r8092 (libmpiwrap.c: add a wrapper for MPI_Waitany) X-Git-Tag: svn/VALGRIND_3_3_1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7b91888379dbc779c07b1b32730b248ac688546;p=thirdparty%2Fvalgrind.git Merge r8092 (libmpiwrap.c: add a wrapper for MPI_Waitany) git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_3_BRANCH@8143 --- diff --git a/auxprogs/libmpiwrap.c b/auxprogs/libmpiwrap.c index 0e1d8247b2..fa9f1305e4 100644 --- a/auxprogs/libmpiwrap.c +++ b/auxprogs/libmpiwrap.c @@ -1403,6 +1403,36 @@ int WRAPPER_FOR(PMPI_Wait)( MPI_Request* request, return err; } +/* --- Waitany --- */ +int WRAPPER_FOR(PMPI_Waitany)( int count, + MPI_Request* requests, + int* index, + MPI_Status* status ) +{ + MPI_Request* requests_before = NULL; + OrigFn fn; + int err, i; + VALGRIND_GET_ORIG_FN(fn); + before("Waitany"); + if (0) fprintf(stderr, "Waitany: %d\n", count); + check_mem_is_addressable_untyped(index, sizeof(int)); + check_mem_is_addressable_untyped(status, sizeof(MPI_Status)); + for (i = 0; i < count; i++) { + check_mem_is_defined_untyped(&requests[i], sizeof(MPI_Request)); + } + requests_before = clone_Request_array( count, requests ); + CALL_FN_W_WWWW(err, fn, count,requests,index,status); + if (err == MPI_SUCCESS && *index >= 0 && *index < count) { + maybe_complete(False/*err in status?*/, + requests_before[*index], requests[*index], status); + make_mem_defined_if_addressable_untyped(status, sizeof(MPI_Status)); + } + if (requests_before) + free(requests_before); + after("Waitany", err); + return err; +} + /* --- Waitall --- */ int WRAPPER_FOR(PMPI_Waitall)( int count, MPI_Request* requests, @@ -2542,7 +2572,7 @@ DEFAULT_WRAPPER_W_5W(Type_vector) DEFAULT_WRAPPER_W_3W(Unpublish_name) DEFAULT_WRAPPER_W_7W(Unpack_external) /* DEFAULT_WRAPPER_W_3W(Waitall) */ -DEFAULT_WRAPPER_W_4W(Waitany) +/* DEFAULT_WRAPPER_W_4W(Waitany) */ /* DEFAULT_WRAPPER_W_2W(Wait) */ DEFAULT_WRAPPER_W_5W(Waitsome) DEFAULT_WRAPPER_W_1W(Win_c2f)