From 5c26f402e5be8c32801ad34e1a9a7726c6b9c43c Mon Sep 17 00:00:00 2001 From: mquinson Date: Sat, 27 Feb 2010 23:06:02 +0000 Subject: [PATCH 1/1] Also remove the pseudo-specific task type for this example (since it's also empty) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7134 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/java/comm_time/CommTimeTask.java | 29 ----------------------- examples/java/comm_time/Makefile.am | 5 ++-- examples/java/comm_time/Master.java | 2 +- examples/java/comm_time/MyTask.java | 28 ---------------------- examples/java/comm_time/Slave.java | 6 ++--- 5 files changed, 5 insertions(+), 65 deletions(-) delete mode 100644 examples/java/comm_time/CommTimeTask.java delete mode 100644 examples/java/comm_time/MyTask.java diff --git a/examples/java/comm_time/CommTimeTask.java b/examples/java/comm_time/CommTimeTask.java deleted file mode 100644 index 1890530adf..0000000000 --- a/examples/java/comm_time/CommTimeTask.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * $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 diff --git a/examples/java/comm_time/Makefile.am b/examples/java/comm_time/Makefile.am index 10b4b5b217..a87ab18450 100644 --- a/examples/java/comm_time/Makefile.am +++ b/examples/java/comm_time/Makefile.am @@ -1,4 +1,4 @@ -# 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 @@ -8,8 +8,7 @@ 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) diff --git a/examples/java/comm_time/Master.java b/examples/java/comm_time/Master.java index 8343873054..7f3b5c725b 100644 --- a/examples/java/comm_time/Master.java +++ b/examples/java/comm_time/Master.java @@ -25,7 +25,7 @@ public class Master extends simgrid.msg.Process { 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)); diff --git a/examples/java/comm_time/MyTask.java b/examples/java/comm_time/MyTask.java deleted file mode 100644 index 633ab004a5..0000000000 --- a/examples/java/comm_time/MyTask.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * $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 diff --git a/examples/java/comm_time/Slave.java b/examples/java/comm_time/Slave.java index 7a7ace7e21..e9069ad997 100644 --- a/examples/java/comm_time/Slave.java +++ b/examples/java/comm_time/Slave.java @@ -21,14 +21,12 @@ public class Slave extends simgrid.msg.Process { 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!"); -- 2.20.1