From: mquinson Date: Sat, 27 Feb 2010 23:06:16 +0000 (+0000) Subject: Use send/recv instead of put/get X-Git-Tag: SVN~601 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b374f6de127cc631c673ea4679bc1a8654c31577 Use send/recv instead of put/get git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7137 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/java/ping_pong/PingPongTest.java b/examples/java/ping_pong/PingPongTest.java index f5c3d589fd..c92750bfb8 100644 --- a/examples/java/ping_pong/PingPongTest.java +++ b/examples/java/ping_pong/PingPongTest.java @@ -28,9 +28,6 @@ public class PingPongTest { System.exit(1); } - /* specify a paje output file. */ - Msg.pajeOutput("ping_pong.trace"); - /* construct the platform and deploy the application */ Msg.createEnvironment(args[0]); Msg.deployApplication(args[1]); diff --git a/examples/java/ping_pong/Receiver.java b/examples/java/ping_pong/Receiver.java index a35426d04f..1f0cf4ea7e 100644 --- a/examples/java/ping_pong/Receiver.java +++ b/examples/java/ping_pong/Receiver.java @@ -24,7 +24,7 @@ public class Receiver extends simgrid.msg.Process { Msg.info("try to get a task"); - PingPongTask task = (PingPongTask)Task.get(0); + PingPongTask task = (PingPongTask)Task.receive(getHost().getName()); double timeGot = Msg.getClock(); double timeSent = task.getTime(); diff --git a/examples/java/ping_pong/Sender.java b/examples/java/ping_pong/Sender.java index fd44bb252f..846566fcc3 100644 --- a/examples/java/ping_pong/Sender.java +++ b/examples/java/ping_pong/Sender.java @@ -1,8 +1,7 @@ /* - * $Id$ + * Sender of basic ping/pong example * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All rights reserved. + * 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. @@ -21,15 +20,15 @@ public class Sender extends simgrid.msg.Process { int hostCount = args.length; - Msg.info("host count : " + hostCount); - Host hostTable[] = new Host[hostCount]; + Msg.info("host count: " + hostCount); + String mailboxes[] = new String[hostCount]; double time; double computeDuration = 0; PingPongTask task; for(int pos = 0; pos < args.length ; pos++) { try { - hostTable[pos] = Host.getByName(args[pos]); + mailboxes[pos] = Host.getByName(args[pos]).getName(); } catch (HostNotFoundException e) { Msg.info("Invalid deployment file: " + e.toString()); System.exit(1); @@ -39,12 +38,12 @@ public class Sender extends simgrid.msg.Process { for (int pos = 0; pos < hostCount; pos++) { time = Msg.getClock(); - Msg.info("sender time : " + time); + Msg.info("sender time: " + time); task = new PingPongTask("no name",computeDuration,commSizeLat); task.setTime(time); - hostTable[pos].put(0,task); + task.send(mailboxes[pos]); } Msg.info("goodbye!");