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