Package org.simgrid.msg
Class Comm
- java.lang.Object
-
- org.simgrid.msg.Comm
-
public class Comm extends java.lang.Object
Communication action, representing an ongoing communication between processes.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Comm()
Protected constructor, used by Comm factories in Task.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
Destroy the C communication object, when the GC reclaims the java part.Task
getTask()
Returns the task associated with the communication.protected void
nativeFinalize()
static void
nativeInit()
Class initializer, to initialize various JNI stuffboolean
test()
Returns if the communication is finished or not.static void
waitAll(Comm[] comms)
Wait all of the communications, with no maximal delaystatic void
waitAll(Comm[] comms, double timeout)
Wait all of the communicationsstatic int
waitAny(Comm[] comms)
Wait any of the communications, and return the rank of the terminating commvoid
waitCompletion()
Wait infinitely for the completion of the communication (infinite timeout)void
waitCompletion(double timeout)
Wait for the completion of the communication.
-
-
-
Field Detail
-
receiving
protected boolean receiving
Indicates if the communication is a receiving communication
-
finished
protected boolean finished
Indicates if the communication is finished
-
task
protected Task task
Task associated with the comm. Beware, it can be null
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable
Destroy the C communication object, when the GC reclaims the java part.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
nativeFinalize
protected void nativeFinalize()
-
test
public boolean test() throws TransferFailureException, HostFailureException, TimeoutException
Returns if the communication is finished or not. If the communication has finished and there was an error, raise an exception.
-
waitCompletion
public void waitCompletion() throws TransferFailureException, HostFailureException, TimeoutException
Wait infinitely for the completion of the communication (infinite timeout)
-
waitCompletion
public void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutException
Wait for the completion of the communication. Throws an exception if there were an error in the communication.- Parameters:
timeout
- Time before giving up (infinite time if negative)- Throws:
TransferFailureException
HostFailureException
TimeoutException
-
waitAll
public static void waitAll(Comm[] comms, double timeout) throws TransferFailureException, HostFailureException, TimeoutException
Wait all of the communications
-
waitAll
public static void waitAll(Comm[] comms) throws TransferFailureException, HostFailureException, TimeoutException
Wait all of the communications, with no maximal delay
-
waitAny
public static int waitAny(Comm[] comms) throws TransferFailureException, HostFailureException, TimeoutException
Wait any of the communications, and return the rank of the terminating comm
-
getTask
public Task getTask()
Returns the task associated with the communication. if the communication isn't finished yet, will return null.
-
nativeInit
public static void nativeInit()
Class initializer, to initialize various JNI stuff
-
-