diff --git a/trunk/paradiseo-peo/src/core/CMakeLists.txt b/trunk/paradiseo-peo/src/core/CMakeLists.txt index b1bb92c83..04cad69fd 100644 --- a/trunk/paradiseo-peo/src/core/CMakeLists.txt +++ b/trunk/paradiseo-peo/src/core/CMakeLists.txt @@ -26,7 +26,10 @@ SET (CORE_SOURCES peo_init.cpp runner.cpp communicable.cpp topology.cpp - ring_topo.cpp) + ring_topo.cpp + star_topo.cpp + random_topo.cpp + complete_topo.cpp) diff --git a/trunk/paradiseo-peo/src/core/complete_topo.cpp b/trunk/paradiseo-peo/src/core/complete_topo.cpp new file mode 100644 index 000000000..e0871e3aa --- /dev/null +++ b/trunk/paradiseo-peo/src/core/complete_topo.cpp @@ -0,0 +1,53 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 +* (C) OPAC Team, LIFL, 2002-2007 +* +* Sebastien Cahon, Alexandru-Adrian Tantar +* +* This software is governed by the CeCILL license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL +* license as circulated by CEA, CNRS and INRIA at the following URL +* "http://www.cecill.info". +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited liability. +* +* In this respect, the user's attention is drawn to the risks associated +* with loading, using, modifying and/or developing or reproducing the +* software by the user in light of its specific status of free software, +* that may mean that it is complicated to manipulate, and that also +* therefore means that it is reserved for developers and experienced +* professionals having in-depth computer knowledge. Users are therefore +* encouraged to load and test the software's suitability as regards their +* requirements in conditions enabling the security of their systems and/or +* data to be ensured and, more generally, to use and operate it in the +* same conditions as regards security. +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL license and that you accept its terms. +* +* ParadisEO WebSite : http://paradiseo.gforge.inria.fr +* Contact: paradiseo-help@lists.gforge.inria.fr +* +*/ + +#include +#include "complete_topo.h" + +void CompleteTopology :: setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to) { + + __from.clear () ; + __to.clear () ; + + for (int i = 0; i < mig.size (); i ++) { + if (mig [i] != __mig) { + __from.push_back (mig [i]); + __to.push_back (mig [i]); + } + } +} diff --git a/trunk/paradiseo-peo/src/core/complete_topo.h b/trunk/paradiseo-peo/src/core/complete_topo.h new file mode 100644 index 000000000..29c4f8d5a --- /dev/null +++ b/trunk/paradiseo-peo/src/core/complete_topo.h @@ -0,0 +1,51 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 +* (C) OPAC Team, LIFL, 2002-2007 +* +* Sebastien Cahon, Alexandru-Adrian Tantar +* +* This software is governed by the CeCILL license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL +* license as circulated by CEA, CNRS and INRIA at the following URL +* "http://www.cecill.info". +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited liability. +* +* In this respect, the user's attention is drawn to the risks associated +* with loading, using, modifying and/or developing or reproducing the +* software by the user in light of its specific status of free software, +* that may mean that it is complicated to manipulate, and that also +* therefore means that it is reserved for developers and experienced +* professionals having in-depth computer knowledge. Users are therefore +* encouraged to load and test the software's suitability as regards their +* requirements in conditions enabling the security of their systems and/or +* data to be ensured and, more generally, to use and operate it in the +* same conditions as regards security. +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL license and that you accept its terms. +* +* ParadisEO WebSite : http://paradiseo.gforge.inria.fr +* Contact: paradiseo-help@lists.gforge.inria.fr +* +*/ + +#ifndef __complete_topo_h +#define __complete_topo_h + +#include "topology.h" + +class CompleteTopology : public Topology { + +public : + + void setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to); +}; + +#endif diff --git a/trunk/paradiseo-peo/src/core/random_topo.cpp b/trunk/paradiseo-peo/src/core/random_topo.cpp new file mode 100644 index 000000000..3b34fc3b6 --- /dev/null +++ b/trunk/paradiseo-peo/src/core/random_topo.cpp @@ -0,0 +1,55 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 +* (C) OPAC Team, LIFL, 2002-2007 +* +* Sebastien Cahon, Alexandru-Adrian Tantar +* +* This software is governed by the CeCILL license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL +* license as circulated by CEA, CNRS and INRIA at the following URL +* "http://www.cecill.info". +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited liability. +* +* In this respect, the user's attention is drawn to the risks associated +* with loading, using, modifying and/or developing or reproducing the +* software by the user in light of its specific status of free software, +* that may mean that it is complicated to manipulate, and that also +* therefore means that it is reserved for developers and experienced +* professionals having in-depth computer knowledge. Users are therefore +* encouraged to load and test the software's suitability as regards their +* requirements in conditions enabling the security of their systems and/or +* data to be ensured and, more generally, to use and operate it in the +* same conditions as regards security. +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL license and that you accept its terms. +* +* ParadisEO WebSite : http://paradiseo.gforge.inria.fr +* Contact: paradiseo-help@lists.gforge.inria.fr +* +*/ + +#include +#include "random_topo.h" + +#include + +void RandomTopology :: setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to) { + + __from.clear () ; + __to.clear () ; + + for (int i = 0; i < mig.size (); i ++) { + if (mig [i] != __mig && rng.uniform() < 0.5 ) { + __from.push_back (mig [i]); + __to.push_back (mig [i]); + } + } +} diff --git a/trunk/paradiseo-peo/src/core/random_topo.h b/trunk/paradiseo-peo/src/core/random_topo.h new file mode 100644 index 000000000..017fa2806 --- /dev/null +++ b/trunk/paradiseo-peo/src/core/random_topo.h @@ -0,0 +1,51 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 +* (C) OPAC Team, LIFL, 2002-2007 +* +* Sebastien Cahon, Alexandru-Adrian Tantar +* +* This software is governed by the CeCILL license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL +* license as circulated by CEA, CNRS and INRIA at the following URL +* "http://www.cecill.info". +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited liability. +* +* In this respect, the user's attention is drawn to the risks associated +* with loading, using, modifying and/or developing or reproducing the +* software by the user in light of its specific status of free software, +* that may mean that it is complicated to manipulate, and that also +* therefore means that it is reserved for developers and experienced +* professionals having in-depth computer knowledge. Users are therefore +* encouraged to load and test the software's suitability as regards their +* requirements in conditions enabling the security of their systems and/or +* data to be ensured and, more generally, to use and operate it in the +* same conditions as regards security. +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL license and that you accept its terms. +* +* ParadisEO WebSite : http://paradiseo.gforge.inria.fr +* Contact: paradiseo-help@lists.gforge.inria.fr +* +*/ + +#ifndef __random_topo_h +#define __random_topo_h + +#include "topology.h" + +class RandomTopology : public Topology { + +public : + + void setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to); +}; + +#endif diff --git a/trunk/paradiseo-peo/src/core/star_topo.cpp b/trunk/paradiseo-peo/src/core/star_topo.cpp new file mode 100644 index 000000000..575dca638 --- /dev/null +++ b/trunk/paradiseo-peo/src/core/star_topo.cpp @@ -0,0 +1,69 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 +* (C) OPAC Team, LIFL, 2002-2007 +* +* Sebastien Cahon, Alexandru-Adrian Tantar +* +* This software is governed by the CeCILL license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL +* license as circulated by CEA, CNRS and INRIA at the following URL +* "http://www.cecill.info". +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited liability. +* +* In this respect, the user's attention is drawn to the risks associated +* with loading, using, modifying and/or developing or reproducing the +* software by the user in light of its specific status of free software, +* that may mean that it is complicated to manipulate, and that also +* therefore means that it is reserved for developers and experienced +* professionals having in-depth computer knowledge. Users are therefore +* encouraged to load and test the software's suitability as regards their +* requirements in conditions enabling the security of their systems and/or +* data to be ensured and, more generally, to use and operate it in the +* same conditions as regards security. +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL license and that you accept its terms. +* +* ParadisEO WebSite : http://paradiseo.gforge.inria.fr +* Contact: paradiseo-help@lists.gforge.inria.fr +* +*/ + +#include +#include "star_topo.h" + +StarTopology :: StarTopology () : center( NULL ) {} + +void StarTopology :: setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to) { + + assert( center != NULL ); + + __from.clear () ; + __to.clear () ; + + if ( __mig == center ) { + + for (int i = 0; i < mig.size (); i ++) { + if (mig [i] != center) { + __from.push_back (mig [i]); + __to.push_back (mig [i]); + } + } + } + else { + __from.push_back (center); + __to.push_back (center); + } +} + +void StarTopology :: setCenter (Cooperative& __center) { + + center = &__center; +} diff --git a/trunk/paradiseo-peo/src/core/star_topo.h b/trunk/paradiseo-peo/src/core/star_topo.h new file mode 100644 index 000000000..79cf29644 --- /dev/null +++ b/trunk/paradiseo-peo/src/core/star_topo.h @@ -0,0 +1,59 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 +* (C) OPAC Team, LIFL, 2002-2007 +* +* Sebastien Cahon, Alexandru-Adrian Tantar +* +* This software is governed by the CeCILL license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL +* license as circulated by CEA, CNRS and INRIA at the following URL +* "http://www.cecill.info". +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited liability. +* +* In this respect, the user's attention is drawn to the risks associated +* with loading, using, modifying and/or developing or reproducing the +* software by the user in light of its specific status of free software, +* that may mean that it is complicated to manipulate, and that also +* therefore means that it is reserved for developers and experienced +* professionals having in-depth computer knowledge. Users are therefore +* encouraged to load and test the software's suitability as regards their +* requirements in conditions enabling the security of their systems and/or +* data to be ensured and, more generally, to use and operate it in the +* same conditions as regards security. +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL license and that you accept its terms. +* +* ParadisEO WebSite : http://paradiseo.gforge.inria.fr +* Contact: paradiseo-help@lists.gforge.inria.fr +* +*/ + +#ifndef __star_topo_h +#define __star_topo_h + +#include "topology.h" + +class StarTopology : public Topology { + +public : + + StarTopology (); + + void setNeighbors (Cooperative * __mig, + std :: vector & __from, + std :: vector & __to); + + void setCenter (Cooperative& __center); + +private : + + Cooperative* center; +}; + +#endif diff --git a/trunk/paradiseo-peo/src/peo.h b/trunk/paradiseo-peo/src/peo.h index a83c4e0f9..a0dba3123 100644 --- a/trunk/paradiseo-peo/src/peo.h +++ b/trunk/paradiseo-peo/src/peo.h @@ -335,6 +335,9 @@ /* Cooperative island model */ #include "core/ring_topo.h" +#include "core/star_topo.h" +#include "core/random_topo.h" +#include "core/complete_topo.h" #include "peoData.h" #include "peoSyncIslandMig.h" #include "peoAsyncIslandMig.h"