Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Use member hooks for CpuTi
[simgrid.git] / src / surf / network_ib.hpp
1 /* Copyright (c) 2014-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef SURF_NETWORK_IB_HPP_
8 #define SURF_NETWORK_IB_HPP_
9
10 #include "network_smpi.hpp"
11 class IBNode;
12
13
14 class ActiveComm{
15 public :
16   //IBNode* origin;
17   IBNode* destination;
18   NetworkAction *action;
19   double init_rate;
20   ActiveComm() : destination(NULL),action(NULL),init_rate(-1){};
21   ~ActiveComm(){};
22 };
23
24 class IBNode{
25 public :
26   int id;
27     //store related links, to ease computation of the penalties
28   std::vector<ActiveComm*> ActiveCommsUp;
29   //store the number of comms received from each node
30   std::map<IBNode*, int> ActiveCommsDown;
31   //number of comms the node is receiving
32   int nbActiveCommsDown;
33   IBNode(int id) : id(id),nbActiveCommsDown(0){};
34   ~IBNode(){};
35 };
36
37 class NetworkIBModel : public NetworkSmpiModel {
38 private:
39   void updateIBfactors_rec(IBNode *root, bool* updatedlist);
40   void computeIBfactors(IBNode *root);
41 public:
42   NetworkIBModel();
43   NetworkIBModel(const char *name);
44   ~NetworkIBModel();
45   void updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove);
46   
47   xbt_dict_t active_nodes;
48   std::map<NetworkAction *, std::pair<IBNode*,IBNode*> > active_comms;
49   
50   double Bs;
51   double Be;
52   double ys;
53
54 };
55
56 #endif