class org.simgrid.msg… java:import:: org.simgrid.msg Storage

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 an 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 an 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.

getAttachedStorage

public native String[] getAttachedStorage()

This methods returns the list of storages (names) attached to an host

getByName

public static native Host getByName(String name)

This static method gets an 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.

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.

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()

getMountedStorage

public native Storage[] getMountedStorage()

Returns the list of mount point names on an host

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 an 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).