git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4903
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
--- /dev/null
+/*
+ * $Id: CommTimeTask.java 3685 2007-07-08 21:02:03Z mquinson $
+ *
+ * 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 FinalizeTask extends Task {
+
+ public FinalizeTask() throws JniException, NativeException{
+ create("",0,0);
+ }
+}
+
\ No newline at end of file
for (int i = 0; i < slavecount; i++) {
for (int i = 0; i < slavecount; i++) {
- CommTimeTask task = new CommTimeTask("finalize_" + i,0,0);
- task.setData(221297);
+ FinalizeTask task = new FinalizeTask();
Msg.info("Send task to host : " + slaves[i].getName());
channel.put(task,slaves[i]);
Msg.info("Send task to host : " + slaves[i].getName());
channel.put(task,slaves[i]);
- double time1,time2;
-
- time1 = Msg.getClock();
-
- CommTimeTask task = (CommTimeTask)channel.get();
- time2 = Msg.getClock();
-
- if(task.getData() == 221297) {
- Msg.info("Received " + task.getName() + " " + getHost().getName());
+ double time1 = Msg.getClock();
+ Task t = channel.get();
+ double time2 = Msg.getClock();
+
+ if (t instanceof FinalizeTask) {
+ Msg.info("Received Finalize " + getHost().getName());
+ CommTimeTask task = (CommTimeTask)t;
if(time1 < task.getTime())
time1 = task.getTime();
if(time1 < task.getTime())
time1 = task.getTime();
- Msg.info("Processing \"" + task.getName() + "\" " + getHost().getName() +
+/* Msg.info("Processing \"" + task.getName() + "\" " + getHost().getName() +
" (Communication time : " + (time2 - time1) + ")");
" (Communication time : " + (time2 - time1) + ")");