source: proiecte/hpl/openmpi_compiled/include/openmpi/ompi/mpi/cxx/group_inln.h @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

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