root/ompi/mpi/c/type_contiguous.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Type_contiguous

   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-2005 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      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 
  25 #include "ompi_config.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 "ompi/memchecker.h"
  33 
  34 #if OMPI_BUILD_MPI_PROFILING
  35 #if OPAL_HAVE_WEAK_SYMBOLS
  36 #pragma weak MPI_Type_contiguous = PMPI_Type_contiguous
  37 #endif
  38 #define MPI_Type_contiguous PMPI_Type_contiguous
  39 #endif
  40 
  41 static const char FUNC_NAME[] = "MPI_Type_contiguous";
  42 
  43 
  44 int MPI_Type_contiguous(int count,
  45                         MPI_Datatype oldtype,
  46                         MPI_Datatype *newtype)
  47 {
  48     int rc;
  49 
  50     MEMCHECKER(
  51         memchecker_datatype(oldtype);
  52         );
  53 
  54     if( MPI_PARAM_CHECK ) {
  55         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  56         if (MPI_DATATYPE_NULL == oldtype || NULL == oldtype ||
  57             NULL == newtype) {
  58             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
  59         } else if( count < 0 ) {
  60             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, FUNC_NAME);
  61         }
  62     }
  63 
  64     OPAL_CR_ENTER_LIBRARY();
  65 
  66     rc = ompi_datatype_create_contiguous( count, oldtype, newtype );
  67     OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME );
  68 
  69     /* data description */
  70     {
  71         const int* a_i[1] = {&count};
  72         ompi_datatype_set_args( *newtype, 1, a_i, 0, NULL, 1, &oldtype, MPI_COMBINER_CONTIGUOUS );
  73     }
  74 
  75     OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME );
  76 }

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