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

Create examples for Distance-1 and Distance-2 Graph Coloring #413

Closed
william76 opened this issue Apr 8, 2019 · 9 comments
Closed

Create examples for Distance-1 and Distance-2 Graph Coloring #413

william76 opened this issue Apr 8, 2019 · 9 comments

Comments

@william76
Copy link
Contributor

Create examples for Distance-1 and Distance-2 graph coloring.

They should be put in:

  • example/graph/KokkosKernels_Example_Distance1GraphColor.cpp
  • example/graph/KokkosKernels_Example_Distance2GraphColor.cpp

Requirements:

  • Basically do what the perf_test samples do but keep it as 'bare bones' as possible for an exmaple.
  • Load MatrixMarket graphs.
@william76 william76 self-assigned this Apr 8, 2019
@srajama1
Copy link
Contributor

srajama1 commented Apr 8, 2019

This is good to do ...

@srajama1
Copy link
Contributor

@william76 Was this ever done ?

@william76
Copy link
Contributor Author

@srajama1 I never did get a chance on that... I got buried with doing Xpetra ETI work this summer. The distance-2 graph coloring perf test is actually a pretty good example... I'll see if I can strip it down a little and remove some dependencies from the test_common/ files. Do you know of any code infrastructure that's baked into Kokkos or Kokkos-Kernels to load MatrixMarket data into a CrsMatrix or StaticGraph? The perf_test codes leverage test_common/MyCRSMatrix.hpp but for an example, I'd rather avoid relying on test headers if possible.

@ndellingwood
Copy link
Contributor

ndellingwood commented Sep 11, 2019

@william76 - here is some glue for an internal impl matrix market reader that takes a filename and store as a CrsMatrix. It won't handle matrix market files of "pattern" type properly right now but I think @brian-kelley is working on a fix.

#include <KokkosKernels_IOUtils.hpp>
 
typedef KokkosSparse::CrsMatrix<scalar_t, lno_t, execution_space, void, size_type> crsmat_t;
crsmat_t triMtx = KokkosKernels::Impl::read_kokkos_crst_matrix<crsmat_t>(lfilename.c_str());

@mhoemmen
Copy link
Contributor

@brian-kelley If you need an example of how to handle "pattern" matrices, check out the Tpetra Matrix Market reader.

@william76
Copy link
Contributor Author

I put in a PR with a somewhat stripped down version of the D2GC code from the perf_test directory...

@brian-kelley the D2GC code is also used in the MueLu Aggregation routines. I think it's still using the D2_SERIAL algorithm but changing it there should be just a matter of changing which enum is passed in.

@brian-kelley
Copy link
Contributor

@william76 KokkosKernels PR #466 with the full MatrixMarket support will probably be merged in the next few days. Then you don't even need to deal with CrsMatrix, you can just do

crsGraph_t graph = KokkosKernels:Impl::read_kokkos_crst_graph<crsGraph_t>("file.mtx");

and that will read a pattern file (or any matrix, and discard the scalar values).

@william76
Copy link
Contributor Author

@brian-kelley ooh, cool! I'll hold off mucking around with this D2GC example till that's in =) When that's merged in can you shoot me a note?

@brian-kelley
Copy link
Contributor

@william76 It was just merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants