-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOp.java
More file actions
77 lines (62 loc) · 1.99 KB
/
Copy pathOp.java
File metadata and controls
77 lines (62 loc) · 1.99 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
/*
* File : Op.java
* Author : Xinying Li, Sang LIm
* Created : Thu Apr 9 12:22:15 1998
* Revision : $Revision: 1.11 $
* Updated : $Date: 2003/01/16 16:39:34 $
* Copyright: Northeast Parallel Architectures Center
* at Syracuse University 1998
*/
package mpi;
//import mpi.*;
public class Op extends Freeable {
private final static int NULL = 0;
private final static int MAX = 1;
private final static int MIN = 2;
private final static int SUM = 3;
private final static int PROD = 4;
private final static int LAND = 5;
private final static int BAND = 6;
private final static int LOR = 7;
private final static int BOR = 8;
private final static int LXOR = 9;
private final static int BXOR =10;
private final static int MINLOC=11;
private final static int MAXLOC=12;
private static native void init();
private User_function uf = null ;
protected Op(int Type) { GetOp(Type);}
/**
* Bind a user-defined global reduction operation to an <tt>Op</tt> object.
* <p>
* <table>
* <tr><td><tt> function </tt></td><td> user defined function </tr>
* <tr><td><tt> commute </tt></td><td> <tt>true</tt> if commutative,
* <tt>false</tt> otherwise </tr>
* </table>
* <p>
* Java binding of the MPI operation <tt>MPI_OP_CREATE</tt>.
*/
public Op(User_function function, boolean commute) throws MPIException {
uf = function;
}
protected boolean isUser() {
return uf != null ;
}
public final void Call(Object invec, int inoffset,
Object outvec, int outoffset,
int count, Datatype datatype) {
uf.Call(invec, inoffset, outvec, outoffset, count, datatype);
}
private native void GetOp(int Type);
protected long handle ;
public void finalize() throws MPIException {
synchronized(MPI.class) {
MPI.freeList.addFirst(this) ;
}
}
native void free() ;
static {
init();
}
}