Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename some symbols around Link::isShared to make their purpose clear
[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 <xbt/base.h>
11
12 #include "network_smpi.hpp"
13 class XBT_PRIVATE IBNode;
14
15 class XBT_PRIVATE ActiveComm{
16 public :
17   //IBNode* origin;
18   IBNode* destination;
19   NetworkAction *action;
20   double init_rate;
21   ActiveComm() : destination(NULL),action(NULL),init_rate(-1){};
22   ~ActiveComm(){};
23 };
24
25 class IBNode{
26 public :
27   int id;
28     //store related links, to ease computation of the penalties
29   std::vector<ActiveComm*> ActiveCommsUp;
30   //store the number of comms received from each node
31   std::map<IBNode*, int> ActiveCommsDown;
32   //number of comms the node is receiving
33   int nbActiveCommsDown;
34   IBNode(int id) : id(id),nbActiveCommsDown(0){};
35   ~IBNode(){};
36 };
37
38 class XBT_PRIVATE NetworkIBModel : public NetworkSmpiModel {
39 private:
40   void updateIBfactors_rec(IBNode *root, bool* updatedlist);
41   void computeIBfactors(IBNode *root);
42 public:
43   NetworkIBModel();
44   NetworkIBModel(const char *name);
45   ~NetworkIBModel();
46   void updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove);
47   
48   xbt_dict_t active_nodes;
49   std::map<NetworkAction *, std::pair<IBNode*,IBNode*> > active_comms;
50   
51   double Bs;
52   double Be;
53   double ys;
54
55 };
56
57 #endif