CHROMA
qpropqio.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Reads a scidac prop and converts only the volume format
3  */
4 
5 #include "chroma.h"
6 
7 using namespace Chroma;
8 
9 
10 struct QpropQIO_t
11 {
13  multi1d<int> nrow;
14 };
15 
16 // Reader for input parameters
17 void read(XMLReader& xml, const std::string& path, QpropQIO_t& input)
18 {
19  XMLReader inputtop(xml, path);
20 
21  // Read the input
22  try
23  {
24  // Propagator parameters
25  InlinePropagatorParams foo(inputtop, "Param");
26  input.param = foo;
27 
28  // Read the lattice size
29  read(inputtop, "nrow", input.nrow);
30  }
31  catch (const std::string& e)
32  {
33  QDPIO::cerr << "Error reading data: " << e << std::endl;
34  throw;
35  }
36 }
37 
38 
39 
40 //! SciDAC prop conversion program
41 /*! \defgroup qpropqio SciDAC prop conversion program
42  * \ingroup main
43  *
44  * Main program for transforming propagator formats
45  */
46 
47 int main(int argc, char *argv[])
48 {
49  // Put the machine into a known state
50  Chroma::initialize(&argc, &argv);
51 
52  START_CODE();
53 
54  // Instantiate xml reader for DATA
55  XMLReader xml_in(Chroma::getXMLInputFileName());
56 
57  // Read data
58  QpropQIO_t input;
59  read(xml_in, "/qpropqio", input);
60  InlinePropagator meas(input.param);
61 
62  // Specify lattice size, shape, etc.
63  Layout::setLattSize(input.nrow);
64  Layout::create();
65 
66  // Output
67  XMLFileWriter& xml_out = Chroma::getXMLOutputInstance();
68 
69  unsigned long cur_update = 0;
70  meas(cur_update, xml_out);
71 
72  xml_out.flush();
73 
74  END_CODE();
75 
76  // Time to bolt
78 
79  exit(0);
80 }
Primary include file for CHROMA in application codes.
Inline propagator calculation.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
Definition: chroma_init.cc:114
void finalize(void)
Chroma finalization routine.
Definition: chroma_init.cc:308
std::string getXMLInputFileName()
Get input file name.
Definition: chroma_init.cc:88
START_CODE()
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Definition: chroma_init.cc:359
::std::string string
Definition: gtest.h:1979
int main(int argc, char *argv[])
Definition: qpropqio.cc:47
InlinePropagatorParams param
Definition: qpropqio.cc:12
multi1d< int > nrow
Definition: qpropqio.cc:13