X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b22adadfea7ebc1441083b43c6e287cdf1eaa79a..77bbf3027c4240a2e833209a3a3f186589da8577:/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 4da5e01347..a5f32b1cf4 100644 --- a/src/bindings/java/org/simgrid/msg/Host.java +++ b/src/bindings/java/org/simgrid/msg/Host.java @@ -1,7 +1,6 @@ /* Bindings to the MSG hosts */ -/* Copyright (c) 2006-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -71,9 +70,8 @@ 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 static native Host getByName(String name) throws HostNotFoundException, NullPointerException; + public static native Host getByName(String name) throws HostNotFoundException; /** Counts the installed hosts. */ public static native int getCount(); @@ -134,7 +132,16 @@ public class 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 */ + /** After this call, sg_host_get_consumed_energy() will not interrupt your process + * (until after the next clock update). + */ + 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 */ @@ -142,14 +149,14 @@ public class Host { /** 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. */ + /** Returns the speed of the processor (in flop/s) at the current pstate. See also @ref 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. */ + /** Returns the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy. */ public native double getPowerPeakAt(int pstate); /** Class initializer, to initialize various JNI stuff */ - public static native void nativeInit(); + private static native void nativeInit(); static { nativeInit(); }