Teko: blockRowCount() Segfaults with Block Size of 1
Created by: jmgate
@trilinos/teko
Expectations
I would hope blockRowCount(const BlockedLinearOp& blo)
in Teko_Utilities.hpp
would give me 1 if the BlockedLinearOp
I give it isn't in fact blocked.
Current Behavior
Currently I'm seeing the following in Charon:
Program received signal SIGSEGV, Segmentation fault.
0x0000000001283eda in Teko::blockRowCount (blo=...) at /workspace/Trilinos/packages/teko/src/Teko_Utilities.hpp:369
369 { return blo->productRange()->numBlocks(); }
Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.26-23.el7.x86_64 glibc-2.17-260.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-34.el7.x86_64 libcom_err-1.42.9-13.el7.x86_64 libcurl-7.29.0-51.el7.x86_64 libidn-1.28-4.el7.x86_64 libselinux-2.5-14.1.el7.x86_64 libssh2-1.4.3-12.el7.x86_64 nspr-4.19.0-1.el7_5.x86_64 nss-3.36.0-7.el7_5.x86_64 nss-softokn-freebl-3.36.0-5.el7_5.x86_64 nss-util-3.36.0-1.el7_5.x86_64 openldap-2.4.44-20.el7.x86_64 openssl-libs-1.0.2k-16.el7.x86_64 pcre-8.32-17.el7.x86_64
(gdb) bt
#0 0x0000000001283eda in Teko::blockRowCount (blo=...) at /workspace/Trilinos/packages/teko/src/Teko_Utilities.hpp:369
#1 0x000000000127f02d in charon::Schur2x2PreconditionerFactory::buildPreconditionerOperator (this=0x9096848, op=..., state=...)
at /workspace/Trilinos/tcad-charon/src/solver/Charon_Schur2x2PreconditionerFactory.cpp:111
Charon's Schur2x2PreconditionerFactory::buildPreconditionerOperator()
starts off with
int rows(blockRowCount(op)), cols(blockColCount(op));
TEUCHOS_ASSERT((rows == 2) and (cols == 2));
to make sure it's only being used on a 2x2 system, but apparently when this gets hit by an unblocked case, we get the stacktrace above.
Motivation and Context
I can handle this elsewhere in Charon, because I know what it is in the input deck that's triggering this scenario, but it'd be awful nice if the blockRowCount()
(and I assume blockColCount()
suffers from the same problem) routine just worked as expected.