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

Wiki examples: tests added #737

Merged
merged 1 commit into from
Jun 10, 2020
Merged

Wiki examples: tests added #737

merged 1 commit into from
Jun 10, 2020

Conversation

lucbv
Copy link
Contributor

@lucbv lucbv commented Jun 5, 2020

@srajama1 @ndellingwood @jjwilke
Adding a couple of tests to make sure that the examples in the wiki are actually compiling and working correctly.
This includes two new test: wiki_crsmatrix and wiki_spmv as well as some CMake logic to get things compiled and tested.

See issue #735 for additional information.

@lucbv
Copy link
Contributor Author

lucbv commented Jun 5, 2020

Sorry for opening a second PR, the previous one was using my develop branch which I keep in sync with this repo to avoid conflict, etc... this new PR actually uses a feature branch.
This shall teach me that no PR opened at 2am is worth the trouble...

@srajama1
Copy link
Contributor

srajama1 commented Jun 5, 2020

@lucbv : Can we add these to the tutorials directory as well ?

@lucbv
Copy link
Contributor Author

lucbv commented Jun 5, 2020

@srajama1 sure, I did not realize we had a tutorial directory and I cannot find it in our source code, is it in a different repo?

@srajama1
Copy link
Contributor

srajama1 commented Jun 5, 2020

It is with Kokkos Tutorial
https://github.com/kokkos/kokkos-tutorials

@crtrott
Copy link
Member

crtrott commented Jun 5, 2020

If you want to add them to the turoial someone needs to write the slides for that.

@@ -78,6 +78,7 @@ IF (KokkosKernels_INSTALL_TESTING)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(test_common)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(perf_test)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(unit_test)
KOKKOSKERNELS_ADD_EXAMPLE_DIRECTORIES(example)
Copy link
Contributor

Choose a reason for hiding this comment

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

When doing install testing we force testing on. Does it make sense to do the same for examples?

SET(KOKKOSKERNELS_ENABLE_EXAMPLES ON)

graph_type myGraph(entries, row_map);
matrix_type myMatrix("test matrix", numRows, values, myGraph);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

The examples don't print anything at the end. Is there some performance stat or some sort of message that makes sense to print so the user knows the test is running successfully?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a fair question, at the moment if an error happens during construction the test will fail, if it reaches completion is will return 0 which ctest interprets as success.
I can add screen output that states that the matrix constructor has been called successfully, I could do the same for the graph constructor actually.

@@ -188,7 +189,7 @@ ELSE()
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(test_common)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(perf_test)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(unit_test)
#KOKKOSKERNELS_ADD_EXAMPLE_DIRECTORIES(example)
KOKKOSKERNELS_ADD_EXAMPLE_DIRECTORIES(example)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would squash the two commits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured I would get comments on the CMake side at least so I felt like squashing was going to be an inevitability before the PR merges ; )

Copy link
Contributor

@jjwilke jjwilke left a comment

Choose a reason for hiding this comment

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

Spot check passes for me. Approve after squashing.

A couple of unrelated lines got changed (trailing spaces cleaned up). Not sure what we want the policy to be on this going forward?

@lucbv
Copy link
Contributor Author

lucbv commented Jun 7, 2020

@jjwilke the comment on whitespaces reminds me that I should probably run clang formatting on the two new examples. I am guilty of not doing it since I have not looked into integrating clang-format with emacs. I am guessing that there must be a script out there that modifies the formatting policy in emacs to use the local project clang format file?

The added tests are fairly small and simple so it should be no problem
to have them built and tested.
Also adding CMake logic to actually enable the tests.
Reformatting both example using clang-format
@lucbv
Copy link
Contributor Author

lucbv commented Jun 8, 2020

kokkos-dev: spot_check

#######################################################
PASSED TESTS
#######################################################
clang-4.0.1-Pthread_Serial-release build_time=318 run_time=126
clang-7.0.1-Cuda_OpenMP-release build_time=1078 run_time=543
cuda-9.2-Cuda_OpenMP-release build_time=1677 run_time=571
gcc-5.3.0-OpenMP-release build_time=213 run_time=62
gcc-7.3.0-Serial-release build_time=188 run_time=67
intel-16.0.3-Pthread-release build_time=289 run_time=66
intel-16.0.3-Serial-release build_time=297 run_time=75
intel-17.0.1-OpenMP-release build_time=427 run_time=54

kokkos-dev: spot_check_tpls

#######################################################
PASSED TESTS
#######################################################
clang-4.0.1-Pthread_Serial-release build_time=315 run_time=129
clang-7.0.1-Cuda_OpenMP-release build_time=1084 run_time=263
cuda-9.2-Cuda_OpenMP-release build_time=1150 run_time=297
gcc-5.3.0-OpenMP-release build_time=216 run_time=64
gcc-7.3.0-Serial-release build_time=186 run_time=67
intel-16.0.3-Pthread-release build_time=283 run_time=65
intel-16.0.3-Serial-release build_time=300 run_time=74
intel-17.0.1-OpenMP-release build_time=424 run_time=52

@lucbv
Copy link
Contributor Author

lucbv commented Jun 8, 2020

@ndellingwood if that's OK with you it seems that this can be merged.
Work on incorporating some of this into the kokkos-kernels tutorial will need to go into another PR against the appropriate repo.

@lucbv
Copy link
Contributor Author

lucbv commented Jun 9, 2020

@srajama1 @brian-kelley
If one of you feels like clicking the merge button that would be nice : )
I am working on more of these examples for another PR and it would be nice to have the CMake changes in develop.

@srajama1 srajama1 merged commit e8fa59e into kokkos:develop Jun 10, 2020
@lucbv lucbv deleted the wiki_examples branch August 31, 2022 21:18
@dalg24 dalg24 mentioned this pull request Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants