|
||||||||
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,BSP_REGISTER<T>> com.multicorebsp.core.BSP_REGISTER<T>
T
- Class of the elements to be stored in the array.public class BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>
This class represents a global variable definition.
Apart from the general 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_ARRAY
,
BSP_PROGRAM
Field Summary | |
---|---|
protected com.multicorebsp.core.BSP_GLOBAL_VAR<T> |
global
Reference to global instance. |
protected int |
pid
Processor ID corresponding to this instance. |
Constructor Summary | |
---|---|
|
BSP_REGISTER(BSP_PROGRAM thread,
T init)
Base constructor. |
protected |
BSP_REGISTER(int P,
java.util.ArrayList<java.util.ArrayList<com.multicorebsp.core.BSP_COMMUNICATION_REQUEST<?>>> buffer,
T init)
Constructor wrapper. |
Method Summary | |
---|---|
void |
bsp_direct_get(BSP_REGISTER<T> source,
int pid)
Direct get instruction. |
void |
bsp_direct_get(int pid)
Get instruction. |
void |
bsp_get(BSP_REGISTER<T> source,
int from)
Get instruction. |
void |
bsp_get(int from)
Get instruction. |
void |
bsp_move()
Move a BSMP message from this global variable's queue. |
void |
bsp_put(BSP_REGISTER<T> source,
int destination_processor)
Put instruction. |
void |
bsp_put(int destination_processor)
Put instruction. |
void |
bsp_put(T source,
int destination_processor)
Put instruction. |
int |
bsp_qsize()
Returns the number of messages waiting in the local message queue. |
void |
bsp_send(BSP_REGISTER<T> source,
int to)
BSMP Send instruction. |
void |
bsp_send(int to)
BSMP Send instruction. |
void |
bsp_send(T source,
int to)
BSMP Send instruction. |
T |
read()
Gets the current variable's value. |
void |
unregister()
Removes all shared references. |
void |
write(T x)
Sets the current variable to a given value. |
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_VAR<T extends CompulsaryCloneable<? extends T>> global
protected int pid
Constructor Detail |
---|
protected BSP_REGISTER(int P, java.util.ArrayList<java.util.ArrayList<com.multicorebsp.core.BSP_COMMUNICATION_REQUEST<?>>> buffer, T init)
P
- Total number of processors.buffer
- Reference to the global request buffer.init
- Initial value of this global variable.public BSP_REGISTER(BSP_PROGRAM thread, T init)
thread
- Thread from which this global variable will be accessed.init
- Initial value of this global variable (at each processor).Method Detail |
---|
public T read()
public void write(T x)
x
- The value current variable will be set to.public int bsp_qsize()
bsp_qsize
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
public void bsp_move()
bsp_move
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
public void bsp_send(int to)
bsp_send
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
to
- Destination processor.public void bsp_send(T source, int to)
bsp_send
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
source
- Object to send.to
- Destination processor.public void bsp_send(BSP_REGISTER<T> source, int to)
bsp_send
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
source
- Variable containing the object to send.to
- Destination processor.public void bsp_put(int destination_processor)
BSP_GLOBAL_COMM
bsp_put
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
destination_processor
- The destination processor.public void bsp_put(BSP_REGISTER<T> source, int destination_processor)
BSP_GLOBAL_COMM
bsp_put
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
source
- Source global variable.destination_processor
- Destination processor.public void bsp_put(T source, int destination_processor)
BSP_GLOBAL_COMM
bsp_put
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
source
- Source variable.destination_processor
- Destination processor.public void bsp_get(int from)
BSP_GLOBAL_COMM
bsp_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
from
- From which processor to get its variable.public void bsp_get(BSP_REGISTER<T> source, int from)
BSP_GLOBAL_COMM
bsp_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
source
- From which global variable to get its contents.from
- From which processor to get its variable.public void unregister()
BSP_GLOBAL_COMM
unregister
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
public void bsp_direct_get(int pid)
BSP_GLOBAL_COMM
bsp_direct_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
pid
- From which processor to get its variable.public void bsp_direct_get(BSP_REGISTER<T> source, int pid)
BSP_GLOBAL_COMM
bsp_direct_get
in class BSP_GLOBAL_COMM<T extends CompulsaryCloneable<? extends T>,BSP_REGISTER<T extends CompulsaryCloneable<? extends T>>>
source
- From which global variable to get its contents.pid
- From which processor to get its variable.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |