root/ompi/mpi/c/unpack_external.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Unpack_external

   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-2016 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) 2006      Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2013      Los Alamos National Security, LLC.  All rights
  15  *                         reserved.
  16  * Copyright (c) 2015-2017 Research Organization for Information Science
  17  *                         and Technology (RIST). All rights reserved.
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  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 "opal/datatype/opal_convertor.h"
  32 #include "ompi/memchecker.h"
  33 
  34 #if OMPI_BUILD_MPI_PROFILING
  35 #if OPAL_HAVE_WEAK_SYMBOLS
  36 #pragma weak MPI_Unpack_external = PMPI_Unpack_external
  37 #endif
  38 #define MPI_Unpack_external PMPI_Unpack_external
  39 #endif
  40 
  41 static const char FUNC_NAME[] = "MPI_Unpack_external";
  42 
  43 
  44 int MPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insize,
  45                          MPI_Aint *position, void *outbuf, int outcount,
  46                          MPI_Datatype datatype)
  47 {
  48     int rc = MPI_SUCCESS;
  49 
  50     MEMCHECKER(
  51         memchecker_datatype(datatype);
  52         memchecker_call(&opal_memchecker_base_isdefined, outbuf, outcount, datatype);
  53     );
  54 
  55     if (MPI_PARAM_CHECK) {
  56         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  57         if ((NULL == inbuf) || (NULL == position)) {  /* outbuf can be MPI_BOTTOM */
  58             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
  59         } else if (outcount < 0) {
  60             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, FUNC_NAME);
  61         }
  62         OMPI_CHECK_DATATYPE_FOR_RECV(rc, datatype, outcount);
  63         OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
  64         OMPI_CHECK_USER_BUFFER(rc, outbuf, datatype, outcount);
  65         OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
  66     }
  67 
  68     OPAL_CR_ENTER_LIBRARY();
  69 
  70     rc = ompi_datatype_unpack_external(datarep, inbuf, insize,
  71                                        position, outbuf, outcount,
  72                                        datatype);
  73     OPAL_CR_EXIT_LIBRARY();
  74 
  75     OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
  76 }

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