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

Kokkos needs to rever to ${PROJECT_NAME}_ENABLE_CXX11 not Trilinos_ENABLE_CXX11 #17

Closed
bartlettroscoe opened this issue May 15, 2015 · 5 comments

Comments

@bartlettroscoe
Copy link
Contributor

You can't assume that the TriBITS project is always "Trilinos". It can be "VERA", or "MPACT", or "SCALE", etc.

Please replace all usage of Trilinos_XXX with ${PROJECT_NAME}_XXX. Otherwise, Kokkos will not work correctly when used with any other TriBITS project, most importantly for us "VERA" and "SCALE".

CC: Jordan (@lefebvre)

From: Bartlett, Roscoe A.
Sent: Friday, May 15, 2015 9:43 AM
To: Clarno, Kevin T.; Roger Pawlowski
Subject: RE: Kokkos_ENABLE_CXX11 warnings

The problem is in:

Trilinos/packages/kokkos/CMakeLists.txt

which has:

TRIBITS_ADD_OPTION_AND_DEFINE(
Kokkos_ENABLE_CXX11
KOKKOS_HAVE_CXX11
"Enable C++11 support in Kokkos."
"${Trilinos_ENABLE_CXX11}"
)

It needs to use "${${PROJECT_NAME}_ENABLE_CXX11}”.

I will fix this in the Trilinos casl-dev/master branch then create a pull request to get this put into the independent Kokkos git repo.

-Ross

From: Clarno, Kevin T.
Sent: Friday, May 15, 2015 12:53 AM
To: Bartlett, Roscoe A.; Roger Pawlowski
Subject: Re: Kokkos_ENABLE_CXX11 warnings

Kokkos does not appear to be tied to either Trilinos_ENABLE_CXX11 or ${PROJECT_NAME}.

Scale has not hard-coded Scale_ENABLE_CXX11, but uses ${PROJECT_NAME}_ENABLE_CXX11_DEFAULT TRUE.

Kevin

From: , Roscoe Bartlett bartlettra@ornl.gov
Date: Thursday, May 14, 2015 at 6:16 PM
To: Kevin Clarno clarnokt@ornl.gov, Roger Pawlowski rppawlo@sandia.gov
Subject: RE: Kokkos_ENABLE_CXX11 warnings

Kevin,

It should. Did they hard-code it to Trilinos_ENABLE_CXX11?

-Ross

From: Clarno, Kevin T.
Sent: Thursday, May 14, 2015 2:58 PM
To: Bartlett, Roscoe A.; Roger Pawlowski
Subject: Kokkos_ENABLE_CXX11 warnings

Ross/Roger,

If Trilinos could tie this:
Kokkos_HAVE_CXX11

To this:
${PROJECT_NAME}_ENABLE_CXX11

Then all of these warnings would disappear for us:

