From: Martin Quinson Date: Tue, 7 Oct 2014 17:28:12 +0000 (+0200) Subject: rename MSG_host_is_avail() to MSG_host_is_on() X-Git-Tag: v3_12~765 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f8cf994b5d7f833930b87bfee6e239ea9c9f6c29 rename MSG_host_is_avail() to MSG_host_is_on() (and same in Java) --- diff --git a/ChangeLog b/ChangeLog index f820250b94..ad6b503f35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ SimGrid (3.12) NOT RELEASED; urgency=low + cMSG: + * Interface improvement: + - Rename MSG_host_is_avail(h) to MSG_host_is_on(h) + jMSG: + * Interface improvement: + - Rename Host.isAvail() to Host.isOn() SIMIX: * New functions - SIMIX_process_throw: raises an exception in a remote process diff --git a/include/msg/msg.h b/include/msg/msg.h index 0d07825c76..5fceca3e31 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -131,7 +131,8 @@ XBT_PUBLIC(int) MSG_get_host_msgload(msg_host_t host); XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h); XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h); XBT_PUBLIC(xbt_swag_t) MSG_host_get_process_list(msg_host_t h); -XBT_PUBLIC(int) MSG_host_is_avail(msg_host_t h); +XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h); +XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h); XBT_PUBLIC(void) __MSG_host_priv_free(msg_host_priv_t priv); XBT_PUBLIC(void) __MSG_host_destroy(msg_host_t host); @@ -368,6 +369,8 @@ typedef msg_error_t MSG_error_t; /* these are the functions which are deprecated. Do not use them, they may get removed in future releases */ XBT_PUBLIC(msg_host_t *) MSG_get_host_table(void); +#define MSG_host_is_avail(h) MSG_host_is_on(h) + #define MSG_TIMEOUT_FAILURE MSG_TIMEOUT #define MSG_TASK_CANCELLED MSG_TASK_CANCELED #define MSG_mailbox_put_with_time_out(mailbox, task, timeout) \ diff --git a/src/bindings/java/jmsg_host.c b/src/bindings/java/jmsg_host.c index 279130af1a..0d4469c572 100644 --- a/src/bindings/java/jmsg_host.c +++ b/src/bindings/java/jmsg_host.c @@ -254,7 +254,7 @@ Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, } JNIEXPORT jboolean JNICALL -Java_org_simgrid_msg_Host_isAvail(JNIEnv * env, jobject jhost) { +Java_org_simgrid_msg_Host_isOn(JNIEnv * env, jobject jhost) { msg_host_t host = jhost_get_native(env, jhost); if (!host) { @@ -262,7 +262,7 @@ Java_org_simgrid_msg_Host_isAvail(JNIEnv * env, jobject jhost) { return 0; } - return (jboolean) MSG_host_is_avail(host); + return (jboolean) MSG_host_is_on(host); } JNIEXPORT jobjectArray JNICALL diff --git a/src/bindings/java/jmsg_host.h b/src/bindings/java/jmsg_host.h index 9033531f54..609b9a95c8 100644 --- a/src/bindings/java/jmsg_host.h +++ b/src/bindings/java/jmsg_host.h @@ -183,10 +183,10 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue); /* * Class org_simgrid_msg_Host - * Method isAvail + * Method isOn * Signature ()Z */ -JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isAvail +JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn (JNIEnv *, jobject); diff --git a/src/bindings/java/org/simgrid/msg/Host.java b/src/bindings/java/org/simgrid/msg/Host.java index 839c84ce68..07dace87a8 100644 --- a/src/bindings/java/org/simgrid/msg/Host.java +++ b/src/bindings/java/org/simgrid/msg/Host.java @@ -199,10 +199,10 @@ public class Host { */ public native void setProperty(String name, String value); - /** This method tests if a host is available. - * @return True if the host is available. - */ - public native boolean isAvail(); + /** This method tests if a host is up and running. + * @return True if the host is available. + */ + 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 diff --git a/src/bindings/java/org/simgrid/surf/NetworkLink.java b/src/bindings/java/org/simgrid/surf/NetworkLink.java index 9fdffda68c..5e61e7f7de 100644 --- a/src/bindings/java/org/simgrid/surf/NetworkLink.java +++ b/src/bindings/java/org/simgrid/surf/NetworkLink.java @@ -72,6 +72,7 @@ public class NetworkLink extends Resource { /** * @param value The new bandwidth + * @param date When to change the bandwidth */ public void updateBandwidth(double value) { SurfJNI.NetworkLink_updateBandwidth__SWIG_1(swigCPtr, this, value); @@ -97,6 +98,7 @@ public class NetworkLink extends Resource { /** * @param value The new latency + * @param date When to change the latency */ public void updateLatency(double value) { SurfJNI.NetworkLink_updateLatency__SWIG_1(swigCPtr, this, value); diff --git a/src/msg/msg_host.c b/src/msg/msg_host.c index 4940e295c1..1f36f3b5af 100644 --- a/src/msg/msg_host.c +++ b/src/msg/msg_host.c @@ -307,17 +307,25 @@ void MSG_host_set_property_value(msg_host_t host, const char *name, char *value, } -/** \ingroup msg_gos_functions - * \brief Determine if a host is available. +/** @ingroup msg_gos_functions + * @brief Determine if a host is up and running. * - * \param host host to test - * \return Returns 1 if host is available, 0 otherwise + * @param host host to test + * @return Returns true if the host is up and running, and false if it's currently down */ -int MSG_host_is_avail(msg_host_t host) +int MSG_host_is_on(msg_host_t host) { xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); return (simcall_host_get_state(host)); } +/** @ingroup msg_gos_functions + * @brief Determine if a host is currently off. + */ +int MSG_host_is_off(msg_host_t host) +{ + xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); + return !(simcall_host_get_state(host)); +} /** \ingroup m_host_management * \brief Set the parameters of a given host