Skip to content

Commit 136f108

Browse files
committed
added descriptions
1 parent 04995c1 commit 136f108

7 files changed

Lines changed: 57 additions & 8 deletions

File tree

include/osp/bsp/scheduler/GreedySchedulers/GreedyMetaScheduler.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@ limitations under the License.
2626

2727
namespace osp {
2828

29+
30+
/**
31+
* @class GreedyMetaScheduler
32+
* @brief The GreedyMetaScheduler class represents a meta-scheduler that selects the best schedule produced from a list of
33+
* added schedulers.
34+
*
35+
* This class inherits from the Scheduler class and implements the computeSchedule() and getScheduleName() methods.
36+
* The computeSchedule() method iterates through a list of schedulers, computes a schedule using each one,
37+
* and returns the schedule with the minimum cost.
38+
*/
2939
template<typename Graph_t>
3040
class GreedyMetaScheduler : public Scheduler<Graph_t> {
3141

3242
Serial<Graph_t> serial_scheduler_;
3343
std::vector<Scheduler<Graph_t>*> schedulers_;
3444

35-
static constexpr bool verbose = true;
45+
static constexpr bool verbose = false;
3646

3747
public:
3848
/**

include/osp/bsp/scheduler/Serial.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ limitations under the License.
2525
#include <string>
2626
namespace osp {
2727

28+
/**
29+
* @class Serial
30+
* @brief The Serial class represents a scheduler that assigns all tasks to a single processor in a serial manner.
31+
* If the architecture is heterogeneous, it assigns tasks to one processor of each type computing a schedule with the smallest number of supersteps.
32+
*
33+
*/
2834
template<typename Graph_t>
2935
class Serial : public Scheduler<Graph_t> {
3036

include/osp/dag_divider/isomorphism_divider/HashComputer.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ limitations under the License.
2323

2424
namespace osp {
2525

26+
/**
27+
* @class HashComputer
28+
* @brief Abstract base class for computing and managing hash values and orbits for graph vertices.
29+
*
30+
* This class provides an interface for obtaining hash values for individual vertices,
31+
* the full list of vertex hashes, the number of unique orbits, and the vertices belonging to specific orbits.
32+
*
33+
* @tparam index_type The type used for indexing vertices in the graph.
34+
*/
2635
template<typename index_type>
2736
class HashComputer {
2837
public:

include/osp/dag_divider/isomorphism_divider/IsomorphicSubgraphScheduler.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,24 @@ limitations under the License.
3131

3232
namespace osp {
3333

34+
/**
35+
* @brief A scheduler that leverages isomorphic subgraphs to partition a DAG.
36+
*
37+
* @class IsomorphicSubgraphScheduler
38+
*
39+
* This scheduler first identifies isomorphic subgraphs within the input DAG using a hash-based approach.
40+
* It then groups these isomorphic subgraphs into "orbits". Each orbit is treated as a single node in a
41+
* coarser graph. The scheduler then uses an ETF-like approach to schedule these coarse nodes (orbits)
42+
* onto available processors. Finally, the schedule for each orbit is "unrolled" back to the original
43+
* DAG, assigning a partition ID to each original vertex.
44+
*
45+
* The scheduler supports trimming of isomorphic groups to better fit processor counts, and can
46+
* dynamically switch between a standard BSP scheduler and a specialized TrimmedGroupScheduler
47+
* for these trimmed groups.
48+
*
49+
* @tparam Graph_t The type of the input computational DAG.
50+
* @tparam Constr_Graph_t The type of the constructable computational DAG used for internal representations.
51+
*/
3452
template<typename Graph_t, typename Constr_Graph_t>
3553
class IsomorphicSubgraphScheduler {
3654
static_assert(is_computational_dag_v<Graph_t>, "Graph must be a computational DAG");

include/osp/dag_divider/isomorphism_divider/MerkleHashComputer.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ limitations under the License.
3131

3232
namespace osp {
3333

34+
/**
35+
* @brief Computes Merkle hashes for graph vertices to identify isomorphic orbits.
36+
*
37+
* The Merkle hash of a vertex is computed recursively based on its own properties
38+
* and the sorted hashes of its parents (or children, depending on the `forward` template parameter).
39+
* This allows for the identification of structurally isomorphic subgraphs.
40+
*
41+
* @tparam Graph_t The type of the graph, must satisfy the `directed_graph` concept.
42+
* @tparam node_hash_func_t A functor that computes a hash for a single node.
43+
* Defaults to `uniform_node_hash_func`.
44+
* @tparam forward If true, hashes are computed based on parents (top-down).
45+
* If false, hashes are computed based on children (bottom-up).
46+
*/
3447
template<typename Graph_t, typename node_hash_func_t = uniform_node_hash_func<vertex_idx_t<Graph_t>>, bool forward = true>
3548
class MerkleHashComputer : public HashComputer<vertex_idx_t<Graph_t>> {
3649

include/osp/dag_divider/isomorphism_divider/OrbitGraphProcessor.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,6 @@ class OrbitGraphProcessor {
304304
<< temp_coarse_graph.num_vertices() << " nodes.\n";
305305
}
306306

307-
// No checks are performed in this function, so we commit directly.
308-
if constexpr (verbose) {
309-
std::cout << " - Merging " << v << " into " << u << ". New coarse graph has "
310-
<< temp_coarse_graph.num_vertices() << " nodes.\n";
311-
}
312-
313307
commit_merge(u, v, std::move(temp_coarse_graph), temp_contraction_map, std::move(new_subgraphs),
314308
current_coarse_graph, current_groups, current_contraction_map);
315309

include/osp/dag_divider/isomorphism_divider/TrimmedGroupScheduler.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ namespace osp {
3030
* @brief A scheduler for a single trimmed group, which consists of multiple isomorphic connected components.
3131
*
3232
* @class TrimmedGroupScheduler
33-
* @brief A scheduler for a single trimmed group, which consists of multiple isomorphic connected components.
3433
*
3534
* This scheduler functions similarly to the ConnectedComponentScheduler but is tailored for a single,
3635
* potentially disconnected, subgraph that resulted from merging smaller isomorphic subgraphs. It divides

0 commit comments

Comments
 (0)