|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* Copyright (C) 2003 University of Chicago.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT notice in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "mpioimpl.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_WEAK_SYMBOLS
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit Service |
c5cf8c |
#pragma weak MPIO_Testall = PMPIO_Testall
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPIO_Testall MPIO_Testall
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPIO_Testall as PMPIO_Testall
|
|
Packit Service |
c5cf8c |
/* end of weak pragmas */
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Include mapping from MPI->PMPI */
|
|
Packit Service |
c5cf8c |
#define MPIO_BUILD_PROFILING
|
|
Packit Service |
c5cf8c |
#include "mpioprof.h"
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
This is a temporary function until we switch to using MPI-2's generalized
|
|
Packit Service |
c5cf8c |
requests.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int MPIO_Testall(int count, MPIO_Request requests[], int *flag, MPI_Status statuses[])
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int done, i, err;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_ENTER();
|
|
Packit Service |
c5cf8c |
if (count == 1) {
|
|
Packit Service |
c5cf8c |
err = MPIO_Test(requests, flag, statuses);
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* This is actually very difficult to do. We can't use MPIO_Test,
|
|
Packit Service |
c5cf8c |
* since we must change the requests only if *ALL* requests are complete
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
/* FIXME: THIS IS NOT CORRECT (see above). But most applications won't
|
|
Packit Service |
c5cf8c |
* care */
|
|
Packit Service |
c5cf8c |
done = 1;
|
|
Packit Service |
c5cf8c |
for (i = 0; i < count; i++) {
|
|
Packit Service |
c5cf8c |
if (requests[i] != MPIO_REQUEST_NULL) {
|
|
Packit Service |
c5cf8c |
err = MPIO_Test(&requests[i], flag, &statuses[i]);
|
|
Packit Service |
c5cf8c |
if (!*flag)
|
|
Packit Service |
c5cf8c |
done = 0;
|
|
Packit Service |
c5cf8c |
if (err)
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
#ifdef MPICH
|
|
Packit Service |
c5cf8c |
/* need to set empty status */
|
|
Packit Service |
c5cf8c |
if (statuses != MPI_STATUSES_IGNORE) {
|
|
Packit Service |
c5cf8c |
statuses[i].MPI_SOURCE = MPI_ANY_SOURCE;
|
|
Packit Service |
c5cf8c |
statuses[i].MPI_TAG = MPI_ANY_TAG;
|
|
Packit Service |
c5cf8c |
MPIR_STATUS_SET_COUNT(statuses[i], 0);
|
|
Packit Service |
c5cf8c |
MPIR_STATUS_SET_CANCEL_BIT(statuses[i], 0);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#else
|
|
Packit Service |
c5cf8c |
;
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
*flag = done;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
err = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_EXIT();
|
|
Packit Service |
c5cf8c |
return err;
|
|
Packit Service |
c5cf8c |
}
|