[97] | 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 | inline MPI::Intercomm |
---|
| 21 | MPI::Intercomm::Dup() const |
---|
| 22 | { |
---|
| 23 | MPI_Comm newcomm; |
---|
| 24 | (void)MPI_Comm_dup(mpi_comm, &newcomm); |
---|
| 25 | return newcomm; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | inline MPI::Intercomm& |
---|
| 29 | MPI::Intercomm::Clone() const |
---|
| 30 | { |
---|
| 31 | MPI_Comm newcomm; |
---|
| 32 | (void)MPI_Comm_dup(mpi_comm, &newcomm); |
---|
| 33 | MPI::Intercomm* dup = new MPI::Intercomm(newcomm); |
---|
| 34 | return *dup; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | inline int |
---|
| 38 | MPI::Intercomm::Get_remote_size() const |
---|
| 39 | { |
---|
| 40 | int size; |
---|
| 41 | (void)MPI_Comm_remote_size(mpi_comm, &size); |
---|
| 42 | return size; |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | inline MPI::Group |
---|
| 46 | MPI::Intercomm::Get_remote_group() const |
---|
| 47 | { |
---|
| 48 | MPI_Group group; |
---|
| 49 | (void)MPI_Comm_remote_group(mpi_comm, &group); |
---|
| 50 | return group; |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | inline MPI::Intracomm |
---|
| 54 | MPI::Intercomm::Merge(bool high) |
---|
| 55 | { |
---|
| 56 | MPI_Comm newcomm; |
---|
| 57 | (void)MPI_Intercomm_merge(mpi_comm, (int)high, &newcomm); |
---|
| 58 | return newcomm; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | // |
---|
| 63 | // Extended Collective Operations |
---|
| 64 | // |
---|
| 65 | |
---|
| 66 | inline MPI::Intercomm |
---|
| 67 | MPI::Intercomm::Create(const Group& group) const |
---|
| 68 | { |
---|
| 69 | MPI_Comm newcomm; |
---|
| 70 | (void) MPI_Comm_create(mpi_comm, (MPI_Group) group, &newcomm); |
---|
| 71 | return newcomm; |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | inline MPI::Intercomm |
---|
| 75 | MPI::Intercomm::Split(int color, int key) const |
---|
| 76 | { |
---|
| 77 | MPI_Comm newcomm; |
---|
| 78 | (void) MPI_Comm_split(mpi_comm, color, key, &newcomm); |
---|
| 79 | return newcomm; |
---|
| 80 | } |
---|