|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaseis.parallel.MPIContext
public class MPIContext
Constructor Summary | |
---|---|
MPIContext()
|
Method Summary | ||
---|---|---|
void |
barrier()
Parallel barrier that requires all tasks to particpate. |
|
|
bcast(int type,
T buf,
int offset,
int count,
int sender)
Broadcast a message to all tasks in this parallel context |
|
void |
bcastByte(int type,
byte[] buf,
int offset,
int count,
int sender)
|
|
void |
bcastDouble(int type,
double[] buf,
int offset,
int count,
int sender)
|
|
void |
bcastFloat(int type,
float[] buf,
int offset,
int count,
int sender)
|
|
void |
bcastInt(int type,
int[] buf,
int offset,
int count,
int sender)
|
|
void |
bcastLong(int type,
long[] buf,
int offset,
int count,
int sender)
|
|
void |
bcastShort(int type,
short[] buf,
int offset,
int count,
int sender)
|
|
|
binaryTree(int len,
T buf,
int startOffset)
Binary tree broadcast operation. |
|
|
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 ai)
Collect a scalar from all tasks into an array returned to all tasks |
|
void |
collectByte(byte[] a,
int aoffset,
byte[] b,
int boffset,
int count)
|
|
double[] |
collectDouble(double ai)
|
|
void |
collectDouble(double[] a,
int aoffset,
double[] b,
int boffset,
int count)
|
|
float[] |
collectFloat(float ai)
|
|
void |
collectFloat(float[] a,
int aoffset,
float[] b,
int boffset,
int count)
|
|
int[] |
collectInt(int ai)
|
|
void |
collectInt(int[] a,
int aoffset,
int[] b,
int boffset,
int count)
|
|
long[] |
collectLong(long ai)
|
|
void |
collectLong(long[] a,
int aoffset,
long[] b,
int boffset,
int count)
|
|
short[] |
collectShort(short ai)
|
|
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(Intracomm commGroup)
Initialize the parellel context using Intracomm rather than calling MPI.Init() so that this can be created from an application that is already running MPI. |
|
boolean |
init(java.lang.String[] args)
Initialize the parallel context using mpiJava |
|
boolean |
isMaster()
Return true if this task is the "master" |
|
static void |
main(java.lang.String[] args)
Simple test harness |
|
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 buf,
int offset,
int count)
Receive a message from another task in this parallel context |
|
void |
recvByte(int tag,
byte[] buf,
int offset,
int count)
|
|
void |
recvDouble(int tag,
double[] buf,
int offset,
int count)
|
|
void |
recvFloat(int tag,
float[] buf,
int offset,
int count)
|
|
void |
recvInt(int tag,
int[] buf,
int offset,
int count)
|
|
void |
recvLong(int tag,
long[] buf,
int offset,
int count)
|
|
void |
recvShort(int tag,
short[] buf,
int offset,
int count)
|
|
|
send(int tag,
T buf,
int offset,
int count,
int dest)
Send a message to another task in this parallel context |
|
void |
sendByte(int tag,
byte[] buf,
int offset,
int count,
int dest)
|
|
void |
sendDouble(int tag,
double[] buf,
int offset,
int count,
int dest)
|
|
void |
sendFloat(int tag,
float[] buf,
int offset,
int count,
int dest)
|
|
void |
sendInt(int tag,
int[] buf,
int offset,
int count,
int dest)
|
|
void |
sendLong(int tag,
long[] buf,
int offset,
int count,
int dest)
|
|
void |
sendShort(int tag,
short[] buf,
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)
(non-Javadoc) |
|
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)
|
|
|
shiftPrimitive(Datatype type,
int nshift,
java.lang.Object a,
int offset,
int count,
java.lang.Object buf)
Shift an array of primitive or objects types across tasks in a parallel context |
|
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 startOffset,
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)
Transpose for variable length tiles. |
|
void |
ttranvInit(int[] lena,
int[] aoffset,
int[] lenb,
int[] boffset)
Calulate output lengths of tiles for variable length tiled transpose. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MPIContext()
Method Detail |
---|
public void barrier()
barrier
in interface IParallelContext
IParallelContext.barrier()
public <T> void bcast(int type, T buf, int offset, int count, int sender)
bcast
in interface IParallelContext
tag
- unique integer tag for this messagebuf
- 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 type, byte[] buf, int offset, int count, int sender)
bcastByte
in interface IParallelContext
public void bcastDouble(int type, double[] buf, int offset, int count, int sender)
bcastDouble
in interface IParallelContext
public void bcastFloat(int type, float[] buf, int offset, int count, int sender)
bcastFloat
in interface IParallelContext
public void bcastInt(int type, int[] buf, int offset, int count, int sender)
bcastInt
in interface IParallelContext
public void bcastLong(int type, long[] buf, int offset, int count, int sender)
bcastLong
in interface IParallelContext
public void bcastShort(int type, short[] buf, int offset, int count, int sender)
bcastShort
in interface IParallelContext
public <T> void binaryTree(int len, T buf, int startOffset)
len
- number of elements in the buffer to broadcastbuf
- object array containing data for the broadcaststartOffset
- location in buffer for the broadcastpublic <T> void collect(T a, int aoffset, T b, int boffset, int count)
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 ai)
collectByte
in interface IParallelContext
ai
- input scalar
public void collectByte(byte[] a, int aoffset, byte[] b, int boffset, int count)
collectByte
in interface IParallelContext
public double[] collectDouble(double ai)
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 ai)
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 ai)
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 ai)
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 ai)
collectShort
in interface IParallelContext
public void collectShort(short[] a, int aoffset, short[] b, int boffset, int count)
collectShort
in interface IParallelContext
public void finish()
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(Intracomm commGroup)
init
in interface IParallelContext
org.javaseis.parallel.IParallelContext#init()
public boolean init(java.lang.String[] args)
init
in interface IParallelContext
args
- command line argument strings
org.javaseis.parallel.IParallelContext#init()
public boolean isMaster()
isMaster
in interface IParallelContext
org.javaseis.parallel.IParallelContext#init()
public static void main(java.lang.String[] args) throws MPIException
args
-
MPIException
public void masterPrint(java.lang.String s)
masterPrint
in interface IParallelContext
s
- string to be printedpublic int rank()
rank
in interface IParallelContext
IParallelContext.rank()
public <T> void recv(int tag, T buf, int offset, int count)
recv
in interface IParallelContext
tag
- unique integer tag for this messagebuf
- 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[] buf, int offset, int count)
recvByte
in interface IParallelContext
public void recvDouble(int tag, double[] buf, int offset, int count)
recvDouble
in interface IParallelContext
public void recvFloat(int tag, float[] buf, int offset, int count)
recvFloat
in interface IParallelContext
public void recvInt(int tag, int[] buf, int offset, int count)
recvInt
in interface IParallelContext
public void recvLong(int tag, long[] buf, int offset, int count)
recvLong
in interface IParallelContext
public void recvShort(int tag, short[] buf, int offset, int count)
recvShort
in interface IParallelContext
public <T> void send(int tag, T buf, int offset, int count, int dest)
send
in interface IParallelContext
tag
- unique integer tag for this messagebuf
- 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[] buf, int offset, int count, int dest)
sendByte
in interface IParallelContext
public void sendDouble(int tag, double[] buf, int offset, int count, int dest)
sendDouble
in interface IParallelContext
public void sendFloat(int tag, float[] buf, int offset, int count, int dest)
sendFloat
in interface IParallelContext
public void sendInt(int tag, int[] buf, int offset, int count, int dest)
sendInt
in interface IParallelContext
public void sendLong(int tag, long[] buf, int offset, int count, int dest)
sendLong
in interface IParallelContext
public void sendShort(int tag, short[] buf, int offset, int count, int dest)
sendShort
in interface IParallelContext
public void serialPrint(java.lang.String s)
serialPrint
in interface IParallelContext
s
- string to be printedpublic <T> void shift(int nshift, T a, int offset, int count, T buf)
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 <T> void shiftPrimitive(Datatype type, int nshift, java.lang.Object a, int offset, int count, java.lang.Object buf)
type
- MPI data type, i.e. MPI.INT, MPI.OBJECT, etca
- 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 shiftShort(int nshift, short[] a, int offset, int count, short[] buf)
shiftShort
in interface IParallelContext
public int size()
size
in interface IParallelContext
IParallelContext.size()
public <T> void ttran(int tileSize, T a, int startOffset, T buf)
ttran
in interface IParallelContext
tileSize
- size of the tile for the transposea
- array containing data to be transposedstartOffset
- 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
lena
- length of each input tile on this taskaoffset
- offset to the start of each tile in aa
- input array containing tileslenb
- output length of each received tileboffset
- output offset to each tile in array bb
- output array containing transposed datapublic void ttranvInit(int[] lena, int[] aoffset, int[] lenb, int[] boffset)
ttranvInit
in interface IParallelContext
lena
- length of each input tile on this taskaoffset
- offset to the start of each input tilelenb
- output length of each received tileboffset
- output offset to the start of each received tile
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |