]> AND Private Git Repository - loba.git/blobdiff - deployment.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Be consistent and hold mutex in any case when returning from condition_t::timedwait().
[loba.git] / deployment.h
index 3cbe6ae367e98105c544fa2c263bad267a81ae64..e1e0d92c33d551046c7ca51aa8dffd68123c7436 100644 (file)
@@ -3,11 +3,14 @@
 
 #include <vector>
 
+// Deploy an application automatically, according to the global parameters
 void MY_launch_application();
 
+// Base class for deployment generators...
 class deployment_generator {
 public:
     deployment_generator();
+    virtual ~deployment_generator() { }
 
     size_t size() const { return hosts.size(); }
     void set_load(int host, double load);
@@ -15,10 +18,13 @@ public:
     void set_link(int host1, int host2);
 
     virtual void generate() = 0;
+    void distribute_load();
     void deploy();
 
 private:
     struct host_parameters {
+        host_parameters(): load(0.0) { }
+
         double load;
         std::vector<int> neighbors;
     };
@@ -31,13 +37,13 @@ private:
     public: void generate();                                    \
     }
 
+DEPLOYMENT(btree);
+DEPLOYMENT(clique);
+DEPLOYMENT(hcube);
 DEPLOYMENT(line);
 DEPLOYMENT(ring);
 DEPLOYMENT(star);
-DEPLOYMENT(clique);
-DEPLOYMENT(btree);
-// DEPLOYMENT(torus);
-DEPLOYMENT(hcube);
+DEPLOYMENT(torus);
 
 #undef DEPLOYMENT