QUDA  v1.1.0
A library for QCD on GPUs
qio_field.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <qmp.h>
3 #include <qio.h>
4 #include <quda.h>
5 #include <util_quda.h>
6 #include <layout_hyper.h>
7 
8 #include <string>
9 
10 static QIO_Layout layout;
11 static int lattice_size[4];
13 
14 std::ostream &operator<<(std::ostream &out, const QIO_Layout &layout)
15 {
16  out << "node_number = " << layout.node_number << std::endl;
17  out << "node_index = " << layout.node_index << std::endl;
18  out << "get_coords = " << layout.get_coords << std::endl;
19  out << "num_sites = " << layout.num_sites << std::endl;
20  out << "latdim = " << layout.latdim << std::endl;
21  out << "latsize = {";
22  for (int d = 0; d < layout.latdim; d++) out << layout.latsize[d] << (d < layout.latdim - 1 ? ", " : "}");
23  out << std::endl;
24  out << "volume = " << layout.volume << std::endl;
25  out << "sites_on_node = " << layout.sites_on_node << std::endl;
26  out << "this_node = " << layout.this_node << std::endl;
27  out << "number_of_nodes = " << layout.number_of_nodes << std::endl;
28  return out;
29 }
30 
31 // for matrix fields this order implies [color][color][complex]
32 // for vector fields this order implies [spin][color][complex]
33 // templatized version to allow for precision conversion
34 template <typename oFloat, typename iFloat, int len> void vput(char *s1, size_t index, int count, void *s2)
35 {
36  oFloat **field = (oFloat **)s2;
37  iFloat *src = (iFloat *)s1;
38 
39  // For the site specified by "index", move an array of "count" data
40  // from the read buffer to an array of fields
41 
42  for (int i = 0; i < count; i++) {
43  oFloat *dest = field[i] + len * index;
44  for (int j = 0; j < len; j++) dest[j] = src[i * len + j];
45  }
46 }
47 
48 // for vector fields this order implies [spin][color][complex]
49 // templatized version of vget_M to allow for precision conversion
50 template <typename oFloat, typename iFloat, int len> void vget(char *s1, size_t index, int count, void *s2)
51 {
52  iFloat **field = (iFloat **)s2;
53  oFloat *dest = (oFloat *)s1;
54 
55  /* For the site specified by "index", move an array of "count" data
56  from the array of fields to the write buffer */
57  for (int i = 0; i < count; i++, dest += len) {
58  iFloat *src = field[i] + len * index;
59  for (int j = 0; j < len; j++) dest[j] = src[j];
60  }
61 }
62 
63 QIO_Reader *open_test_input(const char *filename, int volfmt, int serpar)
64 {
65  QIO_Iflag iflag;
66 
67  iflag.serpar = serpar;
68  iflag.volfmt = volfmt;
69 
70  /* Create the file XML */
71  QIO_String *xml_file_in = QIO_string_create();
72 
73  /* Open the file for reading */
74  QIO_Reader *infile = QIO_open_read(xml_file_in, filename, &layout, NULL, &iflag);
75 
76  if (infile == NULL) {
77  printfQuda("%s(%d): QIO_open_read returns NULL.\n", __func__, quda_this_node);
78  QIO_string_destroy(xml_file_in);
79  return NULL;
80  }
81 
82  printfQuda("%s: QIO_open_read done.\n",__func__);
83  printfQuda("%s: User file info is \"%s\"\n", __func__, QIO_string_ptr(xml_file_in));
84 
85  QIO_string_destroy(xml_file_in);
86  return infile;
87 }
88 
89 QIO_Writer *open_test_output(const char *filename, int volfmt, int serpar, int ildgstyle)
90 {
91  char xml_write_file[] = "Dummy user file XML";
92  QIO_Filesystem filesys;
93  QIO_Oflag oflag;
94 
95  oflag.serpar = serpar;
96  oflag.ildgstyle = ildgstyle;
97  oflag.ildgLFN = QIO_string_create();
98  QIO_string_set(oflag.ildgLFN,"monkey");
99  oflag.mode = QIO_TRUNC;
100 
101  filesys.my_io_node = 0;
102  filesys.master_io_node = 0;
103 
104  /* Create the file XML */
105  QIO_String *xml_file_out = QIO_string_create();
106  QIO_string_set(xml_file_out,xml_write_file);
107 
108  /* Open the file for reading */
109  QIO_Writer *outfile = QIO_open_write(xml_file_out, filename, volfmt, &layout, &filesys, &oflag);
110 
111  QIO_string_destroy(oflag.ildgLFN);
112  if (outfile == NULL) {
113  printfQuda("%s(%d): QIO_open_write returns NULL.\n", __func__, quda_this_node);
114  QIO_string_destroy(xml_file_out);
115  return NULL;
116  }
117 
118  printfQuda("%s: QIO_open_write done.\n",__func__);
119  printfQuda("%s: User file info is \"%s\"\n", __func__, QIO_string_ptr(xml_file_out));
120 
121  QIO_string_destroy(xml_file_out);
122  return outfile;
123 }
124 
125 template <int len>
126 int read_field(QIO_Reader *infile, int count, void *field_in[], QudaPrecision cpu_prec, QudaSiteSubset subset,
127  QudaParity parity, int nSpin, int nColor)
128 {
129  // Get the QIO record and string
130  char dummy[100] = "";
131  QIO_RecordInfo *rec_info = QIO_create_record_info(0, NULL, NULL, 0, dummy, dummy, 0, 0, 0, 0);
132  QIO_String *xml_record_in = QIO_string_create();
133 
134  int status = QIO_read_record_info(infile, rec_info, xml_record_in);
135  int prec = *QIO_get_precision(rec_info);
136 
137  // Check if the read was successful or not.
138  printfQuda("%s: QIO_read_record_data returns status %d\n", __func__, status);
139  if (status != QIO_SUCCESS) { errorQuda("get_prec failed\n"); }
140 
141  // Query components of record
142  int in_nSpin = QIO_get_spins(rec_info);
143  int in_nColor = QIO_get_colors(rec_info);
144  int in_count = QIO_get_datacount(rec_info); // 4 for gauge fields, nVec for packs of vectors
145  int in_typesize = QIO_get_typesize(rec_info); // size of data at each site in bytes
147 
148  // Various checks
149  // Note: we exclude gauge fields from this b/c QUDA originally saved gauge fields as
150  // nSpin == 1, nColor == 9, while it's supposed to be (0,3).
151  // Further, even if the nSpin and nColor don't agree, what really matters is the
152  // total typesize check.
153  if (len != 18) {
154  if (in_nSpin != nSpin) warningQuda("QIO_get_spins %d does not match expected number of colors %d", in_nSpin, nSpin);
155 
156  if (in_nColor != nColor)
157  warningQuda("QIO_get_colors %d does not match expected number of spins %d", in_nColor, nColor);
158  }
159 
160  if (in_count != count) errorQuda("QIO_get_datacount %d does not match expected number of fields %d", in_count, count);
161 
162  if (in_typesize != file_prec * len)
163  errorQuda("QIO_get_typesize %d does not match expected datasize %d", in_typesize, file_prec * len);
164 
165  // Print the XML string.
166  // The len != 18 is a WAR for this line segfaulting on some Chroma configs.
167  // Tracked on github via #936
168  if (len != 18 && QIO_string_length(xml_record_in) > 0) printfQuda("QIO string: %s\n", QIO_string_ptr(xml_record_in));
169 
170  // Get total size. Could probably check the filesize better, but tbd.
171  size_t rec_size = file_prec * count * len;
172 
173  /* Read the field record and convert to cpu precision*/
175  if (file_prec == QUDA_DOUBLE_PRECISION) {
176  status = QIO_read(infile, rec_info, xml_record_in, vput<double, double, len>, rec_size, QUDA_DOUBLE_PRECISION,
177  field_in);
178  } else {
179  status
180  = QIO_read(infile, rec_info, xml_record_in, vput<double, float, len>, rec_size, QUDA_SINGLE_PRECISION, field_in);
181  }
182  } else {
183  if (file_prec == QUDA_DOUBLE_PRECISION) {
184  status
185  = QIO_read(infile, rec_info, xml_record_in, vput<float, double, len>, rec_size, QUDA_DOUBLE_PRECISION, field_in);
186  } else {
187  status
188  = QIO_read(infile, rec_info, xml_record_in, vput<float, float, len>, rec_size, QUDA_SINGLE_PRECISION, field_in);
189  }
190  }
191 
192  QIO_string_destroy(xml_record_in);
193  QIO_destroy_record_info(rec_info);
194  printfQuda("%s: QIO_read_record_data returns status %d\n", __func__, status);
195  if (status != QIO_SUCCESS) return 1;
196  return 0;
197 }
198 
199 int read_su3_field(QIO_Reader *infile, int count, void *field_in[], QudaPrecision cpu_prec)
200 {
201  return read_field<18>(infile, count, field_in, cpu_prec, QUDA_FULL_SITE_SUBSET, QUDA_INVALID_PARITY, 1, 9);
202 }
203 
204 void set_layout(const int *X, QudaSiteSubset subset = QUDA_FULL_SITE_SUBSET)
205 {
206  /* Lattice dimensions */
207  size_t lattice_dim = 4; // assume the comms topology is 4-d
208  size_t lattice_volume = 1;
209  for (int d=0; d<4; d++) {
210  lattice_size[d] = comm_dim(d)*X[d];
211  lattice_volume *= (size_t)lattice_size[d];
212  }
213 
214  /* Set the mapping of coordinates to nodes */
215  if (quda_setup_layout(lattice_size, lattice_dim, QMP_get_number_of_nodes(), subset == QUDA_PARITY_SITE_SUBSET) != 0) {
216  errorQuda("Setup layout failed\n");
217  }
218  printfQuda("%s layout set for %d nodes\n", __func__, QMP_get_number_of_nodes());
219 
220  /* Build the layout structure */
221 #ifdef QIO_HAS_EXTENDED_LAYOUT
222  // members for smaller lattices are not used here
223  layout.node_number = NULL;
224  layout.node_index = NULL;
225  layout.get_coords = NULL;
226  layout.num_sites = NULL;
227  // members using the extended layout for large lattice support
228  layout.node_number_ext = quda_node_number_ext;
229  layout.node_index_ext = quda_node_index_ext;
230  layout.get_coords_ext = quda_get_coords_ext;
231  layout.num_sites_ext = quda_num_sites_ext;
232  layout.arg = NULL;
233  layout.sites_on_node = quda_num_sites_ext(quda_this_node, nullptr);
234 #else
235  // legacy API
236  layout.node_number = quda_node_number;
237  layout.node_index = quda_node_index;
238  layout.get_coords = quda_get_coords;
239  layout.num_sites = quda_num_sites;
240  layout.sites_on_node = quda_num_sites(quda_this_node);
241 #endif // QIO_HAS_EXTENDED_LAYOUT
242  layout.latsize = lattice_size;
243  layout.latdim = lattice_dim;
244  layout.volume = lattice_volume;
245  layout.this_node = quda_this_node;
246  layout.number_of_nodes = QMP_get_number_of_nodes();
247 }
248 
249 void read_gauge_field(const char *filename, void *gauge[], QudaPrecision precision, const int *X, int argc, char *argv[])
250 {
251  quda_this_node = QMP_get_node_number();
252 
253  set_layout(X);
254 
255  /* Open the test file for reading */
256  QIO_Reader *infile = open_test_input(filename, QIO_UNKNOWN, QIO_PARALLEL);
257  if (infile == NULL) { errorQuda("Open file failed\n"); }
258 
259  /* Read the su3 field record */
260  printfQuda("%s: reading su3 field\n",__func__); fflush(stdout);
261  int status = read_su3_field(infile, 4, gauge, precision);
262  if (status) { errorQuda("read_su3_field failed %d\n", status); }
263 
264  /* Close the file */
265  QIO_close_read(infile);
266  printfQuda("%s: Closed file for reading\n",__func__);
267 }
268 
269 // count is the number of vectors
270 // Ninternal is the size of the "inner struct" (24 for Wilson spinor)
271 int read_field(QIO_Reader *infile, int Ninternal, int count, void *field_in[], QudaPrecision cpu_prec,
272  QudaSiteSubset subset, QudaParity parity, int nSpin, int nColor)
273 {
274  int status = 0;
275  switch (Ninternal) {
276  case 6: status = read_field<6>(infile, count, field_in, cpu_prec, subset, parity, nSpin, nColor); break;
277  case 24: status = read_field<24>(infile, count, field_in, cpu_prec, subset, parity, nSpin, nColor); break;
278  case 96: status = read_field<96>(infile, count, field_in, cpu_prec, subset, parity, nSpin, nColor); break;
279  case 128: status = read_field<128>(infile, count, field_in, cpu_prec, subset, parity, nSpin, nColor); break;
280  case 256: status = read_field<256>(infile, count, field_in, cpu_prec, subset, parity, nSpin, nColor); break;
281  case 384: status = read_field<384>(infile, count, field_in, cpu_prec, subset, parity, nSpin, nColor); break;
282  default:
283  errorQuda("Undefined %d", Ninternal);
284  }
285  return status;
286 }
287 
288 void read_spinor_field(const char *filename, void *V[], QudaPrecision precision, const int *X, QudaSiteSubset subset,
289  QudaParity parity, int nColor, int nSpin, int Nvec, int argc, char *argv[])
290 {
291  quda_this_node = QMP_get_node_number();
292 
293  set_layout(X, subset);
294 
295  /* Open the test file for reading */
296  QIO_Reader *infile = open_test_input(filename, QIO_UNKNOWN, QIO_PARALLEL);
297  if (infile == NULL) { errorQuda("Open file failed\n"); }
298 
299  /* Read the spinor field record */
300  printfQuda("%s: reading %d vector fields\n", __func__, Nvec); fflush(stdout);
301  int status = read_field(infile, 2 * nSpin * nColor, Nvec, V, precision, subset, parity, nSpin, nColor);
302  if (status) { errorQuda("read_spinor_fields failed %d\n", status); }
303 
304  /* Close the file */
305  QIO_close_read(infile);
306  printfQuda("%s: Closed file for reading\n",__func__);
307 }
308 
309 template <int len>
310 int write_field(QIO_Writer *outfile, int count, void *field_out[], QudaPrecision file_prec, QudaPrecision cpu_prec,
311  QudaSiteSubset subset, QudaParity parity, int nSpin, int nColor, const char *type)
312 {
313  // Prepare a string.
314  std::string xml_record = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><quda";
315  switch (len) {
316  case 6: xml_record += "StaggeredColorSpinorField>"; break; // SU(3) staggered
317  case 18: xml_record += "GaugeFieldFile>"; break; // SU(3) gauge field
318  case 24: xml_record += "WilsonColorSpinorField>"; break; // SU(3) Wilson
319  case 96:
320  case 128:
321  case 256:
322  case 384: xml_record += "MGColorSpinorField>"; break; // Color spinor vector
323  default: errorQuda("Invalid element length for QIO writing."); break;
324  }
325  xml_record += "<version>BETA</version>";
326  xml_record += "<type>" + std::string(type) + "</type><info>";
327 
328  // if parity+even, it's a half-x-dim even only vector
329  // if parity+odd, it's a half-x-dim odd only vector
330  // if full+even, it's a full vector with only even sites filled, odd are zero
331  // if full+odd, it's a full vector with only odd sites filled, even are zero
332  // if full+full, it's a full vector with all sites filled (either a full ColorSpinorField or a GaugeField)
333 
334  if (subset == QUDA_PARITY_SITE_SUBSET) {
335  xml_record += "<subset>parity</subset>";
336  } else {
337  xml_record += "<subset>full</subset>";
338  }
339  if (parity == QUDA_EVEN_PARITY) {
340  xml_record += "<parity>even</parity>";
341  } else if (parity == QUDA_ODD_PARITY) {
342  xml_record += "<parity>odd</parity>";
343  } else {
344  xml_record += "<parity>full</parity>";
345  } // abuse/hack
346 
347  // A lot of this is redundant of the record info, but eh.
348  xml_record += "<nColor>" + std::to_string(nColor) + "</nColor>";
349  xml_record += "<nSpin>" + std::to_string(nSpin) + "</nSpin>";
350  xml_record += "</info></quda";
351  switch (len) {
352  case 6: xml_record += "StaggeredColorSpinorField>"; break; // SU(3) staggered
353  case 18: xml_record += "GaugeFieldFile>"; break; // SU(3) gauge field
354  case 24: xml_record += "WilsonColorSpinorField>"; break; // SU(3) Wilson
355  case 96:
356  case 128:
357  case 256:
358  case 384: xml_record += "MGColorSpinorField>"; break; // Color spinor vector
359  default: errorQuda("Invalid element length for QIO writing."); break;
360  }
361 
362  int status;
363 
364  // Create the record info for the field
365  if (file_prec != QUDA_DOUBLE_PRECISION && file_prec != QUDA_SINGLE_PRECISION)
366  errorQuda("Error, file_prec=%d not supported", file_prec);
367 
368  const char *precision = (file_prec == QUDA_DOUBLE_PRECISION) ? "D" : "F";
369 
370  // presently assumes 4-d
371  const int nDim = 4;
372  int lower[nDim] = {0, 0, 0, 0};
373  int upper[nDim] = {lattice_size[0], lattice_size[1], lattice_size[2], lattice_size[3]};
374 
375  QIO_RecordInfo *rec_info = QIO_create_record_info(QIO_FIELD, lower, upper, nDim, const_cast<char *>(type),
376  const_cast<char *>(precision), nColor, nSpin, file_prec * len, count);
377 
378  // Create the record XML for the field
379  QIO_String *xml_record_out = QIO_string_create();
380  QIO_string_set(xml_record_out, xml_record.c_str());
381 
382  /* Write the field record converting to desired file precision*/
383  size_t rec_size = file_prec*count*len;
385  if (file_prec == QUDA_DOUBLE_PRECISION) {
386  status = QIO_write(outfile, rec_info, xml_record_out, vget<double, double, len>, rec_size, QUDA_DOUBLE_PRECISION,
387  field_out);
388  } else {
389  status = QIO_write(outfile, rec_info, xml_record_out, vget<double, float, len>, rec_size, QUDA_SINGLE_PRECISION,
390  field_out);
391  }
392  } else {
393  if (file_prec == QUDA_DOUBLE_PRECISION) {
394  status = QIO_write(outfile, rec_info, xml_record_out, vget<float, double, len>, rec_size, QUDA_DOUBLE_PRECISION,
395  field_out);
396  } else {
397  status = QIO_write(outfile, rec_info, xml_record_out, vget<float, float, len>, rec_size, QUDA_SINGLE_PRECISION,
398  field_out);
399  }
400  }
401 
402  printfQuda("%s: QIO_write_record_data returns status %d\n", __func__, status);
403  QIO_destroy_record_info(rec_info);
404  QIO_string_destroy(xml_record_out);
405 
406  if (status != QIO_SUCCESS) return 1;
407  return 0;
408 }
409 
410 int write_su3_field(QIO_Writer *outfile, int count, void *field_out[],
411  QudaPrecision file_prec, QudaPrecision cpu_prec, const char* type)
412 {
413  return write_field<18>(outfile, count, field_out, file_prec, cpu_prec, QUDA_FULL_SITE_SUBSET, QUDA_INVALID_PARITY, 0,
414  3, type);
415 }
416 
417 void write_gauge_field(const char *filename, void *gauge[], QudaPrecision precision, const int *X, int argc, char *argv[])
418 {
419  quda_this_node = QMP_get_node_number();
420 
421  set_layout(X);
422 
423  QudaPrecision file_prec = precision;
424 
425  char type[128];
426  sprintf(type, "QUDA_%sNc%d_GaugeField", (file_prec == QUDA_DOUBLE_PRECISION) ? "D" : "F", 3);
427 
428  /* Open the test file for writing */
429  QIO_Writer *outfile = open_test_output(filename, QIO_SINGLEFILE, QIO_PARALLEL, QIO_ILDGNO);
430  if (outfile == NULL) { errorQuda("Open file failed\n"); }
431 
432  /* Write the gauge field record */
433  printfQuda("%s: writing the gauge field\n", __func__); fflush(stdout);
434  int status = write_su3_field(outfile, 4, gauge, precision, precision, type);
435  if (status) { errorQuda("write_gauge_field failed %d\n", status); }
436 
437  /* Close the file */
438  QIO_close_write(outfile);
439  printfQuda("%s: Closed file for writing\n", __func__);
440 }
441 
442 // count is the number of vectors
443 // Ninternal is the size of the "inner struct" (24 for Wilson spinor)
444 int write_field(QIO_Writer *outfile, int Ninternal, int count, void *field_out[], QudaPrecision file_prec,
445  QudaPrecision cpu_prec, QudaSiteSubset subset, QudaParity parity, int nSpin, int nColor, const char *type)
446 {
447  int status = 0;
448  switch (Ninternal) {
449  case 6:
450  status = write_field<6>(outfile, count, field_out, file_prec, cpu_prec, subset, parity, nSpin, nColor, type);
451  break;
452  case 24:
453  status = write_field<24>(outfile, count, field_out, file_prec, cpu_prec, subset, parity, nSpin, nColor, type);
454  break;
455  case 96:
456  status = write_field<96>(outfile, count, field_out, file_prec, cpu_prec, subset, parity, nSpin, nColor, type);
457  break;
458  case 128:
459  status = write_field<128>(outfile, count, field_out, file_prec, cpu_prec, subset, parity, nSpin, nColor, type);
460  break;
461  case 256:
462  status = write_field<256>(outfile, count, field_out, file_prec, cpu_prec, subset, parity, nSpin, nColor, type);
463  break;
464  case 384:
465  status = write_field<384>(outfile, count, field_out, file_prec, cpu_prec, subset, parity, nSpin, nColor, type);
466  break;
467  default:
468  errorQuda("Undefined %d", Ninternal);
469  }
470  return status;
471 }
472 
473 void write_spinor_field(const char *filename, void *V[], QudaPrecision precision, const int *X, QudaSiteSubset subset,
474  QudaParity parity, int nColor, int nSpin, int Nvec, int argc, char *argv[])
475 {
476  quda_this_node = QMP_get_node_number();
477 
478  set_layout(X, subset);
479 
480  QudaPrecision file_prec = precision;
481 
482  char type[128];
483  sprintf(type, "QUDA_%sNs%dNc%d_ColorSpinorField", (file_prec == QUDA_DOUBLE_PRECISION) ? "D" : "F", nSpin, nColor);
484 
485  /* Open the test file for reading */
486  QIO_Writer *outfile = open_test_output(filename, QIO_SINGLEFILE, QIO_PARALLEL, QIO_ILDGNO);
487  if (outfile == NULL) { errorQuda("Open file failed\n"); }
488 
489  /* Read the spinor field record */
490  printfQuda("%s: writing %d vector fields\n", __func__, Nvec); fflush(stdout);
491  int status
492  = write_field(outfile, 2 * nSpin * nColor, Nvec, V, precision, precision, subset, parity, nSpin, nColor, type);
493  if (status) { errorQuda("write_spinor_fields failed %d\n", status); }
494 
495  /* Close the file */
496  QIO_close_write(outfile);
497  printfQuda("%s: Closed file for writing\n",__func__);
498 }
int comm_dim(int dim)
QudaPrecision prec
int V
Definition: host_utils.cpp:37
QudaParity parity
Definition: covdev_test.cpp:40
const int nColor
Definition: covdev_test.cpp:44
enum QudaPrecision_s QudaPrecision
@ QUDA_FULL_SITE_SUBSET
Definition: enum_quda.h:333
@ QUDA_PARITY_SITE_SUBSET
Definition: enum_quda.h:332
@ QUDA_EVEN_PARITY
Definition: enum_quda.h:284
@ QUDA_ODD_PARITY
Definition: enum_quda.h:284
@ QUDA_INVALID_PARITY
Definition: enum_quda.h:284
enum QudaSiteSubset_s QudaSiteSubset
@ QUDA_DOUBLE_PRECISION
Definition: enum_quda.h:65
@ QUDA_SINGLE_PRECISION
Definition: enum_quda.h:64
enum QudaParity_s QudaParity
QudaPrecision & cpu_prec
Definition: host_utils.cpp:57
void quda_get_coords(int x[], int node, int index)
int quda_node_index(const int x[])
int quda_num_sites(int node)
int quda_setup_layout(int len[], int nd, int numnodes, int single_parity)
int quda_node_number(const int x[])
::std::string string
Definition: gtest-port.h:891
int read_su3_field(QIO_Reader *infile, int count, void *field_in[], QudaPrecision cpu_prec)
Definition: qio_field.cpp:199
QIO_Reader * open_test_input(const char *filename, int volfmt, int serpar)
Definition: qio_field.cpp:63
void set_layout(const int *X, QudaSiteSubset subset=QUDA_FULL_SITE_SUBSET)
Definition: qio_field.cpp:204
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision precision, const int *X, int argc, char *argv[])
Definition: qio_field.cpp:249
std::ostream & operator<<(std::ostream &out, const QIO_Layout &layout)
Definition: qio_field.cpp:14
void write_gauge_field(const char *filename, void *gauge[], QudaPrecision precision, const int *X, int argc, char *argv[])
Definition: qio_field.cpp:417
int quda_this_node
Definition: qio_field.cpp:12
int write_su3_field(QIO_Writer *outfile, int count, void *field_out[], QudaPrecision file_prec, QudaPrecision cpu_prec, const char *type)
Definition: qio_field.cpp:410
int read_field(QIO_Reader *infile, int count, void *field_in[], QudaPrecision cpu_prec, QudaSiteSubset subset, QudaParity parity, int nSpin, int nColor)
Definition: qio_field.cpp:126
void read_spinor_field(const char *filename, void *V[], QudaPrecision precision, const int *X, QudaSiteSubset subset, QudaParity parity, int nColor, int nSpin, int Nvec, int argc, char *argv[])
Definition: qio_field.cpp:288
void vget(char *s1, size_t index, int count, void *s2)
Definition: qio_field.cpp:50
void vput(char *s1, size_t index, int count, void *s2)
Definition: qio_field.cpp:34
int write_field(QIO_Writer *outfile, int count, void *field_out[], QudaPrecision file_prec, QudaPrecision cpu_prec, QudaSiteSubset subset, QudaParity parity, int nSpin, int nColor, const char *type)
Definition: qio_field.cpp:310
void write_spinor_field(const char *filename, void *V[], QudaPrecision precision, const int *X, QudaSiteSubset subset, QudaParity parity, int nColor, int nSpin, int Nvec, int argc, char *argv[])
Definition: qio_field.cpp:473
QIO_Writer * open_test_output(const char *filename, int volfmt, int serpar, int ildgstyle)
Definition: qio_field.cpp:89
Main header file for the QUDA library.
#define printfQuda(...)
Definition: util_quda.h:114
#define warningQuda(...)
Definition: util_quda.h:132
#define errorQuda(...)
Definition: util_quda.h:120