1 class org.simgrid.msg.Host
2 ==========================
4 .. java:package:: org.simgrid.msg
7 .. java:type:: public class Host
9 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
16 .. java:field:: protected String name
24 .. java:constructor:: protected Host()
32 .. java:method:: public static native Host[] all()
35 Returns all hosts of the installed platform.
40 .. java:method:: public static native Host currentHost()
43 Returns the host of the current process.
48 .. java:method:: public native String[] getAttachedStorage()
51 This methods returns the list of storages (names) attached to an host
56 .. java:method:: public native double getAvgLoad()
59 Returns the average load of the host as a ratio since the beginning of the simulation
64 .. java:method:: public static native Host getByName(String name) throws HostNotFoundException
67 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.
69 :param name: The name of the host to get.
70 :throws HostNotFoundException: if the name of the host is not valid.
71 :return: The host object with the given name.
76 .. java:method:: public native double getComputedFlops()
79 Returns the number of flops computed of the host since the beginning of the simulation
84 .. java:method:: public native double getConsumedEnergy()
87 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.
92 .. java:method:: public native double getCoreNumber()
98 .. java:method:: public static native int getCount()
101 Counts the installed hosts.
106 .. java:method:: public native double getCurrentLoad()
109 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.
114 .. java:method:: public native double getCurrentPowerPeak()
117 Returns the speed of the processor (in flop/s) at the current pstate. See also @ref plugin_energy.
122 .. java:method:: public Object getData()
128 .. java:method:: public native double getLoad()
131 Returns the current computation load (in flops per second)
136 .. java:method:: public native Storage[] getMountedStorage()
139 Returns the list of mount point names on an host
144 .. java:method:: public String getName()
150 .. java:method:: public native double getPowerPeakAt(int pstate)
153 Returns the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.
158 .. java:method:: public native String getProperty(String name)
164 .. java:method:: public native int getPstate()
167 Returns the current pstate
172 .. java:method:: public native int getPstatesCount()
178 .. java:method:: public native double getSpeed()
181 This method returns the speed of the processor of a host (in flops), regardless of the current load of the machine.
186 .. java:method:: public boolean hasData()
189 Returns true if the host has an associated data object.
194 .. java:method:: public native boolean isOn()
197 Tests if an host is up and running.
202 .. java:method:: public native void off() throws ProcessKilledError
205 Stops the host if it is on
210 .. java:method:: public native void on()
213 Starts the host if it is off
218 .. java:method:: public static native void setAsyncMailbox(String mailboxName)
221 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.
223 :param mailboxName: The name of the mailbox
228 .. java:method:: public void setData(Object data)
234 .. java:method:: public native void setProperty(String name, String value)
240 .. java:method:: public native void setPstate(int pstate)
243 Changes the current pstate
248 .. java:method:: @Override public String toString()
251 updateAllEnergyConsumptions
252 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
254 .. java:method:: public static native void updateAllEnergyConsumptions()
257 After this call, sg_host_get_consumed_energy() will not interrupt your process (until after the next clock update).