root/ompi/mpi/c/comm_split_type.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Comm_split_type

   1 /*
   2  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2006      Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2012      Sandia National Laboratories. All rights reserved.
  14  * Copyright (c) 2015      Research Organization for Information Science
  15  *                         and Technology (RIST). All rights reserved.
  16  * Copyright (c) 2017      IBM Corporation. All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  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/info/info.h"
  32 #include "ompi/memchecker.h"
  33 
  34 #if OMPI_BUILD_MPI_PROFILING
  35 #if OPAL_HAVE_WEAK_SYMBOLS
  36 #pragma weak MPI_Comm_split_type = PMPI_Comm_split_type
  37 #endif
  38 #define MPI_Comm_split_type PMPI_Comm_split_type
  39 #endif
  40 
  41 static const char FUNC_NAME[] = "MPI_Comm_split_type";
  42 
  43 
  44 int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key,
  45                         MPI_Info info, MPI_Comm *newcomm) {
  46 
  47     int rc;
  48 
  49     MEMCHECKER(
  50         memchecker_comm(comm);
  51     );
  52 
  53     if ( MPI_PARAM_CHECK ) {
  54         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  55 
  56         if ( ompi_comm_invalid ( comm )) {
  57             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
  58                                           FUNC_NAME);
  59         }
  60 
  61         if (NULL == info || ompi_info_is_freed(info)) {
  62             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_INFO,
  63                                           FUNC_NAME);
  64         }
  65 
  66         if ( MPI_COMM_TYPE_SHARED != split_type && // Same as OMPI_COMM_TYPE_NODE
  67              OMPI_COMM_TYPE_CLUSTER != split_type &&
  68              OMPI_COMM_TYPE_CU != split_type &&
  69              OMPI_COMM_TYPE_HOST != split_type &&
  70              OMPI_COMM_TYPE_BOARD != split_type &&
  71              OMPI_COMM_TYPE_NODE != split_type && // Same as MPI_COMM_TYPE_SHARED
  72              OMPI_COMM_TYPE_NUMA != split_type &&
  73              OMPI_COMM_TYPE_SOCKET != split_type &&
  74              OMPI_COMM_TYPE_L3CACHE != split_type &&
  75              OMPI_COMM_TYPE_L2CACHE != split_type &&
  76              OMPI_COMM_TYPE_L1CACHE != split_type &&
  77              OMPI_COMM_TYPE_CORE != split_type &&
  78              OMPI_COMM_TYPE_HWTHREAD != split_type &&
  79              MPI_UNDEFINED != split_type ) {
  80             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG,
  81                                           FUNC_NAME);
  82         }
  83 
  84         if ( NULL == newcomm ) {
  85             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG,
  86                                           FUNC_NAME);
  87         }
  88     }
  89 
  90     OPAL_CR_ENTER_LIBRARY();
  91 
  92     if( (MPI_COMM_SELF == comm) && (MPI_UNDEFINED == split_type) ) {
  93         *newcomm = MPI_COMM_NULL;
  94         rc = MPI_SUCCESS;
  95     } else {
  96         rc = ompi_comm_split_type( (ompi_communicator_t*)comm, split_type, key, &(info->super),
  97                                    (ompi_communicator_t**)newcomm);
  98     }
  99     OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
 100 }

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