[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 (c) 2006 Cisco Systems, Inc. All rights reserved. |
---|
| 14 | // $COPYRIGHT$ |
---|
| 15 | // |
---|
| 16 | // Additional copyrights may follow |
---|
| 17 | // |
---|
| 18 | // $HEADER$ |
---|
| 19 | // |
---|
| 20 | |
---|
| 21 | // |
---|
| 22 | // Point-to-Point Communication |
---|
| 23 | // |
---|
| 24 | |
---|
| 25 | inline int |
---|
| 26 | MPI::Status::Get_count(const MPI::Datatype& datatype) const |
---|
| 27 | { |
---|
| 28 | int count; |
---|
| 29 | (void)MPI_Get_count(const_cast<MPI_Status*>(&mpi_status), datatype, &count); |
---|
| 30 | return count; |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | inline bool |
---|
| 34 | MPI::Status::Is_cancelled() const |
---|
| 35 | { |
---|
| 36 | int t; |
---|
| 37 | (void)MPI_Test_cancelled(const_cast<MPI_Status*>(&mpi_status), &t); |
---|
| 38 | return OPAL_INT_TO_BOOL(t); |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | inline int |
---|
| 42 | MPI::Status::Get_elements(const MPI::Datatype& datatype) const |
---|
| 43 | { |
---|
| 44 | int count; |
---|
| 45 | (void)MPI_Get_elements(const_cast<MPI_Status*>(&mpi_status), datatype, &count); |
---|
| 46 | return count; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | // |
---|
| 50 | // Status Access |
---|
| 51 | // |
---|
| 52 | inline int |
---|
| 53 | MPI::Status::Get_source() const |
---|
| 54 | { |
---|
| 55 | int source; |
---|
| 56 | source = mpi_status.MPI_SOURCE; |
---|
| 57 | return source; |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | inline void |
---|
| 61 | MPI::Status::Set_source(int source) |
---|
| 62 | { |
---|
| 63 | mpi_status.MPI_SOURCE = source; |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | inline int |
---|
| 67 | MPI::Status::Get_tag() const |
---|
| 68 | { |
---|
| 69 | int tag; |
---|
| 70 | tag = mpi_status.MPI_TAG; |
---|
| 71 | return tag; |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | inline void |
---|
| 75 | MPI::Status::Set_tag(int tag) |
---|
| 76 | { |
---|
| 77 | mpi_status.MPI_TAG = tag; |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | inline int |
---|
| 81 | MPI::Status::Get_error() const |
---|
| 82 | { |
---|
| 83 | int error; |
---|
| 84 | error = mpi_status.MPI_ERROR; |
---|
| 85 | return error; |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | inline void |
---|
| 89 | MPI::Status::Set_error(int error) |
---|
| 90 | { |
---|
| 91 | mpi_status.MPI_ERROR = error; |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | inline void |
---|
| 95 | MPI::Status::Set_elements(const MPI::Datatype& datatype, int count) |
---|
| 96 | { |
---|
| 97 | MPI_Status_set_elements(&mpi_status, datatype, count); |
---|
| 98 | } |
---|
| 99 | |
---|
| 100 | inline void |
---|
| 101 | MPI::Status::Set_cancelled(bool flag) |
---|
| 102 | { |
---|
| 103 | MPI_Status_set_cancelled(&mpi_status, (int) flag); |
---|
| 104 | } |
---|
| 105 | |
---|