|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaseis.parallel.UniprocessorContext
public class UniprocessorContext
Constructor Summary | |
---|---|
UniprocessorContext()
|
Method Summary | ||
---|---|---|
void |
barrier()
Parallel barrier that requires all tasks to particpate. |
|
|
bcast(int tag,
T a,
int offset,
int count,
int sender)
Broadcast a message to all tasks in this parallel context |
|
void |
bcastByte(int tag,
byte[] a,
int offset,
int count,
int sender)
|
|
void |
bcastDouble(int tag,
double[] a,
int offset,
int count,
int sender)
|
|
void |
bcastFloat(int tag,
float[] a,
int offset,
int count,
int sender)
|
|
void |
bcastInt(int tag,
int[] a,
int offset,
int count,
int sender)
|
|
void |
bcastLong(int tag,
long[] a,
int offset,
int count,
int sender)
|
|
void |
bcastShort(int tag,
short[] a,
int offset,
int count,
int sender)
|
|
|
collect(T a,
int aoffset,
T b,
int boffset,
int count)
Collect an array from all tasks and concatenate on the master task |
|
byte[] |
collectByte(byte a)
Collect a scalar from all tasks into an array and return to all |
|
void |
collectByte(byte[] a,
int aoffset,
byte[] b,
int boffset,
int count)
|
|
double[] |
collectDouble(double a)
|
|
void |
collectDouble(double[] a,
int aoffset,
double[] b,
int boffset,
int count)
|
|
float[] |
collectFloat(float a)
|
|
void |
collectFloat(float[] a,
int aoffset,
float[] b,
int boffset,
int count)
|
|
int[] |
collectInt(int a)
|
|
void |
collectInt(int[] a,
int aoffset,
int[] b,
int boffset,
int count)
|
|
long[] |
collectLong(long a)
|
|
void |
collectLong(long[] a,
int aoffset,
long[] b,
int boffset,
int count)
|
|
short[] |
collectShort(short a)
|
|
void |
collectShort(short[] a,
int aoffset,
short[] b,
int boffset,
int count)
|
|
void |
finish()
Complete participation in the parallel context |
|
|
globalMax(T a,
int aoffset,
T b,
int boffset,
int count)
|
|
void |
globalMaxByte(byte[] a,
int aoffset,
byte[] b,
int boffset,
int count)
|
|
void |
globalMaxDouble(double[] a,
int aoffset,
double[] b,
int boffset,
int count)
|
|
void |
globalMaxFloat(float[] a,
int aoffset,
float[] b,
int boffset,
int count)
|
|
void |
globalMaxInt(int[] a,
int aoffset,
int[] b,
int boffset,
int count)
|
|
void |
globalMaxLong(long[] a,
int aoffset,
long[] b,
int boffset,
int count)
|
|
void |
globalMaxShort(short[] a,
int aoffset,
short[] b,
int boffset,
int count)
|
|
|
globalMin(T a,
int aoffset,
T b,
int boffset,
int count)
|
|
void |
globalMinByte(byte[] a,
int aoffset,
byte[] b,
int boffset,
int count)
|
|
void |
globalMinDouble(double[] a,
int aoffset,
double[] b,
int boffset,
int count)
|
|
void |
globalMinFloat(float[] a,
int aoffset,
float[] b,
int boffset,
int count)
|
|
void |
globalMinInt(int[] a,
int aoffset,
int[] b,
int boffset,
int count)
|
|
void |
globalMinLong(long[] a,
int aoffset,
long[] b,
int boffset,
int count)
|
|
void |
globalMinShort(short[] a,
int aoffset,
short[] b,
int boffset,
int count)
|
|
|
globalSum(T a,
int aoffset,
T b,
int boffset,
int count)
Global operations across tasks in a ParallelContext Operations are provided for Sum, Min, and Max. |
|
void |
globalSumByte(byte[] a,
int aoffset,
byte[] b,
int boffset,
int count)
|
|
void |
globalSumDouble(double[] a,
int aoffset,
double[] b,
int boffset,
int count)
|
|
void |
globalSumFloat(float[] a,
int aoffset,
float[] b,
int boffset,
int count)
|
|
void |
globalSumInt(int[] a,
int aoffset,
int[] b,
int boffset,
int count)
|
|
void |
globalSumLong(long[] a,
int aoffset,
long[] b,
int boffset,
int count)
|
|
void |
globalSumShort(short[] a,
int aoffset,
short[] b,
int boffset,
int count)
|
|
boolean |
init(java.lang.String[] args)
Return true if this is the "master" task for master/slave style algorithms |
|
boolean |
isMaster()
Initialize the parallel context using mpiJava |
|
static void |
main(java.lang.String[] args)
|
|
void |
masterPrint(java.lang.String s)
Print a string from the rank 0 task only A barrier is invoked, so all tasks must participate in the call to this method. |
|
int |
rank()
Return the rank (task index) of this task in the parallel context |
|
|
recv(int tag,
T a,
int offset,
int count)
Receive a message from another task in this parallel context |
|
void |
recvByte(int tag,
byte[] a,
int offset,
int count)
|
|
void |
recvDouble(int tag,
double[] a,
int offset,
int count)
|
|
void |
recvFloat(int tag,
float[] a,
int offset,
int count)
|
|
void |
recvInt(int tag,
int[] a,
int offset,
int count)
|
|
void |
recvLong(int tag,
long[] a,
int offset,
int count)
|
|
void |
recvShort(int tag,
short[] a,
int offset,
int count)
|
|
|
send(int tag,
T a,
int offset,
int count,
int dest)
Send a message to another task in this parallel context |
|
void |
sendByte(int tag,
byte[] a,
int offset,
int count,
int dest)
|
|
void |
sendDouble(int tag,
double[] a,
int offset,
int count,
int dest)
|
|
void |
sendFloat(int tag,
float[] a,
int offset,
int count,
int dest)
|
|
void |
sendInt(int tag,
int[] a,
int offset,
int count,
int dest)
|
|
void |
sendLong(int tag,
long[] a,
int offset,
int count,
int dest)
|
|
void |
sendShort(int tag,
short[] a,
int offset,
int count,
int dest)
|
|
void |
serialPrint(java.lang.String s)
Serialize printing a string from all tasks, so that one line at a time is printed A barrier is invoked, so all tasks must participate in the call to this method. |
|
|
shift(int nshift,
T a,
int offset,
int count,
T buf)
Shift an array of primitive or objects types across tasks in a parallel context |
|
void |
shiftByte(int nshift,
byte[] a,
int offset,
int count,
byte[] buf)
|
|
void |
shiftDouble(int nshift,
double[] a,
int offset,
int count,
double[] buf)
|
|
void |
shiftFloat(int nshift,
float[] a,
int offset,
int count,
float[] buf)
|
|
void |
shiftInt(int nshift,
int[] a,
int offset,
int count,
int[] buf)
|
|
void |
shiftLong(int nshift,
long[] a,
int offset,
int count,
long[] buf)
|
|
void |
shiftShort(int nshift,
short[] a,
int offset,
int count,
short[] buf)
|
|
int |
size()
Return the size (total number of tasks) in the parallel context |
|
|
ttran(int tileSize,
T a,
int offset,
T buf)
Transpose a "tiled" array across tasks in this parallel context. |
|
void |
ttranByte(int tileSize,
byte[] a,
int offset,
byte[] buf)
|
|
void |
ttranDouble(int tileSize,
double[] a,
int offset,
double[] buf)
|
|
void |
ttranFloat(int tileSize,
float[] a,
int offset,
float[] buf)
|
|
void |
ttranInt(int tileSize,
int[] a,
int offset,
int[] buf)
|
|
void |
ttranLong(int tileSize,
long[] a,
int offset,
long[] buf)
|
|
void |
ttranShort(int tileSize,
short[] a,
int offset,
short[] buf)
|
|
|
ttranv(int[] lena,
int[] aoffset,
T[] a,
int[] lenb,
int[] boffset,
T[] b)
|
|
void |
ttranvInit(int[] lena,
int[] aoffset,
int[] lenb,
int[] boffset)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UniprocessorContext()
Method Detail |
---|
public void barrier()
IParallelContext
barrier
in interface IParallelContext
IParallelContext.barrier()
public <T> void bcast(int tag, T a, int offset, int count, int sender)
IParallelContext
bcast
in interface IParallelContext
a
- array containing data to be sentoffset
- offset into array where broadcast will startcount
- count of elements to be sentsender
- rank of the source for this broadcastorg.javaseis.parallel.IParallelContext#bcast(int, T, int, int,
int)
public void bcastByte(int tag, byte[] a, int offset, int count, int sender)
bcastByte
in interface IParallelContext
public void bcastDouble(int tag, double[] a, int offset, int count, int sender)
bcastDouble
in interface IParallelContext
public void bcastFloat(int tag, float[] a, int offset, int count, int sender)
bcastFloat
in interface IParallelContext
public void bcastInt(int tag, int[] a, int offset, int count, int sender)
bcastInt
in interface IParallelContext
public void bcastLong(int tag, long[] a, int offset, int count, int sender)
bcastLong
in interface IParallelContext
public void bcastShort(int tag, short[] a, int offset, int count, int sender)
bcastShort
in interface IParallelContext
public <T> void collect(T a, int aoffset, T b, int boffset, int count)
IParallelContext
collect
in interface IParallelContext
a
- source arrayaoffset
- offset within source array for the operationb
- result array, length size*count, where size is the context sizeboffset
- offset in the result array where results are placedcount
- number of elements to collect from each task. Output array
b will have count*ParallelContext.size() elements on output.
Methods support object and primitive types.public byte[] collectByte(byte a)
IParallelContext
collectByte
in interface IParallelContext
a
- input scalar
public void collectByte(byte[] a, int aoffset, byte[] b, int boffset, int count)
collectByte
in interface IParallelContext
public double[] collectDouble(double a)
collectDouble
in interface IParallelContext
public void collectDouble(double[] a, int aoffset, double[] b, int boffset, int count)
collectDouble
in interface IParallelContext
public float[] collectFloat(float a)
collectFloat
in interface IParallelContext
public void collectFloat(float[] a, int aoffset, float[] b, int boffset, int count)
collectFloat
in interface IParallelContext
public int[] collectInt(int a)
collectInt
in interface IParallelContext
public void collectInt(int[] a, int aoffset, int[] b, int boffset, int count)
collectInt
in interface IParallelContext
public long[] collectLong(long a)
collectLong
in interface IParallelContext
public void collectLong(long[] a, int aoffset, long[] b, int boffset, int count)
collectLong
in interface IParallelContext
public short[] collectShort(short a)
collectShort
in interface IParallelContext
public void collectShort(short[] a, int aoffset, short[] b, int boffset, int count)
collectShort
in interface IParallelContext
public void finish()
IParallelContext
finish
in interface IParallelContext
IParallelContext.finish()
public <T> void globalMax(T a, int aoffset, T b, int boffset, int count)
globalMax
in interface IParallelContext
public void globalMaxByte(byte[] a, int aoffset, byte[] b, int boffset, int count)
globalMaxByte
in interface IParallelContext
public void globalMaxDouble(double[] a, int aoffset, double[] b, int boffset, int count)
globalMaxDouble
in interface IParallelContext
public void globalMaxFloat(float[] a, int aoffset, float[] b, int boffset, int count)
globalMaxFloat
in interface IParallelContext
public void globalMaxInt(int[] a, int aoffset, int[] b, int boffset, int count)
globalMaxInt
in interface IParallelContext
public void globalMaxLong(long[] a, int aoffset, long[] b, int boffset, int count)
globalMaxLong
in interface IParallelContext
public void globalMaxShort(short[] a, int aoffset, short[] b, int boffset, int count)
globalMaxShort
in interface IParallelContext
public <T> void globalMin(T a, int aoffset, T b, int boffset, int count)
globalMin
in interface IParallelContext
public void globalMinByte(byte[] a, int aoffset, byte[] b, int boffset, int count)
globalMinByte
in interface IParallelContext
public void globalMinDouble(double[] a, int aoffset, double[] b, int boffset, int count)
globalMinDouble
in interface IParallelContext
public void globalMinFloat(float[] a, int aoffset, float[] b, int boffset, int count)
globalMinFloat
in interface IParallelContext
public void globalMinInt(int[] a, int aoffset, int[] b, int boffset, int count)
globalMinInt
in interface IParallelContext
public void globalMinLong(long[] a, int aoffset, long[] b, int boffset, int count)
globalMinLong
in interface IParallelContext
public void globalMinShort(short[] a, int aoffset, short[] b, int boffset, int count)
globalMinShort
in interface IParallelContext
public <T> void globalSum(T a, int aoffset, T b, int boffset, int count)
IParallelContext
globalSum
in interface IParallelContext
aoffset
- offset in input array at which to begin the operationb
- output array containing result across tasksboffset
- offset in output array where results will be placedcount
- number of elements to operate onpublic void globalSumByte(byte[] a, int aoffset, byte[] b, int boffset, int count)
globalSumByte
in interface IParallelContext
public void globalSumDouble(double[] a, int aoffset, double[] b, int boffset, int count)
globalSumDouble
in interface IParallelContext
public void globalSumFloat(float[] a, int aoffset, float[] b, int boffset, int count)
globalSumFloat
in interface IParallelContext
public void globalSumInt(int[] a, int aoffset, int[] b, int boffset, int count)
globalSumInt
in interface IParallelContext
public void globalSumLong(long[] a, int aoffset, long[] b, int boffset, int count)
globalSumLong
in interface IParallelContext
public void globalSumShort(short[] a, int aoffset, short[] b, int boffset, int count)
globalSumShort
in interface IParallelContext
public boolean init(java.lang.String[] args)
IParallelContext
init
in interface IParallelContext
org.javaseis.parallel.IParallelContext#init()
public boolean isMaster()
IParallelContext
isMaster
in interface IParallelContext
org.javaseis.parallel.IParallelContext#init()
public static void main(java.lang.String[] args)
args
- public void masterPrint(java.lang.String s)
IParallelContext
masterPrint
in interface IParallelContext
s
- string to be printedpublic int rank()
IParallelContext
rank
in interface IParallelContext
IParallelContext.rank()
public <T> void recv(int tag, T a, int offset, int count)
IParallelContext
recv
in interface IParallelContext
tag
- unique integer tag for this messagea
- array to receive dataoffset
- offset into array where receive will startcount
- maximum count of elements to be receivedorg.javaseis.parallel.IParallelContext#recv(int, T, int, int)
public void recvByte(int tag, byte[] a, int offset, int count)
recvByte
in interface IParallelContext
public void recvDouble(int tag, double[] a, int offset, int count)
recvDouble
in interface IParallelContext
public void recvFloat(int tag, float[] a, int offset, int count)
recvFloat
in interface IParallelContext
public void recvInt(int tag, int[] a, int offset, int count)
recvInt
in interface IParallelContext
public void recvLong(int tag, long[] a, int offset, int count)
recvLong
in interface IParallelContext
public void recvShort(int tag, short[] a, int offset, int count)
recvShort
in interface IParallelContext
public <T> void send(int tag, T a, int offset, int count, int dest)
IParallelContext
send
in interface IParallelContext
tag
- unique integer tag for this messagea
- array containing data to be sentoffset
- offset into array where send will startcount
- count of elements to be sentdest
- rank of the destination for this messageorg.javaseis.parallel.IParallelContext#send(int, T, int, int, int)
public void sendByte(int tag, byte[] a, int offset, int count, int dest)
sendByte
in interface IParallelContext
public void sendDouble(int tag, double[] a, int offset, int count, int dest)
sendDouble
in interface IParallelContext
public void sendFloat(int tag, float[] a, int offset, int count, int dest)
sendFloat
in interface IParallelContext
public void sendInt(int tag, int[] a, int offset, int count, int dest)
sendInt
in interface IParallelContext
public void sendLong(int tag, long[] a, int offset, int count, int dest)
sendLong
in interface IParallelContext
public void sendShort(int tag, short[] a, int offset, int count, int dest)
sendShort
in interface IParallelContext
public void serialPrint(java.lang.String s)
IParallelContext
serialPrint
in interface IParallelContext
s
- string to be printedpublic <T> void shift(int nshift, T a, int offset, int count, T buf)
IParallelContext
shift
in interface IParallelContext
a
- input array of objects or primitive types to be shiftedoffset
- offset into array a that the shift will be performed uponcount
- number of array elements to shiftbuf
- a matching array to input array a, at least count elements in lengthorg.javaseis.parallel.IParallelContext#shift(int, T, int, int)
public void shiftByte(int nshift, byte[] a, int offset, int count, byte[] buf)
shiftByte
in interface IParallelContext
public void shiftDouble(int nshift, double[] a, int offset, int count, double[] buf)
shiftDouble
in interface IParallelContext
public void shiftFloat(int nshift, float[] a, int offset, int count, float[] buf)
shiftFloat
in interface IParallelContext
public void shiftInt(int nshift, int[] a, int offset, int count, int[] buf)
shiftInt
in interface IParallelContext
public void shiftLong(int nshift, long[] a, int offset, int count, long[] buf)
shiftLong
in interface IParallelContext
public void shiftShort(int nshift, short[] a, int offset, int count, short[] buf)
shiftShort
in interface IParallelContext
public int size()
IParallelContext
size
in interface IParallelContext
IParallelContext.size()
public <T> void ttran(int tileSize, T a, int offset, T buf)
IParallelContext
ttran
in interface IParallelContext
tileSize
- size of the tile for the transposea
- array containing data to be transposedoffset
- index of start position in array a for transposebuf
- array of matching type of length "tileSize" used as work spacepublic void ttranByte(int tileSize, byte[] a, int offset, byte[] buf)
ttranByte
in interface IParallelContext
public void ttranDouble(int tileSize, double[] a, int offset, double[] buf)
ttranDouble
in interface IParallelContext
public void ttranFloat(int tileSize, float[] a, int offset, float[] buf)
ttranFloat
in interface IParallelContext
public void ttranInt(int tileSize, int[] a, int offset, int[] buf)
ttranInt
in interface IParallelContext
public void ttranLong(int tileSize, long[] a, int offset, long[] buf)
ttranLong
in interface IParallelContext
public void ttranShort(int tileSize, short[] a, int offset, short[] buf)
ttranShort
in interface IParallelContext
public <T> void ttranv(int[] lena, int[] aoffset, T[] a, int[] lenb, int[] boffset, T[] b)
ttranv
in interface IParallelContext
public void ttranvInit(int[] lena, int[] aoffset, int[] lenb, int[] boffset)
ttranvInit
in interface IParallelContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |