- * @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.
- */
- public Task(String name, Host[]hosts, double[]computeDurations, double[]messageSizes) {
- parallelCreate(name, hosts, computeDurations, messageSizes);
+ * @param flopsAmount The amount of operations to be performed by each host of hosts.
+ * flopsAmount[i] is the total number of operations that have to be
+ * performed on hosts[i].
+ * @param bytesAmount A matrix describing the amount of data to exchange between hosts. The
+ * length of this array must be hosts.length * hosts.length. It is actually
+ * used as a matrix with the lines being the source and the columns being
+ * the destination of the communications.
+ */
+ public Task(String name, Host[]hosts, double[]flopsAmount, double[]bytesAmount) {
+ if (flopsAmount == null)
+ throw new IllegalArgumentException("Parallel task flops amounts is null");
+ if (bytesAmount == null)
+ throw new IllegalArgumentException("Parallel task bytes amounts is null");
+ if (hosts == null)
+ throw new IllegalArgumentException("Host list is null");
+ if (name == null)
+ throw new IllegalArgumentException("Parallel task name is null");
+
+ parallelCreate(name, hosts, flopsAmount, bytesAmount);
+ this.name = name;