X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/4f8948b8f67d26726a2e53c9afe1a110c037ce4b..4b258b0acb4f4f43d99a3eba7fd38ba40460b96d:/process.h?ds=sidebyside diff --git a/process.h b/process.h index 5802426..607a6af 100644 --- a/process.h +++ b/process.h @@ -22,10 +22,18 @@ public: ~process(); int run(); +protected: + typedef std::vector neigh_type; + typedef std::vector pneigh_type; + + neigh_type neigh; + pneigh_type pneigh; + private: - std::vector neigh; - MAP_TEMPLATE rev_neigh; - std::vector pneigh; + typedef MAP_TEMPLATE rev_neigh_type; + enum recv_wait_mode { NO_WAIT = 0, WAIT, WAIT_FOR_CLOSE }; + + rev_neigh_type rev_neigh; communicator comm; int ctrl_close_pending; @@ -33,20 +41,21 @@ private: unsigned iter; + double prev_load_broadcast; double load; double expected_load; - void compute(); + double sum_of_to_send() const; virtual double load_balance(double my_load); + + void compute(); void send1_no_bookkeeping(neighbor& nb); void send1_bookkeeping(neighbor& nb); void send(); - bool receive(bool wait_for_close); + bool receive(recv_wait_mode wait); void finalize1(neighbor& nb); void finalize(); void print_loads(e_xbt_log_priority_t logp = xbt_log_priority_info); - - void insert_neighbor_in_map(neighbor& nb); }; #endif // !PROCESS_H