SimGrid  3.14.159
Versatile Simulation of Distributed Systems
simgrid::surf::NetworkModel Class Referenceabstract

Detailed Description

SURF network model interface class.

A model is an object which handles the interactions between its Resources and its Actions

#include <network_interface.hpp>

Inheritance diagram for simgrid::surf::NetworkModel:
simgrid::surf::Model simgrid::surf::NetworkCm02Model simgrid::surf::NetworkConstantModel simgrid::surf::NetworkL07Model simgrid::surf::NetworkNS3Model simgrid::surf::NetworkSmpiModel simgrid::surf::NetworkIBModel

Public Member Functions

 NetworkModel ()
 Constructor. More...
 
 ~NetworkModel () override
 Destructor. More...
 
virtual LinkcreateLink (const char *name, double bandwidth, double latency, e_surf_link_sharing_policy_t policy)=0
 Create a Link. More...
 
virtual Actioncommunicate (simgrid::s4u::Host *src, simgrid::s4u::Host *dst, double size, double rate)=0
 Create a communication between two hosts. More...
 
virtual double latencyFactor (double size)
 Get the right multiplicative factor for the latency. More...
 
virtual double bandwidthFactor (double size)
 Get the right multiplicative factor for the bandwidth. More...
 
virtual double bandwidthConstraint (double rate, double bound, double size)
 Get definitive bandwidth. More...
 
double nextOccuringEventFull (double now) override
 
- Public Member Functions inherited from simgrid::surf::Model
 Model ()
 
virtual ~Model ()
 
virtual ActionListgetReadyActionSet ()
 Get the set of actions in ready state. More...
 
virtual ActionListgetRunningActionSet ()
 Get the set of actions in running state. More...
 
virtual ActionListgetFailedActionSet ()
 Get the set of actions in failed state. More...
 
virtual ActionListgetDoneActionSet ()
 Get the set of actions in done state. More...
 
virtual ActionLmmListPtr getModifiedSet ()
 Get the set of modified actions. More...
 
lmm_system_t getMaxminSystem ()
 Get the maxmin system of the current Model. More...
 
e_UM_t getUpdateMechanism ()
 Get the update mechanism of the current Model. More...
 
xbt_heap_t getActionHeap ()
 Get Action heap. More...
 
virtual double nextOccuringEvent (double now)
 Share the resources between the actions. More...
 
virtual double nextOccuringEventLazy (double now)
 
virtual void updateActionsState (double now, double delta)
 Update action to the current time. More...
 
virtual void updateActionsStateLazy (double now, double delta)
 
virtual void updateActionsStateFull (double now, double delta)
 
virtual bool nextOccuringEventIsIdempotent ()
 Returns whether this model have an idempotent shareResource() More...
 

Public Attributes

void(* f_networkSolve )(lmm_system_t) = lmm_solve
 Function pointer to the function to use to solve the lmm_system_t. More...
 
Linkloopback_ = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from simgrid::surf::Model
ActionLmmListPtr modifiedSet_
 
lmm_system_t maxminSystem_ = nullptr
 
e_UM_t updateMechanism_ = UM_UNDEFINED
 
bool selectiveUpdate_
 
xbt_heap_t actionHeap_
 

Constructor & Destructor Documentation

◆ NetworkModel()

simgrid::surf::NetworkModel::NetworkModel ( )
inline

Constructor.

◆ ~NetworkModel()

simgrid::surf::NetworkModel::~NetworkModel ( )
override

Destructor.

Member Function Documentation

◆ createLink()

virtual Link* simgrid::surf::NetworkModel::createLink ( const char *  name,
double  bandwidth,
double  latency,
e_surf_link_sharing_policy_t  policy 
)
pure virtual

Create a Link.

Parameters
nameThe name of the Link
bandwidthThe initial bandwidth of the Link in bytes per second
latencyThe initial latency of the Link in seconds
policyThe sharing policy of the Link

Implemented in simgrid::surf::NetworkL07Model, simgrid::surf::NetworkCm02Model, simgrid::surf::NetworkConstantModel, and simgrid::surf::NetworkNS3Model.

◆ communicate()

virtual Action* simgrid::surf::NetworkModel::communicate ( simgrid::s4u::Host src,
simgrid::s4u::Host dst,
double  size,
double  rate 
)
pure virtual

Create a communication between two hosts.

It makes calls to the routing part, and execute the communication between the two end points.

Parameters
srcThe source of the communication
dstThe destination of the communication
sizeThe size of the communication in bytes
rateAllows to limit the transfer rate. Negative value means unlimited.
Returns
The action representing the communication

Implemented in simgrid::surf::NetworkL07Model, simgrid::surf::NetworkCm02Model, simgrid::surf::NetworkConstantModel, and simgrid::surf::NetworkNS3Model.

◆ latencyFactor()

double simgrid::surf::NetworkModel::latencyFactor ( double  size)
virtual

Get the right multiplicative factor for the latency.

Depending on the model, the effective latency when sending a message might be different from the theoretical latency of the link, in function of the message size. In order to account for this, this function gets this factor.

Parameters
sizeThe size of the message.
Returns
The latency factor.

Reimplemented in simgrid::surf::NetworkSmpiModel.

◆ bandwidthFactor()

double simgrid::surf::NetworkModel::bandwidthFactor ( double  size)
virtual

Get the right multiplicative factor for the bandwidth.

Depending on the model, the effective bandwidth when sending a message might be different from the theoretical bandwidth of the link, in function of the message size. In order to account for this, this function gets this factor.

Parameters
sizeThe size of the message.
Returns
The bandwidth factor.

Reimplemented in simgrid::surf::NetworkSmpiModel.

◆ bandwidthConstraint()

double simgrid::surf::NetworkModel::bandwidthConstraint ( double  rate,
double  bound,
double  size 
)
virtual

Get definitive bandwidth.

It gives the minimum bandwidth between the one that would occur if no limitation was enforced, and the one arbitrary limited.

Parameters
rateThe desired maximum bandwidth.
boundThe bandwidth with only the network taken into account.
sizeThe size of the message.
Returns
The new bandwidth.

Reimplemented in simgrid::surf::NetworkSmpiModel.

◆ nextOccuringEventFull()

double simgrid::surf::NetworkModel::nextOccuringEventFull ( double  now)
overridevirtual

Reimplemented from simgrid::surf::Model.

Member Data Documentation

◆ f_networkSolve

void(* simgrid::surf::NetworkModel::f_networkSolve) (lmm_system_t) = lmm_solve

Function pointer to the function to use to solve the lmm_system_t.

Parameters
systemThe lmm_system_t to solve

◆ loopback_

Link* simgrid::surf::NetworkModel::loopback_ = nullptr

The documentation for this class was generated from the following files: