root/ompi/mpi/cxx/group_inln.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. Get_size
  2. Get_rank
  3. Translate_ranks
  4. Compare
  5. Union
  6. Intersect
  7. Difference
  8. Incl
  9. Excl
  10. Range_incl
  11. Range_excl
  12. Free

   1 // -*- c++ -*-
   2 //
   3 // Copyright (c) 2004-2005 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) 2016 Cisco Systems, Inc.  All rights reserved.
  14 // $COPYRIGHT$
  15 //
  16 // Additional copyrights may follow
  17 //
  18 // $HEADER$
  19 //
  20 
  21 //
  22 // Groups, Contexts, and Communicators
  23 //
  24 
  25 inline int
  26 MPI::Group::Get_size() const
  27 {
  28   int size;
  29   (void)MPI_Group_size(mpi_group, &size);
  30   return size;
  31 }
  32 
  33 inline int
  34 MPI::Group::Get_rank() const
  35 {
  36   int myrank;
  37   (void)MPI_Group_rank(mpi_group, &myrank);
  38   return myrank;
  39 }
  40 
  41 inline void
  42 MPI::Group::Translate_ranks (const MPI::Group& group1, int n,
  43                                     const int ranks1[],
  44                                     const MPI::Group& group2, int ranks2[])
  45 {
  46   (void)MPI_Group_translate_ranks(group1, n, const_cast<int *>(ranks1), group2, const_cast<int *>(ranks2));
  47 }
  48 
  49 inline int
  50 MPI::Group::Compare(const MPI::Group& group1, const MPI::Group& group2)
  51 {
  52   int result;
  53   (void)MPI_Group_compare(group1, group2, &result);
  54   return result;
  55 }
  56 
  57 inline MPI::Group
  58 MPI::Group::Union(const MPI::Group &group1, const MPI::Group &group2)
  59 {
  60   MPI_Group newgroup;
  61   (void)MPI_Group_union(group1, group2, &newgroup);
  62   return newgroup;
  63 }
  64 
  65 inline MPI::Group
  66 MPI::Group::Intersect(const MPI::Group &group1, const MPI::Group &group2)
  67 {
  68   MPI_Group newgroup;
  69   (void)MPI_Group_intersection( group1,  group2, &newgroup);
  70   return newgroup;
  71 }
  72 
  73 inline MPI::Group
  74 MPI::Group::Difference(const MPI::Group &group1, const MPI::Group &group2)
  75 {
  76   MPI_Group newgroup;
  77   (void)MPI_Group_difference(group1, group2, &newgroup);
  78   return newgroup;
  79 }
  80 
  81 inline MPI::Group
  82 MPI::Group::Incl(int n, const int ranks[]) const
  83 {
  84   MPI_Group newgroup;
  85   (void)MPI_Group_incl(mpi_group, n, const_cast<int *>(ranks), &newgroup);
  86   return newgroup;
  87 }
  88 
  89 inline MPI::Group
  90 MPI::Group::Excl(int n, const int ranks[]) const
  91 {
  92   MPI_Group newgroup;
  93   (void)MPI_Group_excl(mpi_group, n, const_cast<int *>(ranks), &newgroup);
  94   return newgroup;
  95 }
  96 
  97 inline MPI::Group
  98 MPI::Group::Range_incl(int n, const int ranges[][3]) const
  99 {
 100   MPI_Group newgroup;
 101   (void)MPI_Group_range_incl(mpi_group, n,
 102 #if OMPI_CXX_SUPPORTS_2D_CONST_CAST
 103                              const_cast<int(*)[3]>(ranges),
 104 #else
 105                              (int(*)[3]) ranges,
 106 #endif
 107                              &newgroup);
 108   return newgroup;
 109 }
 110 
 111 inline MPI::Group
 112 MPI::Group::Range_excl(int n, const int ranges[][3]) const
 113 {
 114   MPI_Group newgroup;
 115   (void)MPI_Group_range_excl(mpi_group, n,
 116 #if OMPI_CXX_SUPPORTS_2D_CONST_CAST
 117                              const_cast<int(*)[3]>(ranges),
 118 #else
 119                              (int(*)[3]) ranges,
 120 #endif
 121                              &newgroup);
 122   return newgroup;
 123 }
 124 
 125 inline void
 126 MPI::Group::Free()
 127 {
 128   (void)MPI_Group_free(&mpi_group);
 129 }

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