Class Jacobi
java.lang.Object
|
+--Task
|
+--Jacobi
- All Implemented Interfaces:
- net.jini.core.entry.Entry, java.io.Serializable
- public final class Jacobi
- extends Task
This class demonstrates the use of JavaSpaces to solve iterative problems
on a regular grid/mesh. Because of the generally high communication needs
of such problems -- and other issues outlined below -- more than anything
else this code shows that JavaSpaces is probably not a good technology
choice for iterative grid solvers. Even if we used known better
algorithms (like red-black SOR, instead of simple Jacobi relaxation) the
communication cost of using JavaSpaces would still be too great. Note,
too, the additional hoops through which one must jump to squeeze out
as much performance as possible:
- using snapshots to retrieve from left/right neighbors
- shadowing the primitive Object wrappers with local primitive
variables (to avoid object reference checks when looping)
- shadowing 2D array contents in 1D arrays, to save 2D array
reference costs
As such this code is considerably more complex than the corresponding C
implementation of SOR given within the cbench directory.
- Author:
- Michael S. Noble (mnoble@cfa.harvard.edu) Copyright (c) 2000
This code may only be used under the terms of GNU General Public License.
- See Also:
- Serialized Form
|
Field Summary |
java.lang.Integer |
N
|
java.lang.Integer |
P
|
net.jini.space.JavaSpace |
space
|
java.lang.Double |
tolerance
|
|
Constructor Summary |
Jacobi()
|
Jacobi(long workerID,
int P,
int N,
double tolerance,
net.jini.space.JavaSpace space)
|
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
P
public java.lang.Integer P
N
public java.lang.Integer N
tolerance
public java.lang.Double tolerance
space
public net.jini.space.JavaSpace space
Jacobi
public Jacobi()
Jacobi
public Jacobi(long workerID,
int P,
int N,
double tolerance,
net.jini.space.JavaSpace space)
compute
public java.lang.Object compute()
- Overrides:
compute in class Task
name
public java.lang.String name()
- Overrides:
name in class Task
mergeResult
public java.lang.Object mergeResult(java.lang.Object meshArray)
- Overrides:
mergeResult in class Task
reportResult
public void reportResult(java.lang.Object result)
- Overrides:
reportResult in class Task