From 73e354350570d611a62abfa09276681893111696 Mon Sep 17 00:00:00 2001 From: Takahiro Hirofuchi Date: Thu, 6 Jun 2013 16:54:45 +0200 Subject: [PATCH] add comments --- examples/msg/cloud/bound.c | 13 +++++++++---- src/msg/msg_vm.c | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/msg/cloud/bound.c b/examples/msg/cloud/bound.c index 20d081c40b..ec22eefd3d 100644 --- a/examples/msg/cloud/bound.c +++ b/examples/msg/cloud/bound.c @@ -72,6 +72,7 @@ static int worker_busy_loop_main(int argc, char *argv[]) return 0; } +/* FIXME: */ #define DOUBLE_MAX 100000000000L static void test_dynamic_change(void) @@ -108,8 +109,8 @@ static void test_dynamic_change(void) double task0_flops_per_sec = task0_remain_prev - task0_remain_now; double task1_flops_per_sec = task1_remain_prev - task1_remain_now; - XBT_INFO("VM0: %f flops/s", task0_flops_per_sec / 100); - XBT_INFO("VM1: %f flops/s", task1_flops_per_sec / 100); + XBT_INFO("Task0@VM0: %f flops/s", task0_flops_per_sec / 100); + XBT_INFO("Task1@VM1: %f flops/s", task1_flops_per_sec / 100); task0_remain_prev = task0_remain_now; task1_remain_prev = task1_remain_now; @@ -338,7 +339,7 @@ static int master_main(int argc, char *argv[]) } - XBT_INFO("# 10. Change a bound dynamically"); + XBT_INFO("# 10. Change a bound dynamically."); test_dynamic_change(); return 0; @@ -360,7 +361,11 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); /* load the platform file */ - xbt_assert(argc == 2); + if (argc != 2) { + printf("Usage: %s example/msg/cloud/simple_plat.xml\n", argv[0]); + return 1; + } + MSG_create_environment(argv[1]); xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar(); diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index 6cbe343178..8055867932 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -1184,6 +1184,7 @@ msg_host_t MSG_vm_get_pm(msg_vm_t vm) /** @brief Set a CPU bound for a given VM. * @ingroup msg_VMs * + * 1. * Note that in some cases MSG_task_set_bound() may not intuitively work for VMs. * * For example, @@ -1207,6 +1208,10 @@ msg_host_t MSG_vm_get_pm(msg_vm_t vm) * * The current solution is to use MSG_vm_set_bound(), which allows us to * directly set the bound of the dummy CPU action. + * + * + * 2. + * Note that bound == 0 means no bound (i.e., unlimited). */ void MSG_vm_set_bound(msg_vm_t vm, double bound) { -- 2.20.1