X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c9494b47b7e9ea3972a94cd6e7103b64ef6a8772..2376b66ee5b55b3c1844dddfda65f98356cec176:/src/bindings/java/org/simgrid/msg/Host.java diff --git a/src/bindings/java/org/simgrid/msg/Host.java b/src/bindings/java/org/simgrid/msg/Host.java index aa058cfac4..4676242247 100644 --- a/src/bindings/java/org/simgrid/msg/Host.java +++ b/src/bindings/java/org/simgrid/msg/Host.java @@ -49,26 +49,18 @@ public class Host { * @see Host.getByName(). */ private long bind; - /** - * Host name - */ protected String name; - /** - * User data. - */ + /** User data. */ private Object data; - /** - * - */ protected Host() { this.bind = 0; this.data = null; - }; + } + @Override public String toString (){ return this.name; - } /** @@ -79,31 +71,16 @@ public class Host { * * @return The host object with the given name. * @exception HostNotFoundException if the name of the host is not valid. - * NativeException if the native version of this method failed. - */ - public native static Host getByName(String name) - throws HostNotFoundException, NullPointerException; - /** - * This static method returns the count of the installed hosts. - * - * @return The count of the installed hosts. */ - public native static int getCount(); + public static native Host getByName(String name) throws HostNotFoundException; + /** Counts the installed hosts. */ + public static native int getCount(); - /** - * This static method return an instance to the host of the current process. - * - * @return The host on which the current process is executed. - */ - public native static Host currentHost(); + /** Returns the host of the current process. */ + public static native Host currentHost(); - /** - * This static method returns all of the hosts of the installed platform. - * - * @return An array containing all the hosts installed. - * - */ - public native static Host[] all(); + /** Returns all hosts of the installed platform. */ + public static native Host[] all(); /** * This static method sets a mailbox to receive in asynchronous mode. @@ -118,101 +95,69 @@ public class Host { */ public static native void setAsyncMailbox(String mailboxName); - - /** - * This method returns the name of a host. - * @return The name of the host. - * - */ public String getName() { return name; } - /** - * Sets the data of the host. - * @param data - */ public void setData(Object data) { this.data = data; } - /** - * Gets the data of the host. - * - * @return The data object associated with the host. - */ + public Object getData() { return this.data; } - - /** - * Checks whether a host has data. - * - * @return True if the host has an associated data object. - */ + /** Returns true if the host has an associated data object. */ public boolean hasData() { return null != this.data; } - /** - * This method start the host if it is off - */ + /** Starts the host if it is off */ public native void on(); - - /** - * This method stop the host if it is on - */ + /** Stops the host if it is on */ public native void off(); - /** - * This method returns the speed of the processor of a host, + * This method returns the speed of the processor of a host (in flops), * regardless of the current load of the machine. - * - * @return The speed of the processor of the host in flops. - * */ public native double getSpeed(); - - /** - * This method returns the number of core of a host. - * - * @return The speed of the processor of the host in flops. - * - */ public native double getCoreNumber(); - /** - * Returns the value of a given host property. - */ public native String getProperty(String name); - - /** - * Change the value of a given host property. - */ public native void setProperty(String name, String value); - - /** This method tests if a host is up and running. - * @return True if the host is available. - */ + /** Tests if an host is up and running. */ public native boolean isOn(); - /** This methods returns the list of mount point names on an host - * @return An array containing all mounted storages on the host - */ + /** Returns the list of mount point names on an host */ public native Storage[] getMountedStorage(); - - /** This methods returns the list of storages attached to an host - * @return An array containing all storages (name) attached to the host - */ + /** This methods returns the list of storages (names) attached to an host */ public native String[] getAttachedStorage(); - /** Returns the amount of Joules consumed by that host so far */ - public native double getConsumedEnergy(); - - /** - * Class initializer, to initialize various JNI stuff + /** After this call, sg_host_get_consumed_energy() will not interrupt your process + * (until after the next clock update). */ - public static native void nativeInit(); + public static native void updateAllEnergyConsumptions(); + /** 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. + */ + public native double getConsumedEnergy(); + + /** Returns the current pstate */ + public native int getPstate(); + /** Changes the current pstate */ + public native void setPstate(int pstate); + public native int getPstatesCount(); + /** Returns the speed of the processor (in flop/s) at the current pstate. See also @ref SURF_plugin_energy. */ + public native double getCurrentPowerPeak(); + /** Returns the speed of the processor (in flop/s) at a given pstate. See also @ref SURF_plugin_energy. */ + public native double getPowerPeakAt(int pstate); + + + /** Class initializer, to initialize various JNI stuff */ + private static native void nativeInit(); static { nativeInit(); }