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

Stokhos: unit test compilation errors with OpenMP and intell/2023.2.0, "error: Tpetra_CrsMatrix_MP_Amesos2_basker_UnitTest is not a template" #12352

Closed
ndellingwood opened this issue Oct 2, 2023 · 2 comments
Labels
pkg: Stokhos type: bug The primary issue is a bug in Trilinos code or tests

Comments

@ndellingwood
Copy link
Contributor

Bug Report

@trilinos/stokhos @etphipp

Description

Stokhos unit tests fail to compile in OpenMP builds with intel/2023.2.0 (using icpc, intel classic compiler):

/home/jenkins/blake-new/workspace/KokkosEco_Trilinos_Blake_OneAPI2023_2_0_ICPC_OpenMP-4T/Trilinos/packages/stokhos/test/UnitTest/Stokhos_TpetraCrsMatrixMPVectorUnitTest_OpenMP.cpp(53): error: Tpetra_CrsMatrix_MP_Amesos2_basker_UnitTest is not a template
  CRSMATRIX_MP_VECTOR_TESTS_N( OpenMPWrapperNode )
  ^

/home/jenkins/blake-new/workspace/KokkosEco_Trilinos_Blake_OneAPI2023_2_0_ICPC_OpenMP-4T/Trilinos/packages/stokhos/test/UnitTest/Stokhos_TpetraCrsMatrixMPVectorUnitTest_OpenMP.cpp(53): error: invalid explicit instantiation declaration
  CRSMATRIX_MP_VECTOR_TESTS_N( OpenMPWrapperNode )
  ^

Steps to Reproduce

  1. SHA1: develop branch, e.g. 1c621fa
  2. Configure script: Blake testbed "all" queue
module purge
module load cmake intel-oneapi-compilers/2023.2.0 intel-oneapi-mkl/2023.2.0

# Configure Trilinos
export BLAS_LIBRARIES="-mkl;${MKLROOT}/lib/intel64/libmkl_intel_lp64.a;${MKLROOT}/lib/intel64/libmkl_intel_thread.a;${MKLROOT}/lib/intel64/libmkl_core.a"
export LAPACK_LIBRARIES=${BLAS_LIBRARIES}
cmake \
  -D CMAKE_INSTALL_PREFIX="${TRILINOS_INSTALL_DIR}" \
  -D CMAKE_CXX_COMPILER="`which icpc`" \
  -D CMAKE_C_COMPILER="`which icc`" \
  -D CMAKE_Fortran_COMPILER="`which ifort`" \
  -D CMAKE_CXX_FLAGS="-g -no-ip" \
  -D CMAKE_C_FLAGS="-g -no-ip" \
  -DTPL_ENABLE_MPI=OFF \
  -DTPL_ENABLE_BLAS:BOOL=ON \
  -DTPL_BLAS_LIBRARIES:PATH="${BLAS_LIBRARIES}" \
  -DTPL_LAPACK_LIBRARIES:PATH="${LAPACK_LIBRARIES}" \
  -DTPL_ENABLE_LAPACK:BOOL=ON \
  -DTrilinos_ENABLE_ALL_PACKAGES=OFF \
  -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF \
  -DTrilinos_ENABLE_TESTS=ON \
  -DTrilinos_MUST_FIND_ALL_TPL_LIBS=TRUE \
  -DTrilinos_ENABLE_COMPLEX=ON \
  -DTrilinos_ENABLE_OpenMP=ON \
  -DTrilinos_ENABLE_Kokkos=ON \
  -D Kokkos_ENABLE_OPENMP=ON \
   -D Kokkos_ENABLE_TESTS=ON \
  -D Kokkos_ARCH_SKX=ON \
  -DTrilinos_ENABLE_KokkosKernels=ON \
   -D KokkosKernels_ENABLE_TESTS=ON \
  -DTrilinos_ENABLE_Tpetra=ON \
   -D Tpetra_ENABLE_TESTS=ON \
  -DTrilinos_ENABLE_Sacado=ON \
   -D Sacado_ENABLE_TESTS=ON \
  -DTrilinos_ENABLE_Stokhos=ON \
   -D Stokhos_ENABLE_TESTS=ON \
\
  -DTPL_ENABLE_Matio=OFF \
\
-DTpetraCore_MatrixMarket_Tpetra_Map_InOutTest_DISABLE=ON \
-DTpetraCore_Bug5800_DISABLE=ON \
-DTpetraCore_BlockCrsMatrix_DISABLE=ON \
\
$TRILINOS_DIR
@ndellingwood ndellingwood added type: bug The primary issue is a bug in Trilinos code or tests pkg: Stokhos labels Oct 2, 2023
@ndellingwood
Copy link
Contributor Author

Looks related to the changes here https://github.com/trilinos/Trilinos/pull/12324/files#diff-605a695df56ef47855f137277b3b36f7170b840dd4a6e13e2f7452fe5f829261 , compiler doesn't like the call guarded in the #else block TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Tpetra_CrsMatrix_MP, Amesos2_basker, Storage, LocalOrdinal, GlobalOrdinal, Node) {} ?

@maartenarnst
Copy link
Contributor

maartenarnst commented Oct 3, 2023

Hi @ndellingwood and @etphipp.

The problem does seem to come from my recent PR that Eric cited. Sorry about that.

I suspect the issue comes from the preprocessor conditional #if defined(HAVE_STOKHOS_AMESOS2). I think I put the corresponding #endif too far down in the code. Hence, when compiling without Amesos2, the macros don't get defined at all, i.e. the empty class guard that Eric mentioned doesn't get defined either.

I hadn't noticed the issue because all our builds are with Amesos2. Note that this guard with an empty class mimics what's done higher in the file for Belos sovers.

I think it can be fixed by organising the conditional better. I'll make a PR.

EDIT: it's PR #12354.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: Stokhos type: bug The primary issue is a bug in Trilinos code or tests
Projects
None yet
Development

No branches or pull requests

2 participants