root/ompi/mpi/c/group_translate_ranks.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Group_translate_ranks

   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-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2012-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/group/group.h"
  32 
  33 #if OMPI_BUILD_MPI_PROFILING
  34 #if OPAL_HAVE_WEAK_SYMBOLS
  35 #pragma weak MPI_Group_translate_ranks = PMPI_Group_translate_ranks
  36 #endif
  37 #define MPI_Group_translate_ranks PMPI_Group_translate_ranks
  38 #endif
  39 
  40 static const char FUNC_NAME[] = "MPI_Group_translate_ranks";
  41 
  42 
  43 int MPI_Group_translate_ranks(MPI_Group group1, int n_ranks, const int ranks1[],
  44                               MPI_Group group2, int ranks2[])
  45 {
  46     int err;
  47 
  48     /* check for errors */
  49     if( MPI_PARAM_CHECK ) {
  50         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  51 
  52         if ((MPI_GROUP_NULL == group1) || (MPI_GROUP_NULL == group2) ||
  53             (NULL == group1) || (NULL == group2)) {
  54             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
  55                                           FUNC_NAME);
  56         }
  57         if (n_ranks < 0) {
  58             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
  59                                           FUNC_NAME);
  60         }
  61         if (n_ranks > 0 && ((NULL == ranks1) || (NULL == ranks2 ))) {
  62             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
  63                                           FUNC_NAME);
  64         }
  65     }
  66 
  67     if (0 == n_ranks) {
  68         return MPI_SUCCESS;
  69     }
  70 
  71     OPAL_CR_ENTER_LIBRARY();
  72 
  73     err = ompi_group_translate_ranks ( group1, n_ranks, ranks1,
  74                                        group2, ranks2 );
  75     OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME );
  76 }

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