POETSII / Orchestrator

The Orchestrator is the configuration and run-time management system for POETS platforms.
1 stars 1 forks source link

Mothership/Softswitch barrier logic breaks "simple" GALS applications #285

Open heliosfa opened 2 years ago

heliosfa commented 2 years ago

This is somewhat related to #247.

The barrier release time for the current Mothership/Software barrier is too short. This means that some parts of the application can start running and sending packets before other parts are even started. If this occurs, this results in some packets being thrown away. For an asynchronous application, this is not necessarily a problem as more packets can be emitted. For GALS applications, the loss of a packet causes local synchronisation to be lost and the entire application to freeze.

An application that illustrates this problem: A 19x19 GALS arithmetic grid works on Ayres while a 20x20 does not. Modifying the Softswitch so that "AA" is printed whenever a packet is thrown away in the barrier shows that the latter throws away packets, causing the application to hang. Running in debug mode exacerbates the problem and makes smaller applications fail.

Possible solutions:

mvousden commented 2 years ago

So we had a natter about this on 2021-10-22. The way forward:

heliosfa commented 2 years ago

OK, so there is an initial working version that appears to sort this and makes GALs applications work as expected.

It is on the BUGFIX-0285-HardwareIdleBarrier branch but needs FEATURE-0242-HardwareIdle-Mothership to be merged in locally to actually work. This will be consolidated in the next day or so.

The initial version makes the feature configurable by preprocessor macro. If the Softswitch is built with SOFTSWITCH_HWIDLE_BARRIER defined (which can be defined by calling make with SOFTSWITCH_HWIDLE_BARRIER=1 as an argument), the feature is enabled and a call to tinselIdle() is made in softswitch_delay() rather than using an unoptimised spinner loop.

Currently, Composer force enables this feature. I will add in Composer commands to configure it from the command line.