-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatus.java
More file actions
107 lines (83 loc) · 2.57 KB
/
Copy pathStatus.java
File metadata and controls
107 lines (83 loc) · 2.57 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* File : Status.java
* Author : Sang Lim, Sung-Hoon Ko, Xinying Li, Bryan Carpenter
* Created : Thu Apr 9 12:22:15 1998
* Revision : $Revision: 1.15 $
* Updated : $Date: 2003/01/16 16:39:34 $
* Copyright: Northeast Parallel Architectures Center
* at Syracuse University 1998
*/
package mpi;
public class Status extends Freeable {
public int index;
public int source;
public int tag;
int elements;
//protected int count;
protected int object_count;
// protected Status(long _handle) { handle = _handle;}
public Status() {alloc() ;}
private native void alloc() ;
public void finalize() throws MPIException {
synchronized(MPI.class) {
MPI.freeList.addFirst(this) ;
}
}
native void free() ;
/**
* Get the number of received entries.
* <p>
* <table>
* <tr><td><tt> datatype </tt></td><td> datatype of each item in receive
* buffer </tr>
* <tr><td><em> returns: </em></td><td> number of received entries </tr>
* </table>
* <p>
* Java binding of the MPI operation <tt>MPI_GET_COUNT</tt>.
*/
public int Get_count(Datatype datatype) throws MPIException {
if (datatype.isObject())
return object_count; // Is this correct?
else
return get_count(datatype);
}
private native int get_count(Datatype datatype);
/**
* Test if communication was cancelled.
* <p>
* <table>
* <tr><td><em> returns: </em></td><td> true if the operation was
* succesfully cancelled,
* false otherwise
* </table>
* <p>
* Java binding of the MPI operation <tt>MPI_TEST_CANCELLED</tt>.
*/
public native boolean Test_cancelled() throws MPIException ;
/**
* Retrieve number of basic elements from status.
* <p>
* <table>
* <tr><td><tt> datatype </tt></td><td> datatype used by receive
* operation </tr>
* <tr><td><em> returns: </em></td><td> number of received basic
* elements </tr>
* </table>
* <p>
* Java binding of the MPI operation <tt>MPI_GET_ELEMENTS</tt>.
*/
public int Get_elements(Datatype datatype) throws MPIException {
if(datatype.isObject())
return MPI.UNDEFINED; // Is this correct?
else
return get_elements(datatype) ;
}
private native int get_elements(Datatype datatype);
private static native void init();
protected long handle;
static {
init();
}
}
// Things to do
//