+++ /dev/null
-/*
- * $Id$
- *
- * Copyright 2006,2007 Martin Quinson, Malek Cherier
- * 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.
- */
-
-import simgrid.msg.*;
-
-public class CommTimeTask extends Task {
-
- private double timeVal;
-
- public CommTimeTask(String name, double computeDuration, double messageSize) throws JniException, NativeException{
- super(name,computeDuration,messageSize);
- }
-
- public void setTime(double timeVal){
- this.timeVal = timeVal;
- }
-
- public double getTime() {
- return this.timeVal;
- }
-}
-
\ No newline at end of file
-# Copyright (c) 2004-2007. The SimGrid team. All right reserved.
+# Copyright (c) 2004-2010. The SimGrid team. All right reserved.
# This file is part of the SimGrid project. This is free software:
# You can redistribute and/or modify it under the terms of the
EXTRA_DIST=comm_time_deployment.xml comm_time_platform.xml
# Declare sources:
-JAVA_SRC=Master.java Slave.java CommTimeTest.java \
- MyTask.java FinalizeTask.java
+JAVA_SRC=Master.java Slave.java CommTimeTest.java FinalizeTask.java
JAVA_TESTS=CommTimeTest.class
TESTS=$(JAVA_TESTS)
Msg.info("Hello! Got "+ slavesCount + " slaves and "+tasksCount+" tasks to process");
for (int i = 0; i < tasksCount; i++) {
- MyTask task = new MyTask("Task_" + i, taskComputeSize, taskCommunicateSize);
+ Task task = new Task("Task_" + i, taskComputeSize, taskCommunicateSize);
if (i%1000==0)
Msg.info("Sending \"" + task.getName()+ "\" to \"slave_" + i % slavesCount + "\"");
task.send("slave_"+(i%slavesCount));
+++ /dev/null
-/*
- * $Id$
- *
- * Copyright 2006,2007,2010 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.
- */
-
-import simgrid.msg.*;
-
-public class MyTask extends Task {
-
- private double timeVal;
-
- public MyTask(String name, double computeDuration, double messageSize) throws JniException, NativeException{
- super(name,computeDuration,messageSize);
- }
-
- public void setTime(double timeVal){
- this.timeVal = timeVal;
- }
-
- public double getTime() {
- return this.timeVal;
- }
-}
-
\ No newline at end of file
Msg.info("Receiving on 'slave_"+num+"'");
while(true) {
- Task t = Task.receive("slave_"+num);
+ Task task = Task.receive("slave_"+num);
- if (t instanceof FinalizeTask) {
+ if (task instanceof FinalizeTask) {
break;
}
- MyTask task = (MyTask)t;
task.execute();
-// Msg.info("\"" + task.getName() + "\" done ");
}
Msg.info("Received Finalize. I'm done. See you!");