SST/macro
dist_dummyswitch.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 SSTMAC_HARDWARE_NETWORK_SWITCHES_DIST_DUMMYSWITCH_H_INCLUDED
13 #define SSTMAC_HARDWARE_NETWORK_SWITCHES_DIST_DUMMYSWITCH_H_INCLUDED
14 
18 
19 #if !SSTMAC_INTEGRATED_SST_CORE
20 
21 namespace sstmac {
22 namespace hw {
23 
24 /**
25  * @brief The dist_dummy_switch class
26  * Encapsulates a switch that is a placeholder used in parallel simulation.
27  * A link between a real switch and a dummy switch represents a link between
28  * switches on different MPI ranks.
29  */
31 {
32  public:
34  {
35  my_addr_ = sid;
36  init_loc_id(event_loc_id(sid));
37  }
38 
39  std::string
40  to_string() const;
41 
42  bool
43  ipc_handler() const {
44  return true;
45  }
46 
47  virtual
49  }
50 
51  virtual void
52  handle(event* ev);
53 
54  virtual void
56  int src_outport,
57  int dst_inport,
58  connection_type_t ty,
59  connectable* mod)
60  { //no op
61  }
62 
63  virtual void
65  int src_outport,
66  int dst_inport,
67  connectable* comp,
68  config* cfg);
69 
70  virtual void
72  int src_outport,
73  int dst_inport,
74  connectable* comp,
75  config* cfg);
76 
77  std::vector<switch_id>
80  "dist_dummyswitch::connected_switches: should not be called on dummy switch");
81  }
82 
83  double
84  hop_bandwidth() const;
85 
86  timestamp
87  hop_latency() const;
88 
89  timestamp
90  lookahead() const;
91 
92  int
93  queue_length(int port) const {
94  return 0;
95  }
96 
97  protected:
98  virtual void
99  connect_ejector(int src_outport, int dst_inport, event_handler* nic);
100 
101  virtual void
102  connect_injector(int src_outport, int dst_inport, event_handler* nic);
103 
104 
105 };
106 
107 }
108 }
109 
110 #endif
111 
112 #endif
113 
std::vector< switch_id > connected_switches() const
virtual void connect_input(int src_outport, int dst_inport, connectable *comp, config *cfg)
The main interface for something that can respond to an event (sst_message).
Definition: event_handler.h:24
virtual void connect_ejector(int src_outport, int dst_inport, event_handler *nic)
timestamp hop_latency() const
A basic container for time (subject to future transplant).
Definition: timestamp.h:29
timestamp lookahead() const
topology_id switch_id
Definition: node_address.h:23
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
virtual void connect_injector(int src_outport, int dst_inport, event_handler *nic)
int queue_length(int port) const
A networkinterface is a delegate between a node and a server module.
Definition: nic.h:45
virtual void connect(int src_outport, int dst_inport, connection_type_t ty, connectable *mod)
The dist_dummy_switch class Encapsulates a switch that is a placeholder used in parallel simulation...
#define spkt_throw(exc,...)
Definition: errors.h:44
virtual void handle(event *ev)
A function was intentionally unimplemented because it doesn&#39;t make sense, or it is ongoing work...
Definition: errors.h:181
virtual void connect_output(int src_outport, int dst_inport, connectable *comp, config *cfg)
std::string to_string() const