Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename MSG_host_is_avail() to MSG_host_is_on()
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Oct 2014 17:28:12 +0000 (19:28 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Oct 2014 18:43:56 +0000 (20:43 +0200)
(and same in Java)

ChangeLog
include/msg/msg.h
src/bindings/java/jmsg_host.c
src/bindings/java/jmsg_host.h
src/bindings/java/org/simgrid/msg/Host.java
src/bindings/java/org/simgrid/surf/NetworkLink.java
src/msg/msg_host.c

index f820250..ad6b503 100644 (file)
--- 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
index 0d07825..5fceca3 100644 (file)
@@ -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) \
index 279130a..0d4469c 100644 (file)
@@ -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
index 9033531..609b9a9 100644 (file)
@@ -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);
 
 
index 839c84c..07dace8 100644 (file)
@@ -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
index 9fdffda..5e61e7f 100644 (file)
@@ -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);
index 4940e29..1f36f3b 100644 (file)
@@ -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