Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 168 #169

Merged
merged 2 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/common/KokkosKernels_SimpleUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct InclusiveParallelPrefixSum{
template <typename view_t, typename MyExecSpace>
inline void kk_exclusive_parallel_prefix_sum(typename view_t::value_type num_elements, view_t arr){
typedef Kokkos::RangePolicy<MyExecSpace> my_exec_space;
Kokkos::parallel_scan( my_exec_space(0, num_elements), ExclusiveParallelPrefixSum<view_t>(arr));
Kokkos::parallel_scan( "KokkosKernels::PrefixSum", my_exec_space(0, num_elements), ExclusiveParallelPrefixSum<view_t>(arr));
}


Expand All @@ -130,7 +130,7 @@ inline void kk_exclusive_parallel_prefix_sum(typename view_t::value_type num_ele
template <typename forward_array_type, typename MyExecSpace>
void kk_inclusive_parallel_prefix_sum(typename forward_array_type::value_type num_elements, forward_array_type arr){
typedef Kokkos::RangePolicy<MyExecSpace> my_exec_space;
Kokkos::parallel_scan( my_exec_space(0, num_elements), InclusiveParallelPrefixSum<forward_array_type>(arr));
Kokkos::parallel_scan( "KokkosKernels::PrefixSum", my_exec_space(0, num_elements), InclusiveParallelPrefixSum<forward_array_type>(arr));
}

template <typename view_t>
Expand Down Expand Up @@ -296,7 +296,7 @@ struct ReduceMaxFunctor{
template <typename view_type , typename MyExecSpace>
void kk_view_reduce_max(size_t num_elements, view_type view_to_reduce, typename view_type::non_const_value_type &max_reduction){
typedef Kokkos::RangePolicy<MyExecSpace> my_exec_space;
Kokkos::parallel_reduce( my_exec_space(0,num_elements), ReduceMaxFunctor<view_type>(view_to_reduce), max_reduction);
Kokkos::parallel_reduce( "KokkosKernels::FindMax", my_exec_space(0,num_elements), ReduceMaxFunctor<view_type>(view_to_reduce), max_reduction);
}


Expand Down
10 changes: 5 additions & 5 deletions src/graph/KokkosGraph_GraphColorHandle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class GraphColoringHandle
teamSizeMax,
nv, ne);

Kokkos::parallel_for(
Kokkos::parallel_for("KokkosGraph::CountLowerTriangleTeam",
team_policy_t(nv / teamSizeMax + 1 , teamSizeMax, vector_size),
clt//, new_num_edge
);
Expand All @@ -515,7 +515,7 @@ class GraphColoringHandle
new_num_edge = hlower();
nnz_lno_persistent_work_view_t half_src (Kokkos::ViewAllocateWithoutInitializing("HALF SRC"),new_num_edge);
nnz_lno_persistent_work_view_t half_dst (Kokkos::ViewAllocateWithoutInitializing("HALF DST"),new_num_edge);
Kokkos::parallel_for(
Kokkos::parallel_for("KokkosGraph::FillLowerTriangleTeam",
team_policy_t(nv / teamSizeMax + 1 , teamSizeMax, vector_size),
FillLowerTriangleTeam
<row_index_view_type, nonzero_view_type,
Expand All @@ -527,7 +527,7 @@ class GraphColoringHandle
}
else {
if (nv > 0) {
Kokkos::parallel_reduce(my_exec_space(0,nv),
Kokkos::parallel_reduce("KokkosGraph::CountLowerTriangleTeam",my_exec_space(0,nv),
CountLowerTriangle<row_index_view_type, nonzero_view_type, size_type_temp_work_view_t> (nv, xadj, adj, lower_count), new_num_edge);
}

Expand All @@ -538,7 +538,7 @@ class GraphColoringHandle
nnz_lno_persistent_work_view_t half_src (Kokkos::ViewAllocateWithoutInitializing("HALF SRC"),new_num_edge);
nnz_lno_persistent_work_view_t half_dst (Kokkos::ViewAllocateWithoutInitializing("HALF DST"),new_num_edge);

Kokkos::parallel_for(my_exec_space(0,nv), FillLowerTriangle
Kokkos::parallel_for("KokkosGraph::FillLowerTriangleTeam",my_exec_space(0,nv), FillLowerTriangle
<row_index_view_type, nonzero_view_type,
size_type_temp_work_view_t,nnz_lno_persistent_work_view_t> (nv, xadj, adj, lower_count, half_src, half_dst));

Expand Down Expand Up @@ -578,7 +578,7 @@ class GraphColoringHandle
nnz_lno_t get_num_colors(){
if (num_colors == 0){
typedef typename Kokkos::RangePolicy<ExecutionSpace> my_exec_space;
Kokkos::parallel_reduce(my_exec_space(0, vertex_colors.dimension_0()),
Kokkos::parallel_reduce("KokkosKernels::FindMax", my_exec_space(0, vertex_colors.dimension_0()),
ReduceMaxFunctor(vertex_colors) ,num_colors);
}
return num_colors;
Expand Down
7 changes: 7 additions & 0 deletions src/graph/KokkosGraph_graph_color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ void d2_graph_color(
}

default:
{
color_view_type colors_out = color_view_type("Graph Colors", num_rows);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crtrott Just to check, Serial here refers strictly to the algorithms style of execution, the exec_space of the View does not need to be Kokkos::Serial?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah exactly.

BaseGraphColoring gc(num_rows, row_entries.dimension_0(), row_map, row_entries, gch);
gc.d2_color_graph/*<lno_col_view_t_,lno_colnnz_view_t_>*/(colors_out, num_phases, num_cols, col_map, col_entries);
gch->set_num_phases(num_phases);
gch->set_vertex_colors(colors_out);
break;
}

}

Expand Down