@@ -22,43 +22,77 @@ limitations under the License.
2222
2323namespace osp {
2424
25- // / @class IBspSchedule
26- // / @brief Interface for a BSP (Bulk Synchronous Parallel) schedule.
25+ /* *
26+ * @class IBspSchedule
27+ * @brief Pure interface class to organize the interaction with a BSP schedule.
28+ *
29+ * A BSP schedule assigns nodes to processors and supersteps, is based on an instance, and has a number of supersteps.
30+ * It provides unified access for different data implementations.
31+ *
32+ * - The class `BspSchedule` implements the assignments as vectors.
33+ * - The class `SetBspSchedule` implements containers that contain all nodes assigned to a pair of processor and superstep.
34+ *
35+ * @tparam GraphT The type of the computational DAG, which must satisfy `is_computational_dag_v`.
36+ * @see BspInstance
37+ * @see BspSchedule
38+ * @see SetBspSchedule
39+ */
2740template <typename GraphT>
2841class IBspSchedule {
2942 using VertexIdx = VertexIdxT<GraphT>;
3043
44+ static_assert (isComputationalDagV<GraphT>, " IBspSchedule can only be used with computational DAGs." );
45+
3146 public:
32- // / @brief Destructor.
3347 virtual ~IBspSchedule () = default ;
3448
35- virtual const BspInstance<GraphT> &GetInstance () const = 0;
36-
37- // / @brief Set the assigned superstep for a node.
38- // / @param node The node index.
39- // / @param superstep The assigned superstep.
49+ /* *
50+ * @brief Get the BSP instance associated with this schedule.
51+ *
52+ * @return The BSP instance.
53+ */
54+ [[nodiscard]] virtual const BspInstance<GraphT> &GetInstance () const = 0;
55+
56+ /* *
57+ * @brief Set the assigned superstep for a node.
58+ *
59+ * @param node The node index.
60+ * @param superstep The assigned superstep.
61+ */
4062 virtual void SetAssignedSuperstep (VertexIdx node, unsigned int superstep) = 0;
4163
42- // / @brief Set the assigned processor for a node.
43- // / @param node The node index.
44- // / @param processor The assigned processor.
64+ /* *
65+ * @brief Set the assigned processor for a node.
66+ *
67+ * @param node The node index.
68+ * @param processor The assigned processor.
69+ */
4570 virtual void SetAssignedProcessor (VertexIdx node, unsigned int processor) = 0;
4671
47- // / @brief Get the assigned superstep of a node.
48- // / @param node The node index.
49- // / @return The assigned superstep of the node.
50- // / If the node is not assigned to a superstep, this.NumberOfSupersteps() is returned.
51- virtual unsigned AssignedSuperstep (VertexIdx node) const = 0;
52-
53- // / @brief Get the assigned processor of a node.
54- // / @param node The node index.
55- // / @return The assigned processor of the node.
56- // / If the node is not assigned to a processor, this.GetInstance().NumberOfProcessors() is returned.
57- virtual unsigned AssignedProcessor (VertexIdx node) const = 0;
58-
59- // / @brief Get the number of supersteps in the schedule.
60- // / @return The number of supersteps in the schedule.
61- virtual unsigned NumberOfSupersteps () const = 0;
72+ /* *
73+ * @brief Get the assigned superstep of a node.
74+ *
75+ * @param node The node index.
76+ * @return The assigned superstep of the node.
77+ * If the node is not assigned to a superstep, this.NumberOfSupersteps() is returned.
78+ */
79+ [[nodiscard]] virtual unsigned AssignedSuperstep (VertexIdx node) const = 0;
80+
81+ /* *
82+ * @brief Get the assigned processor of a node.
83+ *
84+ * @param node The node index.
85+ * @return The assigned processor of the node.
86+ * If the node is not assigned to a processor, this.GetInstance().NumberOfProcessors() is returned.
87+ */
88+ [[nodiscard]] virtual unsigned AssignedProcessor (VertexIdx node) const = 0;
89+
90+ /* *
91+ * @brief Get the number of supersteps in the schedule.
92+ *
93+ * @return The number of supersteps in the schedule.
94+ */
95+ [[nodiscard]] virtual unsigned NumberOfSupersteps () const = 0;
6296};
6397
6498} // namespace osp
0 commit comments