root/ompi/mpi/c/pack_external.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Pack_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 #include <stdio.h>
  26 
  27 #include "ompi/mpi/c/bindings.h"
  28 #include "ompi/runtime/params.h"
  29 #include "ompi/communicator/communicator.h"
  30 #include "ompi/errhandler/errhandler.h"
  31 #include "ompi/datatype/ompi_datatype.h"
  32 #include "opal/datatype/opal_convertor.h"
  33 #include "ompi/memchecker.h"
  34 
  35 #if OMPI_BUILD_MPI_PROFILING
  36 #if OPAL_HAVE_WEAK_SYMBOLS
  37 #pragma weak MPI_Pack_external = PMPI_Pack_external
  38 #endif
  39 #define MPI_Pack_external PMPI_Pack_external
  40 #endif
  41 
  42 static const char FUNC_NAME[] = "MPI_Pack_external";
  43 
  44 
  45 int MPI_Pack_external(const char datarep[], const void *inbuf, int incount,
  46                       MPI_Datatype datatype, void *outbuf,
  47                       MPI_Aint outsize, MPI_Aint *position)
  48 {
  49     int rc = MPI_SUCCESS;
  50 
  51     MEMCHECKER(
  52         memchecker_datatype(datatype);
  53         memchecker_call(&opal_memchecker_base_isdefined, inbuf, incount, datatype);
  54     );
  55 
  56     if (MPI_PARAM_CHECK) {
  57         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  58         if ((NULL == outbuf) || (NULL == position)) {  /* inbuf can be MPI_BOTTOM */
  59             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
  60         } else if (incount < 0) {
  61             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, FUNC_NAME);
  62         } else if (outsize < 0) {
  63             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
  64         }
  65         OMPI_CHECK_DATATYPE_FOR_SEND(rc, datatype, incount);
  66         OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
  67         OMPI_CHECK_USER_BUFFER(rc, inbuf, datatype, incount);
  68         OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
  69     }
  70 
  71     OPAL_CR_ENTER_LIBRARY();
  72 
  73     rc = ompi_datatype_pack_external(datarep, inbuf, incount,
  74                                      datatype, outbuf, 
  75                                      outsize, position);
  76 
  77     OPAL_CR_EXIT_LIBRARY();
  78 
  79     OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
  80 }

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