class org.simgrid.msg.Host

public class Host

A host object represents a location (any possible place) where a process may run. Thus it is represented as a physical resource with computing capabilities, some mailboxes to enable running process to communicate with remote ones, and some private data that can be only accessed by local process. An instance of this class is always bound with the corresponding native host. All the native hosts are automatically created during the call of the method Msg.createEnvironment(). This method take as parameter a platform file which describes all elements of the platform (host, link, root..). You cannot create a host yourself. The best way to get a host instance is to call the static method Host.getByName(). For example to get the instance of the host. If your platform file description contains a host named “Jacquelin” : verbatim Host jacquelin; try { jacquelin = Host.getByName(“Jacquelin”); } catch(HostNotFoundException e) { System.err.println(e.toString()); } … endverbatim

Fields

name

protected String name

Constructors

Host

protected Host()

Methods

all

public static native Host[] all()

Returns all hosts of the installed platform.

currentHost

public static native Host currentHost()

Returns the host of the current process.

getAvgLoad

public native double getAvgLoad()

Returns the average load of the host as a ratio since the beginning of the simulation

getByName

public static native Host getByName(String name)

This static method gets a host instance associated with a native host of your platform. This is the best way to get a java host object.

Parameters
  • name – The name of the host to get.

Throws
Returns

The host object with the given name.

getComputedFlops

public native double getComputedFlops()

Returns the number of flops computed of the host since the beginning of the simulation

getConsumedEnergy

public native double getConsumedEnergy()

Returns the amount of Joules consumed by that host so far Please note that since the consumption is lazily updated, it may require a simcall to update it. The result is that the actor requesting this value will be interrupted, the value will be updated in kernel mode before returning the control to the requesting actor.

getCoreNumber

public native double getCoreNumber()

getCount

public static native int getCount()

Counts the installed hosts.

getCurrentLoad

public native double getCurrentLoad()

Returns the current load of the host, as a ratio = achieved_flops / (core_current_speed * core_amount) See simgrid::plugin::HostLoad::get_current_load() for the full documentation.

getCurrentPowerPeak

public native double getCurrentPowerPeak()

Returns the speed of the processor (in flop/s) at the current pstate. See also @ref plugin_energy.

getData

public Object getData()

getLoad

public native double getLoad()

Returns the current computation load (in flops per second)

getName

public String getName()

getPowerPeakAt

public native double getPowerPeakAt(int pstate)

Returns the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.

getProperty

public native String getProperty(String name)

getPstate

public native int getPstate()

Returns the current pstate

getPstatesCount

public native int getPstatesCount()

getSpeed

public native double getSpeed()

This method returns the speed of the processor of a host (in flops), regardless of the current load of the machine.

hasData

public boolean hasData()

Returns true if the host has an associated data object.

isOn

public native boolean isOn()

Tests if a host is up and running.

off

public native void off()

Stops the host if it is on

on

public native void on()

Starts the host if it is off

setAsyncMailbox

public static native void setAsyncMailbox(String mailboxName)

This static method sets a mailbox to receive in asynchronous mode. All messages sent to this mailbox will be transferred to the receiver without waiting for the receive call. The receive call will still be necessary to use the received data. If there is a need to receive some messages asynchronously, and some not, two different mailboxes should be used.

Parameters
  • mailboxName – The name of the mailbox

setData

public void setData(Object data)

setProperty

public native void setProperty(String name, String value)

setPstate

public native void setPstate(int pstate)

Changes the current pstate

toString

public String toString()

updateAllEnergyConsumptions

public static native void updateAllEnergyConsumptions()

After this call, sg_host_get_consumed_energy() will not interrupt your process (until after the next clock update).