From: Martin Quinson Date: Mon, 8 Jan 2018 16:46:43 +0000 (+0100) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3.19~379^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e112990de34a1d23cc56293558545ad16d1f7dfa?hp=11540a621b6da515148b06059d4700053feee4db Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/.gitattributes b/.gitattributes index 0f7186c54d..00f78b4494 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ .gitattributes export-ignore .gitignore export-ignore - +.mailmap export-ignore diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000..434bd3974e --- /dev/null +++ b/.mailmap @@ -0,0 +1,116 @@ +Khaled Baati +Benoît Bimal +Laurent Bobelin +Toufik Boubehziz +Toufik Boubehziz +Toufik Boubehziz +Paul Bédaride +Paul Bédaride +Paul Bédaride +Benjamin Camus +Benjamin Camus +Danilo Carastan Dos Santos +Alexandra Carpen-Amarie +Henri Casanova +Henri Casanova +Henri Casanova +Henri Casanova +Stéphane Castelli +Stéphane Castelli +Fabien Chaix +Fabien Chaix +Abdelmalek Cherier +Pierre-Nicolas Clauss +Pierre-Nicolas Clauss +Pierre-Nicolas Clauss +Pierre-Nicolas Clauss +Tom Cornebize +Gabriel Corona +Gabriel Corona +Augustin Degomme +Augustin Degomme +Augustin Degomme +Augustin Degomme +Augustin Degomme +Darina Dimitrova +Bruno Donassolo +Pierre-François Dutot +Lionel Eyraud-Dubois +Lionel Eyraud-Dubois +Lionel Eyraud-Dubois +Adrien Faure +Marc Frincu +Marc Fuentes +Kayo Fujiwara +Stéphane Genaud +Stéphane Genaud +Arnaud Giersch +Arnaud Giersch +Arnaud Giersch +Julien Gossa +Marion Guthmuller +Ahmed Harbaoui +Christian Heinrich +Jean-Baptiste Hervé +Takahiro Hirofuchi +Sascha Hunold +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Adrien Lèbre +Arnaud Legrand +Loris Marchal +El Mehdi Fekari +El Mehdi Fekari +Michael Mercier +Etienne Michon +Pierre Navarro +Pierre Navarro +Pierre Navarro +Pierre Navarro +Pierre Navarro +Pierre Navarro +Pierre Navarro +Lucas Nussbaum +Tien-Dat Phan +Martin Quinson <(no author)@48e7efb5-ca39-0410-a469-dd3cf9ba447f> +Martin Quinson +Martin Quinson +Martin Quinson +Martin Quinson +Martin Quinson +Jean-Noël Quintin +Jean-Noël Quintin +Jean-Noël Quintin +Jean-Noël Quintin +Jean-Noël Quintin +Jean-Noël Quintin +Jean-Noël Quintin +Jean-Noël Quintin +Cristian Rosa +Cristian Rosa +Lucas M. Schnorr +Lucas M. Schnorr +Lucas M. Schnorr +Lucas M. Schnorr +Mark Stillwell +Mark Stillwell +Mark Stillwell +Mark Stillwell +Frédéric Suter +Frédéric Suter +Frédéric Suter +Christophe Thiéry +Christophe Thiéry +Ruben Ezequiel Torti Lopez +Pedro Velho +Pedro Velho +Flavien Vernier +Steven Whatelse +Chidambar Zinnoury diff --git a/ChangeLog b/ChangeLog index b9f4bdd631..479c24b486 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ SimGrid (3.19) NOT RELEASED YET (target: March 20 2018, 16:15:27 UTC) + MSG + - Fix MSG_task_get_remaining_work_ratio() to return 1.0 for tasks that have + not started. + S4U - Execution->setHost() can be called after start() to migrate it. - Comm::test_any() is now implemented. @@ -12,10 +16,10 @@ SimGrid (3.18) Released December 24 2017 The "Ho Ho Ho! SimGrid 4 beta is coming to town" release. MSG IS NOW DEPRECATED. Please use S4U for new projects. - - Support for MSG should not be removed from SimGrid before 2020, + - Support for MSG should not be removed from SimGrid before 2020, but future evolutions will be limited to the integration of user-provided patches. - + S4U New features - s4u::onDeadlock() signal, run before stopping the simulation. - s4u::Exec: asynchronous executions (abstraction of background @@ -29,7 +33,7 @@ SimGrid (3.18) Released December 24 2017 Mailbox::getCname() instead to get a char*. - Storage::getName() changed to return a std::string, use Storage::getCname() instead to get a char*. - - s4u::allStorages() becomes s4u::getStorageList(whereTo) + - s4u::allStorages() becomes s4u::getStorageList(whereTo) to have both allocation and deallocation of the map in user space. MSG @@ -40,7 +44,7 @@ SimGrid (3.18) Released December 24 2017 - Both changes fix GitHub's #223 using PR #237 as a basis. Thanks Michael Mercier. - Most examples were converted to S4U and hidden elsewhere at tests. - Rational: we still want MSG to work; we want newcomers to use S4U. + Rationale: we still want MSG to work; we want newcomers to use S4U. SURF - LMM stuff moved to its own namespace: simgrid::kernel::lmm. @@ -54,10 +58,10 @@ SimGrid (3.18) Released December 24 2017 - Live migration is getting moved to a plugin. Dirty page tracking is the first part of this plugin. This imply that VM migration is now only possible if one this function is called : - - C/MSG: MSG_vm_live_migration_plugin_init() + - C/MSG: MSG_vm_live_migration_plugin_init() - C/C++: sg_vm_live_migration_plugin_init() - Java: Msg.liveMigrationInit() - For C and C++, "simgrid/plugins/live_migration.h" also has to be + For C and C++, "simgrid/plugins/live_migration.h" also has to be included. XBT @@ -92,11 +96,11 @@ SimGrid (3.18) Released December 24 2017 - #248: Kill of finished processes leads to segfault - #240: xbt_cond_wait_timeout should gracefully return for C apps - #239: please implement signal s4u::onDeadlock() - - #230: segfaults when exit() without run() + - #230: segfaults when exit() without run() - #225: s4u::Actor::kill() doesn not really kill victims in a join() - #223: MSG_task_get_flops_amount() not working with parallel tasks - - #222: Actor::kill() doesn't really kill and segfaults - - #221: odd LMM warning when killing an actor + - #222: Actor::kill() doesn't really kill and segfaults + - #221: odd LMM warning when killing an actor - #120: Memory leak when the processes are forcefully killed SimGrid (3.17) Released October 8 2017 diff --git a/doc/doxygen/inside_release.doc b/doc/doxygen/inside_release.doc index e66ac5fd48..95cfe0d699 100644 --- a/doc/doxygen/inside_release.doc +++ b/doc/doxygen/inside_release.doc @@ -98,7 +98,7 @@ the settings icon of the release you want to change. - Mail the simgrid-user mailing list - the NEWS chunk in the mail; - Hall of Fame in the mail\n - git log --after="22 september 2017" --pretty=short |grep Author|sort |uniq -c + git shortlog -sne v3.18.. - the ChangeLog chunk as attachment - Also mail some other lists (G5K users), with only the NEWS chunk and the link to the download section diff --git a/examples/java/energy/vm/EnergyVMRunner.java b/examples/java/energy/vm/EnergyVMRunner.java index 62e359da1a..1fbb13b1f7 100644 --- a/examples/java/energy/vm/EnergyVMRunner.java +++ b/examples/java/energy/vm/EnergyVMRunner.java @@ -47,10 +47,10 @@ public class EnergyVMRunner extends Process { Host host3 = Host.getByName("MyHost3"); Msg.info("Creating and starting two VMs"); - VM vmHost1 = new VM(host1, "vmHost1", 2048, 10, 50); + VM vmHost1 = new VM(host1, "vmHost1"); vmHost1.start(); - VM vmHost2 = new VM(host2, "vmHost3", 2048, 10, 50); + VM vmHost2 = new VM(host2, "vmHost3"); vmHost2.start(); Msg.info("Create two tasks on Host1: one inside a VM, the other directly on the host"); @@ -58,20 +58,20 @@ public class EnergyVMRunner extends Process { new DummyProcess (vmHost1, "p12").start(); Msg.info("Create two tasks on Host2: both directly on the host"); - new DummyProcess (vmHost2, "p21").start(); - new DummyProcess (host2, "p22").start(); + new DummyProcess (vmHost2, "p21").start(); + new DummyProcess (host2, "p22").start(); Msg.info("Create two tasks on Host3: both inside a VM"); - new DummyProcess (host3, "p31").start(); - new DummyProcess (host3, "p312").start(); + new DummyProcess (host3, "p31").start(); + new DummyProcess (host3, "p312").start(); Msg.info("Wait 5 seconds. The tasks are still running (they run for 3 seconds, but 2 tasks are co-located, " + "so they run for 6 seconds)"); - waitFor(5); + waitFor(5); Msg.info("Wait another 5 seconds. The tasks stop at some point in between"); - waitFor(5); + waitFor(5); - vmHost1.destroy(); - vmHost2.destroy(); + vmHost1.destroy(); + vmHost2.destroy(); } } diff --git a/examples/msg/cloud-masterworker/cloud-masterworker.tesh b/examples/msg/cloud-masterworker/cloud-masterworker.tesh index a83825c92b..4490cb95fa 100644 --- a/examples/msg/cloud-masterworker/cloud-masterworker.tesh +++ b/examples/msg/cloud-masterworker/cloud-masterworker.tesh @@ -41,12 +41,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-masterworker$EXEEXT --log=no_loc ${platfdir} > [VM00:WRK02:(4) 10.280841] [msg_test/INFO] WRK02 executed task(Task02) > [VM01:WRK03:(5) 10.361121] [msg_test/INFO] WRK03 received task(Task03) from mailbox(MBOX:WRK03) > [node-0.acme.org:master:(1) 10.361121] [msg_test/INFO] # Migrate all VMs to PM(node-1.acme.org) -> [node-1.acme.org:__pr_mig_tx:VM00(node-1.acme.org-node-1.acme.org):(7) 10.361121] [vm_live_migration/WARNING] use the default max_downtime value 30ms > [VM01:WRK03:(5) 10.371121] [msg_test/INFO] WRK03 executed task(Task03) -> [node-10.acme.org:__pr_mig_tx:VM01(node-10.acme.org-node-1.acme.org):(9) 19.682922] [vm_live_migration/WARNING] use the default max_downtime value 30ms > [node-0.acme.org:master:(1) 28.561942] [msg_test/INFO] # Migrate all VMs to PM(node-10.acme.org) -> [node-1.acme.org:__pr_mig_tx:VM00(node-1.acme.org-node-10.acme.org):(11) 28.561942] [vm_live_migration/WARNING] use the default max_downtime value 30ms -> [node-1.acme.org:__pr_mig_tx:VM01(node-1.acme.org-node-10.acme.org):(13) 37.440963] [vm_live_migration/WARNING] use the default max_downtime value 30ms > [node-0.acme.org:master:(1) 46.319984] [msg_test/INFO] # Shutdown the half of worker processes gracefully. The remaining half will be forcibly killed. > [VM00:WRK00:(2) 46.327790] [msg_test/INFO] WRK00 received task(finalize) from mailbox(MBOX:WRK00) > [VM01:WRK01:(3) 46.335596] [msg_test/INFO] WRK01 received task(finalize) from mailbox(MBOX:WRK01) diff --git a/examples/msg/cloud-migration/cloud-migration.tesh b/examples/msg/cloud-migration/cloud-migration.tesh index f76685234e..6f32cff5da 100644 --- a/examples/msg/cloud-migration/cloud-migration.tesh +++ b/examples/msg/cloud-migration/cloud-migration.tesh @@ -1,18 +1,12 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-migration ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:master_@Fafard) Test: Migrate a VM with 1000 Mbytes RAM -> [ 0.000000] (3:__pr_mig_tx:VM0(Fafard-Tremblay)@Fafard) use the default max_downtime value 30ms > [132.765801] (1:master_@Fafard) VM0 migrated: Fafard->Tremblay in 132.766 s > [132.765801] (1:master_@Fafard) Test: Migrate a VM with 100 Mbytes RAM -> [132.765801] (5:__pr_mig_tx:VM0(Fafard-Tremblay)@Fafard) use the default max_downtime value 30ms > [146.111793] (1:master_@Fafard) VM0 migrated: Fafard->Tremblay in 13.346 s > [146.111793] (1:master_@Fafard) Test: Migrate two VMs at once from PM0 to PM1 -> [146.111793] (8:__pr_mig_tx:VM0(Fafard-Tremblay)@Fafard) use the default max_downtime value 30ms -> [146.111793] (11:__pr_mig_tx:VM1(Fafard-Tremblay)@Fafard) use the default max_downtime value 30ms > [411.566271] (9:mig_wrk@Fafard) VM1 migrated: Fafard->Tremblay in 265.454 s > [411.566271] (6:mig_wrk@Fafard) VM0 migrated: Fafard->Tremblay in 265.454 s > [10146.111793] (1:master_@Fafard) Test: Migrate two VMs at once to different PMs -> [10146.111793] (14:__pr_mig_tx:VM0(Fafard-Tremblay)@Fafard) use the default max_downtime value 30ms -> [10146.111793] (17:__pr_mig_tx:VM1(Fafard-Bourassa)@Fafard) use the default max_downtime value 30ms > [10362.620589] (15:mig_wrk@Fafard) VM1 migrated: Fafard->Bourassa in 216.509 s > [10411.547334] (12:mig_wrk@Fafard) VM0 migrated: Fafard->Tremblay in 265.436 s > [20146.111793] (0:maestro@) Bye (simulation time 20146.1) diff --git a/examples/msg/energy-vm/energy-vm.c b/examples/msg/energy-vm/energy-vm.c index 1bdd14b87f..e1d9bb65a9 100644 --- a/examples/msg/energy-vm/energy-vm.c +++ b/examples/msg/energy-vm/energy-vm.c @@ -25,9 +25,9 @@ static int dvfs(int argc, char *argv[]) /* Host 1 */ XBT_INFO("Creating and starting two VMs"); - msg_vm_t vm_host1 = MSG_vm_create(host1, "vm_host1", 1, 2048, 10, 50); + msg_vm_t vm_host1 = MSG_vm_create_core(host1, "vm_host1"); MSG_vm_start(vm_host1); - msg_vm_t vm_host2 = MSG_vm_create(host2, "vm_host2", 1, 2048, 10, 50); + msg_vm_t vm_host2 = MSG_vm_create_core(host2, "vm_host2"); MSG_vm_start(vm_host2); XBT_INFO("Create two tasks on Host1: both inside a VM"); diff --git a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp index fd0d627264..e8a9ec2c01 100644 --- a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp +++ b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp @@ -207,9 +207,6 @@ static void master_main() vm0->destroy(); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - s_vm_params_t params; - memset(¶ms, 0, sizeof(params)); - vm0->setParameters(¶ms); vm0->setRamsize(1e9); // 1GB vm0->start(); diff --git a/examples/s4u/cloud-capping/s4u-cloud-capping.tesh b/examples/s4u/cloud-capping/s4u-cloud-capping.tesh index 383edb709d..e3eb60f33c 100644 --- a/examples/s4u/cloud-capping/s4u-cloud-capping.tesh +++ b/examples/s4u/cloud-capping/s4u-cloud-capping.tesh @@ -175,7 +175,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-cloud-capping ${platfdir}/small_platform.xml - > [51100.000000] (88:worker0@VM0) not bound => duration 100.000000 (7629600.000000 flops/s) > [52000.000000] (1:master_@Fafard) > [52000.000000] (1:master_@Fafard) # 10. (c) migrate -> [52000.000000] (90:__pr_mig_tx:VM0(Fafard-Fafard)@Fafard) use the default max_downtime value 30ms > [52002.070722] (1:master_@Fafard) > [52002.070722] (1:master_@Fafard) # 10. (d) Put a task again on the VM. > [52102.070722] (91:worker0@VM0) not bound => duration 100.000000 (7629600.000000 flops/s) diff --git a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp index 61f0bd75a7..4f6cca5345 100644 --- a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp +++ b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp @@ -193,9 +193,6 @@ static void master_main() " network one"); XBT_INFO("### Relocate VM0 between PM0 and PM1"); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - s_vm_params_t params; - memset(¶ms, 0, sizeof(params)); - vm0->setParameters(¶ms); vm0->setRamsize(1L * 1024 * 1024 * 1024); // 1GiB vm0->start(); diff --git a/examples/s4u/cloud-simple/s4u-cloud-simple.tesh b/examples/s4u/cloud-simple/s4u-cloud-simple.tesh index 8717fffbc4..a764a8c9b5 100644 --- a/examples/s4u/cloud-simple/s4u-cloud-simple.tesh +++ b/examples/s4u/cloud-simple/s4u-cloud-simple.tesh @@ -51,8 +51,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-cloud-simple$EXEEXT --log=no_loc ${platfdir:=. > [Fafard:master_:(1) 49.000000] [s4u_test/INFO] ## Test 5 (ended) > [Fafard:master_:(1) 49.000000] [s4u_test/INFO] ## Test 6 (started): Check migration impact (not yet implemented neither on the CPU resource nor on the network one > [Fafard:master_:(1) 49.000000] [s4u_test/INFO] ### Relocate VM0 between PM0 and PM1 -> [Fafard:__pr_mig_tx:VM0(Fafard-Tremblay):(38) 49.010000] [vm_live_migration/WARNING] use the default max_downtime value 30ms > [Bourassa:comm_rx:(36) 49.204993] [s4u_test/INFO] VM0:comm_tx to Bourassa:comm_rx => 0.204993 sec -> [Tremblay:__pr_mig_tx:VM0(Tremblay-Fafard):(40) 191.674258] [vm_live_migration/WARNING] use the default max_downtime value 30ms > [Fafard:master_:(1) 339.199251] [s4u_test/INFO] ## Test 6 (ended) > [339.199251] [s4u_test/INFO] Simulation time 339.199 diff --git a/include/simgrid/datatypes.h b/include/simgrid/datatypes.h deleted file mode 100644 index facacb4749..0000000000 --- a/include/simgrid/datatypes.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (c) 2013-2015. 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. */ - -#ifndef SIMGRID_DATATYPES_H_ -#define SIMGRID_DATATYPES_H_ - -#include "simgrid/forward.h" - -struct vm_params { - double max_downtime; - double dp_intensity; // Percentage of pages that get dirty compared to netspeed [0;1] bytes per 1 flop execution - double dp_cap; - double mig_speed; // Set migration speed -}; - -typedef struct vm_params s_vm_params_t; -typedef struct vm_params* vm_params_t; - -#endif /* SIMGRID_DATATYPES_H_ */ diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index dde50778ed..aefc89e320 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -6,7 +6,6 @@ #ifndef MSG_H #define MSG_H -#include "simgrid/datatypes.h" #include "simgrid/forward.h" #include "simgrid/host.h" @@ -463,8 +462,6 @@ XBT_PUBLIC(int) MSG_vm_is_migrating(msg_vm_t vm); XBT_PUBLIC(int) MSG_vm_is_suspended(msg_vm_t vm); XBT_PUBLIC(const char*) MSG_vm_get_name(msg_vm_t vm); -XBT_PUBLIC(void) MSG_vm_get_params(msg_vm_t vm, vm_params_t params); -XBT_PUBLIC(void) MSG_vm_set_params(msg_vm_t vm, vm_params_t params); XBT_PUBLIC(void) MSG_vm_set_ramsize(msg_vm_t vm, size_t size); XBT_PUBLIC(size_t) MSG_vm_get_ramsize(msg_vm_t vm); diff --git a/include/simgrid/plugins/live_migration.h b/include/simgrid/plugins/live_migration.h index 8fa1b7b58c..24425cc81f 100644 --- a/include/simgrid/plugins/live_migration.h +++ b/include/simgrid/plugins/live_migration.h @@ -17,6 +17,14 @@ XBT_PUBLIC(void) sg_vm_start_dirty_page_tracking(sg_vm_t vm); XBT_PUBLIC(void) sg_vm_stop_dirty_page_tracking(sg_vm_t vm); XBT_PUBLIC(double) sg_vm_lookup_computed_flops(sg_vm_t vm); XBT_PUBLIC(void) sg_vm_migrate(sg_vm_t vm, sg_host_t dst_pm); +XBT_PUBLIC(int) sg_vm_is_migratable(sg_vm_t vm); +XBT_PUBLIC(void) sg_vm_set_dirty_page_intensity(sg_vm_t vm, double intensity); +XBT_PUBLIC(double) sg_vm_get_dirty_page_intensity(sg_vm_t vm); +XBT_PUBLIC(void) sg_vm_set_working_set_memory(sg_vm_t vm, sg_size_t size); +XBT_PUBLIC(sg_size_t) sg_vm_get_working_set_memory(sg_vm_t vm); +XBT_PUBLIC(void) sg_vm_set_migration_speed(sg_vm_t vm, double speed); +XBT_PUBLIC(double) sg_vm_get_migration_speed(sg_vm_t vm); +XBT_PUBLIC(double) sg_vm_get_max_downtime(sg_vm_t vm); #define MSG_vm_live_migration_plugin_init() sg_vm_live_migration_plugin_init() #define MSG_vm_migrate(vm, dst_pm) sg_vm_migrate(vm, dst_pm) diff --git a/include/simgrid/s4u/VirtualMachine.hpp b/include/simgrid/s4u/VirtualMachine.hpp index 3510e78ce2..de4ebd8027 100644 --- a/include/simgrid/s4u/VirtualMachine.hpp +++ b/include/simgrid/s4u/VirtualMachine.hpp @@ -6,7 +6,6 @@ #ifndef SIMGRID_S4U_VM_HPP #define SIMGRID_S4U_VM_HPP -#include "simgrid/datatypes.h" #include "simgrid/s4u/Host.hpp" #include "simgrid/s4u/forward.hpp" @@ -52,8 +51,6 @@ public: bool isMigrating(); - void getParameters(vm_params_t params); - void setParameters(vm_params_t params); simgrid::s4u::Host* getPm(); void setPm(simgrid::s4u::Host * pm); size_t getRamsize(); diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 5acf3b829e..7ac87fb902 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -6,7 +6,6 @@ #ifndef _SIMIX_SIMIX_H #define _SIMIX_SIMIX_H -#include "simgrid/datatypes.h" #include "simgrid/forward.h" #include "simgrid/host.h" #include "xbt/ex.h" diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index eef491c376..eb3a7b3d37 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -12,7 +12,7 @@ #include #endif -#include +#include #include #include #include diff --git a/src/include/surf/surf.hpp b/src/include/surf/surf.hpp index 36ac4775c5..a645e3a4b6 100644 --- a/src/include/surf/surf.hpp +++ b/src/include/surf/surf.hpp @@ -6,7 +6,6 @@ #ifndef SURF_SURF_H #define SURF_SURF_H -#include "simgrid/datatypes.h" #include "simgrid/forward.h" #include "src/internal_config.h" #include "xbt/config.h" diff --git a/src/msg/msg_task.cpp b/src/msg/msg_task.cpp index ae1f59c4e0..3e1d68be7a 100644 --- a/src/msg/msg_task.cpp +++ b/src/msg/msg_task.cpp @@ -86,7 +86,9 @@ msg_task_t MSG_task_create(const char *name, double flop_amount, double message_ msg_task_t MSG_parallel_task_create(const char *name, int host_nb, const msg_host_t * host_list, double *flops_amount, double *bytes_amount, void *data) { - msg_task_t task = MSG_task_create(name, 0, 0, data); + // Task's flops amount is set to an arbitrary value > 0.0 to be able to distinguish, in + // MSG_task_get_remaining_work_ratio(), a finished task and a task that has not started yet. + msg_task_t task = MSG_task_create(name, 1.0, 0, data); simdata_task_t simdata = task->simdata; /* Simulator Data specific to parallel tasks */ @@ -231,7 +233,6 @@ msg_error_t MSG_task_cancel(msg_task_t task) * to do: starts at 1 and goes to 0. Returns 0 if not started or finished. * * It works for either parallel or sequential tasks. - * TODO: Improve this function by returning 1 if the task has not started */ double MSG_task_get_remaining_work_ratio(msg_task_t task) { @@ -240,8 +241,8 @@ double MSG_task_get_remaining_work_ratio(msg_task_t task) { // Task in progress return task->simdata->compute->remainingRatio(); } else { - // Task not started or finished - return 0; + // Task not started (flops_amount is > 0.0) or finished (flops_amount is set to 0.0) + return task->simdata->flops_amount > 0.0 ? 1.0 : 0.0; } } diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index c43ab8db24..ce2030b122 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -37,28 +37,6 @@ msg_host_t MSG_vm_get_pm(msg_vm_t vm) return vm->getPm(); } -/** \ingroup m_vm_management - * \brief Set the parameters of a given host - * - * \param vm a vm - * \param params a parameter object - */ -void MSG_vm_set_params(msg_vm_t vm, vm_params_t params) -{ - vm->setParameters(params); -} - -/** \ingroup m_vm_management - * \brief Get the parameters of a given host - * - * \param vm the vm you are interested into - * \param params a prameter object - */ -void MSG_vm_get_params(msg_vm_t vm, vm_params_t params) -{ - vm->getParameters(params); -} - void MSG_vm_set_ramsize(msg_vm_t vm, size_t size) { vm->setRamsize(size); @@ -127,14 +105,16 @@ msg_vm_t MSG_vm_create(msg_host_t pm, const char* name, int coreAmount, int rams /* For the moment, intensity_rate is the percentage against the migration bandwidth */ msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount, static_cast(ramsize) * 1024 * 1024); - s_vm_params_t params; - params.max_downtime = 0.03; - params.mig_speed = static_cast(mig_netspeed) * 1024 * 1024; // mig_speed - params.dp_intensity = static_cast(dp_intensity) / 100; - params.dp_cap = vm->getRamsize() * 0.9; // assume working set memory is 90% of ramsize - - XBT_DEBUG("migspeed : %f intensity mem : %d", params.mig_speed, dp_intensity); - vm->setParameters(¶ms); + if (not sg_vm_is_migratable(vm)) { + if (mig_netspeed != 0 || dp_intensity != 0) + XBT_WARN("The live migration is not enabled. dp_intensity and mig_netspeed can't be used"); + } else { + sg_vm_set_dirty_page_intensity(vm, dp_intensity / 100.0); + sg_vm_set_working_set_memory(vm, vm->getRamsize() * 0.9); // assume working set memory is 90% of ramsize + sg_vm_set_migration_speed(vm, mig_netspeed * 1024 * 1024.0); + + XBT_DEBUG("migspeed : %f intensity mem : %d", mig_netspeed * 1024 * 1024.0, dp_intensity); + } return vm; } @@ -150,9 +130,6 @@ msg_vm_t MSG_vm_create_core(msg_host_t pm, const char* name) "Cannot create a VM named %s: this name is already used by an host or a VM", name); msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, 1); - s_vm_params_t params; - memset(¶ms, 0, sizeof(params)); - vm->setParameters(¶ms); return vm; } /** @brief Create a new VM object with the default parameters, but with a specified amount of cores @@ -166,9 +143,6 @@ msg_vm_t MSG_vm_create_multicore(msg_host_t pm, const char* name, int coreAmount "Cannot create a VM named %s: this name is already used by an host or a VM", name); msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount); - s_vm_params_t params; - memset(¶ms, 0, sizeof(params)); - vm->setParameters(¶ms); return vm; } diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 9ba6c33151..4367a9b74c 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -283,15 +283,5 @@ void VirtualMachineImpl::setBound(double bound) action_->setBound(bound); } -void VirtualMachineImpl::getParams(vm_params_t params) -{ - *params = params_; -} - -void VirtualMachineImpl::setParams(vm_params_t params) -{ - /* may check something here. */ - params_ = *params; -} } } diff --git a/src/plugins/vm/VirtualMachineImpl.hpp b/src/plugins/vm/VirtualMachineImpl.hpp index fb91bd40f4..709ff69224 100644 --- a/src/plugins/vm/VirtualMachineImpl.hpp +++ b/src/plugins/vm/VirtualMachineImpl.hpp @@ -55,9 +55,6 @@ public: virtual void setBound(double bound); - void getParams(vm_params_t params); - void setParams(vm_params_t params); - /* The vm object of the lower layer */ surf::Action* action_ = nullptr; @@ -87,7 +84,6 @@ public: private: simgrid::s4u::Host* hostPM_; - s_vm_params_t params_; int coreAmount_; size_t ramsize_ = 0; e_surf_vm_state_t vmState_ = SURF_VM_STATE_CREATED; diff --git a/src/plugins/vm/VmLiveMigration.cpp b/src/plugins/vm/VmLiveMigration.cpp index 7d8c3b12b6..f0ec4ec59e 100644 --- a/src/plugins/vm/VmLiveMigration.cpp +++ b/src/plugins/vm/VmLiveMigration.cpp @@ -78,15 +78,15 @@ void MigrationRx::operator()() XBT_DEBUG("mig: rx_done"); } -static sg_size_t get_updated_size(double computed, double dp_rate, double dp_cap) +static sg_size_t get_updated_size(double computed, double dp_rate, sg_size_t dp_cap) { - double updated_size = computed * dp_rate; - XBT_DEBUG("updated_size %f dp_rate %f", updated_size, dp_rate); + sg_size_t updated_size = static_cast(computed * dp_rate); + XBT_DEBUG("updated_size %llu dp_rate %f", updated_size, dp_rate); if (updated_size > dp_cap) { updated_size = dp_cap; } - return static_cast(updated_size); + return updated_size; } sg_size_t MigrationTx::sendMigrationData(sg_size_t size, int stage, int stage2_round, double mig_speed, double timeout) @@ -131,13 +131,12 @@ void MigrationTx::operator()() XBT_DEBUG("mig: tx_start"); double host_speed = vm_->getPm()->getSpeed(); - s_vm_params_t params; - vm_->getParameters(¶ms); const sg_size_t ramsize = vm_->getRamsize(); - const double dp_rate = host_speed ? (params.mig_speed * params.dp_intensity) / host_speed : 1; - const double dp_cap = params.dp_cap; - const double mig_speed = params.mig_speed; - double max_downtime = params.max_downtime; + const double dp_rate = + host_speed ? (sg_vm_get_migration_speed(vm_) * sg_vm_get_dirty_page_intensity(vm_)) / host_speed : 1; + const sg_size_t dp_cap = sg_vm_get_working_set_memory(vm_); + const double mig_speed = sg_vm_get_migration_speed(vm_); + double max_downtime = sg_vm_get_max_downtime(vm_); double mig_timeout = 10000000.0; bool skip_stage2 = false; @@ -208,7 +207,7 @@ void MigrationTx::operator()() updated_size = get_updated_size(computed, dp_rate, dp_cap); } - XBT_DEBUG("mig-stage 2:%d updated_size %llu computed_during_stage1 %f dp_rate %f dp_cap %f", stage2_round, + XBT_DEBUG("mig-stage 2:%d updated_size %llu computed_during_stage1 %f dp_rate %f dp_cap %llu", stage2_round, updated_size, computed_during_stage1, dp_rate, dp_cap); /* Check whether the remaining size is below the threshold value. If so, move to stage 3. */ diff --git a/src/plugins/vm/s4u_VirtualMachine.cpp b/src/plugins/vm/s4u_VirtualMachine.cpp index 197e4dd71b..403a647e92 100644 --- a/src/plugins/vm/s4u_VirtualMachine.cpp +++ b/src/plugins/vm/s4u_VirtualMachine.cpp @@ -171,17 +171,6 @@ void VirtualMachine::setBound(double bound) { simgrid::simix::kernelImmediate([this, bound]() { pimpl_vm_->setBound(bound); }); } -/** @brief Retrieve a copy of the parameters of that VM/PM - * @details The ramsize and overcommit fields are used on the PM too */ -void VirtualMachine::getParameters(vm_params_t params) -{ - pimpl_vm_->getParams(params); -} -/** @brief Sets the params of that VM/PM */ -void VirtualMachine::setParameters(vm_params_t params) -{ - simgrid::simix::kernelImmediate([this, params] { pimpl_vm_->setParams(params); }); -} } // namespace simgrid } // namespace s4u diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index ac5581783f..be0db14e17 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -138,12 +138,12 @@ Activity* Comm::wait(double timeout) } int Comm::test_any(std::vector* comms) { - smx_activity_t* array = static_cast(malloc(sizeof(smx_activity_t) * comms->size())); + smx_activity_t* array = new smx_activity_t[comms->size()]; for (unsigned int i = 0; i < comms->size(); i++) { array[i] = comms->at(i)->pimpl_; } - int res = simcall_comm_testany(array, static_cast(comms->size())); - free(array); + int res = simcall_comm_testany(array, comms->size()); + delete[] array; return res; } diff --git a/src/surf/plugins/dirty_page_tracking.cpp b/src/surf/plugins/dirty_page_tracking.cpp index 329f12396c..e75cb111de 100644 --- a/src/surf/plugins/dirty_page_tracking.cpp +++ b/src/surf/plugins/dirty_page_tracking.cpp @@ -13,7 +13,12 @@ namespace vm { class VmDirtyPageTrackingExt { bool dp_tracking = false; std::map dp_objs; - double dp_updated_by_deleted_tasks = 0; + double dp_updated_by_deleted_tasks = 0.0; + // Percentage of pages that get dirty compared to netspeed [0;1] bytes per 1 flop execution + double dp_intensity = 0.0; + sg_size_t working_set_memory = 0.0; + double max_downtime = 0.03; + double mig_speed = 0.0; public: void startTracking(); @@ -24,6 +29,13 @@ public: double getStoredRemains(kernel::activity::ExecImplPtr exec) { return dp_objs.at(exec); } void updateDirtyPageCount(double delta) { dp_updated_by_deleted_tasks += delta; } double computedFlopsLookup(); + double getIntensity() { return dp_intensity; } + void setIntensity(double intensity) { dp_intensity = intensity; } + double getWorkingSetMemory() { return working_set_memory; } + void setWorkingSetMemory(sg_size_t size) { working_set_memory = size; } + void setMigrationSpeed(double speed) { mig_speed = speed; } + double getMigrationSpeed() { return mig_speed; } + double getMaxDowntime() { return max_downtime; } static simgrid::xbt::Extension EXTENSION_ID; virtual ~VmDirtyPageTrackingExt() = default; @@ -103,6 +115,11 @@ void sg_vm_live_migration_plugin_init() } } +int sg_vm_is_migratable(sg_vm_t vm) +{ + return simgrid::vm::VmDirtyPageTrackingExt::EXTENSION_ID.valid(); +} + void sg_vm_start_dirty_page_tracking(sg_vm_t vm) { vm->pimpl_vm_->extension()->startTracking(); @@ -117,4 +134,40 @@ double sg_vm_lookup_computed_flops(sg_vm_t vm) { return vm->pimpl_vm_->extension()->computedFlopsLookup(); } + +void sg_vm_set_dirty_page_intensity(sg_vm_t vm, double intensity) +{ + vm->pimpl_vm_->extension()->setIntensity(intensity); +} + +double sg_vm_get_dirty_page_intensity(sg_vm_t vm) +{ + return vm->pimpl_vm_->extension()->getIntensity(); +} + +void sg_vm_set_working_set_memory(sg_vm_t vm, sg_size_t size) +{ + vm->pimpl_vm_->extension()->setWorkingSetMemory(size); +} + +sg_size_t sg_vm_get_working_set_memory(sg_vm_t vm) +{ + return vm->pimpl_vm_->extension()->getWorkingSetMemory(); +} + +void sg_vm_set_migration_speed(sg_vm_t vm, double speed) +{ + vm->pimpl_vm_->extension()->setMigrationSpeed(speed); +} + +double sg_vm_get_migration_speed(sg_vm_t vm) +{ + return vm->pimpl_vm_->extension()->getMigrationSpeed(); +} + +double sg_vm_get_max_downtime(sg_vm_t vm) +{ + return vm->pimpl_vm_->extension()->getMaxDowntime(); +} + SG_END_DECL() diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 5960575934..02dfd42156 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -321,6 +321,7 @@ void surf_exit() { TRACE_end(); /* Just in case it was not called by the upper layer (or there is no upper layer) */ + simgrid::s4u::Engine::shutdown(); sg_link_exit(); for (auto const& e : storage_types) { simgrid::surf::StorageType* stype = e.second; @@ -345,7 +346,6 @@ void surf_exit() tmgr_finalize(); sg_platf_exit(); - simgrid::s4u::Engine::shutdown(); NOW = 0; /* Just in case the user plans to restart the simulation afterward */ } diff --git a/teshsuite/msg/cloud-capping/cloud-capping.tesh b/teshsuite/msg/cloud-capping/cloud-capping.tesh index 86278aa476..0bd4127549 100644 --- a/teshsuite/msg/cloud-capping/cloud-capping.tesh +++ b/teshsuite/msg/cloud-capping/cloud-capping.tesh @@ -174,7 +174,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-capping ${platfdir}/small_platform.xml --log > [51100.000000] (88:worker0@VM0) not bound => duration 100.000000 (7629600.000000 flops/s) > [52000.000000] (1:master_@Fafard) > [52000.000000] (1:master_@Fafard) # 10. (c) migrate -> [52000.000000] (90:__pr_mig_tx:VM0(Fafard-Fafard)@Fafard) use the default max_downtime value 30ms > [52002.070722] (1:master_@Fafard) > [52002.070722] (1:master_@Fafard) # 10. (d) Put a task again on the VM. > [52102.070722] (91:worker0@VM0) not bound => duration 100.000000 (7629600.000000 flops/s) diff --git a/teshsuite/msg/cloud-simple/cloud-simple.tesh b/teshsuite/msg/cloud-simple/cloud-simple.tesh index f4f501d1b9..cd26fb6065 100644 --- a/teshsuite/msg/cloud-simple/cloud-simple.tesh +++ b/teshsuite/msg/cloud-simple/cloud-simple.tesh @@ -51,8 +51,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud-simple$EXEEXT --log=no_loc ${platfdir}/small > [Fafard:master_:(1) 49.000000] [msg_test/INFO] ## Test 5 (ended) > [Fafard:master_:(1) 49.000000] [msg_test/INFO] ## Test 6 (started): Check migration impact (not yet implemented neither on the CPU resource nor on the network one > [Fafard:master_:(1) 49.000000] [msg_test/INFO] ### Relocate VM0 between PM0 and PM1 -> [Fafard:__pr_mig_tx:VM0(Fafard-Tremblay):(38) 49.010000] [vm_live_migration/WARNING] use the default max_downtime value 30ms > [Bourassa:comm_rx:(36) 49.204993] [msg_test/INFO] VM0:comm_tx to Bourassa:comm_rx => 0.204993 sec -> [Tremblay:__pr_mig_tx:VM0(Tremblay-Fafard):(40) 191.674258] [vm_live_migration/WARNING] use the default max_downtime value 30ms > [Fafard:master_:(1) 339.199251] [msg_test/INFO] ## Test 6 (ended) > [339.199251] [msg_test/INFO] Bye (simulation time 339.199) diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c index cc9d85e000..10ab828b98 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c @@ -180,16 +180,13 @@ static int test_launcher(int argc, char *argv[]) XBT_INFO("Test 6: Turn on Jupiter, assign a VM on Jupiter, launch a process inside the VM, and turn off the node"); // Create VM0 - int dpRate = 70; - msg_vm_t vm0; - msg_process_t daemon; - - vm0 = MSG_vm_create(jupiter, "vm0", 1, 2048, 125, dpRate); + msg_vm_t vm0 = MSG_vm_create_core(jupiter, "vm0"); MSG_vm_start(vm0); argvF = xbt_new(char*, 2); argvF[0] = xbt_strdup("process_daemon"); - daemon = MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, (msg_host_t)vm0, 1, argvF); + msg_process_t daemon = + MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, (msg_host_t)vm0, 1, argvF); argvF = xbt_new(char*, 2); argvF[0] = xbt_strdup("process_daemonJUPI"); diff --git a/teshsuite/msg/task_progress/task_progress.cpp b/teshsuite/msg/task_progress/task_progress.cpp index c681ec9f31..adf5200278 100644 --- a/teshsuite/msg/task_progress/task_progress.cpp +++ b/teshsuite/msg/task_progress/task_progress.cpp @@ -15,21 +15,21 @@ static int seq_task(int /*argc*/, char* /*argv*/ []) { double task_comp_size = 5E7; double task_comm_size = 1E6; - double progress = 0; + double progress; msg_task_t task = MSG_task_create("simple", task_comp_size, task_comm_size, NULL); tasks.push_back(task); XBT_INFO("get the progress of %s before the task starts", task->name); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be 0 not %f", progress); + xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress); XBT_INFO("Executing task: \"%s\"", task->name); MSG_task_execute(task); XBT_INFO("get the progress of %s after the task finishes", task->name); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress); + xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress); MSG_task_destroy(task); XBT_INFO("Goodbye now!"); @@ -40,7 +40,7 @@ static int par_task(int /*argc*/, char* /*argv*/ []) { double * computation_amount = new double[2] {10E7, 10E7}; double * communication_amount = new double[4] {1E6, 1E6, 1E6, 1E6}; - double progress = 0; + double progress; std::vector hosts_to_use = std::vector(); hosts_to_use.push_back(MSG_get_host_by_name("Tremblay")); @@ -51,14 +51,14 @@ static int par_task(int /*argc*/, char* /*argv*/ []) XBT_INFO("get the progress of %s before the task starts", task->name); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be 0 not %f", progress); + xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress); XBT_INFO("Executing task: \"%s\"", task->name); MSG_parallel_task_execute(task); XBT_INFO("get the progress of %s after the task finishes", task->name); progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0, "Progress should be equal to 1 not %f", progress); + xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress); MSG_task_destroy(task); delete[] computation_amount; diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 97aab8be5b..28db9333b0 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -677,7 +677,6 @@ set(headers_to_install include/simgrid/instr.h include/simgrid/msg.h include/simgrid/simdag.h - include/simgrid/datatypes.h include/simgrid/modelchecker.h include/simgrid/forward.h include/simgrid/simix.h