|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jumpi.impl.AbstractConnector | +--org.jumpi.impl.connector.mpi11.MpiConnector
The MpiConnector allows to send and receive messages via mpiJava over a native MPI1.1 implementation. Currently a single Group, COMM_WORLD is established and intra-group, point to point communications are allowed. A client application must ensure that receive's are matched by send's in order to avoid blocking. A configurable but fixed sized receive buffer is used to receive messages. Truncation occurs if the buffer length is exceeded on receive.
Field Summary | |
static java.lang.String |
PROPERTY_MPI_RECV_STATUS
The receive status is returned to client applications to allow the client to determine the length of the data received. |
Fields inherited from class org.jumpi.impl.AbstractConnector |
cancelledRecvs_, cancelledSends_, controller_, joinFailInterval_, joinTestInterval_, jumpi_, maxRecvBacklog_, maxSendBacklog_, name_, protocol_, recvQueue_, recvTransformer_, sendQueue_, sendTransformer_, started_, stopping_, taskId_, url_format_, url_prefix_ |
Constructor Summary | |
MpiConnector()
|
Method Summary | |
void |
cancelRecv(Envelope env)
Does nothing. |
void |
cancelSend(Envelope env)
Does nothing. |
protected boolean |
checkJoinCondition()
The shutdown join condition is true if there are no pending send or receive operations. |
void |
configure(java.lang.String name,
Properties props)
Configure the MpiConnector. |
protected void |
establishGroups()
Establish the communication Groups from the MPI implementation. |
Destination |
getDestination(java.lang.String url,
java.util.Hashtable clientProps)
Get the Destination corresponding to the Url provided. |
void |
manage(Component root,
Component parent,
java.lang.String operation,
java.util.Hashtable parameters)
Perform a recursive management operation through the Jumpi component tree, using the parameters provided. |
protected boolean |
onRecv(Envelope env)
Receive a message from a MPI Processor Destination. |
protected boolean |
onSend(Envelope env)
Send a message to a MPI Processor Destination. |
void |
recv(Envelope env)
Perform the recv synchronously. |
void |
send(Envelope env)
Perform the send synchronously. |
protected void |
shutdownState()
Clear the pending send and receive operations. |
Methods inherited from class org.jumpi.impl.AbstractConnector |
getName, getTaskId, isLongRunning, isSchedulable, run |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTY_MPI_RECV_STATUS
Constructor Detail |
public MpiConnector()
Method Detail |
public void configure(java.lang.String name, Properties props) throws java.lang.Exception
The following configuration attributes are defined in addition to those of the superclass:
args - commaseparatedstrings - optional[].
The comma separated arguments to pass to MPI.Init call to bootstrap the MPI implementation.
sendbuflen - integer[0..MAX-INT] - optional[8192].
The initial size of the send buffer in bytes. The send buffer grows if more data is written to it, but it never shrinks. The receive buffer does not grow so in order to avoid data truncation, pre-determined data sizes are required.
recvbuflen - integer[0..MAX-INT] - optional[8192].
The receive buffer size in bytes. The receive buffer does not grow so in order to avoid data truncation, pre-determined data sizes are required.
configure
in interface Configurable
configure
in class AbstractConnector
name
- the fully qualified instance name.props
- the read-only properties to configure the instance with.
java.lang.Exception
- when configuration is unsuccessful.public void manage(Component root, Component parent, java.lang.String operation, java.util.Hashtable parameters) throws java.lang.Exception
manage
in interface Manageable
manage
in class AbstractConnector
root
- the Jumpi instance at the root of the component tree.parent
- the immediate parent of the component.operation
- the operation.parameters
- the operation parameters.
java.lang.Exception
- if any failure to perform management occurs.protected boolean checkJoinCondition()
checkJoinCondition
in class AbstractConnector
protected void shutdownState()
shutdownState
in class AbstractConnector
protected void establishGroups() throws java.lang.Exception
java.lang.Exception
- if any failure condition occurs.public Destination getDestination(java.lang.String url, java.util.Hashtable clientProps)
getDestination
in interface Connector
getDestination
in class AbstractConnector
url
- the Url of the MPI Connector.clientProps
- not used.
java.lang.IllegalArgumentException
- when url is null.recv(org.jumpi.spi.Envelope)
protected boolean onSend(Envelope env) throws java.lang.Exception
Send a message to a MPI Processor Destination.
The message format required at the native MPI layer is a byte[]. If a send transformer is configured, then the transformer must transform the message Object into a byte[] and place this in the send buffer. The send buffer is pushed onto the envelope's context stack on top of the message itself. If no send transformer is configured, then the message must be a byte[].
Allows only a single send at a time, blocking if multiple sends are performed concurrently.
The default MPI send mode is used. This is typically blocking.
onSend
in class AbstractConnector
env
- the Envelope containing the Destination to send to and the
message.
java.lang.Exception
- if a failure condition occurs.public void send(Envelope env) throws java.lang.Exception
send
in interface Connector
send
in class AbstractConnector
env
- the Envelope which gives the Destination to send to and the
message itself.
java.lang.Exception
- if any failure condition occurs during the send
method.
java.lang.IllegalArgumentException
- when env is null.
java.lang.IllegalStateException
- when not started or stopping.Controller.callbackSend(org.jumpi.spi.Envelope, boolean, java.lang.String)
public void cancelSend(Envelope env)
cancelSend
in interface Connector
cancelSend
in class AbstractConnector
env
- the send operation's Envelope to cancel.protected boolean onRecv(Envelope env) throws java.lang.Exception
Receive a message from a MPI Processor Destination. Receiving from the MPI Connector Destination ( <protocol>:// ) returns the MPI COMM_WORLD GroupMembershipInfo structure. From this, the client application can address send and receive operations to specific MPI Processors. A receive from any processor is achieved by calling recv on the Group's wildcard destination.
The receive operation at the MPI layer delivers a byte[]. Tbe byte[] is read by the MPIConnector into the receive buffer. If the sent data is more than the size of the receive buffer, then the data is truncated. The length may be less than the size of the receive buffer. If a receive transformer is configured, then this must transform the receive buffer's contents. The receive operation's status and then the receive buffer are placed on the context stack. If no receive transformer is defined, then the receive buffer's byte[] is passed up to the controller layer. A subsequent receive will overwrite the receive buffer's contents.
Allows only a single receive at a time, blocking if multiple receives are performed concurrently.
The default MPI receive mode is used. This is typically blocking.
onRecv
in class AbstractConnector
env
- the Envelope containing the Destination to receive from.
java.lang.Exception
- if a failure condition occurs.public void recv(Envelope env) throws java.lang.Exception
recv
in interface Connector
recv
in class AbstractConnector
env
- the Envelope which gives the Destination to receive from and
where the received message is eventually placed with the sender.
java.lang.Exception
- if any failure condition occurs during the recv
method.
java.lang.IllegalArgumentException
- when env is null.
java.lang.IllegalStateException
- when not started or stopping.Controller.callbackRecv(org.jumpi.spi.Envelope, boolean, java.lang.String)
public void cancelRecv(Envelope env)
cancelRecv
in interface Connector
cancelRecv
in class AbstractConnector
env
- the recv operation's Envelope to cancel.
|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |