mgpusim icon indicating copy to clipboard operation
mgpusim copied to clipboard

Parallel simulation results is very different from serial simulation

Open syifan opened this issue 1 year ago • 1 comments

To Reproduce MGPUSim version of commit ID:

Command that recreates the problem

Command

Current behavior A clear and concise description of what is wrong.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

syifan avatar Mar 06 '24 14:03 syifan

This is parallel engine. image

This is serial engine. image

In terms of this bug, I print the information about the event scheduling and handling. In a common situation, the endpoint[0] pops the msg in the output buffer at 0.0000000030, then the driver checks whether the port could send new message at the same tick (0.0000000030). In serial engine, although these two events are scheduled at the same tick, the simulator handles the endpoint event (ID: 133) before the driver event (ID: 134), therefore the driver could send new message successfully. However, in parallel engine, the simulator handles the driver event (ID: 134) first instead of endpoint event (ID: 134), so the driver could not send new message due to the output buffer of endpoint is full.

Briefly, in the parallel engine, the event with larger ID may be handled earlier than the event with smaller ID, which is contrary to the behavior of serial engine. I think this may cause the bug that parallel simulation results is very different from serial simulation.

MaxKev1n avatar Mar 06 '24 17:03 MaxKev1n