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

Private GIT Repository
a49c6efcd41e376189683c7761126db8abe0d859
[loba.git] / process.h
1 #ifndef PROCESS_H
2 #define PROCESS_H
3
4 #include <map>
5 #include <vector>
6 #include <msg/msg.h>
7 #include "communicator.h"
8 #include "neighbor.h"
9
10 class process {
11 public:
12     process(int argc, char* argv[]);
13     ~process() { };
14     int run();
15
16 private:
17     std::vector<neighbor> neigh;
18     std::map<m_host_t, neighbor*> rev_neigh;
19
20     communicator comm;
21     int ctrl_close_pending;
22     int data_close_pending;
23
24     unsigned iter;
25
26     double load;
27     double expected_load;
28
29     void compute();
30     virtual double load_balance(double my_load);
31     void send1_no_bookkeeping(neighbor& nb);
32     void send1_bookkeeping(neighbor& nb);
33     void send();
34     bool receive(bool wait_for_close);
35     void finalize1(neighbor& nb);
36     void finalize();
37     void print_loads(e_xbt_log_priority_t logp = xbt_log_priority_info);
38
39     void insert_neighbor_in_map(neighbor& nb);
40 };
41
42 #endif // !PROCESS_H
43
44 // Local variables:
45 // mode: c++
46 // End: