1 /* Copyright (c) 2012-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. */
9 import org.simgrid.msg.Host;
10 import org.simgrid.msg.Msg;
11 import org.simgrid.msg.MsgException;
12 import org.simgrid.msg.Task;
13 import org.simgrid.msg.Process;
15 public class Emigrant extends Process {
16 public Emigrant(Host host, String name, String[]args) {
17 super(host,name,args);
19 public void main(String[] args) throws MsgException {
20 Migration.mutex.acquire();
22 Msg.info("I'll look for a new job on another machine where the grass is greener.");
23 migrate(Host.getByName("Boivin"));
25 Msg.info("Yeah, found something to do");
26 Task task = new Task("job", 98095000, 0);
30 Msg.info("Moving back to home after work");
31 migrate(Host.getByName("Jacquelin"));
32 migrate(Host.getByName("Boivin"));
35 Migration.processToMigrate = this;
36 Migration.mutex.release();
39 Msg.info("I've been moved on this new host:" + getHost().getName());
40 Msg.info("Uh, nothing to do here. Stopping now");