Package edu.jas.util
Class MPJChannel
- java.lang.Object
-
- edu.jas.util.MPJChannel
-
public final class MPJChannel extends java.lang.Object
MPJChannel provides a communication channel for Java objects using MPI or TCP/IP to a given rank. Can use MPI transport layer for "niodev" with FastMPJ.- Author:
- Heinz Kredel
-
-
Constructor Summary
Constructors Constructor Description MPJChannel(mpi.Comm s, int r)Constructs a MPI channel on the given MPI engine.MPJChannel(mpi.Comm s, int r, int t)Constructs a MPI channel on the given MPI engine.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the channel.mpi.CommgetEngine()Get the MPI engine.java.lang.Objectreceive()Receives an object.java.lang.Objectreceive(int t)Receives an object.voidsend(int t, java.lang.Object v)Sends an object.(package private) voidsend(int t, java.lang.Object v, int pr)Sends an object.voidsend(java.lang.Object v)Sends an object.java.lang.StringtoString()to string.
-
-
-
Field Detail
-
CHANTAG
public static final int CHANTAG
- See Also:
- Constant Field Values
-
useTCP
static boolean useTCP
-
-
Constructor Detail
-
MPJChannel
public MPJChannel(mpi.Comm s, int r) throws java.io.IOException, mpi.MPIException
Constructs a MPI channel on the given MPI engine.- Parameters:
s- MPI communicator object.r- rank of MPI partner.- Throws:
java.io.IOExceptionmpi.MPIException
-
MPJChannel
public MPJChannel(mpi.Comm s, int r, int t) throws java.io.IOException, mpi.MPIException
Constructs a MPI channel on the given MPI engine.- Parameters:
s- MPI communicator object.r- rank of MPI partner.t- tag for messages.- Throws:
java.io.IOExceptionmpi.MPIException
-
-
Method Detail
-
getEngine
public mpi.Comm getEngine()
Get the MPI engine.
-
send
public void send(java.lang.Object v) throws java.io.IOException, mpi.MPIException
Sends an object.- Parameters:
v- message object.- Throws:
java.io.IOExceptionmpi.MPIException
-
send
public void send(int t, java.lang.Object v) throws java.io.IOException, mpi.MPIException
Sends an object.- Parameters:
t- message tag.v- message object.- Throws:
java.io.IOExceptionmpi.MPIException
-
send
void send(int t, java.lang.Object v, int pr) throws java.io.IOException, mpi.MPIException
Sends an object.- Parameters:
t- message tag.v- message object.pr- partner rank.- Throws:
java.io.IOExceptionmpi.MPIException
-
receive
public java.lang.Object receive() throws java.io.IOException, java.lang.ClassNotFoundException, mpi.MPIException
Receives an object.- Returns:
- a message object.
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundExceptionmpi.MPIException
-
receive
public java.lang.Object receive(int t) throws java.io.IOException, java.lang.ClassNotFoundException, mpi.MPIException
Receives an object.- Parameters:
t- message tag.- Returns:
- a message object.
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundExceptionmpi.MPIException
-
close
public void close()
Closes the channel.
-
toString
public java.lang.String toString()
to string.- Overrides:
toStringin classjava.lang.Object
-
-