u = u_hyp; } if( input.param.num_smear == 0 ) { u_hyp = u;
int main(int argc, char *argv[]){  // Put the machine into a known state  QDP_initialize(&argc, &argv);  // Parameter structure for the input  Hypsmear_input_t input;  // Instantiate xml reader for DATA  XMLReader xml_in("DATA");  // Read data  read(xml_in, "/hypsmear", input);  Layout::setLattSize(input.param.nrow);  Layout::create();  QDPIO::cout << " HYPSMEAR: HYP smearing of gauge config" << endl;  // Read in the configuration along with relevant information.  multi1d<LatticeColorMatrix> u(Nd);  XMLReader gauge_file_xml, gauge_xml;  clock_t t1 = clock();  // Startup gauge  gaugeStartup(gauge_file_xml, gauge_xml, u, input.cfg);  clock_t t2 = clock();  QDPIO::cout << "Gauge read took " << (double)((int)(t2)-(int)(t1))/(double)(CLOCKS_PER_SEC) << " secs" << endl;  // Instantiate XML writer for XMLDAT  XMLFileWriter xml_out("XMLDAT");  push(xml_out, "hypsmear");  proginfo(xml_out);    // Print out basic program info  // Write out the input  write(xml_out, "Input", xml_in);  // Write out the config header  write(xml_out, "Config_info", gauge_xml);  push(xml_out, "Output_version");  write(xml_out, "out_version", 1);  pop(xml_out);  xml_out.flush();  // Check if the gauge field configuration is unitarized  t1 = clock();  unitarityCheck(u);  t2 = clock();  QDPIO::cout << "Unitarity took " << (double)((int)(t2)-(int)(t1))/(double)(CLOCKS_PER_SEC) << " secs" << endl;    // Calculate some gauge invariant observables just for info.  Double w_plaq, s_plaq, t_plaq, link;  t1 = clock();  MesPlq(u, w_plaq, s_plaq, t_plaq, link);  t2 = clock();  QDPIO::cout << "Plaquette took " << (double)((int)(t2)-(int)(t1))/(double)(CLOCKS_PER_SEC) << " secs" << endl;  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);  xml_out.flush();  // Now hyp smear  multi1d<LatticeColorMatrix> u_hyp(Nd);  Real BlkAccu = 1.0e-5;  int BlkMax = 100;  t1 = clock();  for( int n = 0; n < input.param.num_smear; n ++ )  {    Hyp_Smear(u, u_hyp, 	      input.param.alpha1, input.param.alpha2, input.param.alpha3, 	      BlkAccu, BlkMax);  }  t2 = clock();  QDPIO::cout << "Hypsmear took " << (double)((int)(t2)-(int)(t1))/(double)(CLOCKS_PER_SEC) << " secs" << endl;  // Calculate some gauge invariant observables just for info.  MesPlq(u_hyp, w_plaq, s_plaq, t_plaq, link);  push(xml_out, "HYP_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);  // Now write the configuration to disk  t1 = clock();  switch (input.hyp.cfg_type)   {  case CFG_TYPE_SZIN :  {    SzinGauge_t szin_out;    initHeader(szin_out);    switch(input.param.trunc)    {    case 1:      writeSzinTrunc(szin_out, u_hyp, input.param.j_decay,		     input.param.t_start, input.param.t_end,		     input.hyp.hyp_file);      break;    default:      writeSzin(szin_out, u_hyp,		input.hyp.hyp_file);      break;    }    break;  }  default :    QDP_error_exit("Configuration type is unsupported.");  }  t2 = clock();  QDPIO::cout << "Gauge write took " << (double)((int)(t2)-(int)(t1))/(double)(CLOCKS_PER_SEC) << " secs" << endl;  pop(xml_out);  // Time to bolt  QDP_finalize();  exit(0);}