CrayLabs / SmartSim

SmartSim Infrastructure Library.
BSD 2-Clause "Simplified" License
219 stars 36 forks source link

DragonBackend refactor #590

Open al-rigazzi opened 1 month ago

al-rigazzi commented 1 month ago

Description

The DragonBackend class should be refactored to ensure maintainability and readability.

Justification

The DragonBackend class contains some monolithic methods, such as _start_steps and _stop_steps that are deeply nested and complex to read or maintain. The methods manage several queues at the same time, and if new scenarios will arise, it could be difficult to ensure proper handling of workflows.

Implementation Strategy

The refactor should aim at reducing complexity, most likely by adding new single-responsibility objects, and splitting up nested and long methods. Data structures used to represent queues or data (such as _group_infos) should be examined and possibly replaced with thread-safe counterparts.