|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.multicorebsp.core.BSP_GLOBAL_COMM<T[],S> com.multicorebsp.core.BSP_GLOBAL_ARR_COMM<T,BSP_ARRAY<T>> com.multicorebsp.core.BSP_ARRAY<T>
T
- Class of the elements to be stored in the array.public class BSP_ARRAY<T extends CompulsaryCloneable<T>>
This class represents a global array definition.
Apart from the general vector-like read / write methods, bulk-synchronous
message passing (BSMP) and direct remote memory access (DRMA) methods are
available.
This class is to be used within the parallel part of an instance of a
BSP_PROGRAM.
BSP_REGISTER
,
BSP_PROGRAM
Field Summary | |
---|---|
protected com.multicorebsp.core.BSP_GLOBAL_ARR<T> |
global
Reference to global instance. |
protected int |
length
Array size. |
protected int |
pid
Processor ID corresponding to this array instance. |
Constructor Summary | |
---|---|
BSP_ARRAY(BSP_PROGRAM thread,
int N,
T init)
Base constructor. |
Method Summary | |
---|---|
void |
bsp_direct_get(BSP_ARRAY<T> source,
int source_processor)
Direct get instruction. |
void |
bsp_direct_get(BSP_ARRAY<T> source,
int source_processor,
int length)
DRMA Direct-get instruction. |
void |
bsp_direct_get(BSP_ARRAY<T> source,
int source_processor,
int source_offset,
int destination_offset,
int length)
DRMA Direct-get instruction. |
void |
bsp_direct_get(int source_processor)
Get instruction. |
void |
bsp_direct_get(int source_processor,
int length)
DRMA Direct-get instruction. |
void |
bsp_direct_get(int source_processor,
int source_offset,
int dest_offset,
int length)
DRMA Direct get instruction. |
void |
bsp_get(BSP_ARRAY<T> source,
int source_processor)
DRMA Get instruction. |
void |
bsp_get(BSP_ARRAY<T> source,
int source_processor,
int length)
DRMA Get instruction. |
void |
bsp_get(BSP_ARRAY<T> source,
int source_processor,
int source_offset,
int destination_offset,
int length)
DRMA Get instruction. |
void |
bsp_get(int source_processor)
DRMA Get instruction. |
void |
bsp_get(int source_processor,
int length)
DRMA Get instruction. |
void |
bsp_get(int source_processor,
int source_offset,
int dest_offset,
int length)
DRMA Get instruction. |
void |
bsp_move()
Replaces the current value with a BSMP message from this global variable's queue. |
void |
bsp_put(BSP_ARRAY<T> source,
int destination_processor)
DRMA Put instruction. |
void |
bsp_put(BSP_ARRAY<T> source,
int destination_processor,
int length)
DRMA Put instruction. |
void |
bsp_put(BSP_ARRAY<T> source,
int source_offset,
int destination_processor,
int destination_offset,
int length)
DRMA Put instruction. |
void |
bsp_put(java.util.Collection<T> source,
int source_offset,
int destination_processor,
int destination_offset,
int length)
DRMA Put instruction. |
void |
bsp_put(int destination_processor)
DRMA Put instruction. |
void |
bsp_put(int destination_processor,
int length)
DRMA Put instruction. |
void |
bsp_put(int source_offset,
int destination_processor,
int dest_offset,
int length)
DRMA Put instruction. |
void |
bsp_put(T[] source,
int destination_processor)
DRMA Put instruction. |
void |
bsp_put(T[] source,
int destination_processor,
int length)
DRMA Put instruction. |
void |
bsp_put(T[] source,
int source_offset,
int destination_processor,
int destination_offset,
int length)
DRMA Put instruction. |
void |
bsp_put(T item,
int destination_processor,
int destination_offset)
DRMA Put instruction. |
int |
bsp_qsize()
BSMP instruction. |
void |
bsp_send(java.util.ArrayList<T> source,
int to)
BSMP Enqueue instruction. |
void |
bsp_send(BSP_ARRAY<T> source,
int to)
BSMP Send instruction. |
void |
bsp_send(int to)
BSMP Send instruction. |
void |
bsp_send(T[] source,
int to)
BSMP instruction. |
java.util.Iterator<T> |
iterator()
|
T |
read(int index)
Read a given element from the array. |
void |
unregister()
Removes all shared references. |
void |
write(int index,
T x)
Writes a given value to a given position in the array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.multicorebsp.core.BSP_GLOBAL_ARR<T extends CompulsaryCloneable<T>> global
protected int pid
protected int length
Constructor Detail |
---|
public BSP_ARRAY(BSP_PROGRAM thread, int N, T init)
thread
- Instance of BSP_PROGRAM corresponding to this global array.N
- Size of array.init
- Initial caption of array elements.Method Detail |
---|
public T read(int index)
index
- Index of the element to-be read.
public void write(int index, T x)
index
- Index of the position to-be written to.x
- Value to be stored at the given position.public void bsp_move() throws EmptyQueueException
bsp_move
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
EmptyQueueException
public int bsp_qsize()
BSP_GLOBAL_COMM
bsp_qsize
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
public void bsp_send(int to)
bsp_send
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
to
- Destination processor.public void bsp_send(BSP_ARRAY<T> source, int to)
bsp_send
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- Source array.to
- Destination processor.public void bsp_send(java.util.ArrayList<T> source, int to)
source
- The array to be enqueued.to
- Destination processor.public void bsp_send(T[] source, int to)
BSP_GLOBAL_COMM
bsp_send
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- The object to send.to
- The ID of the receiving thread.public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T extends CompulsaryCloneable<T>>
public void bsp_direct_get(int source_processor)
BSP_GLOBAL_COMM
bsp_direct_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source_processor
- From which processor to get its variable.public void bsp_direct_get(int source_processor, int length)
bsp_direct_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source_processor
- Processor to get partial array from.length
- Number of elements to copy.public void bsp_direct_get(int source_processor, int source_offset, int dest_offset, int length)
BSP_GLOBAL_ARR_COMM
bsp_direct_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source_processor
- Processor to get the (partial) vector from.source_offset
- Get elements starting from source[ isource_offset ][..].dest_offset
- Copy elements into sub-array starting from destination[ idestination_offset ][..].length
- Number of elements to retrieve in the row direction.public void bsp_direct_get(BSP_ARRAY<T> source, int source_processor)
BSP_GLOBAL_COMM
bsp_direct_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- From which global variable to get its contents.source_processor
- From which processor to get its variable.public void bsp_direct_get(BSP_ARRAY<T> source, int source_processor, int length)
bsp_direct_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- From which global variable to get the sub-array.source_processor
- Processor to get partial array from.length
- Number of elements to copy.public void bsp_direct_get(BSP_ARRAY<T> source, int source_processor, int source_offset, int destination_offset, int length)
bsp_direct_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- From which global variable to get the sub-array.source_processor
- Processor to get partial array from.source_offset
- Get elements starting from source[ source_offset ].destination_offset
- Copy elements into sub-array starting from destination[ destination_offset ].length
- Number of elements to copy.public void bsp_get(int source_processor)
bsp_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source_processor
- Processor to get partial array from.public void bsp_get(int source_processor, int length)
bsp_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source_processor
- Processor to get partial array from.length
- Number of element to copy.public void bsp_get(int source_processor, int source_offset, int dest_offset, int length)
BSP_GLOBAL_ARR_COMM
bsp_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source_processor
- Processor to get the (partial) array from.source_offset
- Get elements starting from source[ isource_offset ][..].dest_offset
- Copy elements into sub-array starting from destination[ idestination_offset ][..].length
- Number of elements to retrieve in the row direction.public void bsp_get(BSP_ARRAY<T> source, int source_processor)
bsp_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- From which global variable to get the sub-array.source_processor
- Processor to get partial array from.public void bsp_get(BSP_ARRAY<T> source, int source_processor, int length)
bsp_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- From which global variable to get the sub-array.source_processor
- Processor to get partial array from.length
- Number of element to copy.public void bsp_get(BSP_ARRAY<T> source, int source_processor, int source_offset, int destination_offset, int length)
bsp_get
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- From which global variable to get the sub-array.source_processor
- Processor to get partial array from.source_offset
- Get elements starting from source[ source_offset ].destination_offset
- Copy elements into sub-array starting from destination[ destination_offset ].length
- Number of element to copy.public void bsp_put(int destination_processor)
bsp_put
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
destination_processor
- Target processor ID of this put instruction.public void bsp_put(int destination_processor, int length)
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
destination_processor
- Target processor ID of this put instruction.length
- Put a total of length items.public void bsp_put(int source_offset, int destination_processor, int dest_offset, int length)
BSP_GLOBAL_ARR_COMM
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source_offset
- Copy length items beginning at
this[ source_offset ].destination_processor
- Target processor ID of this put instruction.dest_offset
- Put items into destination starting at
this[ destination_offset ] (at processor pid).length
- Put a total of length items in the row direction.public void bsp_put(BSP_ARRAY<T> source, int destination_processor)
bsp_put
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- Source collection.destination_processor
- Target processor ID of this put instruction.public void bsp_put(BSP_ARRAY<T> source, int destination_processor, int length)
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- Source collection.destination_processor
- Target processor ID of this put instruction.length
- Put a total of length items.public void bsp_put(BSP_ARRAY<T> source, int source_offset, int destination_processor, int destination_offset, int length)
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- Source array.source_offset
- Copy length items beginning at source[ source_offset ].destination_processor
- Target processor ID of this put instruction.destination_offset
- Put items into destination starting at destination[ destination_offset ].length
- Put a total of length items.public void bsp_put(T[] source, int destination_processor)
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- Source array.destination_processor
- Target processor ID of this put instruction.public void bsp_put(T[] source, int destination_processor, int length)
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- Source array.destination_processor
- Target processor ID of this put instruction.length
- Put a total of length items.public void bsp_put(T[] source, int source_offset, int destination_processor, int destination_offset, int length)
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
source
- Source array.source_offset
- Copy length items beginning at source[ source_offset ].destination_processor
- Target processor ID of this put instruction.destination_offset
- Put items into destination starting at destination[ destination_offset ].length
- Put a total of length items.public void bsp_put(T item, int destination_processor, int destination_offset)
bsp_put
in class BSP_GLOBAL_ARR_COMM<T extends CompulsaryCloneable<T>,BSP_ARRAY<T extends CompulsaryCloneable<T>>>
item
- Element to copy.destination_processor
- Target processor ID of this put instruction.destination_offset
- Put items into destination starting at destination[ destination_offset ].public void bsp_put(java.util.Collection<T> source, int source_offset, int destination_processor, int destination_offset, int length)
source
- Source array.source_offset
- Copy length items beginning at source[ source_offset ].destination_processor
- Target processor ID of this put instruction.destination_offset
- Put items into destination starting at destination[ destination_offset ].length
- Put a total of length items.public void unregister()
BSP_GLOBAL_COMM
unregister
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<T>[],BSP_ARRAY<T extends CompulsaryCloneable<T>>>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |