|
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_Waitall = PMPIO_Waitall
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPIO_Waitall MPIO_Waitall
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPIO_Waitall as PMPIO_Waitall
|
|
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_Waitall(int count, MPIO_Request requests[], MPI_Status statuses[])
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int notdone, i, flag, err;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_ENTER();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (count == 1) {
|
|
Packit Service |
c5cf8c |
err = MPIO_Wait(requests, statuses);
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
do {
|
|
Packit Service |
c5cf8c |
notdone = 0;
|
|
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 |
notdone = 1;
|
|
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 |
} while (notdone);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
err = MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_EXIT();
|
|
Packit Service |
c5cf8c |
return err;
|
|
Packit Service |
c5cf8c |
}
|