Package org.simgrid.msg
Class Comm
- java.lang.Object
-
- org.simgrid.msg.Comm
-
public class Comm extends java.lang.ObjectCommunication action, representing an ongoing communication between processes.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedComm()Protected constructor, used by Comm factories in Task.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinalize()Destroy the C communication object, when the GC reclaims the java part.TaskgetTask()Returns the task associated with the communication.protected voidnativeFinalize()static voidnativeInit()Class initializer, to initialize various JNI stuffbooleantest()Returns if the communication is finished or not.static voidwaitAll(Comm[] comms)Wait all of the communications, with no maximal delaystatic voidwaitAll(Comm[] comms, double timeout)Wait all of the communicationsstatic intwaitAny(Comm[] comms)Wait any of the communications, and return the rank of the terminating commvoidwaitCompletion()Wait infinitely for the completion of the communication (infinite timeout)voidwaitCompletion(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.ThrowableDestroy the C communication object, when the GC reclaims the java part.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
nativeFinalize
protected void nativeFinalize()
-
test
public boolean test() throws TransferFailureException, HostFailureException, TimeoutExceptionReturns 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, TimeoutExceptionWait infinitely for the completion of the communication (infinite timeout)
-
waitCompletion
public void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutExceptionWait 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:
TransferFailureExceptionHostFailureExceptionTimeoutException
-
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
-
-