Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Apply the default settings of 'smpi/buffering' too
[simgrid.git] / src / surf / network_constant.hpp
1 /* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef NETWORK_CONSTANT_HPP_
7 #define NETWORK_CONSTANT_HPP_
8
9 #include <xbt/base.h>
10
11 #include "network_interface.hpp"
12
13 namespace simgrid {
14 namespace kernel {
15 namespace resource {
16
17 class NetworkConstantModel : public NetworkModel {
18 public:
19   NetworkConstantModel();
20   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
21   double next_occuring_event(double now) override;
22   void update_actions_state(double now, double delta) override;
23
24   LinkImpl* create_link(const std::string& name, const std::vector<double>& bws, double lat,
25                         s4u::Link::SharingPolicy policy) override;
26 };
27
28 class NetworkConstantAction : public NetworkAction {
29 public:
30   NetworkConstantAction(NetworkConstantModel* model_, double size, double latency);
31   ~NetworkConstantAction();
32   double initial_latency_;
33   void update_remains_lazy(double now) override;
34 };
35
36 } // namespace resource
37 } // namespace kernel
38 } // namespace simgrid
39
40 #endif /* NETWORK_CONSTANT_HPP_ */