Skip to content

Commit 314b1f8

Browse files
Max bsp growlocal (#80)
* progress * progress * progress * compiles * some fixes * progress * fixed bug * removed commented code * removed restrictions * conditioning for next superstep * improved lower bound on allready usage * added compare to inplace merge * changed to base function call
1 parent 9e63602 commit 314b1f8

File tree

3 files changed

+457
-11
lines changed

3 files changed

+457
-11
lines changed

include/osp/bsp/model/BspInstance.hpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,20 @@ class BspInstance {
107107
* @param cdag The computational DAG for the instance.
108108
* @param architecture The BSP architecture for the instance.
109109
*/
110-
BspInstance(const GraphT &cdag,
110+
template <typename OtherGraphT>
111+
BspInstance(const OtherGraphT &cdag,
111112
const BspArchitecture<GraphT> &architecture,
112113
std::vector<std::vector<bool>> nodeProcessorCompatibility = std::vector<std::vector<bool>>({{true}}))
113-
: cdag_(cdag), architecture_(architecture), nodeProcessorCompatibility_(nodeProcessorCompatibility) {}
114+
: cdag_(cdag), architecture_(architecture), nodeProcessorCompatibility_(nodeProcessorCompatibility) {
115+
static_assert(std::is_same_v<VMemwT<GraphT>, VMemwT<OtherGraphT>>,
116+
"BspArchitecture: GraphT and Graph_t_other have the same memory weight type.");
117+
118+
static_assert(std::is_same_v<VCommwT<GraphT>, VCommwT<OtherGraphT>>,
119+
"BspArchitecture: GraphT and Graph_t_other have the same communication weight type.");
120+
121+
static_assert(std::is_same_v<VTypeT<GraphT>, VTypeT<OtherGraphT>>,
122+
"BspArchitecture: GraphT and Graph_t_other have the same processor type.");
123+
}
114124

115125
/**
116126
* @brief Constructs a BspInstance object with the specified computational DAG and BSP architecture.
@@ -319,7 +329,7 @@ class BspInstance {
319329
bool HasAnyTypeRestrictions() const {
320330
for (VertexTypeTOrDefault node_type = 0; node_type < nodeProcessorCompatibility_.size(); ++node_type) {
321331
for (VertexTypeTOrDefault proc_type = 0; proc_type < nodeProcessorCompatibility_[node_type].size(); ++proc_type) {
322-
if(!nodeProcessorCompatibility_[node_type][proc_type]) {
332+
if (!nodeProcessorCompatibility_[node_type][proc_type]) {
323333
return true;
324334
}
325335
}

0 commit comments

Comments
 (0)