root/ompi/mca/io/romio321/romio/mpi-io/iowaitall.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. MPIO_Waitall

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 2003 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include "mpioimpl.h"
   9 
  10 #ifdef HAVE_WEAK_SYMBOLS
  11 
  12 #if defined(HAVE_PRAGMA_WEAK)
  13 #pragma weak MPIO_Waitall = PMPIO_Waitall
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPIO_Waitall MPIO_Waitall
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPIO_Waitall as PMPIO_Waitall
  18 /* end of weak pragmas */
  19 #endif
  20 
  21 /* Include mapping from MPI->PMPI */
  22 #define MPIO_BUILD_PROFILING
  23 #include "mpioprof.h"
  24 #endif
  25 
  26 /*
  27   This is a temporary function until we switch to using MPI-2's generalized
  28   requests.
  29 */
  30 
  31 int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] )
  32 {
  33     int notdone, i, flag, err; 
  34     MPID_THREADPRIV_DECL;
  35 
  36     ROMIO_THREAD_CS_ENTER();
  37 
  38     if (count == 1)  {
  39             err = MPIO_Wait(requests, statuses);
  40             goto fn_exit;
  41     }
  42     
  43     
  44     do {
  45         notdone = 0;
  46         for (i=0; i<count; i++) {
  47             if (requests[i] != MPIO_REQUEST_NULL) {
  48                 err = MPIO_Test( &requests[i], &flag, &statuses[i] );
  49                 if (!flag) notdone = 1;
  50                 if (err) goto fn_exit;
  51             }
  52             else {
  53 #ifdef MPICH
  54                 /* need to set empty status */
  55                 if (statuses != MPI_STATUSES_IGNORE) {
  56                     statuses[i].MPI_SOURCE = MPI_ANY_SOURCE;
  57                     statuses[i].MPI_TAG    = MPI_ANY_TAG;
  58                     MPIR_STATUS_SET_COUNT(statuses[i], 0);
  59                     MPIR_STATUS_SET_CANCEL_BIT(statuses[i], 0);
  60                 }
  61 #else
  62                 ;
  63 #endif
  64             }
  65         }
  66     } while (notdone);
  67 
  68     err = MPI_SUCCESS;
  69 fn_exit:
  70 
  71     ROMIO_THREAD_CS_EXIT();
  72     return err;
  73 }
  74 

/* [<][>][^][v][top][bottom][index][help] */