SST/macro
simple_nic.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef SIMPLE_NIC_H
13 #define SIMPLE_NIC_H
14 
17 
18 #if !SSTMAC_INTEGRATED_SST_CORE
19 
20 namespace sstmac {
21 namespace hw {
22 
23 /**
24  * A networkinterface is a delegate between a node and a server module.
25  * This object helps ornament network operations with information about
26  * the process (ppid) involved.
27  */
28 class simple_nic :
29  public nic
30 {
31  public:
33  nic(interconn), next_free_(0) {}
34 
35  /// Goodbye.
36  virtual ~simple_nic() {}
37 
38  virtual void
39  init_factory_params(sprockit::sim_parameters *params);
40 
41  virtual void
42  finalize_init();
43 
44  void handle(event *ev);
45 
46  virtual void
47  connect(
48  int src_outport,
49  int dst_inport,
51  connectable* mod,
52  config* cfg);
53 
54  virtual std::string
55  to_string() const {
56  return "simple nic";
57  }
58 
59  timestamp
61  return inj_lat_;
62  }
63 
64  double
66  return 1.0/inj_bw_inverse_;
67  }
68 
69  protected:
70  /**
71  Start the message sending and inject it into the network
72  @param payload The network message to send
73  */
74  virtual void
76 
77  protected:
79 
81 
83 
84  private:
85  void send_to_injector(timestamp arrival, network_message* netmsg);
86  void send_to_node(timestamp arrival, network_message* netmsg);
87 
88 };
89 
90 }
91 } // end of namespace sstmac.
92 
93 #endif
94 
95 #endif // SIMPLE_NIC_H
96 
virtual ~simple_nic()
Goodbye.
Definition: simple_nic.h:36
virtual std::string to_string() const
Definition: simple_nic.h:55
double injection_bandwidth() const
Definition: simple_nic.h:65
virtual void connect(int src_outport, int dst_inport, connection_type_t ty, connectable *mod, config *cfg)
connect
void handle(event *ev)
A basic container for time (subject to future transplant).
Definition: timestamp.h:29
void send_to_injector(timestamp arrival, network_message *netmsg)
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
A networkinterface is a delegate between a node and a server module.
Definition: nic.h:45
A networkinterface is a delegate between a node and a server module.
Definition: simple_nic.h:28
virtual void finalize_init()
A final initialization function called for the object after all parameters have been read...
virtual void init_factory_params(sprockit::sim_parameters *params)
Initialize all member variables from the parameters object.
timestamp injection_latency() const
Definition: simple_nic.h:60
simple_nic(sprockit::factory_type *interconn)
Definition: simple_nic.h:32
void send_to_node(timestamp arrival, network_message *netmsg)
virtual void do_send(network_message *msg)
Start the message sending and inject it into the network.