root/ompi/mpi/c/waitall.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Waitall

   1 /*
   2  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2018 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2006      Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2012      Los Alamos National Security, LLC.  All rights
  14  *                         reserved.
  15  * Copyright (c) 2015      Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 #include "ompi_config.h"
  24 #include <stdio.h>
  25 
  26 #include "ompi/mpi/c/bindings.h"
  27 #include "ompi/runtime/params.h"
  28 #include "ompi/communicator/communicator.h"
  29 #include "ompi/errhandler/errhandler.h"
  30 #include "ompi/request/request.h"
  31 #include "ompi/memchecker.h"
  32 #include "ompi/runtime/ompi_spc.h"
  33 
  34 #if OMPI_BUILD_MPI_PROFILING
  35 #if OPAL_HAVE_WEAK_SYMBOLS
  36 #pragma weak MPI_Waitall = PMPI_Waitall
  37 #endif
  38 #define MPI_Waitall PMPI_Waitall
  39 #endif
  40 
  41 static const char FUNC_NAME[] = "MPI_Waitall";
  42 
  43 
  44 int MPI_Waitall(int count, MPI_Request requests[], MPI_Status statuses[])
  45 {
  46     SPC_RECORD(OMPI_SPC_WAITALL, 1);
  47 
  48     MEMCHECKER(
  49         int j;
  50         for (j = 0; j < count; j++){
  51             memchecker_request(&requests[j]);
  52         }
  53     );
  54 
  55     if ( MPI_PARAM_CHECK ) {
  56         int i, rc = MPI_SUCCESS;
  57         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  58         if( (NULL == requests) && (0 != count) ) {
  59             rc = MPI_ERR_REQUEST;
  60         } else {
  61             for (i = 0; i < count; i++) {
  62                 if (NULL == requests[i]) {
  63                     rc = MPI_ERR_REQUEST;
  64                     break;
  65                 }
  66             }
  67         }
  68         if (count < 0) {
  69             rc = MPI_ERR_ARG;
  70         }
  71         OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
  72     }
  73 
  74     if (OPAL_UNLIKELY(0 == count)) {
  75         return MPI_SUCCESS;
  76     }
  77 
  78     OPAL_CR_ENTER_LIBRARY();
  79 
  80     if (OMPI_SUCCESS == ompi_request_wait_all(count, requests, statuses)) {
  81         OPAL_CR_EXIT_LIBRARY();
  82         return MPI_SUCCESS;
  83     }
  84 
  85     if (MPI_SUCCESS !=
  86         ompi_errhandler_request_invoke(count, requests, FUNC_NAME)) {
  87         OPAL_CR_EXIT_LIBRARY();
  88         return MPI_ERR_IN_STATUS;
  89     }
  90 
  91     OPAL_CR_EXIT_LIBRARY();
  92     return MPI_SUCCESS;
  93 }

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