-
Notifications
You must be signed in to change notification settings - Fork 575
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
Tpetra: link errors in Norms with deprecated code OFF #4951
Comments
FYI, you don't need the option |
The cause could be that |
It works OK when deprecated code is ON. |
Are you saying this could be a CMakeLists.txt issue rather than a source code issue? |
Hm, I have a build here with |
Thanks for looking at this issue, @mhoemmen . With Tpetra_ENABLE_DEPRECATED_CODE=ON:
With Tpetra_ENABLE_DEPRECATED_CODE=OFF:
|
@kddevin I think I've figured this out.
|
Thanks, @mhoemmen |
Should we pull @william76 into the conversation? |
@kddevin wait a minute or two; I am writing a temporary solution for you. |
The easiest work-around would be to add #if defined(HAVE_TPETRA_INST_INT_INT)
// don't need to do anything; Scalar=int is already added
# define TPETRA_DETAILS_NORMIMPL_INSTANT_INT( NODE )
#else
# define TPETRA_DETAILS_NORMIMPL_INSTANT_INT( NODE ) \
TPETRA_DETAILS_NORMIMPL_INSTANT( int, NODE )
#endif
namespace Tpetra {
TPETRA_ETI_MANGLING_TYPEDEFS()
TPETRA_INSTANTIATE_SN( TPETRA_DETAILS_NORMIMPL_INSTANT )
TPETRA_INSTANTIATE_N( TPETRA_DETAILS_NORMIMPL_INSTANT_INT )
#ifdef HAVE_TPETRA_INST_CUDA
using cuda_host_mirror_device_type =
Kokkos::Device<Kokkos::DefaultHostExecutionSpace,
Kokkos::CudaUVMSpace>;
#define TPETRA_DETAILS_NORMIMPL_INSTANT_CUDAHOSTMIRROR( S ) \
TPETRA_DETAILS_NORMIMPL_INSTANT( S, cuda_host_mirror_device_type )
TPETRA_INSTANTIATE_S( TPETRA_DETAILS_NORMIMPL_INSTANT_CUDAHOSTMIRROR )
#if ! defined(HAVE_TPETRA_INST_INT_INT)
TPETRA_DETAILS_NORMIMPL_INSTANT_CUDAHOSTMIRROR( int )
#endif
#endif // HAVE_TPETRA_INST_CUDA
} // namespace Tpetra |
Wow, thanks, @mhoemmen |
@kddevin wrote:
Please do; I have another thing on the fire at the moment. Thanks! |
@mhoemmen As I understand it: When Trilinos instantiated two global ordinal types by default, it added global ordinal types int and long long to the instantiated scalar types. With Tpetra_ENABLE_DEPRECATED_CODE=OFF, the default global ordinal type is then long long. Tpetra adds long long to the instantiated scalar types. But then something in Tpetra is still trying to run with MultiVector<int, int, long long>. That is, should we back out the instantiation changes and, instead, fix the call to normImpl? |
OK, I see. MultiVector is instantiated with scalar=int but this normImpl function is not. For now, I am going to revert the changes above so that @ikalash 's tests will pass. I will revisit this later this weekend. |
Thanks @kddevin ! |
@kddevin wrote:
It's actually downstream of Tpetra, in MueLu. MueLu uses Vector (and therefore MultiVector) with This is why Tpetra treats MultiVector ETI as a special case, and always includes MueLu could just cast the process ranks to |
OK; that explains why MultiVector has scalar = int. But how is it done? I don't see where TPETRA_MULTIVECTOR_INSTANT is used anywhere. How is the MultiVector instantiation enabled? Also, what code change caused the bug? Is normImpl new? |
@kddevin wrote:
Tpetra has two ETI systems. The first and original one predates me. Read I wrote the second ETI system when build times with ETI enabled became unacceptably large. (Laptops were running out of memory building a single .cpp file.) The issue is that the first system's ETI macros (e.g., The two systems can coexist just fine. Classes and functions must opt into ETI explicitly, and they can use either system (but not both, of course!). The second system currently only works for classes that take all four (S, LO, GO, N) template parameters, which is why I had to use the first system for Christian Trott uses a different system for kokkos-kernels. It's a variant of the second system, but Christian uses a Python script to generate the I still haven't quite answered your question. In Tpetra's version of the second system, MultiVector is a special case. You can see the logic for adding
|
…s:develop' (7db7806). * trilinos-develop: (128 commits) MueLu: Better configure time checks for matlab EXODUS: Fix a few off-by-one in copy_string (trilinos#4961) Phalanx: Evalautor Typo Fix tpetra: added scalar = int instantiation as suggested in trilinos#4951 Belos,Ifpack2,ShyLU: Fix use of deprecated Tpetra features MueLu: fix link issue Tpetra: Fix trilinos#4857 Tpetra::CrsGraph: Hide CrsGraphCopier in deprecated macro Tpetra::MultiVector: Hide MultiVectorCloner in deprecated macro Ifpack2: Fix use of deprecated Tpetra::Map constructor Tpetra,Ifpack2: Finish hiding methods deprecated by trilinos#2630 IOSS: Fix name length handling one last time SUPES: Fix off-by-one error xpetra: removed default types in deprecated code Set Trilinos_MAKE_INSTALL_WORLD_READABLE=ON by default (trilinos#2689) Automatic snapshot commit from tribits at 747ad3d KokkosKernels: Patching in test size reduction to D2GC unit test MueLu: Fixing issue identified by Yingzhou Li (4927) MueLu: Fixing issue identified by Yingzhou Li (4927) MueLu: Fixing issue identified by Yingzhou Li (4927) ...
…s:develop' (7db7806). * trilinos-develop: (128 commits) MueLu: Better configure time checks for matlab EXODUS: Fix a few off-by-one in copy_string (trilinos#4961) Phalanx: Evalautor Typo Fix tpetra: added scalar = int instantiation as suggested in trilinos#4951 Belos,Ifpack2,ShyLU: Fix use of deprecated Tpetra features MueLu: fix link issue Tpetra: Fix trilinos#4857 Tpetra::CrsGraph: Hide CrsGraphCopier in deprecated macro Tpetra::MultiVector: Hide MultiVectorCloner in deprecated macro Ifpack2: Fix use of deprecated Tpetra::Map constructor Tpetra,Ifpack2: Finish hiding methods deprecated by trilinos#2630 IOSS: Fix name length handling one last time SUPES: Fix off-by-one error xpetra: removed default types in deprecated code Set Trilinos_MAKE_INSTALL_WORLD_READABLE=ON by default (trilinos#2689) Automatic snapshot commit from tribits at 747ad3d KokkosKernels: Patching in test size reduction to D2GC unit test MueLu: Fixing issue identified by Yingzhou Li (4927) MueLu: Fixing issue identified by Yingzhou Li (4927) MueLu: Fixing issue identified by Yingzhou Li (4927) ...
@mhoemmen I'm still having troubles with normImpl instantiation. I get link errors with a stokhos build. Using the ATDM testing framework, I do
Here are the link errors:
|
@kddevin We should just forget about ETI for normImpl. It's not clear that it's worth the trouble. |
@mhoemmen does one do that by just yanking out all macros mentioning NORMIMPL and purgin Tpetra_Details_normImpl.cpp? |
@kddevin We would need to do the following:
We need to do 1-3 because otherwise, if ETI is enabled, |
Tpetra: Fix #4951 (remove normImpl ETI)
…s:develop' (7d36349). * trilinos-develop: MueLu: Rebase Tpetra: Fix trilinos#4951 (remove normImpl ETI) avoid double testing a condition MueLu: Updateing diagonal limiting Xpetra: More Updates Xpetra: Making code compile MueLu: Adding relative diagonal flooring to both RAP and RAPShift Xpetra: Adding relative diagonal flooring capability add throw to row matrix add
…s:develop' (7d36349). * trilinos-develop: MueLu: Rebase Tpetra: Fix trilinos#4951 (remove normImpl ETI) avoid double testing a condition MueLu: Updateing diagonal limiting Xpetra: More Updates Xpetra: Making code compile MueLu: Adding relative diagonal flooring to both RAP and RAPShift Xpetra: Adding relative diagonal flooring capability add throw to row matrix add
@rrdrake @ajpowelsnl FYI |
Bug Report
@trilinos/tpetra
Description
Using the develop branch with Tpetra_ENABLE_DEPRECATED_CODE=OFF, I see the following link errors:
Steps to Reproduce
The text was updated successfully, but these errors were encountered: