Tpetra::MatrixMatrix::jacobi_A_B_newmatrix_LowThreadGustavsonKernel assumes POD scalar types
Created by: etphipp
The OpenMP-specific Tpetra::MatrixMatrix::jacobi_A_B_newmatrix_LowThreadGustavsonKernel() implementation make clear POD scalar type assumptions, e.g.,
u_scalar_view_t Cvals((typename u_scalar_view_t::data_type)malloc(u_scalar_view_t::shmem_size(CSR_alloc)),CSR_alloc);
This causes a seg fault in Stokhos' Stokhos_TpetraCrsMatrixUQPCEUnitTest_OpenMP unit test that ultimately calls this function through MueLu using the UQ::PCE scalar type. The reason is of course that the memory allocated for u_scalar_view_t is never properly initialized.
My basic question is, why do it this way? Why not just use a simpler view allocation that already has all of the proper specializations to make sure the memory is properly initialized, e.g.,
scalar_view_t Cvals(Kokkos::ViewAllocateWithoutInitializing("scalar_view_t"),CSR_alloc);
As a spot check, I tried the changes in the attached patch on Stokhos and it appears to work fine. tpetra_pod_patch.txt
@trilinos/tpetra @trilinos/muelu @trilinos/stokhos