X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c4a28141285b1569c48c4b72b16114f6f6a3218c..10d24bfbe5d413bdb49bf12b9655fc73203cd4f0:/src/bindings/java/org/simgrid/msg/Task.java diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index 2b7b2dd98b..994d2306bf 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -1,11 +1,8 @@ -/* - * Copyright 2006-2012 The SimGrid Team. - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - * (GNU LGPL) which comes with this package. - */ +/* Copyright (c) 2006-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; @@ -49,17 +46,17 @@ public class Task { * * @param name Task's name * - * @param computeDuration A value of the processing amount (in flop) needed to process the task. + * @param flopsAmount A value of the processing amount (in flop) needed to process the task. * If 0, then it cannot be executed with the execute() method. * This value has to be >= 0. * - * @param messageSize A value of amount of data (in bytes) needed to transfert this task. + * @param bytesAmount A value of amount of data (in bytes) needed to transfert this task. * If 0, then it cannot be transfered with the get() and put() methods. * This value has to be >= 0. */ - public Task(String name, double computeDuration, double messageSize) { - create(name, computeDuration, messageSize); - this.messageSize = messageSize; + public Task(String name, double flopsAmount, double bytesAmount) { + create(name, flopsAmount, bytesAmount); + this.messageSize = bytesAmount; setId(idCpt); idCpt++; } @@ -69,44 +66,44 @@ public class Task { * * @param name The name of the parallel task. * @param hosts The list of hosts implied by the parallel task. - * @param computeDurations The amount of operations to be performed by each host of \a hosts. - * @param messageSizes A matrix describing the amount of data to exchange between hosts. + * @param flopsAmount The amount of operations to be performed by each host of \a hosts. + * @param bytesAmount A matrix describing the amount of data to exchange between hosts. */ - public Task(String name, Host[]hosts, double[]computeDurations, double[]messageSizes) { - parallelCreate(name, hosts, computeDurations, messageSizes); + public Task(String name, Host[]hosts, double[]flopsAmount, double[]bytesAmount) { + parallelCreate(name, hosts, flopsAmount, bytesAmount); } /** * The natively implemented method to create a MSG task. * * @param name The name of th task. - * @param computeDuration A value of the processing amount (in flop) needed + * @param flopsAmount A value of the processing amount (in flop) needed * to process the task. If 0, then it cannot be executed * with the execute() method. This value has to be >= 0. - * @param messageSize A value of amount of data (in bytes) needed to transfert + * @param bytesAmount A value of amount of data (in bytes) needed to transfert * this task. If 0, then it cannot be transfered this task. * If 0, then it cannot be transfered with the get() and put() * methods. This value has to be >= 0. * @exception IllegalArgumentException if compute duration <0 or message size <0 */ private final native void create(String name, - double computeDuration, - double messageSize) + double flopsAmount, + double bytesAmount) throws IllegalArgumentException; /** * The natively implemented method to create a MSG parallel task. * * @param name The name of the parallel task. * @param hosts The list of hosts implied by the parallel task. - * @param computeDurations The total number of operations that have to be performed + * @param flopsAmount The total number of operations that have to be performed * on the hosts. - * @param messageSizes An array of doubles + * @param bytesAmount An array of doubles * */ private final native void parallelCreate(String name, Host[]hosts, - double[]computeDurations, - double[]messageSizes) + double[]flopsAmount, + double[]bytesAmount) throws NullPointerException, IllegalArgumentException; /* * * * * * Getters / Setters * * @@ -126,13 +123,12 @@ public class Task { * Returns null if the task hasn't been sent yet. */ public native Host getSource(); - /** Gets the computing amount of the task - * FIXME: Cache it ! - */ - public native double getComputeDuration(); - /** Gets the remaining computation of the task - */ - public native double getRemainingDuration(); + + /** Gets the remaining amount of flops to execute in this task + * + * If it's ongoing, you get the exact amount at the present time. If it's already done, it's 0. + */ + public native double getFlopsAmount(); /** * Sets the name of the task * @param name the new task name.c