Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add missing files (again)
[simgrid.git] / src / surf / network_interface.cpp
1 /*
2  * network_interface.cpp
3  *
4  *  Created on: Nov 29, 2013
5  *      Author: bedaride
6  */
7 #include "network_interface.hpp"
8 #include "simgrid/sg_config.h"
9
10 #ifndef NETWORK_INTERFACE_CPP_
11 #define NETWORK_INTERFACE_CPP_
12
13
14 NetworkModelPtr surf_network_model = NULL;
15
16 xbt_dynar_t NetworkModel::getRoute(RoutingEdgePtr src, RoutingEdgePtr dst)
17 {
18   xbt_dynar_t route = NULL;
19   routing_platf->getRouteAndLatency(src, dst, &route, NULL);
20   return route;
21 }
22
23 double NetworkModel::latencyFactor(double /*size*/) {
24   return sg_latency_factor;
25 }
26
27 double NetworkModel::bandwidthFactor(double /*size*/) {
28   return sg_bandwidth_factor;
29 }
30
31 double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double /*size*/) {
32   return rate;
33 }
34
35 bool NetworkLinkLmm::isUsed()
36 {
37   return lmm_constraint_used(p_model->p_maxminSystem, p_constraint);
38 }
39
40 double NetworkLink::getLatency()
41 {
42   return m_latCurrent;
43 }
44
45 double NetworkLinkLmm::getBandwidth()
46 {
47   return p_power.peak * p_power.scale;
48 }
49
50 bool NetworkLinkLmm::isShared()
51 {
52   return lmm_constraint_is_shared(p_constraint);
53 }
54
55 #endif /* NETWORK_INTERFACE_CPP_ */