if( fermact == "UNPRECONDITIONED_WILSON" || fermact == "UNPRECONDITIONED_DWFTRANSF" ) {
if( fermact == "UNPRECONDITIONED_WILSON" ) {
int main(int argc, char **argv){  // Put the machine into a known state  QDP_initialize(&argc, &argv);  ChromaWilsonRitz_t input;  XMLReader xml_in("DATA");  try {     read(xml_in, "/WilsonRitzEigen", input);  }  catch( const string& e ) {     QDPIO::cerr << "Caught Exception: " << e << endl;    QDP_error_exit("Exiting\n");  }  // Setup the lattice  Layout::setLattSize(input.nrow);  Layout::create();  QDP::RNG::setrn(input.seed);  QDPIO::cout << "RitzEigen" << endl;  multi1d<LatticeColorMatrix> u(Nd);  XMLReader gauge_file_xml, gauge_xml;  gaugeStartup(gauge_file_xml, gauge_xml, u, input.cfg);  XMLFileWriter xml_out("XMLDAT");  push(xml_out, "RitzEigen");  proginfo(xml_out);  // Write out the input  write(xml_out, "Input", xml_in);  write(xml_out, "Config_info", gauge_xml);  xml_out.flush();  // Check if the gauge field configuration is unitarized  unitarityCheck(u);  // Calculate some gauge invariant observables just for info.  Double w_plaq, s_plaq, t_plaq, link;  MesPlq(u, w_plaq, s_plaq, t_plaq, link);  push(xml_out, "Observables");  write(xml_out, "w_plaq", w_plaq);  write(xml_out, "s_plaq", s_plaq);  write(xml_out, "t_plaq", t_plaq);  write(xml_out, "link", link);  pop(xml_out);  /* Construct fermionic BC Need one for LatticeFermion and    * multi1d<LatticeFermion>      * Note, the handle is on an ABSTRACT type   */  Handle< FermBC<LatticeFermion> >  fbc(new SimpleFermBC<LatticeFermion>(input.boundary));  Handle< FermBC<multi1d<LatticeFermion> > >  fbc_a(new SimpleFermBC<multi1d<LatticeFermion> >(input.boundary));  // Initialise Fermion action  std::istringstream xml_fermact_string(input.fermact);  XMLReader fermacttop(xml_fermact_string);  const string fermact_path = "/FermionAction";  string fermact;  try  {    read(fermacttop, fermact_path + "/FermAct", fermact);  }  catch (const std::string& e)   {    QDPIO::cerr << "Error reading fermact: " << e << endl;    throw;  }  QDPIO::cout << "FermAct = " << fermact << endl;  // Make a reader for the stateInfo  std::istringstream state_info_is(input.state_info);  XMLReader state_info_xml(state_info_is);  string state_info_path="/StateInfo";  bool success = false;  if( ! success ) {     try {       QDPIO::cout << "Trying unprec DWF-like actions" << endl;      // DWF-like 5D Wilson-Type stuff      Handle< UnprecDWFermActBaseArray<LatticeFermion> >	S_f(TheUnprecDWFermActBaseArrayFactory::Instance().createObject(fermact,									fbc_a,									fermacttop,									fermact_path));      Handle<const ConnectState> state(S_f->createState(u,							state_info_xml,							state_info_path));      Handle< const LinearOperator<multi1d<LatticeFermion> > > MM(S_f->lMdagM(state));      RitzCode5D(MM, input, xml_out);      success = true;    }    catch(const std::string& e ) {        QDPIO::cout << "Unprec DWF-like: " << e << endl;    }  }  if( ! success ) {     try {       QDPIO::cout << "Trying  even odd prec DWF-like actions" << endl;      // DWF-like 5D Wilson-Type stuff      Handle< EvenOddPrecDWFermActBaseArray<LatticeFermion> >	S_f(TheEvenOddPrecDWFermActBaseArrayFactory::Instance().createObject(fermact,									fbc_a,									fermacttop,									fermact_path));      Handle<const ConnectState> state(S_f->createState(u,							state_info_xml,							state_info_path));      Handle< const LinearOperator<multi1d<LatticeFermion> > > MM(S_f->lMdagM(state));      RitzCode5D(MM, input, xml_out);      success = true;    }    catch(const std::string& e ) {        QDPIO::cout << "EvenOddPrec DWF-like: " << e << endl;    }  }  if( ! success ) {     try {       QDPIO::cout << "Trying 5D Wilson like actions" << endl;      // DWF-like 5D Wilson-Type stuff      Handle< WilsonTypeFermAct< multi1d<LatticeFermion> > >	S_f(TheWilsonTypeFermActArrayFactory::Instance().createObject(fermact,									fbc_a,									fermacttop,									fermact_path));      Handle<const ConnectState> state(S_f->createState(u,							state_info_xml,							state_info_path));      Handle< const LinearOperator<multi1d<LatticeFermion> > > MM(S_f->lMdagM(state));      QDPIO::cout << "LINOP CREATED" << endl << flush <<endl;      RitzCode5D(MM, input, xml_out);      success = true;    }    catch(const std::string& e ) {        QDPIO::cout << "5D Wilson like: " << e << endl;    }  }  if( ! success ) {     try {             // Special case UNPRECONDITIONED_WILSON      QDPIO::cout << "Trying 4D Wilson Like actions: " << endl;      if( fermact == "UNPRECONDITIONED_WILSON"	  || fermact == "UNPRECONDITIONED_DWFTRANSF" ) {	QDPIO::cout << "Special case. Computing Hw e-values and evecs too" << endl;	// DWF-like 5D Wilson-Type stuff	Handle< WilsonTypeFermAct<LatticeFermion> >	  S_f(TheWilsonTypeFermActFactory::Instance().createObject(fermact,								   fbc,								   fermacttop,								   fermact_path));		Handle<const ConnectState> state(S_f->createState(u,							  state_info_xml,							  state_info_path));	Handle< const LinearOperator<LatticeFermion> > MM(S_f->lMdagM(state));	Handle< const LinearOperator<LatticeFermion> > H(S_f->gamma5HermLinOp(state));	RitzCode4DHw(MM, H, input, xml_out);	success = true;      }      else {// DWF-like 5D Wilson-Type stuff	Handle< WilsonTypeFermAct<LatticeFermion> >	  S_f(TheWilsonTypeFermActFactory::Instance().createObject(fermact,								   fbc,								   fermacttop,								   fermact_path));		Handle<const ConnectState> state(S_f->createState(u,							  state_info_xml,							  state_info_path));	Handle< const LinearOperator<LatticeFermion> > MM(S_f->lMdagM(state));	RitzCode4D(MM, input, xml_out);	success = true;      }    }    catch(const std::string& e ) {        QDPIO::cout << "4D: " << e << endl;    }  }  pop(xml_out);  xml_out.flush();  xml_out.close();  QDP_finalize();      exit(0);}