Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the files generated by javasphinx in the git
[simgrid.git] / docs / source / java / org / simgrid / msg / Host.rst
1 class org.simgrid.msg.Host
2 ==========================
3
4 .. java:package:: org.simgrid.msg
5    :noindex:
6
7 .. java:type:: public class Host
8
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
10
11 Fields
12 ------
13 name
14 ^^^^
15
16 .. java:field:: protected String name
17    :outertype: Host
18
19 Constructors
20 ------------
21 Host
22 ^^^^
23
24 .. java:constructor:: protected Host()
25    :outertype: Host
26
27 Methods
28 -------
29 all
30 ^^^
31
32 .. java:method:: public static native Host[] all()
33    :outertype: Host
34
35    Returns all hosts of the installed platform.
36
37 currentHost
38 ^^^^^^^^^^^
39
40 .. java:method:: public static native Host currentHost()
41    :outertype: Host
42
43    Returns the host of the current process.
44
45 getAttachedStorage
46 ^^^^^^^^^^^^^^^^^^
47
48 .. java:method:: public native String[] getAttachedStorage()
49    :outertype: Host
50
51    This methods returns the list of storages (names) attached to an host
52
53 getAvgLoad
54 ^^^^^^^^^^
55
56 .. java:method:: public native double getAvgLoad()
57    :outertype: Host
58
59    Returns the average load of the host as a ratio since the beginning of the simulation
60
61 getByName
62 ^^^^^^^^^
63
64 .. java:method:: public static native Host getByName(String name) throws HostNotFoundException
65    :outertype: Host
66
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.
68
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.
72
73 getComputedFlops
74 ^^^^^^^^^^^^^^^^
75
76 .. java:method:: public native double getComputedFlops()
77    :outertype: Host
78
79    Returns the number of flops computed of the host since the beginning of the simulation
80
81 getConsumedEnergy
82 ^^^^^^^^^^^^^^^^^
83
84 .. java:method:: public native double getConsumedEnergy()
85    :outertype: Host
86
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.
88
89 getCoreNumber
90 ^^^^^^^^^^^^^
91
92 .. java:method:: public native double getCoreNumber()
93    :outertype: Host
94
95 getCount
96 ^^^^^^^^
97
98 .. java:method:: public static native int getCount()
99    :outertype: Host
100
101    Counts the installed hosts.
102
103 getCurrentLoad
104 ^^^^^^^^^^^^^^
105
106 .. java:method:: public native double getCurrentLoad()
107    :outertype: Host
108
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.
110
111 getCurrentPowerPeak
112 ^^^^^^^^^^^^^^^^^^^
113
114 .. java:method:: public native double getCurrentPowerPeak()
115    :outertype: Host
116
117    Returns the speed of the processor (in flop/s) at the current pstate. See also @ref plugin_energy.
118
119 getData
120 ^^^^^^^
121
122 .. java:method:: public Object getData()
123    :outertype: Host
124
125 getLoad
126 ^^^^^^^
127
128 .. java:method:: public native double getLoad()
129    :outertype: Host
130
131    Returns the current computation load (in flops per second)
132
133 getMountedStorage
134 ^^^^^^^^^^^^^^^^^
135
136 .. java:method:: public native Storage[] getMountedStorage()
137    :outertype: Host
138
139    Returns the list of mount point names on an host
140
141 getName
142 ^^^^^^^
143
144 .. java:method:: public String getName()
145    :outertype: Host
146
147 getPowerPeakAt
148 ^^^^^^^^^^^^^^
149
150 .. java:method:: public native double getPowerPeakAt(int pstate)
151    :outertype: Host
152
153    Returns the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.
154
155 getProperty
156 ^^^^^^^^^^^
157
158 .. java:method:: public native String getProperty(String name)
159    :outertype: Host
160
161 getPstate
162 ^^^^^^^^^
163
164 .. java:method:: public native int getPstate()
165    :outertype: Host
166
167    Returns the current pstate
168
169 getPstatesCount
170 ^^^^^^^^^^^^^^^
171
172 .. java:method:: public native int getPstatesCount()
173    :outertype: Host
174
175 getSpeed
176 ^^^^^^^^
177
178 .. java:method:: public native double getSpeed()
179    :outertype: Host
180
181    This method returns the speed of the processor of a host (in flops), regardless of the current load of the machine.
182
183 hasData
184 ^^^^^^^
185
186 .. java:method:: public boolean hasData()
187    :outertype: Host
188
189    Returns true if the host has an associated data object.
190
191 isOn
192 ^^^^
193
194 .. java:method:: public native boolean isOn()
195    :outertype: Host
196
197    Tests if an host is up and running.
198
199 off
200 ^^^
201
202 .. java:method:: public native void off() throws ProcessKilledError
203    :outertype: Host
204
205    Stops the host if it is on
206
207 on
208 ^^
209
210 .. java:method:: public native void on()
211    :outertype: Host
212
213    Starts the host if it is off
214
215 setAsyncMailbox
216 ^^^^^^^^^^^^^^^
217
218 .. java:method:: public static native void setAsyncMailbox(String mailboxName)
219    :outertype: Host
220
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.
222
223    :param mailboxName: The name of the mailbox
224
225 setData
226 ^^^^^^^
227
228 .. java:method:: public void setData(Object data)
229    :outertype: Host
230
231 setProperty
232 ^^^^^^^^^^^
233
234 .. java:method:: public native void setProperty(String name, String value)
235    :outertype: Host
236
237 setPstate
238 ^^^^^^^^^
239
240 .. java:method:: public native void setPstate(int pstate)
241    :outertype: Host
242
243    Changes the current pstate
244
245 toString
246 ^^^^^^^^
247
248 .. java:method:: @Override public String toString()
249    :outertype: Host
250
251 updateAllEnergyConsumptions
252 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
253
254 .. java:method:: public static native void updateAllEnergyConsumptions()
255    :outertype: Host
256
257    After this call, sg_host_get_consumed_energy() will not interrupt your process (until after the next clock update).
258