This source file includes following definitions.
- init
- isNull
- isNoProc
- mProbe
- mProbe
- imProbe
- imProbe
- mRecv
- mRecv
- imRecv
- imRecv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 package mpi;
30
31 import java.nio.*;
32 import static mpi.MPI.assertDirectBuffer;
33
34
35
36
37 public final class Message
38 {
39 protected long handle;
40 private static long NULL, NO_PROC;
41
42 static
43 {
44 init();
45 }
46
47 private static native void init();
48
49
50
51
52 public Message()
53 {
54 handle = NULL;
55 }
56
57
58
59
60
61 public boolean isNull()
62 {
63 return handle == NULL;
64 }
65
66
67
68
69
70 public boolean isNoProc()
71 {
72 return handle == NO_PROC;
73 }
74
75
76
77
78
79
80
81
82
83 public Status mProbe(int source, int tag, Comm comm) throws MPIException
84 {
85 MPI.check();
86 Status status = new Status();
87 handle = mProbe(source, tag, comm.handle, status.data);
88 return status;
89 }
90
91 private native long mProbe(int source, int tag, long comm, long[] status)
92 throws MPIException;
93
94
95
96
97
98
99
100
101
102 public Status imProbe(int source, int tag, Comm comm) throws MPIException
103 {
104 MPI.check();
105 return imProbe(source, tag, comm.handle);
106 }
107
108 private native Status imProbe(int source, int tag, long comm)
109 throws MPIException;
110
111
112
113
114
115
116
117
118
119 public Status mRecv(Object buf, int count, Datatype type) throws MPIException
120 {
121 MPI.check();
122 int off = 0;
123 boolean db = false;
124 Status status = new Status();
125
126 if(buf instanceof Buffer && !(db = ((Buffer)buf).isDirect()))
127 {
128 off = type.getOffset(buf);
129 buf = ((Buffer)buf).array();
130 }
131
132 handle = mRecv(handle, buf, db, off, count,
133 type.handle, type.baseType, status.data);
134
135 return status;
136 }
137
138 private native long mRecv(
139 long message, Object buf, boolean db, int offset, int count,
140 long type, int baseType, long[] status) throws MPIException;
141
142
143
144
145
146
147
148
149
150 public Request imRecv(Buffer buf, int count, Datatype type)
151 throws MPIException
152 {
153 MPI.check();
154 assertDirectBuffer(buf);
155 Request req = new Request(imRecv(handle, buf, count, type.handle));
156 req.addRecvBufRef(buf);
157 return req;
158 }
159
160 private native long imRecv(long message, Object buf, int count, long type)
161 throws MPIException;
162
163 }