GitHub PushEvent at 2014-03-16 21:37:10
Repository: warped
Actor: ajalt
Payload: {"shas":[["6e39d4e231e4de5c443555426e8223a35dbe59a7","2048b22ac0881f917af3e938105055ab85498548@alt","Fixed case where sim would fail to terminate\n\nThis is a fix for a race condition that only happens when an application\nwith no internal termination condition is run using non-threaded warped\non multiple nodes with a maximum GVT  specified (i.e. `--simulateUntil\nx`). The first manager would terminate as expected, but all other\nmanagers would continue to run.\n\nThe manager with ID 0 is hard coded to do GVT calculations. When the max\nGVT is exceeded, it would tell the TerminationManager to circulate a\nSIMULATION_COMPLETE TerminationToken, which would cause all other\nmanagers to terminate once they received it.\n\nThe first manager is also initially in control of triggering the normal\ntermination check. However, if a manager trigger a normal termination\ncheck (which happens when it runs out of event to process), and another\nmanager has events remaining, the manager that ran out of events will\nhand control of termination over to the manager that had events\nremaining.\n\nThe first manager can check if it has any events remaining before any\nevents have been scheduled, causing the termination control to pass to\nanother manager before the simulation actually begins.\n\nIf the first manager had control of the termination, it would trigger\nthe termination as part of the GVT calculation, which happens even if\nthere were still pending events. Since only the first manager performs\nGVT calculations, if another manager controlled termination, it would\ntrigger it once it had run out of events to process.\n\nHowever, it is possible for a simulation object to schedule events for\nitself. In the case of models like Epidemic and RAID, all objects will\nschedule events for themselves indefinitely.\n\nWhat was happening was the first manager would calculate the GVT, see\nthat it had exceeded the max, and trigger a termination. However, if it\nhad handed off termination control, the termination trigger would be a\nno-op, and the other managers would continue to run until the one in\ncontrol of termination ran out of events and had a chance to check the\nGVT. If that manager never ran out of events, it would never terminate.\n\nThe fix was simply to continue to let the first manager perform GVT\ncalculations, but to have all managers check the GVT value before\nprocessing every event.","AJ Alt",true]],"size":1,"ref":"refs/heads/master","head":"6e39d4e231e4de5c443555426e8223a35dbe59a7"}