本文整理汇总了C++中Teuchos::ParameterXMLFileReader方法的典型用法代码示例。如果您正苦于以下问题:C++ Teuchos::ParameterXMLFileReader方法的具体用法?C++ Teuchos::ParameterXMLFileReader怎么用?C++ Teuchos::ParameterXMLFileReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Teuchos
的用法示例。
在下文中一共展示了Teuchos::ParameterXMLFileReader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char*argv[])
{
Teuchos::GlobalMPISession mpisess(&argc,&argv,&cout);
RCP<const Comm<int> > comm = Teuchos::createMpiComm<int>(Teuchos::opaqueWrapper<MPI_Comm>(MPI_COMM_WORLD));
const int numImages = comm->getSize(),
myImageID = comm->getRank();
const bool IAmRoot = (myImageID == 0);
// Time timer("Total time for BelosTpetraHybridDriver test");
// timer.start();
// Get macine and test parameter files from command line
string fnTestParams("");
string fnMachine("");
Teuchos::CommandLineProcessor cmdp(false,true);
cmdp.setOption("param-file", &fnTestParams, "XML Parameters file");
cmdp.setOption("machine-file",&fnMachine,"Filename for XML machine description file.");
if (cmdp.parse(argc,argv) != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL) {
return -1;
}
// Read XML machine file into a ParameterList
if (IAmRoot) {
cout << "Every proc machine parameters from: " << fnMachine << endl;
}
ParameterList plMachine = ParameterXMLFileReader(fnMachine).getParameters();
// Read the contents of the xml file into a ParameterList.
if (IAmRoot) {
cout << "Every proc reading parameters from: " << fnTestParams << endl;
}
BelosTpetraHybridDriverTest::plTestParams = ParameterXMLFileReader(fnTestParams).getParameters();
// Everything is node based from here on out; have the HybridPlatform launch us appropriately
Tpetra::HybridPlatform platform(comm,plMachine);
platform.runUserCode<runTest>();
// timer.stop();
// if (IAmRoot) {
// cout << "proc 0 total program time: " << timer.totalElapsedTime() << endl;
// }
return 0;
}