X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/d47d44b2ed067c834ef210ad544512e7581a1c8e..4f8948b8f67d26726a2e53c9afe1a110c037ce4b:/process.h?ds=inline diff --git a/process.h b/process.h index 8711fca..5802426 100644 --- a/process.h +++ b/process.h @@ -1,24 +1,52 @@ #ifndef PROCESS_H #define PROCESS_H +#define USE_UNORDERED_MAP 1 +//#undef USE_UNORDERED_MAP + #include -#include +#ifdef USE_UNORDERED_MAP +# include +# define MAP_TEMPLATE std::tr1::unordered_map +#else +# include +# define MAP_TEMPLATE std::map +#endif +#include #include "communicator.h" #include "neighbor.h" class process { public: - process(int argc, char *argv[]); - ~process() { }; + process(int argc, char* argv[]); + ~process(); int run(); private: - communicator comm; std::vector neigh; + MAP_TEMPLATE rev_neigh; + std::vector pneigh; + + communicator comm; + int ctrl_close_pending; + int data_close_pending; + + unsigned iter; + double load; + double expected_load; void compute(); + virtual double load_balance(double my_load); + void send1_no_bookkeeping(neighbor& nb); + void send1_bookkeeping(neighbor& nb); + void send(); + bool receive(bool wait_for_close); + 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