root/ompi/mpiext/pcollreq/c/exscan_init.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPIX_Exscan_init

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2017 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2013      Los Alamos National Security, LLC.  All rights
  14  *                         reserved.
  15  * Copyright (c) 2015-2018 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 
  24 #include "ompi_config.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/datatype/ompi_datatype.h"
  31 #include "ompi/op/op.h"
  32 #include "ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h"
  33 #include "ompi/memchecker.h"
  34 #include "ompi/runtime/ompi_spc.h"
  35 
  36 #if OMPI_BUILD_MPI_PROFILING
  37 #if OPAL_HAVE_WEAK_SYMBOLS
  38 #pragma weak MPIX_Exscan_init = PMPIX_Exscan_init
  39 #endif
  40 #define MPIX_Exscan_init PMPIX_Exscan_init
  41 #endif
  42 
  43 static const char FUNC_NAME[] = "MPIX_Exscan_init";
  44 
  45 
  46 int MPIX_Exscan_init(const void *sendbuf, void *recvbuf, int count,
  47                      MPI_Datatype datatype, MPI_Op op, MPI_Comm comm,
  48                      MPI_Info info, MPI_Request *request)
  49 {
  50     int err;
  51 
  52     SPC_RECORD(OMPI_SPC_EXSCAN_INIT, 1);
  53 
  54     MEMCHECKER(
  55         memchecker_datatype(datatype);
  56         memchecker_call(&opal_memchecker_base_isdefined, sendbuf, count, datatype);
  57         memchecker_comm(comm);
  58     );
  59 
  60     if (MPI_PARAM_CHECK) {
  61         char *msg;
  62         err = MPI_SUCCESS;
  63         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  64         if (ompi_comm_invalid(comm)) {
  65             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
  66                                           FUNC_NAME);
  67         }
  68 
  69         /* Unrooted operation -- same checks for intracommunicators
  70            and intercommunicators */
  71         else if (MPI_OP_NULL == op) {
  72             err = MPI_ERR_OP;
  73         } else if (!ompi_op_is_valid(op, datatype, &msg, FUNC_NAME)) {
  74             int ret = OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OP, msg);
  75             free(msg);
  76             return ret;
  77         } else {
  78             OMPI_CHECK_DATATYPE_FOR_SEND(err, datatype, count);
  79         }
  80         OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
  81     }
  82 
  83     OPAL_CR_ENTER_LIBRARY();
  84 
  85     /* Invoke the coll component to perform the back-end operation */
  86 
  87     OBJ_RETAIN(op);
  88     err = comm->c_coll->coll_exscan_init(sendbuf, recvbuf, count,
  89                                          datatype, op, comm, info, request,
  90                                          comm->c_coll->coll_exscan_init_module);
  91     OBJ_RELEASE(op);
  92     OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
  93 }

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