1 /* Copyright (c) 2006-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 import org.simgrid.msg.*;
10 public class Slave extends org.simgrid.msg.Process {
11 public Slave(Host host, String name, String[]args) {
12 super(host,name,args);
14 public void main(String[] args) throws MsgException {
15 if (args.length < 1) {
16 Msg.info("Slave needs 1 argument (its number)");
20 int num = Integer.valueOf(args[0]).intValue();
21 Msg.info("Receiving on 'slave_"+num+"'");
24 Task task = Task.receive("slave_"+num);
25 if (task instanceof FinalizeTask) {
30 Msg.info("Received Finalize. I'm done. See you!");