本文整理汇总了C++中teuchos::RCP::CreateView方法的典型用法代码示例。如果您正苦于以下问题:C++ RCP::CreateView方法的具体用法?C++ RCP::CreateView怎么用?C++ RCP::CreateView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::RCP
的用法示例。
在下文中一共展示了RCP::CreateView方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Add
void Add(
const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>& A,
bool transposeA,
Scalar scalarA,
const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>& B,
bool transposeB,
Scalar scalarB,
Teuchos::RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> > C) {
if ( !(A.getRowMap()->isSameAs(*(B.getRowMap()))) ) {
throw(Xpetra::Exceptions::RuntimeError("Xpetra::MatrixMatrix::Add: matrix row maps are not the same."));
}
if (C==Teuchos::null)
//FIXME 5 is a complete guess as to the #nonzeros per row
C = rcp( new Xpetra::CrsMatrixWrap<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>(A.getRowMap(), 5) );
if (C->getRowMap()->lib() == Xpetra::UseEpetra) {
#ifdef HAVE_XPETRA_EPETRAEXT
const Epetra_CrsMatrix& epA = Xpetra::MatrixMatrix::Op2EpetraCrs(A);
const Epetra_CrsMatrix& epB = Xpetra::MatrixMatrix::Op2EpetraCrs(B);
RCP<Epetra_CrsMatrix> epC = Xpetra::MatrixMatrix::Op2NonConstEpetraCrs(C);
Epetra_CrsMatrix* ref2epC = &*epC; //to avoid a compiler error...
//FIXME is there a bug if beta=0?
int i = EpetraExt::MatrixMatrix::Add(epA,transposeA,scalarA,epB,transposeB,scalarB,ref2epC);
if (i != 0) {
std::ostringstream buf;
buf << i;
std::string msg = "EpetraExt::MatrixMatrix::Add return value of " + buf.str();
throw(Xpetra::Exceptions::RuntimeError(msg));
}
#else
throw(Xpetra::Exceptions::RuntimeError("Xpetra must be compile with EpetraExt."));
#endif
} else if(C->getRowMap()->lib() == Xpetra::UseTpetra) {
#ifdef HAVE_XPETRA_TPETRA
const Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> & tpA = Xpetra::MatrixMatrix::Op2TpetraCrs(A);
const Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> & tpB = Xpetra::MatrixMatrix::Op2TpetraCrs(B);
RCP<Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> > tpC = Xpetra::MatrixMatrix::Op2NonConstTpetraCrs(C);
Tpetra::MatrixMatrix::Add(tpA, transposeA, scalarA, tpB, transposeB, scalarB, tpC);
#else
throw(Xpetra::Exceptions::RuntimeError("Xpetra must be compile with Tpetra."));
#endif
}
///////////////////////// EXPERIMENTAL
RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> > rcpA = Teuchos::rcp_const_cast<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> >(Teuchos::rcpFromRef(A));
RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> > rcpB = Teuchos::rcp_const_cast<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> >(Teuchos::rcpFromRef(B));
if(A.IsView("stridedMaps")) C->CreateView("stridedMaps", rcpA);
if(B.IsView("stridedMaps")) C->CreateView("stridedMaps", rcpB);
///////////////////////// EXPERIMENTAL
}
示例2: GetParameterList
void SubBlockAFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::Build(Level & currentLevel) const {
typedef Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> OMatrix; //TODO
typedef Xpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> CrsMatrixClass; //TODO
typedef Xpetra::CrsMatrixWrap<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> CrsMatrixWrapClass; //TODO
typedef Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps> BlockedCrsOMatrix; //TODO
typedef Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node> MapExtractorClass;
const ParameterList & pL = GetParameterList();
size_t row = Teuchos::as<size_t>(pL.get<int>("block row"));
size_t col = Teuchos::as<size_t>(pL.get<int>("block col"));
RCP<OMatrix> Ain = Teuchos::null;
Ain = Get< RCP<OMatrix> >(currentLevel, "A");
RCP<BlockedCrsOMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsOMatrix>(Ain);
TEUCHOS_TEST_FOR_EXCEPTION(bA==Teuchos::null, Exceptions::BadCast, "MueLu::SubBlockAFactory::Build: input matrix A is not of type BlockedCrsMatrix! error.");
TEUCHOS_TEST_FOR_EXCEPTION(row > bA->Rows(), Exceptions::RuntimeError, "MueLu::SubBlockAFactory::Build: A.Rows() > rows_! error.");
TEUCHOS_TEST_FOR_EXCEPTION(col > bA->Cols(), Exceptions::RuntimeError, "MueLu::SubBlockAFactory::Build: A.Cols() > cols_! error.");
Teuchos::RCP<CrsMatrixClass> A = bA->getMatrix(row, col);
Teuchos::RCP<CrsMatrixWrapClass> Op = Teuchos::rcp(new CrsMatrixWrapClass(A));
//////////////// EXPERIMENTAL
// extract striding information from RangeMapExtractor
Teuchos::RCP<const MapExtractorClass> rgMapExtractor = bA->getRangeMapExtractor();
Teuchos::RCP<const MapExtractorClass> doMapExtractor = bA->getDomainMapExtractor();
Teuchos::RCP<const Map> rgMap = rgMapExtractor->getMap(row);
Teuchos::RCP<const Map> doMap = doMapExtractor->getMap(col);
Teuchos::RCP<const StridedMap> srgMap = Teuchos::rcp_dynamic_cast<const StridedMap>(rgMap);
Teuchos::RCP<const StridedMap> sdoMap = Teuchos::rcp_dynamic_cast<const StridedMap>(doMap);
if(srgMap == Teuchos::null) {
Teuchos::RCP<const Map> fullRgMap = rgMapExtractor->getFullMap();
Teuchos::RCP<const StridedMap> sFullRgMap = Teuchos::rcp_dynamic_cast<const StridedMap>(fullRgMap);
TEUCHOS_TEST_FOR_EXCEPTION(sFullRgMap==Teuchos::null, Exceptions::BadCast, "MueLu::SubBlockAFactory::Build: full rangeMap is not a strided map");
std::vector<size_t> stridedData = sFullRgMap->getStridingData();
if(stridedData.size() == 1 && row > 0) // we have block matrices. use striding block information 0
srgMap = StridedMapFactory::Build(rgMap, stridedData, 0, sFullRgMap->getOffset());
else // we have strided matrices. use striding information of the corresponding block
srgMap = StridedMapFactory::Build(rgMap, stridedData, row, sFullRgMap->getOffset());
}
if(sdoMap == Teuchos::null) {
Teuchos::RCP<const Map> fullDoMap = doMapExtractor->getFullMap();
Teuchos::RCP<const StridedMap> sFullDoMap = Teuchos::rcp_dynamic_cast<const StridedMap>(fullDoMap);
TEUCHOS_TEST_FOR_EXCEPTION(sFullDoMap==Teuchos::null, Exceptions::BadCast, "MueLu::SubBlockAFactory::Build: full domainMap is not a strided map");
std::vector<size_t> stridedData2 = sFullDoMap->getStridingData();
if(stridedData2.size() == 1 && col > 0) // we have block matrices. use striding block information 0
sdoMap = StridedMapFactory::Build(doMap, stridedData2, 0, sFullDoMap->getOffset());
else // we have strided matrices. use striding information of the corresponding block
sdoMap = StridedMapFactory::Build(doMap, stridedData2, col, sFullDoMap->getOffset());
}
TEUCHOS_TEST_FOR_EXCEPTION(srgMap==Teuchos::null, Exceptions::BadCast, "MueLu::SubBlockAFactory::Build: rangeMap " << row << " is not a strided map");
TEUCHOS_TEST_FOR_EXCEPTION(sdoMap==Teuchos::null, Exceptions::BadCast, "MueLu::SubBlockAFactory::Build: domainMap " << col << " is not a strided map");
GetOStream(Statistics1) << "A(" << row << "," << col << ") has strided maps: range map fixed block size=" << srgMap->getFixedBlockSize() << " strided block id = " << srgMap->getStridedBlockId() << ", domain map fixed block size=" << sdoMap->getFixedBlockSize() << ", strided block id=" << sdoMap->getStridedBlockId() << std::endl;
if(Op->IsView("stridedMaps") == true) Op->RemoveView("stridedMaps");
Op->CreateView("stridedMaps", srgMap, sdoMap);
TEUCHOS_TEST_FOR_EXCEPTION(Op->IsView("stridedMaps")==false, Exceptions::RuntimeError, "MueLu::SubBlockAFactory::Build: failed to set stridedMaps");
//////////////// EXPERIMENTAL
currentLevel.Set("A", Teuchos::rcp_dynamic_cast<OMatrix>(Op), this);
}
示例3: m
void SchurComplementFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::Build(Level & currentLevel) const
{
FactoryMonitor m(*this, "SchurComplementFactory", currentLevel);
Teuchos::RCP<Matrix> A = Get<RCP<Matrix> >(currentLevel, "A");
RCP<BlockedCrsMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(A);
TEUCHOS_TEST_FOR_EXCEPTION(bA == Teuchos::null, Exceptions::BadCast, "MueLu::SchurComplementFactory::Build: input matrix A is not of type BlockedCrsMatrix! A generated by AFact_ must be a 2x2 block operator. error.");
Teuchos::RCP<CrsMatrix> A00 = bA->getMatrix(0,0);
Teuchos::RCP<CrsMatrix> A01 = bA->getMatrix(0,1);
Teuchos::RCP<CrsMatrix> A10 = bA->getMatrix(1,0);
Teuchos::RCP<CrsMatrix> A11 = bA->getMatrix(1,1);
Teuchos::RCP<CrsMatrixWrap> Op00 = Teuchos::rcp(new CrsMatrixWrap(A00));
Teuchos::RCP<CrsMatrixWrap> Op01 = Teuchos::rcp(new CrsMatrixWrap(A01));
Teuchos::RCP<CrsMatrixWrap> Op10 = Teuchos::rcp(new CrsMatrixWrap(A10));
Teuchos::RCP<CrsMatrixWrap> Op11 = Teuchos::rcp(new CrsMatrixWrap(A11));
Teuchos::RCP<Matrix> F = Teuchos::rcp_dynamic_cast<Matrix>(Op00);
Teuchos::RCP<Matrix> G = Teuchos::rcp_dynamic_cast<Matrix>(Op01);
Teuchos::RCP<Matrix> D = Teuchos::rcp_dynamic_cast<Matrix>(Op10);
Teuchos::RCP<Matrix> Z = Teuchos::rcp_dynamic_cast<Matrix>(Op11);
// TODO move this to BlockedCrsMatrix->getMatrix routine...
F->CreateView("stridedMaps", bA->getRangeMap(0), bA->getDomainMap(0));
G->CreateView("stridedMaps", bA->getRangeMap(0), bA->getDomainMap(1));
D->CreateView("stridedMaps", bA->getRangeMap(1), bA->getDomainMap(0));
Z->CreateView("stridedMaps", bA->getRangeMap(1), bA->getDomainMap(1));
const ParameterList& pL = GetParameterList();
Scalar omega = pL.get<Scalar>("omega");
// copy the value of G so we can do the left scale.
RCP<Matrix> FhatinvG = MatrixFactory::Build(G->getRowMap(), G->getGlobalMaxNumRowEntries());
RCP<Matrix> emptyMat = MatrixFactory::Build(G->getRowMap(), G->getGlobalMaxNumRowEntries());
emptyMat->fillComplete(G->getDomainMap(),G->getRowMap());
Utils2::TwoMatrixAdd(G,false,1.0,emptyMat,false,-1.0/omega,FhatinvG);
FhatinvG->fillComplete(G->getDomainMap(),G->getRowMap()); // complete the matrix. left scaling does not change the pattern of the operator.
bool lumping = pL.get<bool>("lumping");
if(!lumping) {
// extract diagonal of F. store it in ArrayRCP object
Teuchos::ArrayRCP<SC> AdiagFinv = Utils::GetMatrixDiagonal(*F);
for (size_t k = 0; k < Teuchos::as<size_t> (AdiagFinv.size ()); ++k) {
if (Teuchos::ScalarTraits<SC>::magnitude(AdiagFinv[k]) < 1e-4)
AdiagFinv[k] = Teuchos::ScalarTraits<SC>::one();
}
Utils::MyOldScaleMatrix(FhatinvG,AdiagFinv,true,false,false); // TODO check the MyOldScaleMatrix routine...
} else {
// use diagonal of lumped matrix as approximation
Teuchos::ArrayRCP<SC> AdiagFinv = Utils::GetLumpedMatrixDiagonal(*F);
Utils::MyOldScaleMatrix(FhatinvG,AdiagFinv,true,false,false); // TODO check the MyOldScaleMatrix routine...
}
// build D \hat{F}^{-1} G
RCP<Matrix> DFhatinvG = Utils::Multiply(*D,false,*FhatinvG,false);
// build full SchurComplement operator
// S = - 1/omega D \hat{F}^{-1} G + Z
RCP<Matrix> S;
Utils2::TwoMatrixAdd(Z,false,1.0,DFhatinvG,false,-1.0/omega,S);
S->fillComplete();
{
// note: variable "A" generated by this SchurComplement factory is in fact the SchurComplement matrix
// we have to use the variable name "A" since the Smoother object expects the matrix to be called "A"
Set(currentLevel, "A", S);
}
}
示例4: CoalesceDropFactory
TEUCHOS_UNIT_TEST(CoalesceDropFactory, AmalgamationStridedOffsetDropping2LW)
{
// unit test for block size 9 = (2,3,4). wrap block 1.
// drop small entries
// lightweight wrap = true
out << "version: " << MueLu::Version() << std::endl;
RCP<const Teuchos::Comm<int> > comm = Parameters::getDefaultComm();
Xpetra::UnderlyingLib lib = TestHelpers::Parameters::getLib();
// create strided map information
std::vector<size_t> stridingInfo;
stridingInfo.push_back(as<size_t>(2));
stridingInfo.push_back(as<size_t>(3));
stridingInfo.push_back(as<size_t>(4));
LocalOrdinal stridedBlockId = 1;
GlobalOrdinal offset = 19;
RCP<const StridedMap> dofMap = Xpetra::StridedMapFactory<LocalOrdinal, GlobalOrdinal, Node>::Build(lib, 9*comm->getSize(), 0,
stridingInfo, comm,
stridedBlockId, offset);
/////////////////////////////////////////////////////
Teuchos::RCP<Matrix> mtx = TestHelpers::TestFactory<SC,LO,GO,NO>::BuildTridiag(dofMap, 2.0, 1.0, 0.0001);
Level fineLevel;
TestHelpers::TestFactory<SC,LO,GO,NO>::createSingleLevelHierarchy(fineLevel);
RCP<const Map> stridedRangeMap = Xpetra::StridedMapFactory<LocalOrdinal, GlobalOrdinal, Node>::Build(
mtx->getRangeMap(),
stridingInfo,
stridedBlockId,
offset
);
RCP<const Map> stridedDomainMap = Xpetra::StridedMapFactory<LocalOrdinal, GlobalOrdinal, Node>::Build(
mtx->getDomainMap(),
stridingInfo,
stridedBlockId,
offset
);
if(mtx->IsView("stridedMaps") == true) mtx->RemoveView("stridedMaps");
mtx->CreateView("stridedMaps", stridedRangeMap, stridedDomainMap);
fineLevel.Set("A", mtx);
CoalesceDropFactory dropFact = CoalesceDropFactory();
dropFact.SetParameter("lightweight wrap",Teuchos::ParameterEntry(true));
dropFact.SetParameter("aggregation: drop tol",Teuchos::ParameterEntry(0.3));
fineLevel.Request("Graph", &dropFact);
fineLevel.Request("DofsPerNode", &dropFact);
dropFact.Build(fineLevel);
fineLevel.print(out);
RCP<GraphBase> graph = fineLevel.Get<RCP<GraphBase> >("Graph", &dropFact);
LO myDofsPerNode = fineLevel.Get<LO>("DofsPerNode", &dropFact);
TEST_EQUALITY(as<int>(graph->GetDomainMap()->getGlobalNumElements()) == comm->getSize(), true);
TEST_EQUALITY(as<int>(myDofsPerNode) == 9, true);
bool bCorrectGraph = false;
if (comm->getSize() == 1 && graph->getNeighborVertices(0).size() == 1) {
bCorrectGraph = true;
} else {
if (comm->getRank() == 0) {
if (graph->getNeighborVertices(0).size() == 1) bCorrectGraph = true;
}
else {
if (graph->getNeighborVertices(0).size() == 2) bCorrectGraph = true;
}
}
TEST_EQUALITY(bCorrectGraph, true);
const RCP<const Map> myImportMap = graph->GetImportMap(); // < note that the ImportMap is built from the column map of the matrix A WITHOUT dropping!
const RCP<const Map> myDomainMap = graph->GetDomainMap();
TEST_EQUALITY(myImportMap->getMaxAllGlobalIndex(), comm->getSize()-1);
TEST_EQUALITY(myImportMap->getMinAllGlobalIndex(), 0);
TEST_EQUALITY(myImportMap->getMinLocalIndex(),0);
TEST_EQUALITY(myImportMap->getGlobalNumElements(),as<size_t>(comm->getSize()+2*(comm->getSize()-1)));
if (comm->getSize()>1) {
size_t numLocalRowMapElts = graph->GetNodeNumVertices();
size_t numLocalImportElts = myImportMap->getNodeNumElements();
if (comm->getRank() == 0 || comm->getRank() == comm->getSize()-1) {
TEST_EQUALITY(as<bool>(numLocalImportElts==numLocalRowMapElts+1), true);
} else {
TEST_EQUALITY(as<bool>(numLocalImportElts==numLocalRowMapElts+2), true);
}
}
TEST_EQUALITY(myDomainMap->getMaxAllGlobalIndex(), comm->getSize()-1);
TEST_EQUALITY(myDomainMap->getMinAllGlobalIndex(), 0);
TEST_EQUALITY(myDomainMap->getMinLocalIndex(),0);
TEST_EQUALITY(myDomainMap->getGlobalNumElements(),as<size_t>(comm->getSize()));
TEST_EQUALITY(as<bool>(myDomainMap->getNodeNumElements()==1), true);
} // AmalgamationStridedOffsetDropping2LW
示例5: m
//.........这里部分代码省略.........
Teuchos::ArrayView< const GlobalOrdinal > nodeRangeMapii = rebRii->getRangeMap()->getNodeElementList();
stridedRgMap = StridedMapFactory::Build(
originalTransferOp->getRangeMap()->lib(),
Teuchos::OrdinalTraits<Xpetra::global_size_t>::invalid(),
nodeRangeMapii,
rebRii->getRangeMap()->getIndexBase(),
stridingData,
originalTransferOp->getRangeMap()->getComm(),
orig_stridedRgMap->getStridedBlockId(),
orig_stridedRgMap->getOffset());
}
RCP<const Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node> > doRMapExtractor = bOriginalTransferOp->getDomainMapExtractor(); // original map extractor
Teuchos::RCP<const StridedMap> orig_stridedDoMap = Teuchos::rcp_dynamic_cast<const StridedMap>(doRMapExtractor->getMap(Teuchos::as<size_t>(curBlockId)));
Teuchos::RCP<const Map> stridedDoMap = Teuchos::null;
if(orig_stridedDoMap != Teuchos::null) {
std::vector<size_t> stridingData = orig_stridedDoMap->getStridingData();
Teuchos::ArrayView< const GlobalOrdinal > nodeDomainMapii = rebRii->getDomainMap()->getNodeElementList();
stridedDoMap = StridedMapFactory::Build(
originalTransferOp->getDomainMap()->lib(),
Teuchos::OrdinalTraits<Xpetra::global_size_t>::invalid(),
nodeDomainMapii,
rebRii->getDomainMap()->getIndexBase(),
stridingData,
originalTransferOp->getDomainMap()->getComm(),
orig_stridedDoMap->getStridedBlockId(),
orig_stridedDoMap->getOffset());
}
TEUCHOS_TEST_FOR_EXCEPTION(stridedRgMap == Teuchos::null,Exceptions::RuntimeError, "MueLu::RebalanceBlockRestrictionFactory::Build: failed to generate striding information. error.");
TEUCHOS_TEST_FOR_EXCEPTION(stridedDoMap == Teuchos::null,Exceptions::RuntimeError, "MueLu::RebalanceBlockRestrictionFactory::Build: failed to generate striding information. error.");
// replace stridedMaps view in diagonal sub block
if(rebRii->IsView("stridedMaps")) rebRii->RemoveView("stridedMaps");
rebRii->CreateView("stridedMaps", stridedRgMap, stridedDoMap);
// store rebalanced subblock
subBlockRebR.push_back(rebRii);
// append strided row map (= range map) to list of range maps.
Teuchos::RCP<const Map> rangeMapii = rebRii->getRowMap("stridedMaps"); //rebRii->getRangeMap();
subBlockRRangeMaps.push_back(rangeMapii);
Teuchos::ArrayView< const GlobalOrdinal > nodeRangeMapii = rebRii->getRangeMap()->getNodeElementList();
fullRangeMapVector.insert(fullRangeMapVector.end(), nodeRangeMapii.begin(), nodeRangeMapii.end());
sort(fullRangeMapVector.begin(), fullRangeMapVector.end());
// append strided col map (= domain map) to list of range maps.
Teuchos::RCP<const Map> domainMapii = rebRii->getColMap("stridedMaps"); //rebRii->getDomainMap();
subBlockRDomainMaps.push_back(domainMapii);
Teuchos::ArrayView< const GlobalOrdinal > nodeDomainMapii = rebRii->getDomainMap()->getNodeElementList();
fullDomainMapVector.insert(fullDomainMapVector.end(), nodeDomainMapii.begin(), nodeDomainMapii.end());
sort(fullDomainMapVector.begin(), fullDomainMapVector.end());
////////////////////////////////////////////////////////////
// rebalance null space
if(rebalanceImporter != Teuchos::null)
{ // rebalance null space
std::stringstream ss2; ss2 << "Rebalancing nullspace block(" << curBlockId << "," << curBlockId << ")";
SubFactoryMonitor subM(*this, ss2.str(), coarseLevel);
RCP<MultiVector> nullspace = coarseLevel.Get<RCP<MultiVector> >("Nullspace", (*it)->GetFactory("Nullspace").get());
RCP<MultiVector> permutedNullspace = MultiVectorFactory::Build(rebalanceImporter->getTargetMap(), nullspace->getNumVectors());
permutedNullspace->doImport(*nullspace, *rebalanceImporter, Xpetra::INSERT);
// TODO think about this
//if (pL.get<bool>("useSubcomm") == true) // TODO either useSubcomm is enabled everywhere or nowhere