X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/31f8d2188a6cfd24c58c7503728bc1317be2f073..24904a5d2b3de5c5404f3817e5f01966cbd1a8d2:/src/bindings/java/org/simgrid/msg/Comm.java diff --git a/src/bindings/java/org/simgrid/msg/Comm.java b/src/bindings/java/org/simgrid/msg/Comm.java index 8d07c51b9d..99b889d2ef 100644 --- a/src/bindings/java/org/simgrid/msg/Comm.java +++ b/src/bindings/java/org/simgrid/msg/Comm.java @@ -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; @@ -34,12 +31,8 @@ public class Comm { } /** Destroy the C communication object, when the GC reclaims the java part. */ @Override - protected void finalize() { - try { - nativeFinalize(); - } catch (Throwable e) { - e.printStackTrace(); - } + protected void finalize() throws Throwable{ + nativeFinalize(); } protected native void nativeFinalize(); /** @@ -59,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 void waitAny(Comm[] comms) throws TransferFailureException, HostFailureException, TimeoutException; /** * Returns the task associated with the communication. * if the communication isn't finished yet, will return null.