Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill ALL trailing whitespace (and deprecate a function in Link)
[simgrid.git] / src / bindings / java / org / simgrid / msg / Comm.java
index 29c5587..d4b405e 100644 (file)
@@ -6,10 +6,7 @@
 
 package org.simgrid.msg;
 
-/**
- * Communication action, representing an ongoing communication
- * between processes.
- */
+/** Communication action, representing an ongoing communication between processes. */
 public class Comm {
        /** Indicates if the communication is a receiving communication */
        protected boolean receiving;
@@ -17,7 +14,7 @@ public class Comm {
        protected boolean finished = false;
        /**
         * Represents the bind between the java comm and the
-        * native C comm. You must never access it, since it is 
+        * native C comm. You must never access it, since it is
         * automatically set.
         */
        private long bind = 0;
@@ -33,6 +30,7 @@ public class Comm {
 
        }
        /** Destroy the C communication object, when the GC reclaims the java part. */
+       @Override
        protected void finalize() throws Throwable{
                nativeFinalize();
        }
@@ -54,6 +52,14 @@ public class Comm {
         */
        public native void waitCompletion(double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
 
+       /** Wait all of the communications */
+       public static native void waitAll(Comm[] comms, double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
+       /** Wait all of the communications, with no maximal delay */
+       public static void waitAll(Comm[] comms) throws TransferFailureException, HostFailureException, TimeoutException {
+               waitAll(comms, -1.);
+       }
+       /** Wait any of the communications, and return the rank of the terminating comm */
+       public static native int waitAny(Comm[] comms) throws TransferFailureException, HostFailureException, TimeoutException;
        /**
         * Returns the task associated with the communication.
         * if the communication isn't finished yet, will return null.