All Packages Class Hierarchy This Package Previous Next Index
Class javaNOW.JavaNOWAPI
java.lang.Object
|
+----javaNOW.JavaNOWAPI
- public class JavaNOWAPI
- extends Object
JavaNOWAPI: The public interface for JavaNOW operations
-
MAX_WAIT
- Constants
-
JavaNOWAPI(JavaNOWVirtualMachine)
- Constructors
-
addWaitingMailboxKeys(MailboxKey)
- keeps count of sync for messagespaces
-
barrier(MailboxKey, int)
- barrier: waits numMessages number of processes have executed this
operation.
-
broadcast(int, Message, MailboxKey[])
- It retrieves copy of message from one messagespace and inserts
it in all other messagespaces.
-
broadcast(int, Message, Vector)
- It retrieves copy of message from one messagespace and inserts
it in all other messagespaces.
-
clear(MailboxKey)
- Removes all message from a mailbox
-
combine(ActiveMessage, MailboxKey[], Message[])
-
-
combine(ActiveMessage, Vector, Message[])
- It is like reduce except it stores result in all messages
e.g.
-
concat(Message[], MailboxKey[])
-
-
concat(Message[], Vector)
- It is complete broadcast and inserts messages from each message space
into each other message spaces, e.g.
-
eval(MailboxKey, ActiveMessage, Object)
- It is used to evaluate a message method (execute()) and inserts the
output of that method in message space.
-
evalDelayed(MailboxKey, MailboxKey, Message, ActiveMessage)
- Performs data flow operation by evaluating active message in
messageSapceKey1 when message arrives at mailboxKey2 and pass the
data value as argument to eval.
-
finalize()
- Destructors
-
gather(int, Message[], MailboxKey[])
-
-
gather(int, Message[], Vector)
- It gathers messages from different message spaces (keys stored in
enumeration) and stores them in output message space
e.g.
-
get(MailboxKey, Message)
- Removes message from message space in blocking fashion.
-
getDestHost(Message)
-
-
getHostId()
-
-
getHostName()
-
-
getJavaNOWHandle()
-
-
getMessageCount(MailboxKey)
- It returns number of messages in the messagespace
-
getMessageCount(MailboxKey, Message)
- It returns number of messages in the messagespace that matches the
message value as that of aMessage
-
getp(MailboxKey, Message)
- Removes message from message space in nonblocking fashion.
-
getpType(MailboxKey, Message)
- It returns vector of messages that match the message value of the
aMessage
-
getpType(MailboxKey, Message, int)
- It returns nth message in the message space that matches the message value
as that of aMessage
-
getTime()
- It returns current time in milliseconds
-
index(Message[][], MailboxKey[])
- It distributes distinct messages from each message space to all other
message spaces
e.g.
-
notifyGet(JavaNOWMessageNotifier, MailboxKey, Message)
- notify user when message arrives
-
notifyIfWaiting(MailboxKey)
- Wake any processes who are waiting in sync
-
notifyRead(JavaNOWMessageNotifier, MailboxKey, Message)
- notify user when message arrives
-
prefix(ActiveMessage, MailboxKey[], Message[])
-
-
prefix(ActiveMessage, Vector, Message[])
- It is like reduce except it stores partial result in all messages
e.g.
-
present(MailboxKey, Message)
- Returns true if message exist in message spaces (nonblocking)
-
put(MailboxKey, Message)
- Inserts a message into message space
-
putDelayed(MailboxKey, MailboxKey, Message)
- BUILDING HIGHER ABSTRACTION BASED ON CORE JavaNOW FUNCTIONS
/**
/**
Performs data flow operation by putting message in messageSapceKey1
when message arrives at mailboxKey2
-
read(MailboxKey, Message)
- Returns a copy of message from message space in nonblocking fashion.
-
readp(MailboxKey, Message)
- Returns a copy of message from message space in nonblocking fashion.
-
readpType(MailboxKey, Message)
- It is same as getpType() couterpart except it returns copy of messages
-
readpType(MailboxKey, Message, int)
- It is same as getpType() counterpart except it returns copy of messages
-
reduce(int, ActiveMessage, MailboxKey[], Message[])
-
-
reduce(int, ActiveMessage, Vector, Message[])
- It retrieves message from different message spaces and performs
operation on it as specified in the message method and inserts in
output message space.
-
removeWaitingMailboxKeys(MailboxKey)
- remove messagespace from list of waiting messagespaces
-
scatter(int, Message[], MailboxKey[])
-
-
scatter(int, Message[], Vector)
- Inserts each message in message array into different message space as
specified in message space key.
-
shift(Message[], MailboxKey[])
-
-
shift(Message[], Vector)
- It retrieves message from one message space and inserts it in next
message space, e.g.
-
slaveNums()
- It returns number of slave workers
-
stopAll()
- Stop threads to process
-
stopProcessing()
-
-
stopProcessing(boolean)
- Stop threads to process
-
sync(MailboxKey, int)
- waits until the message space contains numMessages number of messages
-
sync(MailboxKey[], int)
- waits until each message space in enumerations contains numMessages
-
sync(Vector, int)
- waits until each message space in enumerations contains numMessages
-
validateArgument(Object)
-
-
waitAllHosts()
-
-
waitAllHosts(long)
-
-
waitUntilFound(MailboxKey, Message)
- Waits until message exist in message spaces (blocking)
-
workerNums()
- It returns number of threads/workers
MAX_WAIT
protected static final int MAX_WAIT
- Constants
- See Also:
- class, method
JavaNOWAPI
public JavaNOWAPI(JavaNOWVirtualMachine javaNOWVM)
- Constructors
- See Also:
- class, method
finalize
protected void finalize()
- Destructors
- Overrides:
- finalize in class Object
- See Also:
- class, method
getHostName
public String getHostName()
getHostId
public int getHostId()
workerNums
public int workerNums()
- It returns number of threads/workers
- See Also:
- class, method
slaveNums
public int slaveNums()
- It returns number of slave workers
- See Also:
- class, method
getTime
public long getTime()
- It returns current time in milliseconds
- See Also:
- class, method
stopAll
public void stopAll()
- Stop threads to process
- See Also:
- class, method
stopProcessing
public void stopProcessing()
stopProcessing
public void stopProcessing(boolean flag)
- Stop threads to process
- See Also:
- class, method
put
public void put(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Inserts a message into message space
- See Also:
- class, method
getp
public Message getp(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Removes message from message space in nonblocking fashion.
If message does not exist, it returns null
- See Also:
- class, method
get
public Message get(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Removes message from message space in blocking fashion.
If message does not exist, it blocks until it is inserted
- See Also:
- class, method
present
public boolean present(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Returns true if message exist in message spaces (nonblocking)
- See Also:
- class, method
notifyRead
public void notifyRead(JavaNOWMessageNotifier notifier,
MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- notify user when message arrives
- See Also:
- class, method
notifyGet
public void notifyGet(JavaNOWMessageNotifier notifier,
MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- notify user when message arrives
- See Also:
- class, method
waitUntilFound
public void waitUntilFound(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Waits until message exist in message spaces (blocking)
- See Also:
- class, method
readp
public Message readp(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Returns a copy of message from message space in nonblocking fashion.
If message does not exist, it returns null
- See Also:
- class, method
read
public Message read(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Returns a copy of message from message space in nonblocking fashion.
If message does not exist, it blocks until it is inserted
- See Also:
- class, method
eval
public void eval(MailboxKey ts,
ActiveMessage aMessage,
Object arg) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It is used to evaluate a message method (execute()) and inserts the
output of that method in message space.
- See Also:
- class, method
getpType
public Vector getpType(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It returns vector of messages that match the message value of the
aMessage
- See Also:
- class, method
getpType
public Message getpType(MailboxKey ts,
Message aMessage,
int n) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It returns nth message in the message space that matches the message value
as that of aMessage
- See Also:
- class, method
readpType
public Vector readpType(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It is same as getpType() couterpart except it returns copy of messages
- See Also:
- class, method
readpType
public Message readpType(MailboxKey ts,
Message aMessage,
int n) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It is same as getpType() counterpart except it returns copy of messages
- See Also:
- class, method
getMessageCount
public int getMessageCount(MailboxKey ts,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It returns number of messages in the messagespace that matches the
message value as that of aMessage
- See Also:
- class, method
getMessageCount
public int getMessageCount(MailboxKey ts) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It returns number of messages in the messagespace
- See Also:
- class, method
barrier
public void barrier(MailboxKey ts,
int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- barrier: waits numMessages number of processes have executed this
operation.
- See Also:
- class, method
sync
public void sync(MailboxKey ts,
int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- waits until the message space contains numMessages number of messages
- See Also:
- class, method
clear
public void clear(MailboxKey ts) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Removes all message from a mailbox
- See Also:
- class, method
putDelayed
public void putDelayed(MailboxKey ts1,
MailboxKey ts2,
Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- BUILDING HIGHER ABSTRACTION BASED ON CORE JavaNOW FUNCTIONS
/**
/**
Performs data flow operation by putting message in messageSapceKey1
when message arrives at mailboxKey2
- See Also:
- class, method
evalDelayed
public void evalDelayed(MailboxKey ts1,
MailboxKey ts2,
Message aMessage,
ActiveMessage activeMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Performs data flow operation by evaluating active message in
messageSapceKey1 when message arrives at mailboxKey2 and pass the
data value as argument to eval.
- See Also:
- class, method
broadcast
public void broadcast(int source,
Message aMessage,
Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It retrieves copy of message from one messagespace and inserts
it in all other messagespaces.
e.g. if messagespaces 1,2,3, and 4 have following messages
value as specified by their message key:
MailboxKey 1 2 3 4
MessageValue A
Then after this operation, it will look like
MailboxKey 1 2 3 4
MessageValue A A A A
- See Also:
- class, method
broadcast
public void broadcast(int source,
Message aMessage,
MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It retrieves copy of message from one messagespace and inserts
it in all other messagespaces.
e.g. if messagespaces 1,2,3, and 4 have following messages
value as specified by their message key:
MailboxKey 1 2 3 4
MessageValue A
Then after this operation, it will look like
MailboxKey 1 2 3 4
MessageValue A A A A
- See Also:
- class, method
concat
public void concat(Message aMessages[],
Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It is complete broadcast and inserts messages from each message space
into each other message spaces, e.g.
e.g. if messagespaces 1,2,3, and 4 have following messages
value as specified by their message key:
MailboxKey 1 2 3 4
MessageValue A B C D
Then after this operation, it will look like
MailboxKey 1 2 3 4
MessageValue A A A A
B B B B
C C C C
D D D D
- See Also:
- class, method
concat
public void concat(Message aMessages[],
MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
scatter
public void scatter(int source,
Message aMessages[],
Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- Inserts each message in message array into different message space as
specified in message space key.
e.g. if messagespaces 1,2,3, and 4 have following messages
value as specified by their message key:
MailboxKey 1 2 3 4
MessageValue A
B
C
D
Then after this operation, it will look like
MailboxKey 1 2 3 4
MessageValue A B C D
- See Also:
- class, method
scatter
public void scatter(int source,
Message aMessages[],
MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
gather
public void gather(int dest,
Message aMessages[],
Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It gathers messages from different message spaces (keys stored in
enumeration) and stores them in output message space
e.g. if messagespaces 1,2,3, and 4 have following messages
value as specified by their message key:
MailboxKey 1 2 3 4
MessageValue A B C D
Then after this operation, it will look like
MailboxKey 1 2 3 4
MessageValue A
B
C
D
- See Also:
- class, method
gather
public void gather(int dest,
Message aMessages[],
MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
shift
public void shift(Message aMessages[],
Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It retrieves message from one message space and inserts it in next
message space, e.g. if messagespaces 1,2,3, & 4 have following messages
value as specified by their message key:
MailboxKey 1 2 3 4
MessageValue A B C D
Then after this operation, it will look like
MailboxKey 1 2 3 4
MessageValue B C D A
- See Also:
- class, method
shift
public void shift(Message aMessages[],
MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
index
public void index(Message aMessages[][],
MailboxKey mailboxes[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It distributes distinct messages from each message space to all other
message spaces
e.g. if messagespaces A,B,C, and D have following messages
value as specified by their message key:
MailboxKey A B C D
MessageValue 1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
Then after this operation, it will look like
MailboxKey A B C D
MessageValue 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
- See Also:
- class, method
reduce
public void reduce(int dest,
ActiveMessage outMessage,
Vector mailboxes,
Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It retrieves message from different message spaces and performs
operation on it as specified in the message method and inserts in
output message space.
e.g. if messagespaces A,B,C, and D have following messages
value as specified by their message key:
MailboxKey A B C D
MessageValue 3 12 5 7
and the execute method of ActiveMessage is simply adding message
values then after this operation, the output message will contain
27.
- See Also:
- class, method
reduce
public void reduce(int dest,
ActiveMessage outMessage,
MailboxKey arrMailboxKey[],
Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
combine
public void combine(ActiveMessage outMessage,
Vector mailboxes,
Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It is like reduce except it stores result in all messages
e.g. if messagespaces A,B,C, and D have following messages
value as specified by their message key:
MailboxKey A B C D
MessageValue 3 12 5 7
and the execute method of ActiveMessage is simply adding message
values then after this operation, it will look like
MailboxKey A B C D
MessageValue 27 27 27 27
- See Also:
- class, method
combine
public void combine(ActiveMessage outMessage,
MailboxKey arrMailboxKey[],
Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
prefix
public void prefix(ActiveMessage outMessage,
Vector mailboxes,
Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- It is like reduce except it stores partial result in all messages
e.g. if messagespaces A,B,C, and D have following messages
value as specified by their message key:
MailboxKey A B C D
MessageValue 3 12 5 7
and the execute method of ActiveMessage is simply adding message
values then after this operation, it will look like
MailboxKey A B C D
MessageValue 3 15 20 27
- See Also:
- class, method
prefix
public void prefix(ActiveMessage outMessage,
MailboxKey arrMailboxKey[],
Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
sync
public void sync(Vector mailboxes,
int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- waits until each message space in enumerations contains numMessages
- See Also:
- class, method
sync
public void sync(MailboxKey arrMailboxKey[],
int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
- waits until each message space in enumerations contains numMessages
- See Also:
- class, method
addWaitingMailboxKeys
protected synchronized void addWaitingMailboxKeys(MailboxKey ts)
- keeps count of sync for messagespaces
- See Also:
- class, method
removeWaitingMailboxKeys
protected synchronized void removeWaitingMailboxKeys(MailboxKey ts)
- remove messagespace from list of waiting messagespaces
- See Also:
- class, method
waitAllHosts
protected void waitAllHosts(long milliseconds)
waitAllHosts
protected void waitAllHosts()
notifyIfWaiting
protected void notifyIfWaiting(MailboxKey ts) throws SingleThreadBlockException
- Wake any processes who are waiting in sync
- See Also:
- class, method
validateArgument
protected void validateArgument(Object arg) throws InvalidArgumentException, NotSerializableException
getJavaNOWHandle
protected JavaNOWVirtualMachine getJavaNOWHandle()
getDestHost
protected int getDestHost(Message aMessage) throws InvalidArgumentException
All Packages Class Hierarchy This Package Previous Next Index