root/ompi/mpi/c/comm_create_group.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Comm_create_group

   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-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2008 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2006-2007 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 #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/mca/pml/pml.h"
  32 #include "ompi/memchecker.h"
  33 
  34 #if OMPI_BUILD_MPI_PROFILING
  35 #if OPAL_HAVE_WEAK_SYMBOLS
  36 #pragma weak MPI_Comm_create_group = PMPI_Comm_create_group
  37 #endif
  38 #define MPI_Comm_create_group PMPI_Comm_create_group
  39 #endif
  40 
  41 static const char FUNC_NAME[] = "MPI_Comm_create_group";
  42 
  43 
  44 int MPI_Comm_create_group (MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm) {
  45     int rc;
  46 
  47     MEMCHECKER(
  48         memchecker_comm(comm);
  49     );
  50 
  51     if ( MPI_PARAM_CHECK ) {
  52         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  53 
  54         if (ompi_comm_invalid (comm))
  55             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
  56                                           FUNC_NAME);
  57 
  58         if (tag < 0 || tag > mca_pml.pml_max_tag)
  59             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TAG,
  60                                           FUNC_NAME);
  61 
  62         if ( NULL == group )
  63             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_GROUP,
  64                                           FUNC_NAME);
  65 
  66         if ( NULL == newcomm )
  67             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG,
  68                                           FUNC_NAME);
  69     }
  70 
  71     if (MPI_GROUP_NULL == group || MPI_UNDEFINED == ompi_group_rank (group)) {
  72         *newcomm = MPI_COMM_NULL;
  73         return MPI_SUCCESS;
  74     }
  75 
  76     OPAL_CR_ENTER_LIBRARY();
  77 
  78     rc = ompi_comm_create_group ((ompi_communicator_t *) comm, (ompi_group_t *) group,
  79                                  tag, (ompi_communicator_t **) newcomm);
  80     OMPI_ERRHANDLER_RETURN (rc, comm, rc, FUNC_NAME);
  81 }

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