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

Private GIT Repository
Rename process::load -> process::real_load.
[loba.git] / process.h
index b124593cae368cc943779ce85bcbc6b861e61088..8f96fd8e188eac0719b938b21af2085c77be9daa 100644 (file)
--- a/process.h
+++ b/process.h
@@ -28,7 +28,7 @@ public:
     virtual ~process();
 
     double get_comp() const                { return comp; }
-    double get_load() const                { return load; }
+    double get_real_load() const           { return real_load; }
 
     int run();
 
@@ -39,9 +39,6 @@ protected:
     pneigh_type pneigh;         // list of pointers to neighbors that
                                 // we are free to reorder
 
-    // Returns the sum of "to_send" for all neighbors.
-    double sum_of_to_send() const;
-
     // Calls neighbor::print(verbose, logp, cat) for each member of neigh.
     void print_loads(bool verbose = false,
                      e_xbt_log_priority_t logp = xbt_log_priority_info,
@@ -77,14 +74,14 @@ private:
 
     double prev_load_broadcast; // used to ensure that we do not send
                                 // a same information messages
-    double load;                // current load
+    double real_load;           // current load
     double expected_load;       // expected load in bookkeeping mode
 
-    double& lb_load() { return opt::bookkeeping ? expected_load : load; }
+    double& lb_load() { return opt::bookkeeping ? expected_load : real_load; }
 
     // The load balancing algorithm comes here...
     // Parameter "my_load" is the load to take into account for myself
-    // (may be load or expected load).
+    // (may be real load or expected load).
     // Returns the total load sent to neighbors.
     virtual double load_balance(double my_load);
 
@@ -94,13 +91,15 @@ private:
     // Send procedures, with helpers for bookkeeping mode or not
     void send1_no_bookkeeping(neighbor& nb);
     void send1_bookkeeping(neighbor& nb);
-    void send();
+    void send_all();
 
     // Returns true if there remains neighbors to listen for
     bool may_receive() { return ctrl_close_pending || data_close_pending; }
 
-    // Receive procedure: wait (or not) for a message to come
-    void receive(bool wait);
+    // Receive procedure
+    // Parameter "timeout" may be 0 for non-blocking operation, -1 for
+    // infinite waiting, or any positive timeout.
+    void receive(double timeout);
 
     // Finalize sends a "close" message to each neighbor and wait for
     // all of them to answer.