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

Unit tests do not build with Serial backend #154

Closed
ndellingwood opened this issue Feb 15, 2018 · 5 comments
Closed

Unit tests do not build with Serial backend #154

ndellingwood opened this issue Feb 15, 2018 · 5 comments

Comments

@ndellingwood
Copy link
Contributor

After generating a makefile with the Serial backend only and running make build-test, no unit tests are built. This occurred with gcc 5.4.

Script used to generate makefile:

KOKKOS_PATH=${HOME}/Research/kokkos_items/kokkos #path to kokkos source
KOKKOSKERNELS_SCALARS=double #the scalar types to instantiate =double,float...
KOKKOSKERNELS_LAYOUTS=LayoutLeft #the layout types to instantiate.
KOKKOSKERNELS_ORDINALS=int #ordinal types to instantiate
KOKKOSKERNELS_OFFSETS=int #offset types to instantiate
KOKKOSKERNELS_PATH=../.. #path to kokkos-kernels top directory.
CXX=g++ #${KOKKOS_PATH}/config/nvcc_wrapper #icpc #
KOKKOSKERNELS_OPTIONS=eti-only #options for kokkoskernels
KOKKOS_DEVICES=Serial # other devices Cuda,Serial ..
KOKKOS_ARCHS=
CXXFLAGS="-Wall -pedantic -Werror -O3 -g -Wshadow -Wsign-compare -Wtype-limits -Wuninitialized"

../../scripts/generate_makefile.bash --kokkoskernels-path=${KOKKOSKERNELS_PATH} --with-scalars=${KOKKOSKERNELS_SCALARS} --with-ordinals=${KOKKOSKERNELS_ORDINALS} --with-offsets=${KOKKOSKERNELS_OFFSETS} --kokkos-path=${KOKKOS_PATH} --with-devices=${KOKKOS_DEVICES} --arch=${KOKKOS_ARCHS} --compiler=${CXX} --with-options=${KOKKOSKERNELS_OPTIONS}  --cxxflags="${CXXFLAGS}"
@ndellingwood
Copy link
Contributor Author

Added some $(info ...) statements to unit_tests/Makefile to see what variables were/weren't being set.
By generating makefile as in previous statement:

  • KOKKOS_INTERNAL_USE_SERIAL is not set to 1.
  • KOKKOSKERNELS_INTERNAL_TEST_SERIAL is never set as a result, hence the unit tests never compiling
  • KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_SERIAL is set 1

@ndellingwood
Copy link
Contributor Author

ndellingwood commented Feb 15, 2018

After Makefile.kokkos-kernels includes Makefile.kokkos (from KOKKOS_PATH=${KOKKOSKERNELS_PATH}/../kokkos), KOKKOS_INTERNAL_USE_SERIAL is undefined, though when I add info messages within my clone of Kokkos KOKKOS_INTERNAL_USE_SERIAL is set to 1.

From the print statements from Makefile.kokkos-kernels during compilation:

echo "# Kokkos Internal Settings" >> /Users/ndellin/Research/kokkos_items/kokkos-kernels/testing/Serial-gcc/install/Makefile.kokkos-kernels
echo "KOKKOS_INTERNAL_USE_CUDA = 0" >> /Users/ndellin/Research/kokkos_items/kokkos-kernels/testing/Serial-gcc/install/Makefile.kokkos-kernels
echo "KOKKOS_INTERNAL_USE_OPENMP = 0" >> /Users/ndellin/Research/kokkos_items/kokkos-kernels/testing/Serial-gcc/install/Makefile.kokkos-kernels
echo "KOKKOS_INTERNAL_USE_SERIAL = " >> /Users/ndellin/Research/kokkos_items/kokkos-kernels/testing/Serial-gcc/install/Makefile.kokkos-kernels
echo "KOKKOS_INTERNAL_USE_PTHREADS = 0" >> /Users/ndellin/Research/kokkos_items/kokkos-kernels/testing/Serial-gcc/install/Makefile.kokkos-kernels
...

Also, from my testing/kokkos/install directory, KOKKOS_INTERNAL_USE_SERIAL does not appear in the Makefile.kokkos file; the other exec spaces are set to 0. Last several lines of the file pasted below:

#Internal settings which need to propagated for Kokkos examples
KOKKOS_INTERNAL_USE_CUDA = 0
KOKKOS_INTERNAL_USE_OPENMP = 0
KOKKOS_INTERNAL_USE_PTHREADS = 0
KOKKOS_INTERNAL_USE_ROCM = 0
KOKKOS_INTERNAL_USE_QTHREADS = 0

#Fake kokkos-clean target
kokkos-clean:

@ndellingwood
Copy link
Contributor Author

Alright, chased this down to a bug in Kokkos in core/src/Makefile.generate_build_files, lines to append KOKKOS_INTERNAL_USE_SERIAL when generating the Makefile.kokkos were missing, so KOKKOS_INTERNAL_USE_SERIAL definition never propogated to Kokkos-Kernels.
Fixed the bug locally and will issue a PR to Kokkos and will cross-reference here.

@ndellingwood
Copy link
Contributor Author

I opened Kokkos issue # 1418 regarding the issue and PR # 1419 with the fix.

@ndellingwood ndellingwood self-assigned this Feb 16, 2018
@ndellingwood
Copy link
Contributor Author

Not sure how to label this since the bug is in Kokkos, not Kokkos-Kernels...

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

1 participant