root/ompi/mpi/c/type_set_name.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Type_set_name

   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) 2013      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 (c) 2018      Cisco Systems, Inc.  All rights reserved
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 
  25 #include "ompi_config.h"
  26 
  27 #include <string.h>
  28 
  29 #include "opal/util/string_copy.h"
  30 
  31 #include "ompi/mpi/c/bindings.h"
  32 #include "ompi/runtime/params.h"
  33 #include "ompi/communicator/communicator.h"
  34 #include "ompi/errhandler/errhandler.h"
  35 #include "ompi/datatype/ompi_datatype.h"
  36 #include "ompi/memchecker.h"
  37 
  38 #if OMPI_BUILD_MPI_PROFILING
  39 #if OPAL_HAVE_WEAK_SYMBOLS
  40 #pragma weak MPI_Type_set_name = PMPI_Type_set_name
  41 #endif
  42 #define MPI_Type_set_name PMPI_Type_set_name
  43 #endif
  44 
  45 static const char FUNC_NAME[] = "MPI_Type_set_name";
  46 
  47 
  48 int MPI_Type_set_name (MPI_Datatype type, const char *type_name)
  49 {
  50     MEMCHECKER(
  51         memchecker_datatype(type);
  52         );
  53 
  54     OPAL_CR_NOOP_PROGRESS();
  55 
  56     if (MPI_PARAM_CHECK) {
  57         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  58         if (NULL == type || MPI_DATATYPE_NULL == type) {
  59             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
  60         } else if (NULL == type_name) {
  61             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
  62         }
  63     }
  64 
  65     memset(type->name, 0, MPI_MAX_OBJECT_NAME);
  66     opal_string_copy( type->name, type_name, MPI_MAX_OBJECT_NAME);
  67     return MPI_SUCCESS;
  68 }

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