OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

status.h
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-2008 Cisco Systems, Inc. All rights reserved.
14 // $COPYRIGHT$
15 //
16 // Additional copyrights may follow
17 //
18 // $HEADER$
19 //
20
21
22 class Status {
23 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
24 // friend class PMPI::Status;
25 #endif
26 friend class MPI::Comm; //so I can access pmpi_status data member in comm.cc
27 friend class MPI::Request; //and also from request.cc
28 #if OMPI_PROVIDE_MPI_FILE_INTERFACE
29 friend class MPI::File;
30 #endif
31
32 public:
33 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
34
35 // construction / destruction
36 Status() { }
37 virtual ~Status() {}
38
39 // copy / assignment
40 Status(const Status& data) : pmpi_status(data.pmpi_status) { }
41
42 Status(const MPI_Status &i) : pmpi_status(i) { }
43
44 Status& operator=(const Status& data) {
45 pmpi_status = data.pmpi_status; return *this; }
46
47 // comparison, don't need for status
48
49 // inter-language operability
50 Status& operator= (const MPI_Status &i) {
51 pmpi_status = i; return *this; }
52 operator MPI_Status () const { return pmpi_status; }
53 // operator MPI_Status* () const { return pmpi_status; }
54 operator const PMPI::Status&() const { return pmpi_status; }
55
56 #else
57
58 Status() : mpi_status() { }
59 // copy
60 Status(const Status& data) : mpi_status(data.mpi_status) { }
61
62 Status(const MPI_Status &i) : mpi_status(i) { }
63
64 virtual ~Status() {}
65
66 Status& operator=(const Status& data) {
67 mpi_status = data.mpi_status; return *this; }
68
69 // comparison, don't need for status
70
71 // inter-language operability
72 Status& operator= (const MPI_Status &i) {
73 mpi_status = i; return *this; }
74 operator MPI_Status () const { return mpi_status; }
75 // operator MPI_Status* () const { return (MPI_Status*)&mpi_status; }
76
77 #endif
78
79 //
80 // Point-to-Point Communication
81 //
82
83 virtual int Get_count(const Datatype& datatype) const;
84
85 virtual bool Is_cancelled() const;
86
87 virtual int Get_elements(const Datatype& datatype) const;
88
89 //
90 // Status Access
91 //
92 virtual int Get_source() const;
93
94 virtual void Set_source(int source);
95
96 virtual int Get_tag() const;
97
98 virtual void Set_tag(int tag);
99
100 virtual int Get_error() const;
101
102 virtual void Set_error(int error);
103
104 virtual void Set_elements(const MPI::Datatype& datatype, int count);
105
106 virtual void Set_cancelled(bool flag);
107
108 protected:
109 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
110 PMPI::Status pmpi_status;
111 #else
112 MPI_Status mpi_status;
113 #endif
114
115 };
Datatype
Definition: datatype.h:24
Status
Definition: status.h:22
ompi_status_public_t
Definition: mpi.h:337