|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "mpiimpl.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#if !defined(MPIR_REQUEST_PTR_ARRAY_SIZE)
|
|
Packit Service |
c5cf8c |
#define MPIR_REQUEST_PTR_ARRAY_SIZE 16
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* -- Begin Profiling Symbol Block for routine MPI_Testall */
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit Service |
c5cf8c |
#pragma weak MPI_Testall = PMPI_Testall
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPI_Testall MPI_Testall
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPI_Testall as PMPI_Testall
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit Service |
c5cf8c |
int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
|
|
Packit Service |
c5cf8c |
MPI_Status array_of_statuses[]) __attribute__ ((weak, alias("PMPI_Testall")));
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
/* -- End Profiling Symbol Block */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
|
|
Packit Service |
c5cf8c |
the MPI routines */
|
|
Packit Service |
c5cf8c |
#ifndef MPICH_MPI_FROM_PMPI
|
|
Packit Service |
c5cf8c |
#undef MPI_Testall
|
|
Packit Service |
c5cf8c |
#define MPI_Testall PMPI_Testall
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_Testall_impl
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
int MPIR_Testall_impl(int count, MPIR_Request * request_ptrs[], int *flag,
|
|
Packit Service |
c5cf8c |
MPI_Status array_of_statuses[], int requests_property)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int i;
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
int n_completed = 0;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
mpi_errno = MPID_Progress_test();
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_POP(mpi_errno);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (requests_property & MPIR_REQUESTS_PROPERTY__NO_GREQUESTS) {
|
|
Packit Service |
c5cf8c |
for (i = 0; i < count; i++) {
|
|
Packit Service |
c5cf8c |
if ((i + 1) % MPIR_CVAR_REQUEST_POLL_FREQ == 0) {
|
|
Packit Service |
c5cf8c |
mpi_errno = MPID_Progress_test();
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_POP(mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i] == NULL || MPIR_Request_is_complete(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
n_completed++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
for (i = 0; i < count; i++) {
|
|
Packit Service |
c5cf8c |
if ((i + 1) % MPIR_CVAR_REQUEST_POLL_FREQ == 0) {
|
|
Packit Service |
c5cf8c |
mpi_errno = MPID_Progress_test();
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_POP(mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i] != NULL) {
|
|
Packit Service |
c5cf8c |
if (MPIR_Request_has_poll_fn(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Grequest_poll(request_ptrs[i], &array_of_statuses[i]);
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
MPIR_ERR_POP(mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (MPIR_Request_is_complete(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
n_completed++;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
n_completed++;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
*flag = (n_completed == count) ? TRUE : FALSE;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
fn_fail:
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_Testall
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
int MPIR_Testall(int count, MPI_Request array_of_requests[], int *flag,
|
|
Packit Service |
c5cf8c |
MPI_Status array_of_statuses[])
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPIR_Request *request_ptr_array[MPIR_REQUEST_PTR_ARRAY_SIZE];
|
|
Packit Service |
c5cf8c |
MPIR_Request **request_ptrs = request_ptr_array;
|
|
Packit Service |
c5cf8c |
int i;
|
|
Packit Service |
c5cf8c |
int n_completed;
|
|
Packit Service |
c5cf8c |
int active_flag;
|
|
Packit Service |
c5cf8c |
int rc = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
int proc_failure = FALSE;
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
int requests_property = MPIR_REQUESTS_PROPERTY__OPT_ALL;
|
|
Packit Service |
c5cf8c |
int ignoring_status = (array_of_statuses == MPI_STATUSES_IGNORE);
|
|
Packit Service |
c5cf8c |
MPIR_CHKLMEM_DECL(1);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int ii, icount, impi_errno;
|
|
Packit Service |
c5cf8c |
n_completed = 0;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Convert MPI request handles to a request object pointers */
|
|
Packit Service |
c5cf8c |
if (count > MPIR_REQUEST_PTR_ARRAY_SIZE) {
|
|
Packit Service |
c5cf8c |
MPIR_CHKLMEM_MALLOC_ORJUMP(request_ptrs, MPIR_Request **,
|
|
Packit Service |
c5cf8c |
count * sizeof(MPIR_Request *), mpi_errno, "request pointers",
|
|
Packit Service |
c5cf8c |
MPL_MEM_OBJECT);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (ii = 0; ii < count; ii += MPIR_CVAR_REQUEST_BATCH_SIZE) {
|
|
Packit Service |
c5cf8c |
icount = count - ii > MPIR_CVAR_REQUEST_BATCH_SIZE ?
|
|
Packit Service |
c5cf8c |
MPIR_CVAR_REQUEST_BATCH_SIZE : count - ii;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
requests_property = MPIR_REQUESTS_PROPERTY__OPT_ALL;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = ii; i < ii + icount; i++) {
|
|
Packit Service |
c5cf8c |
if (array_of_requests[i] != MPI_REQUEST_NULL) {
|
|
Packit Service |
c5cf8c |
MPIR_Request_get_ptr(array_of_requests[i], request_ptrs[i]);
|
|
Packit Service |
c5cf8c |
/* Validate object pointers if error checking is enabled */
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_ERROR_CHECKING
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPID_BEGIN_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPIR_Request_valid_ptr(request_ptrs[i], mpi_errno);
|
|
Packit Service |
c5cf8c |
if (mpi_errno)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
MPID_END_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i]->kind != MPIR_REQUEST_KIND__RECV &&
|
|
Packit Service |
c5cf8c |
request_ptrs[i]->kind != MPIR_REQUEST_KIND__SEND) {
|
|
Packit Service |
c5cf8c |
requests_property &= ~MPIR_REQUESTS_PROPERTY__SEND_RECV_ONLY;
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i]->kind == MPIR_REQUEST_KIND__GREQUEST) {
|
|
Packit Service |
c5cf8c |
requests_property &= ~MPIR_REQUESTS_PROPERTY__NO_GREQUESTS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
request_ptrs[i] = NULL;
|
|
Packit Service |
c5cf8c |
requests_property &= ~MPIR_REQUESTS_PROPERTY__NO_NULL;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
impi_errno = MPID_Testall(icount, &request_ptrs[ii], flag,
|
|
Packit Service |
c5cf8c |
ignoring_status ? MPI_STATUSES_IGNORE : &array_of_statuses[ii],
|
|
Packit Service |
c5cf8c |
requests_property);
|
|
Packit Service |
c5cf8c |
if (impi_errno != MPI_SUCCESS) {
|
|
Packit Service |
c5cf8c |
mpi_errno = impi_errno;
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = ii; i < ii + icount; i++) {
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i] == NULL || MPIR_Request_is_complete(request_ptrs[i]))
|
|
Packit Service |
c5cf8c |
n_completed += 1;
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_ERROR_CHECKING
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPID_BEGIN_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i] == NULL)
|
|
Packit Service |
c5cf8c |
continue;
|
|
Packit Service |
c5cf8c |
if (MPIR_Request_is_complete(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
rc = MPIR_Request_get_error(request_ptrs[i]);
|
|
Packit Service |
c5cf8c |
if (rc != MPI_SUCCESS) {
|
|
Packit Service |
c5cf8c |
if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc) ||
|
|
Packit Service |
c5cf8c |
MPIX_ERR_PROC_FAILED_PENDING == MPIR_ERR_GET_CLASS(rc))
|
|
Packit Service |
c5cf8c |
proc_failure = TRUE;
|
|
Packit Service |
c5cf8c |
mpi_errno = MPI_ERR_IN_STATUS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
} else if (unlikely(MPIR_Request_is_anysrc_mismatched(request_ptrs[i]))) {
|
|
Packit Service |
c5cf8c |
mpi_errno = MPI_ERR_IN_STATUS;
|
|
Packit Service |
c5cf8c |
MPIR_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
|
|
Packit Service |
c5cf8c |
if (!ignoring_status)
|
|
Packit Service |
c5cf8c |
array_of_statuses[i].MPI_ERROR = rc;
|
|
Packit Service |
c5cf8c |
proc_failure = TRUE;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
MPID_END_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
*flag = (n_completed == count) ? TRUE : FALSE;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* We only process completion of requests if all are finished, or
|
|
Packit Service |
c5cf8c |
* there is an error. */
|
|
Packit Service |
c5cf8c |
if (!(*flag || mpi_errno == MPI_ERR_IN_STATUS))
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (ignoring_status && (requests_property & MPIR_REQUESTS_PROPERTY__SEND_RECV_ONLY)) {
|
|
Packit Service |
c5cf8c |
for (i = 0; i < count; i++) {
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i] != NULL && MPIR_Request_is_complete(request_ptrs[i]))
|
|
Packit Service |
c5cf8c |
MPIR_Request_completion_processing_fastpath(&array_of_requests[i], request_ptrs[i]);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (ignoring_status) {
|
|
Packit Service |
c5cf8c |
for (i = 0; i < count; i++) {
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i] != NULL && MPIR_Request_is_complete(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
MPIR_Request_completion_processing(request_ptrs[i],
|
|
Packit Service |
c5cf8c |
MPI_STATUS_IGNORE, &active_flag);
|
|
Packit Service |
c5cf8c |
if (!MPIR_Request_is_persistent(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
MPIR_Request_free(request_ptrs[i]);
|
|
Packit Service |
c5cf8c |
array_of_requests[i] = MPI_REQUEST_NULL;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = 0; i < count; i++) {
|
|
Packit Service |
c5cf8c |
if (request_ptrs[i] != NULL) {
|
|
Packit Service |
c5cf8c |
if (MPIR_Request_is_complete(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
rc = MPIR_Request_completion_processing(request_ptrs[i],
|
|
Packit Service |
c5cf8c |
&array_of_statuses[i], &active_flag);
|
|
Packit Service |
c5cf8c |
if (!MPIR_Request_is_persistent(request_ptrs[i])) {
|
|
Packit Service |
c5cf8c |
MPIR_Request_free(request_ptrs[i]);
|
|
Packit Service |
c5cf8c |
array_of_requests[i] = MPI_REQUEST_NULL;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (mpi_errno == MPI_ERR_IN_STATUS) {
|
|
Packit Service |
c5cf8c |
if (active_flag) {
|
|
Packit Service |
c5cf8c |
array_of_statuses[i].MPI_ERROR = rc;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
array_of_statuses[i].MPI_ERROR = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (mpi_errno == MPI_ERR_IN_STATUS) {
|
|
Packit Service |
c5cf8c |
if (!proc_failure)
|
|
Packit Service |
c5cf8c |
array_of_statuses[i].MPI_ERROR = MPI_ERR_PENDING;
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
array_of_statuses[i].MPI_ERROR = MPIX_ERR_PROC_FAILED_PENDING;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
MPIR_Status_set_empty(&array_of_statuses[i]);
|
|
Packit Service |
c5cf8c |
if (mpi_errno == MPI_ERR_IN_STATUS) {
|
|
Packit Service |
c5cf8c |
array_of_statuses[i].MPI_ERROR = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
if (count > MPIR_REQUEST_PTR_ARRAY_SIZE) {
|
|
Packit Service |
c5cf8c |
MPIR_CHKLMEM_FREEALL();
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
fn_fail:
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPI_Testall
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
/*@
|
|
Packit Service |
c5cf8c |
MPI_Testall - Tests for the completion of all previously initiated
|
|
Packit Service |
c5cf8c |
requests
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Input Parameters:
|
|
Packit Service |
c5cf8c |
+ count - lists length (integer)
|
|
Packit Service |
c5cf8c |
- array_of_requests - array of requests (array of handles)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Output Parameters:
|
|
Packit Service |
c5cf8c |
+ flag - True if all requests have completed; false otherwise (logical)
|
|
Packit Service |
c5cf8c |
- array_of_statuses - array of status objects (array of Status). May be
|
|
Packit Service |
c5cf8c |
'MPI_STATUSES_IGNORE'.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Notes:
|
|
Packit Service |
c5cf8c |
'flag' is true only if all requests have completed. Otherwise, flag is
|
|
Packit Service |
c5cf8c |
false and neither the 'array_of_requests' nor the 'array_of_statuses' is
|
|
Packit Service |
c5cf8c |
modified.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
If one or more of the requests completes with an error, 'MPI_ERR_IN_STATUS' is
|
|
Packit Service |
c5cf8c |
returned. An error value will be present is elements of 'array_of_status'
|
|
Packit Service |
c5cf8c |
associated with the requests. Likewise, the 'MPI_ERROR' field in the status
|
|
Packit Service |
c5cf8c |
elements associated with requests that have successfully completed will be
|
|
Packit Service |
c5cf8c |
'MPI_SUCCESS'. Finally, those requests that have not completed will have a
|
|
Packit Service |
c5cf8c |
value of 'MPI_ERR_PENDING'.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
While it is possible to list a request handle more than once in the
|
|
Packit Service |
c5cf8c |
'array_of_requests', such an action is considered erroneous and may cause the
|
|
Packit Service |
c5cf8c |
program to unexecpectedly terminate or produce incorrect results.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N ThreadSafe
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N waitstatus
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N Fortran
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N Errors
|
|
Packit Service |
c5cf8c |
.N MPI_SUCCESS
|
|
Packit Service |
c5cf8c |
.N MPI_ERR_IN_STATUS
|
|
Packit Service |
c5cf8c |
.N MPI_ERR_REQUEST
|
|
Packit Service |
c5cf8c |
.N MPI_ERR_ARG
|
|
Packit Service |
c5cf8c |
@*/
|
|
Packit Service |
c5cf8c |
int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
|
|
Packit Service |
c5cf8c |
MPI_Status array_of_statuses[])
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int mpi_errno = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPI_TESTALL);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_INITIALIZED_ORDIE();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPID_THREAD_CS_ENTER(VNI_GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
|
|
Packit Service |
c5cf8c |
MPIR_FUNC_TERSE_REQUEST_ENTER(MPID_STATE_MPI_TESTALL);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Check the arguments */
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_ERROR_CHECKING
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPID_BEGIN_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int i = 0;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_COUNT(count, mpi_errno);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (count != 0) {
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_ARGNULL(array_of_requests, "array_of_requests", mpi_errno);
|
|
Packit Service |
c5cf8c |
/* NOTE: MPI_STATUSES_IGNORE != NULL */
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_ARGNULL(array_of_statuses, "array_of_statuses", mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_ARGNULL(flag, "flag", mpi_errno);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = 0; i < count; i++) {
|
|
Packit Service |
c5cf8c |
MPIR_ERRTEST_ARRAYREQUEST_OR_NULL(array_of_requests[i], i, mpi_errno);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
MPID_END_ERROR_CHECKS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif /* HAVE_ERROR_CHECKING */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* ... body of routine ... */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Testall(count, array_of_requests, flag, array_of_statuses);
|
|
Packit Service |
c5cf8c |
if (mpi_errno != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_fail;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* ... end of body of routine ... */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_FUNC_TERSE_REQUEST_EXIT(MPID_STATE_MPI_TESTALL);
|
|
Packit Service |
c5cf8c |
MPID_THREAD_CS_EXIT(VNI_GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
|
|
Packit Service |
c5cf8c |
return mpi_errno;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_fail:
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_ERROR_CHECKING
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
mpi_errno =
|
|
Packit Service |
c5cf8c |
MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER,
|
|
Packit Service |
c5cf8c |
"**mpi_testall", "**mpi_testall %d %p %p %p", count,
|
|
Packit Service |
c5cf8c |
array_of_requests, flag, array_of_statuses);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
mpi_errno = MPIR_Err_return_comm(NULL, FCNAME, mpi_errno);
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
}
|