reduce memory usage of torus
Looking into the event count of dragonfly (and most of it applies for the torus queuing), majority of the events are being generated by the splitting the packets into chunks (chunk size is 64 bytes).
So for example, a message size of 4MB will generate an event population of 65K packet generate events per originating node. In the case of a very small scale dragonfly having 72 nodes and 36 routers , sending a 4MB will generate roughly 2M arrival events at the routers and the same amount of departure events. Note that the number of routers traversed in minimal routing is 4 so we can have around 16M events generated for a 4MB message.
Fixing the chunk issuance in a loop brings down the event population to some extent but not much since the primary bottleneck in the dragonfly is a router. In case of torus, long queues are formed at the torus link especially if torus is of lower dimension. One down side of having sequential chunk issuance (as we saw in the case of dragonfly) is that it will affect the number of packets queued at the terminals. With that, the maximum number of packets queued at the terminals/node VCs in dragonfly is 2. That is acceptable in dragonfly since the real queues are formed at the routers, not terminals/nodes.
The thing that has substantially helped in bringing down the event population for dragonfly is minimizing router events as much as possible. With the recent changes in repo, the dragonfly routers have only two events, a packet forward event instead of separate router arrival and departure events and a router buffer update event. That alone has bought down the event count of the routers by 40% and the overall simulation event count by ~28%, this also improves the simulation runtime issue in optimistic mode (thats for a small-scale 72 node simulation, we might see more of a difference with a large-scale run having larger messages).
Similar squeezing of events needs to be done for the torus. Having only one event for one hop would substantially bring down the event population. Thats the next thing on the list.