-
Notifications
You must be signed in to change notification settings - Fork 572
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
Tacho : return value from team-factor #13678
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2190,8 +2190,13 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
// const ordinal_type team_size_factor[2] = { 16, 16 }, vector_size_factor[2] = { 32, 32}; | ||
const ordinal_type team_size_factor[2] = {64, 64}, vector_size_factor[2] = {8, 4}; | ||
const ordinal_type team_size_update[2] = {16, 8}, vector_size_update[2] = {32, 32}; | ||
// returned value from team Chol | ||
colind_view d_rval("rval",1); | ||
auto h_rval = Kokkos::create_mirror_view(host_memory_space(), d_rval); | ||
{ | ||
typedef TeamFunctor_FactorizeChol<supernode_info_type> functor_type; | ||
functor_type functor(_info, _factorize_mode, _level_sids, _buf, d_rval.data()); | ||
|
||
#if defined(TACHO_TEST_LEVELSET_TOOLS_KERNEL_OVERHEAD) | ||
typedef Kokkos::TeamPolicy<Kokkos::Schedule<Kokkos::Static>, exec_space, typename functor_type::DummyTag> | ||
team_policy_factorize; | ||
|
@@ -2204,11 +2209,8 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
typedef Kokkos::TeamPolicy<Kokkos::Schedule<Kokkos::Static>, exec_space, typename functor_type::UpdateTag> | ||
team_policy_update; | ||
#endif | ||
|
||
int rval = 0; | ||
team_policy_factor policy_factor(1, 1, 1); | ||
team_policy_update policy_update(1, 1, 1); | ||
functor_type functor(_info, _factorize_mode, _level_sids, _buf, &rval); | ||
|
||
// get max vector size | ||
const ordinal_type vmax = policy_factor.vector_length_max(); | ||
|
@@ -2259,10 +2261,14 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
Kokkos::fence(); time_device += tick.seconds(); | ||
tick.reset(); | ||
} | ||
Kokkos::fence(); | ||
Kokkos::deep_copy(h_rval, d_rval); | ||
int rval = h_rval(0); | ||
if (rval != 0) { | ||
TACHO_TEST_FOR_EXCEPTION(rval, std::runtime_error, "POTRF (team) returns non-zero error code."); | ||
} | ||
//if (_status != 0) { | ||
// TACHO_TEST_FOR_EXCEPTION(rval, std::runtime_error, "POTRF (device) returns non-zero error code."); | ||
//} | ||
|
||
Kokkos::parallel_for("update factor", policy_update, functor); | ||
if (verbose) { | ||
|
@@ -3926,8 +3932,13 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
const ordinal_type team_size_factor[2] = {64, 64}, vector_size_factor[2] = {8, 4}; | ||
#endif | ||
const ordinal_type team_size_update[2] = {16, 8}, vector_size_update[2] = {32, 32}; | ||
// returned value from team LDL | ||
colind_view d_rval("rval",1); | ||
auto h_rval = Kokkos::create_mirror_view(host_memory_space(), d_rval); | ||
{ | ||
typedef TeamFunctor_FactorizeLDL<supernode_info_type> functor_type; | ||
functor_type functor(_info, _factorize_mode, _level_sids, _piv, _diag, _buf, d_rval.data()); | ||
|
||
#if defined(TACHO_TEST_LEVELSET_TOOLS_KERNEL_OVERHEAD) | ||
typedef Kokkos::TeamPolicy<Kokkos::Schedule<Kokkos::Static>, exec_space, typename functor_type::DummyTag> | ||
team_policy_factorize; | ||
|
@@ -3940,12 +3951,10 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
typedef Kokkos::TeamPolicy<Kokkos::Schedule<Kokkos::Static>, exec_space, typename functor_type::UpdateTag> | ||
team_policy_update; | ||
#endif | ||
int rval = 0; | ||
team_policy_factor policy_factor(1, 1, 1); | ||
team_policy_update policy_update(1, 1, 1); | ||
functor_type functor(_info, _factorize_mode, _level_sids, _piv, _diag, _buf, &rval); | ||
|
||
// get max vector length | ||
team_policy_factor policy_factor(1, 1, 1); | ||
team_policy_update policy_update(1, 1, 1); | ||
const ordinal_type vmax = policy_factor.vector_length_max(); | ||
{ | ||
for (ordinal_type lvl = (_team_serial_level_cut - 1); lvl >= 0; --lvl) { | ||
|
@@ -3994,10 +4003,14 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
Kokkos::fence(); time_device += tick.seconds(); | ||
tick.reset(); | ||
} | ||
Kokkos::fence(); | ||
Kokkos::deep_copy(h_rval, d_rval); | ||
int rval = h_rval(0); | ||
if (rval != 0) { | ||
TACHO_TEST_FOR_EXCEPTION(rval, std::runtime_error, "SYTRF (team) returns non-zero error code."); | ||
} | ||
//if (_status != 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be deleted in follow up cleanup? |
||
// TACHO_TEST_FOR_EXCEPTION(rval, std::runtime_error, "SYTRF (device) returns non-zero error code."); | ||
//} | ||
|
||
Kokkos::parallel_for("update factor", policy_update, functor); | ||
if (verbose) { | ||
|
@@ -4271,6 +4284,10 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
const ordinal_type team_size_factor[2] = {64, 64}, vector_size_factor[2] = {8, 4}; | ||
#endif | ||
const ordinal_type team_size_update[2] = {16, 8}, vector_size_update[2] = {32, 32}; | ||
|
||
// returned value from team LU | ||
colind_view d_rval("rval",1); | ||
auto h_rval = Kokkos::create_mirror_view(host_memory_space(), d_rval); | ||
{ | ||
typedef TeamFunctor_FactorizeLU<supernode_info_type> functor_type; | ||
#if defined(TACHO_TEST_LEVELSET_TOOLS_KERNEL_OVERHEAD) | ||
|
@@ -4285,10 +4302,9 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
typedef Kokkos::TeamPolicy<Kokkos::Schedule<Kokkos::Static>, exec_space, typename functor_type::UpdateTag> | ||
team_policy_update; | ||
#endif | ||
int rval = 0; | ||
team_policy_factor policy_factor(1, 1, 1); | ||
team_policy_update policy_update(1, 1, 1); | ||
functor_type functor(_info, _factorize_mode, _level_sids, _piv, _buf, &rval); | ||
functor_type functor(_info, _factorize_mode, _level_sids, _piv, _buf, d_rval.data()); | ||
if (pivot_tol > 0.0) { | ||
functor.setDiagPertubationTol(pivot_tol); | ||
} | ||
|
@@ -4342,13 +4358,15 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> { | |
Kokkos::fence(); time_device += tick.seconds(); | ||
tick.reset(); | ||
} | ||
Kokkos::fence(); | ||
Kokkos::deep_copy(h_rval, d_rval); | ||
int rval = h_rval(0); | ||
if (rval != 0) { | ||
TACHO_TEST_FOR_EXCEPTION(rval, std::runtime_error, "GETRF (team) returns non-zero error code."); | ||
} | ||
if (_status != 0) { | ||
TACHO_TEST_FOR_EXCEPTION(rval, std::runtime_error, "GETRF (device) returns non-zero error code."); | ||
} | ||
//if (_status != 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be deleted in follow up cleanup? |
||
// TACHO_TEST_FOR_EXCEPTION(rval, std::runtime_error, "GETRF (device) returns non-zero error code."); | ||
//} | ||
|
||
Kokkos::parallel_for("update factor", policy_update, functor); | ||
if (verbose) { | ||
Kokkos::fence(); time_update += tick.seconds(); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be deleted in follow up cleanup?