Skip to content

Commit 69f80eb

Browse files
removed Compact Sparse Graph warnings
1 parent 2bde9e9 commit 69f80eb

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

include/osp/coarser/Sarkar/Sarkar.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ vertex_idx_t<Graph_t_in> Sarkar<Graph_t_in, Graph_t_out>::allChildrenContraction
381381
}
382382

383383
expansionMapOutput.emplace_back( std::move(part) );
384-
counter += graph.out_degree(groupHead);
384+
counter += static_cast<vertex_idx_t<Graph_t_in>>( graph.out_degree(groupHead) );
385385
if (counter > maxCorseningNum) {
386386
minSave = vertSave;
387387
}
@@ -512,7 +512,7 @@ vertex_idx_t<Graph_t_in> Sarkar<Graph_t_in, Graph_t_out>::allParentsContraction(
512512
}
513513

514514
expansionMapOutput.emplace_back( std::move(part) );
515-
counter += graph.in_degree(groupFoot);
515+
counter += static_cast<vertex_idx_t<Graph_t_in>>( graph.in_degree(groupFoot) );
516516
if (counter > maxCorseningNum) {
517517
minSave = vertSave;
518518
}

include/osp/graph_algorithms/directed_graph_top_sort.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ struct top_sort_iterator {
264264
if (is_source(v, graph)) {
265265
next.push(v);
266266
} else {
267-
predecessors_count[v] = graph.in_degree(v);
267+
predecessors_count[v] = static_cast<vertex_idx_t<Graph_t>>( graph.in_degree(v) );
268268
}
269269
}
270270
current_vertex = next.pop_next();

tests/graph_vector_adapter.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ limitations under the License.
2626
#include "osp/graph_implementations/adj_list_impl/computational_dag_vector_impl.hpp"
2727
#include "osp/graph_implementations/adj_list_impl/dag_vector_adapter.hpp"
2828
#include "osp/graph_implementations/boost_graphs/boost_graph.hpp"
29+
#include "osp/graph_implementations/adj_list_impl/compact_sparse_graph.hpp"
2930
#include "osp/bsp/scheduler/GreedySchedulers/BspLocking.hpp"
3031
#include "osp/bsp/scheduler/Serial.hpp"
3132
#include "osp/bsp/scheduler/GreedySchedulers/GreedyMetaScheduler.hpp"
@@ -52,6 +53,7 @@ BOOST_AUTO_TEST_CASE(test_dag_vector_adapter) {
5253
using v_impl = cdag_vertex_impl<unsigned, int, int, int, unsigned>;
5354
using graph_t = dag_vector_adapter<v_impl,int>;
5455
using graph_constr_t = computational_dag_vector_impl<v_impl>;
56+
using CoarseGraphType = Compact_Sparse_Graph<true, true, true, true, true, vertex_idx_t<graph_t>, std::size_t, v_workw_t<graph_t>, v_workw_t<graph_t>, v_workw_t<graph_t>, v_type_t<graph_t>>;
5557

5658
graph_t graph(out_neighbors, in_neighbors);
5759

@@ -68,7 +70,7 @@ BOOST_AUTO_TEST_CASE(test_dag_vector_adapter) {
6870
ComboScheduler<graph_constr_t> growlocal_kl(growlocal, kl);
6971
ComboScheduler<graph_constr_t> locking_kl(locking, kl);
7072
ComboScheduler<graph_constr_t> children_kl(children, kl);
71-
73+
7274
GreedyMetaScheduler<graph_constr_t> scheduler;
7375
// scheduler.addScheduler(growlocal_kl);
7476
scheduler.addScheduler(locking_kl);
@@ -84,9 +86,9 @@ BOOST_AUTO_TEST_CASE(test_dag_vector_adapter) {
8486
bool acyc = is_acyclic(corase_graph);
8587
BOOST_CHECK(acyc);
8688

87-
SarkarMul<graph_t, graph_constr_t> coarser;
89+
SarkarMul<graph_t, CoarseGraphType> coarser;
8890

89-
graph_constr_t coarse_dag;
91+
CoarseGraphType coarse_dag;
9092
std::vector<unsigned> reverse_vertex_map;
9193
coarser.coarsenDag(graph, coarse_dag, reverse_vertex_map);
9294

0 commit comments

Comments
 (0)