Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use MSG_task_get_flops_amount() when we don't want a ratio
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 8 Dec 2017 21:25:57 +0000 (22:25 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 8 Dec 2017 22:18:21 +0000 (23:18 +0100)
examples/msg/cloud-capping/cloud-capping.c
examples/msg/cloud-two-tasks/cloud-two-tasks.c
src/bindings/java/jmsg_task.cpp
src/msg/msg_vm.cpp
teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp

index b27d11e..4471034 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-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. */
@@ -76,8 +75,8 @@ static void test_dynamic_change(void)
   MSG_process_create("worker0", worker_busy_loop_main, &task0, (msg_host_t)vm0);
   MSG_process_create("worker1", worker_busy_loop_main, &task1, (msg_host_t)vm1);
 
-  double task0_remain_prev = MSG_task_get_remaining_work_ratio(task0);
-  double task1_remain_prev = MSG_task_get_remaining_work_ratio(task1);
+  double task0_remain_prev = MSG_task_get_flops_amount(task0);
+  double task1_remain_prev = MSG_task_get_flops_amount(task1);
 
   const double cpu_speed = MSG_host_get_speed(pm0);
   for (int i = 0; i < 10; i++) {
@@ -86,8 +85,8 @@ static void test_dynamic_change(void)
     MSG_vm_set_bound(vm1, new_bound);
     MSG_process_sleep(100);
 
-    double task0_remain_now = MSG_task_get_remaining_work_ratio(task0);
-    double task1_remain_now = MSG_task_get_remaining_work_ratio(task1);
+    double task0_remain_now = MSG_task_get_flops_amount(task0);
+    double task1_remain_now = MSG_task_get_flops_amount(task1);
 
     double task0_flops_per_sec = task0_remain_prev - task0_remain_now;
     double task1_flops_per_sec = task1_remain_prev - task1_remain_now;
index 3dafdbd..746e5c8 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-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. */
@@ -52,7 +51,7 @@ static int master_main(int argc, char *argv[])
 
   while(MSG_get_clock()<100) {
     if (atask != NULL)
-      XBT_INFO("aTask remaining duration: %g", MSG_task_get_remaining_work_ratio(atask));
+      XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask));
     MSG_process_sleep(1);
   }
 
index 6c41d3e..91f2557 100644 (file)
@@ -205,7 +205,7 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount(JNIEnv * env,
     jxbt_throw_notbound(env, "task", jtask);
     return -1;
   }
-  return (jdouble)MSG_task_get_remaining_work_ratio(ptask);
+  return (jdouble)MSG_task_get_flops_amount(ptask);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname) {
index 3d9c4da..3da12b6 100644 (file)
@@ -347,7 +347,7 @@ static void start_dirty_page_tracking(msg_vm_t vm)
 
   for (auto const& elm : vm->pimpl_vm_->dp_objs) {
     dirty_page_t dp    = elm.second;
-    double remaining = MSG_task_get_remaining_work_ratio(dp->task);
+    double remaining   = MSG_task_get_flops_amount(dp->task);
     dp->prev_clock = MSG_get_clock();
     dp->prev_remaining = remaining;
     XBT_DEBUG("%s@%s remaining %f", elm.first.c_str(), vm->getCname(), remaining);
@@ -377,7 +377,7 @@ static double lookup_computed_flop_counts(msg_vm_t vm, int stage_for_fancy_debug
   for (auto const& elm : vm->pimpl_vm_->dp_objs) {
     const std::string& key = elm.first;
     dirty_page_t dp  = elm.second;
-    double remaining       = MSG_task_get_remaining_work_ratio(dp->task);
+    double remaining       = MSG_task_get_flops_amount(dp->task);
 
     double clock = MSG_get_clock();
 
@@ -436,7 +436,7 @@ void MSG_host_del_task(msg_host_t host, msg_task_t task)
   /* If we are in the middle of dirty page tracking, we record how much computation has been done until now, and keep
    * the information for the lookup_() function that will called soon. */
   if (vm->pimpl_vm_->dp_enabled) {
-    double remaining = MSG_task_get_remaining_work_ratio(task);
+    double remaining = MSG_task_get_flops_amount(task);
     double clock = MSG_get_clock();
     double updated = get_computed(key, vm, dp, remaining, clock); // was host instead of vm
 
index 0326f56..76ca980 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-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. */
@@ -98,7 +97,7 @@ static int worker(int /*argc*/, char* /*argv*/ [])
     MSG_task_execute(task);
     double end = MSG_get_clock();
     XBT_INFO("Task \"%s\" done in %f (amount %f)", MSG_task_get_name(task), end - start,
-             MSG_task_get_remaining_work_ratio(task));
+             MSG_task_get_flops_amount(task));
 
     MSG_task_destroy(task);
   }