From f67ee442c74994fb52c12274e45cf47ec2eff191 Mon Sep 17 00:00:00 2001 From: quemy Date: Sun, 2 Dec 2012 15:36:30 +0100 Subject: [PATCH] Add notion of base EOT for heterogeneous model. Island can be templated on a EOT regardless the EOT of its model. Island must have a conversion function from and to base EOT. Base EOT is optionnal and would be considered as EOT. In that case, conversion functions would be identity function. --- smp/src/abstractIsland.h | 11 +---- smp/src/contWrapper.cpp | 6 +-- smp/src/contWrapper.h | 6 +-- smp/src/island.cpp | 70 ++++++++++++++++++++++---------- smp/src/island.h | 26 +++++++++--- smp/src/islandModel.cpp | 8 ++-- smp/src/islandModel.h | 2 + smp/src/smp.h | 1 + smp/test/CMakeLists.txt | 1 + smp/test/t-smpIsland.cpp | 9 ---- smp/test/t-smpMI_Homogeneous.cpp | 4 +- 11 files changed, 86 insertions(+), 58 deletions(-) diff --git a/smp/src/abstractIsland.h b/smp/src/abstractIsland.h index 5ffb7927b..00317a485 100644 --- a/smp/src/abstractIsland.h +++ b/smp/src/abstractIsland.h @@ -63,16 +63,7 @@ public: */ virtual void setModel(IslandModel* _model) = 0; - /** - * Send population to mediator - * @param _select Method to select EOT to send - */ - virtual void send(eoSelect& _select) = 0; - - /** - * Check if there is population to receive - */ - virtual void receive(void) = 0; + /** * Check if there is population to receive or to emigrate diff --git a/smp/src/contWrapper.cpp b/smp/src/contWrapper.cpp index 38737bcdc..e8fd35444 100644 --- a/smp/src/contWrapper.cpp +++ b/smp/src/contWrapper.cpp @@ -27,10 +27,10 @@ ParadisEO WebSite : http://paradiseo.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr */ -template -paradiseo::smp::ContWrapper::ContWrapper(eoContinue& _cont, AIsland* island) : +template +paradiseo::smp::ContWrapper::ContWrapper(eoContinue& _cont, AIsland* island) : ck(_cont), - islandNotifier(island, &AIsland::check) + islandNotifier(island, &AIsland::check) { ck.add(islandNotifier); } diff --git a/smp/src/contWrapper.h b/smp/src/contWrapper.h index 68511ce4a..9d99495e5 100644 --- a/smp/src/contWrapper.h +++ b/smp/src/contWrapper.h @@ -50,7 +50,7 @@ By using the wrapper, we do not have to modify original continuators inside the it avoids some side effects. */ -template +template class ContWrapper { public: @@ -59,11 +59,11 @@ public: * @param _cont Original continuators * @param _policy Policy to wrap with continuators */ - ContWrapper(eoContinue& _cont, AIsland* island); + ContWrapper(eoContinue& _cont, AIsland* island); protected: eoCheckPoint ck; - IslandNotifier islandNotifier; + IslandNotifier islandNotifier; }; #include diff --git a/smp/src/island.cpp b/smp/src/island.cpp index 7ad27c4fb..889ade6eb 100644 --- a/smp/src/island.cpp +++ b/smp/src/island.cpp @@ -27,12 +27,12 @@ ParadisEO WebSite : http://paradiseo.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr */ -template