Skip to content

Commit 9b3aa5a

Browse files
committed
packet size issue
1 parent 1baad7a commit 9b3aa5a

3 files changed

Lines changed: 30 additions & 42 deletions

File tree

src/sst/elements/astra/astraEvent.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class AstraEvent : public SST::Event {
2222
void (*msg_handler_)(void* fun_arg); //TODO
2323
void* fun_arg_; //TODO
2424

25+
bool tail_;
26+
2527
void serialize_order(SST::Core::Serialization::serializer &ser) override {
2628
SST::Event::serialize_order(ser);
2729
//SST_SER(buffer_); //TODO

src/sst/elements/astra/astraNIC.cc

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ AstraNIC::AstraNIC(ComponentId_t id, Params &params, int nicID) : SubComponent(i
1717
primaryComponentDoNotEndSim();
1818

1919
// NIC Params
20-
mtu_ = params.find<int>("mtu", "1500");
20+
mtu_ = params.find<int>("mtu", "1500"); //bytes
2121

2222
// Link params
2323
networkInterface_ = new AstraNetworkInterface(nicID_, *this);
24-
std::string lctype = params.find<std::string>("linkcontrol", "merlin.linkcontrol");
24+
std::string lctype = params.find<std::string>("linkcontrol", "merlin.reorderlinkcontrol");
2525
Params lcparams;
26-
lcparams.insert("link_bw", params.find<std::string>("network_bw", "80GiB/s"));
27-
lcparams.insert("in_buf_size", params.find<std::string>("network_input_buffer_size", "8KiB"));
28-
lcparams.insert("out_buf_size", params.find<std::string>("network_output_buffer_size", "8KiB"));
26+
lcparams.insert("link_bw", params.find<std::string>("network_bw", "100Gb/s"));
27+
lcparams.insert("in_buf_size", params.find<std::string>("network_input_buffer_size", "10kB"));
28+
lcparams.insert("out_buf_size", params.find<std::string>("network_output_buffer_size", "10kB"));
2929

3030
freq_ = params.find<std::string>("frequency", "2.0GHz");
3131
clockHandler_ = new Clock::Handler<AstraNIC, &AstraNIC::tick>(this);
@@ -72,15 +72,14 @@ void AstraNIC::finish() {
7272
bool AstraNIC::tick(SimTime_t cycle) {
7373
bool disableClock = false;
7474

75-
7675
int recvCount = 0;
7776
while (!recvQueue.empty()) {
7877
SimpleNetwork::Request* req = recvQueue.front(); // TODO - do I need to limit how much can be done per cycle?
7978
recvQueue.pop();
8079
AstraEvent* ae = static_cast<AstraEvent*>(req->takePayload());
8180

8281
// Notify AstraSim::Sys that the send has completed
83-
if (req->tail) {
82+
if (ae->tail_) {
8483
ae->msg_handler_(ae->fun_arg_);
8584

8685
MsgKey mk{req->src, req->dest, ae->tag_};
@@ -97,9 +96,11 @@ bool AstraNIC::tick(SimTime_t cycle) {
9796
}
9897
delete(ae);
9998
delete(req);
99+
recvCount++;
100100

101101
}
102102

103+
dbg_->debug(CALL_INFO, 1, 0, "nicID=%d Recv %d requests\n", nicID_, recvCount);
103104
dbg_->debug(CALL_INFO, 1, 0, "nicID=%d Send queue size: %d\n", nicID_, sendQueue.size());
104105

105106
//drain send queue
@@ -126,6 +127,7 @@ bool AstraNIC::tick(SimTime_t cycle) {
126127
isClocked_ = false;
127128
}
128129
return disableClock;
130+
//return false;
129131
}
130132

131133
void AstraNIC::handleSimSchedule(Event* ev) {
@@ -134,27 +136,22 @@ void AstraNIC::handleSimSchedule(Event* ev) {
134136
ae->msg_handler_(ae->fun_arg_);
135137
// The event should be delayed when it is put on the Link. We may call it immediately
136138
if (!isClocked_) {
137-
// TODO - is this needed?
139+
// TODO - is this needed? - only need to do this in the send/recv logic
138140
reregisterClock(freq_, clockHandler_);
139141
isClocked_ = true;
140142
}
141143
}
142144

143145
// Called when a packet is received
144-
// TODO put this in clock handler
145146
bool AstraNIC::handleRecv(int) {
146147
dbg_->debug(CALL_INFO, 1, 0, "nicID=%d handleRecv called\n", nicID_);
147148
SST::Interfaces::SimpleNetwork::Request* req = linkControl_->recv(0);
148149
recvQueue.push(req);
149150

151+
reregisterClock(freq_, clockHandler_);
152+
isClocked_ = true;
150153

151-
if (!isClocked_) {
152-
// TODO - is this needed? - Answer may depend on if we get a send or a recv and whether we already have the other side
153-
reregisterClock(freq_, clockHandler_);
154-
isClocked_ = true;
155-
}
156-
157-
return true; // TODO - what is this?
154+
return true; // Keep this handler registered
158155
}
159156

160157
/*********************************************************/
@@ -198,14 +195,16 @@ int AstraNIC::sim_send(void* buffer,
198195
if (i == (num_packets - 1)) {
199196
ae->msg_handler_ = msg_handler;
200197
ae->fun_arg_ = fun_arg;
198+
ae->tail_ = true;
201199

202-
//req->size_in_bits = msg_size_rem * 8;
203-
req->size_in_bits = 1;
204-
req->tail = true;
200+
//TODO -restore
201+
req->size_in_bits = msg_size_rem * 8;
202+
//req->size_in_bits = 1024;
203+
assert(msg_size_rem > 0);
205204
} else {
206-
//req->size_in_bits = mtu_ * 8;
207-
req->size_in_bits = 1;
208-
req->tail = false;
205+
ae->tail_ = false;
206+
req->size_in_bits = mtu_ * 8;
207+
//req->size_in_bits = 128;
209208
msg_size_rem -= mtu_;
210209
}
211210

@@ -221,6 +220,7 @@ int AstraNIC::sim_send(void* buffer,
221220
return 0;
222221
}
223222

223+
// TODO put these in postedRecvQueue and process during `tick`
224224
int AstraNIC::sim_recv(void* msg,
225225
uint64_t msg_size,
226226
int type,

src/sst/elements/astra/tests/astra-basic.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ def parseTopoFile(path):
6161
}
6262
)
6363

64-
# workload has ports "port%d"
65-
# -> shared with astraNIC
66-
# -> shared with merlin.linkcontrol
67-
68-
# Q1: How do I connect to ports? -> A: Create an EndPoint object -> DONE
69-
# Q2: What is the proper event to send on the links to SimpleNetwork -> ??
70-
# Q3: FATAL: Merlin: In workload, port '' must be connected -> A: lcparams issues -> DONE
71-
# Q3.1: Why do we need lcparams to have port_name as well as a parameter for SimpleNetwork? -> ??
72-
# Q4: How do I get a torus with exactly 16 ports? -> specify shape of size 16 and local_ports=1 -> DONE
7364

7465
## Merlin Config
7566
merlinTopo = topoTorus()
@@ -79,23 +70,18 @@ def parseTopoFile(path):
7970
sst.merlin._params["torus.local_ports"] = "1"
8071
sst.merlin._params["num_dims"] = "3"
8172

82-
sst.merlin._params["link_bw"] = "4GB/s"
73+
sst.merlin._params["link_bw"] = "100Gb/s"
8374
sst.merlin._params["link_lat"] = "20ns"
84-
sst.merlin._params["flit_size"] = "8B"
85-
sst.merlin._params["xbar_bw"] = "4GB/s"
75+
sst.merlin._params["flit_size"] = "64b"
76+
sst.merlin._params["xbar_bw"] = "100Gb/s" # Should this be higher?
77+
8678
sst.merlin._params["input_latency"] = "20ns"
8779
sst.merlin._params["output_latency"] = "20ns"
88-
sst.merlin._params["input_buf_size"] = "4kB"
89-
sst.merlin._params["output_buf_size"] = "4kB"
80+
sst.merlin._params["input_buf_size"] = "10kB"
81+
sst.merlin._params["output_buf_size"] = "10kB"
9082

9183
sst.merlin._params["xbar_arb"] = "merlin.xbar_arb_lru"
9284

93-
94-
#links = []
95-
#for i in range(numNPUs):
96-
# links.append(sst.Link(f"link_{i}"))
97-
# link[i].connect
98-
9985
class AstraEndPoint(EndPoint):
10086
def __init__(self, workload):
10187
EndPoint.__init__(self)

0 commit comments

Comments
 (0)