dev: Exit correctly in dist-gem5
Review Request #3586 - Created Aug. 4, 2016 and submitted
| Information | |
|---|---|
| Michael LeBeane | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11552:24441a44d54e --------------------------- dev: Exit correctly in dist-gem5 The receiver thread in dist_iface is allowed to directly exit the simulation. This can cause exit to be called twice if the main thread simultaneously wants to exit the simulation. Therefore, have the receiver thread enqueue a request to exit on the primary event queue for the main simulation thread to handle.
Ship it! Thanks for fixing this!
- Gabor Dozsa
Ship It!
Posted (Aug. 16, 2016, 2:26 p.m.)
Thanks for this fix. Just one issue that I think still is not resolved for the termination of dist-gem5 simulations. Maybe Gabor also has an opinoin on this.
When one of the gem5 processes (nodes) disconnects from message server (switch), we need to kill the entire simulation (Please correct me if I'm wrong). Then why we continue simulation if we receive an erroneous message or connection gets closed in "TCPIface::recvTCP" function? Shoudn't we terminate simulation at recvTCP function as well? E.g. simplyfying recvTCP function to:bool
TCPIface::recvTCP(int sock, void *buf, unsigned length)
{
ssize_t ret;ret = ::recv(sock, buf, length, MSG_WAITALL ); if (ret <= 0 || ret != length) panic("recv() failed"); return (ret == length);}
