4 * Copyright 2010. The SimGrid Team. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package.
10 import simgrid.msg.MsgException;
11 import simgrid.msg.Task;
12 import simgrid.msg.Msg;
14 public class Node extends simgrid.msg.Process {
16 public void request(double CStime) throws MsgException {
17 RequestTask req = new RequestTask(this.name);
18 Msg.info("Send a request to the coordinator");
19 req.send("coordinator");
20 Msg.info("Wait for a grant from the coordinator");
21 Task.receive(this.name); // FIXME: ensure that this is a grant
22 Task compute = new Task("CS", CStime, 0);
24 ReleaseTask release = new ReleaseTask();
25 release.send("coordinator");
28 public void main(String[] args) throws MsgException {
29 request(Double.parseDouble(args[1]));