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. */
7 package energy.consumption;
9 import org.simgrid.msg.Msg;
10 import org.simgrid.msg.Comm;
11 import org.simgrid.msg.Host;
12 import org.simgrid.msg.Task;
13 import org.simgrid.msg.Process;
14 import org.simgrid.msg.MsgException;
15 import org.simgrid.msg.HostNotFoundException;
17 public class EnergyConsumer extends Process {
18 public EnergyConsumer(String hostname, String name) throws HostNotFoundException{
22 public void main(String[] args) throws MsgException {
23 Msg.info("Energetic profile: " + getHost().getProperty("watt_per_state"));
24 Msg.info("Initial peak speed= " + getHost().getSpeed() + " flop/s; Energy dissipated = "
25 + getHost().getConsumedEnergy() + " J");
28 Msg.info("Currently consumed energy after sleeping 10 sec: "+getHost().getConsumedEnergy());
29 new Task(null, 1E9, 0).execute();
30 Msg.info("Currently consumed energy after executing 1E9 flops: "+getHost().getConsumedEnergy());