1 /* Copyright (c) 2014-2015. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef SURF_NETWORK_IB_HPP_
8 #define SURF_NETWORK_IB_HPP_
12 #include "network_smpi.hpp"
13 class XBT_PRIVATE IBNode;
15 class XBT_PRIVATE ActiveComm{
19 NetworkAction *action;
21 ActiveComm() : destination(NULL),action(NULL),init_rate(-1){};
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){};
38 class XBT_PRIVATE NetworkIBModel : public NetworkSmpiModel {
40 void updateIBfactors_rec(IBNode *root, bool* updatedlist);
41 void computeIBfactors(IBNode *root);
44 NetworkIBModel(const char *name);
46 void updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove);
48 xbt_dict_t active_nodes;
49 std::map<NetworkAction *, std::pair<IBNode*,IBNode*> > active_comms;