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 void
close()
Closes the channel.mpi.Comm
getEngine()
Get the MPI engine.java.lang.Object
receive()
Receives an object.java.lang.Object
receive(int t)
Receives an object.void
send(int t, java.lang.Object v)
Sends an object.(package private) void
send(int t, java.lang.Object v, int pr)
Sends an object.void
send(java.lang.Object v)
Sends an object.java.lang.String
toString()
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.IOException
mpi.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.IOException
mpi.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.IOException
mpi.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.IOException
mpi.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.IOException
mpi.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.IOException
java.lang.ClassNotFoundException
mpi.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.IOException
java.lang.ClassNotFoundException
mpi.MPIException
-
close
public void close()
Closes the channel.
-
toString
public java.lang.String toString()
to string.- Overrides:
toString
in classjava.lang.Object
-
-