Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add MSG_task_set_data_size function binding
authorJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Wed, 30 Jan 2013 11:30:16 +0000 (12:30 +0100)
committerJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Wed, 30 Jan 2013 11:30:16 +0000 (12:30 +0100)
org/simgrid/msg/Task.java
src/jmsg_task.c
src/jmsg_task.h

index 022961d..1b2e0cd 100644 (file)
@@ -152,6 +152,11 @@ public class Task {
         * @param computationAmount the amount of computation needed to process the task
         */
        public native void setComputeDuration(double computationAmount);
+       /**
+        * Set the data size of the task
+        * @param dataSize the size of the task
+        */
+       public native void setDataSize(double dataSize);
        /* *                     * *
         * * Computation-related * *
         * *                     * */
index d7a9fea..a2e4b92 100644 (file)
@@ -348,6 +348,18 @@ Java_org_simgrid_msg_Task_setComputeDuration
        MSG_task_set_compute_duration(task, (double) computationAmount);
 }
 JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Task_setDataSize
+               (JNIEnv *env, jobject jtask, jdouble dataSize) {
+       msg_task_t task = jtask_to_native_task(jtask, env);
+
+       if (!task) {
+    jxbt_throw_notbound(env, "task", jtask);
+    return;
+       }
+       MSG_task_set_data_size(task, (double) dataSize);
+}
+
+JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_send(JNIEnv * env,jobject jtask,
                                     jstring jalias,
                                     jdouble jtimeout)
index 99b83e6..2bae18d 100644 (file)
@@ -183,6 +183,16 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Task_setComputeDuration
                (JNIEnv *env, jobject jtask, jdouble computationAmount);
+               
+               /**
+ * Class               org_simgrid_msg_Task
+ * Method              setDataSize
+ * Signature   (D)V
+ */
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Task_setDataSize
+               (JNIEnv *env, jobject jtask, jdouble dataSize);
+               
 /**
  * Class               org_simgrid_msg_Task
  * Method              send