[ 90%] Building CXX object Exnihilo/packages/Insilico/mocsi/CMakeFiles/Insilico_mocsi.dir/MOC_Atlas.pt.cc.o
In file included from /home/kto/scale/Trilinos/packages/tpetra/core/src/kokkos_refactor/Tpetra_KokkosRefactor_CrsMatrix_decl.hpp:53:0,
from /home/kto/scale/Trilinos/packages/tpetra/core/src/Tpetra_CrsMatrix_decl.hpp:2833,
from /home/kto/dev/samples/Trilinos/packages/tpetra/core/src/Tpetra_CrsMatrix.hpp:1,
from /home/kto/scale/Trilinos/packages/tpetra/core/src/Tpetra_RowMatrix_def.hpp:46,
from /home/kto/dev/samples/Trilinos/packages/tpetra/core/src/Tpetra_RowMatrix.hpp:2,
from /home/kto/scale/Exnihilo/packages/Transcore/solvers/LinAlgTypedefs.hh:33,
from /home/kto/scale/Exnihilo/packages/Transcore/solvers/LinearSolver.hh:24,
from /home/kto/scale/Exnihilo/packages/Denovo/kba_solvers/Arnoldi_Transport_Operator.hh:36,
from /home/kto/scale/Exnihilo/packages/Denovo/kba_solvers/Arnoldi.hh:21,
from /home/kto/scale/Exnihilo/packages/Insilico/moc/components/Arnoldi.hh:14,
from /home/kto/scale/Exnihilo/packages/Insilico/moc/components/Denovo_MOC_Specializations.hh:24,
from /home/kto/scale/Exnihilo/packages/Insilico/mocsi/Manager.hh:18,
from /home/kto/scale/Exnihilo/packages/Insilico/mocsi/Manager.t.hh:14,
from /home/kto/scale/Exnihilo/packages/Insilico/mocsi/MOC_Atlas.pt.cc:21:
/home/kto/scale/Trilinos/packages/tpetra/kernels/src/Kokkos_Sparse.hpp: In function ‘void KokkosSparse::spmv(const char_, const AlphaType&, const AMatrix&, const XVector&, const BetaType&, const YVector&, KokkosSparse::{anonymous}::RANK_ONE)’:
/home/kto/scale/Trilinos/packages/tpetra/kernels/src/Kokkos_Sparse.hpp:107:5: warning: typedef ‘Blas1_spmv_vector_ranks_do_not_match’ locally defined but not used [-Wunused-local-typedefs]
Blas1_spmv_vector_ranks_do_not_match;
^
/home/kto/scale/Trilinos/packages/tpetra/kernels/src/Kokkos_Sparse.hpp:111:5: warning: typedef ‘Blas1_spmv_vector_rank_not_one’ locally defined but not used [-Wunused-local-typedefs]
Blas1_spmv_vector_rank_not_one;
^
In file included from /home/kto/scale/Trilinos/packages/tpetra/kernels/src/Kokkos_Sparse.hpp:183:0,
from /home/kto/scale/Trilinos/packages/tpetra/core/src/kokkos_refactor/Tpetra_KokkosRefactor_CrsMatrix_decl.hpp:53,
from /home/kto/scale/Trilinos/packages/tpetra/core/src/Tpetra_CrsMatrix_decl.hpp:2833,
from /home/kto/dev/samples/Trilinos/packages/tpetra/core/src/Tpetra_CrsMatrix.hpp:1,
from /home/kto/scale/Trilinos/packages/tpetra/core/src/Tpetra_RowMatrix_def.hpp:46,
from /home/kto/dev/samples/Trilinos/packages/tpetra/core/src/Tpetra_RowMatrix.hpp:2,
from /home/kto/scale/Exnihilo/packages/Transcore/solvers/LinAlgTypedefs.hh:33,
from /home/kto/scale/Exnihilo/packages/Transcore/solvers/LinearSolver.hh:24,
from /home/kto/scale/Exnihilo/packages/Denovo/kba_solvers/Arnoldi_Transport_Operator.hh:36,
from /home/kto/scale/Exnihilo/packages/Denovo/kba_solvers/Arnoldi.hh:21,
from /home/kto/scale/Exnihilo/packages/Insilico/moc/components/Arnoldi.hh:14,
from /home/kto/scale/Exnihilo/packages/Insilico/moc/components/Denovo_MOC_Specializations.hh:24,
from /home/kto/scale/Exnihilo/packages/Insilico/mocsi/Manager.hh:18,
from /home/kto/scale/Exnihilo/packages/Insilico/mocsi/Manager.t.hh:14,
from /home/kto/scale/Exnihilo/packages/Insilico/mocsi/MOC_Atlas.pt.cc:21:
/home/kto/scale/Trilinos/packages/tpetra/kernels/src/Kokkos_Sparse_MV.hpp: In function ‘void KokkosSparse::spmv(const char_, const AlphaType&, const AMatrix&, const XVector&, const BetaType&, const YVector&, KokkosSparse::{anonymous}::RANK_TWO)’:
/home/kto/scale/Trilinos/packages/tpetra/kernels/src/Kokkos_Sparse_MV.hpp:83:70: warning: typedef ‘Blas1_spmv_vector_ranks_do_not_match’ locally defined but not used [-Wunused-local-typedefs]
Kokkos::Impl::StaticAssert<XVector::rank == YVector::rank>::type Blas1_spmv_vector_ranks_do_not_match;
^

