#include <iostream>
#include <qd/qd_real.h>
#include <Teuchos_oblackholestream.hpp>
#include <Tpetra_DefaultPlatform.hpp>
#include <TpetraExt_TypeStack.hpp>
#include <IRTRDriver.hpp>
#undef HAVE_KOKKOSCLASSIC_THRUST
#include <Tpetra_HybridPlatform.hpp>
int main(int argc, char *argv[])
{
const int myImageID = comm->getRank();
bool verbose = (myImageID==0);
std::string matfile;
std::string xmlfile;
std::string machineFile;
cmdp.
setOption(
"verbose",
"quiet",&verbose,
"Print messages and results.");
cmdp.
setOption(
"matrix-file",&matfile,
"Filename for matrix");
cmdp.
setOption(
"param-file", &xmlfile,
"XML file for solver parameters");
cmdp.
setOption(
"machine-file",&machineFile,
"Filename for XML machine description file.");
return -1;
}
std::string defaultMachine(
" <ParameterList> "
" <ParameterList name='%1=0'> "
" <Parameter name='NodeType' type='string' value='Kokkos::SerialNode'/> "
" </ParameterList> "
" </ParameterList> "
);
Teuchos::updateParametersFromXmlString(defaultMachine,machinePL.
ptr());
if (machineFile !=
"") Teuchos::updateParametersFromXmlFile(machineFile,machinePL.
ptr());
typedef qd_real Scalar;
IRTR_Driver<Scalar> driver;
if (verbose) driver.out = Teuchos::getFancyOStream(
Teuchos::rcp(&std::cout,
false));
driver.matrixFile = matfile;
std::string xmlString(
" <ParameterList> \n"
" <Parameter name='tolerance' value='1e-63' type='double'/> \n"
" <Parameter name='verbose' value='1' type='int'/> \n"
" <Parameter name='rho_prime' value='.1' type='double'/> \n"
" <Parameter name='kappa' value='.1' type='double'/> \n"
" <Parameter name='theta' value='2' type='double'/> \n"
" </ParameterList> \n"
);
Teuchos::updateParametersFromXmlString(xmlString,params.
ptr());
if (xmlfile !=
"") Teuchos::updateParametersFromXmlFile(xmlfile,params.
ptr());
driver.params = params;
platform.runUserCode(driver);
if (driver.testPassed) {
*driver.out << "End Result: TEST PASSED" << std::endl;
}
return 0;
}