And we’d really appreciate it.

Kevin

@bartlettroscoe
Copy link
Contributor Author

Actually, in cases like:

TRIBITS_ADD_OPTION_AND_DEFINE(
  Kokkos_ENABLE_CXX11
  KOKKOS_HAVE_CXX11
  "Enable C++11 support in Kokkos."
  "${${PROJECT_NAME}_ENABLE_CXX11}"
)

You really want to not use the quotes "" for variables that should always be non-empty. In the case of ${PROJECT_NAME}_ENABLE_CXX11, which is a BOOL and TriBITS always sets it to TRUE or FALSE (or is overridden by the user to some other non-empty value), then as a debug check, you should remove the quotes and use:

TRIBITS_ADD_OPTION_AND_DEFINE(
  Kokkos_ENABLE_CXX11
  KOKKOS_HAVE_CXX11
  "Enable C++11 support in Kokkos."
  ${${PROJECT_NAME}_ENABLE_CXX11}
)

bartlettroscoe pushed a commit to bartlettroscoe/kokkos that referenced this issue May 15, 2015
kokkos#17)

This makes Kokkos behave correctly when the project is not "Trilinos", like
when it is "VERA" or "SCALE".

See Github Kokkos issue kokkos#17.
@bartlettroscoe
Copy link
Contributor Author

I fixed this in the VERA copy of Trilinos then pulled off the patch with:

$ cd VERA/Trilinos/
$ git format-patch -1 -o ../../patches HEAD -- packages/kokkos/

I then forked the kokkos github repo into my account, created the branch replace_trilinos_with_project_name_17, then applied the patch with:

$ cd ../../../Trilinos.base/Trilinos/kokkos/
$ git am -p3 \
  ../../../VERA.base/patches/0001-Replace-Trilinos_ENABLE_XXX-with-PROJECT_NAME-_ENABL.patch

Applying: Replace "Trilinos_ENABLE_XXX" with "${PROJECT_NAME}_ENABLE_XXX" (Kokkos #17)

Note that you have to use -p3 with git am because the patch shows the paths:

a/packages/kokkos/???
b/packages/kokkos/???

so you have to strip of the 'a/packages/kokkos' and 'b/packages/kokkos' to get it to match the files in the standalone kokkos repo.

I then pushe this branch to my forked github repo:

To git@github.com:/bartlettroscoe/kokkos.git
   2d596fe..80afe36  replace_trilinos_with_project_name_17 -> replace_trilinos_with_project_name_17

I then clicked the botton to create pull request:

#18

Please, please accept this pull request quickly or the next time kokkos is snapshotted to Trilinos and Trilinos is updated into CASL, then it will break this all over again.

hcedwar pushed a commit that referenced this issue May 15, 2015
#17)

This makes Kokkos behave correctly when the project is not "Trilinos", like
when it is "VERA" or "SCALE".

See Github Kokkos issue #17.
@hcedwar
Copy link
Contributor

hcedwar commented May 15, 2015

Done

@hcedwar hcedwar closed this as completed May 15, 2015
@bartlettroscoe
Copy link
Contributor Author

Note: @clarnokt

@clarnokt
Copy link

Thanks.

Rombur added a commit to Rombur/kokkos that referenced this issue Oct 3, 2019
crtrott added a commit that referenced this issue Nov 2, 2020
dalg24 added a commit to dalg24/kokkos that referenced this issue May 2, 2022
algorithms: fix name and sidebar of std sorting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants