QDP++
qdp_iogauge.cc
Go to the documentation of this file.
1//
2// QDP data parallel interface
7
8#include "qdp.h"
9#include "qdp_iogauge.h"
10
11#include "time.h"
12
13#include <unistd.h>
14#include <string>
15using std::string;
16
17// QCDOC HACK. QCDOC Does not have gethostname
18// provided in qdp_util.cc
19#ifndef HAVE_GETHOSTNAME
20extern int gethostname(char *, size_t);
21#endif
22
23namespace QDP {
24
25
26// Anonymous namespace
27namespace
28{
29 // Float tolerance
30 const Double tol = 1.e-5; /* tolerance for floating point checks */
31
32 // Grrh, I do not want to expose the plaquette code.
33 void mesplq(Double& w_plaq, Double& link, const multi1d<LatticeColorMatrix>& u)
34 {
35 w_plaq = link = 0.0;
36
37 // Compute the average plaquettes
38 for(int mu=1; mu < Nd; ++mu)
39 {
40 for(int nu=0; nu < mu; ++nu)
41 {
42 /* tmp_0 = u(x+mu,nu)*u_dag(x+nu,mu) */
43 LatticeColorMatrix tmp_0 = shift(u[nu],FORWARD,mu) * adj(shift(u[mu],FORWARD,nu));
44
45 /* tmp_1 = tmp_0*u_dag(x,nu)=u(x+mu,nu)*u_dag(x+nu,mu)*u_dag(x,nu) */
46 LatticeColorMatrix tmp_1 = tmp_0 * adj(u[nu]);
47
48 /* tmp = sum(tr(u(x,mu)*tmp_1=u(x,mu)*u(x+mu,nu)*u_dag(x+nu,mu)*u_dag(x,nu))) */
49 Double tmp = sum(real(trace(u[mu]*tmp_1)));
50
51 w_plaq += tmp;
52 }
53 }
54
55 // NERSC normalization
56 w_plaq *= 2.0 / double(Layout::vol()*Nd*(Nd-1)*Nc);
57
58 // Compute the average link
59 for(int mu=0; mu < Nd; ++mu)
60 link += sum(real(trace(u[mu])));
61
62 link /= double(Layout::vol()*Nd*Nc);
63 }
64
65} // end anonymous namespace
66
67
68
70template<class T>
71std::ostream& operator<<(std::ostream& s, const multi1d<T>& d)
72{
73 s << d[0];
74 for(int i=1; i < d.size(); ++i)
75 s << " " << d[i];
76
77 return s;
78}
79
80
82{
83 mat_size = 2*Nc*(Nc-1);
84 float_size = 4; // 32 bits
86 boundary.resize(Nd);
87 boundary = 1; // periodic
89 ensemble_label = "NERSC archive";
90 creator = "QDP++";
91 {
92 const int namelen = 128;
93 char name[namelen];
94 gethostname(name, namelen);
95 name[namelen-1] = '\0';
96 creator_hardware = name;
97 }
98 checksum = 0;
99
100 time_t now = time(NULL);
101 {
102 char *tmp = ctime(&now);
103 int date_size = strlen(tmp);
104 char *datetime = new(std::nothrow) char[date_size+1];
105 if( datetime == 0x0 ) {
106 QDP_error_exit("Unable to allocate datetime in qdp_iogauge.cc\n");
107 }
108
109 strcpy(datetime,ctime(&now));
110
111 for(int i=0; i < date_size; ++i)
112 if ( datetime[i] == '\n' )
113 {
114 datetime[i] = '\0';
115 date_size = i;
116 break;
117 }
118
119 creation_date = datetime;
120 delete[] datetime;
121 }
123
124 {
125 std::ostringstream s;
126 s << "X" << now;
127 ensemble_id = s.str();
128 }
129
130 w_plaq = 0; // WARNING: bogus
131 link = 0; // WARNING: bogus
132}
133
134
136void read(XMLReader& xml, const std::string& path, ArchivGauge_t& header)
137{
138 XMLReader paramtop(xml, path);
139
140 read(paramtop, "mat_size", header.mat_size);
141 read(paramtop, "float_size", header.float_size);
142 read(paramtop, "nrow", header.nrow);
143 read(paramtop, "boundary", header.boundary);
144 read(paramtop, "w_plaq", header.w_plaq);
145 read(paramtop, "link", header.link);
146 read(paramtop, "ensemble_id", header.ensemble_id);
147 read(paramtop, "ensemble_label", header.ensemble_label);
148 read(paramtop, "creator", header.creator);
149 read(paramtop, "creator_hardware", header.creator_hardware);
150 read(paramtop, "creation_date", header.creation_date);
151 read(paramtop, "archive_date", header.archive_date);
152 read(paramtop, "sequence_number", header.sequence_number);
153
154 // read a hex as a string and then convert
155 {
156 std::string chk;
157 read(paramtop, "checksum", chk);
158 std::istringstream s(chk);
159 s >> header.checksum;
160 }
161}
162
163
165void write(XMLWriter& xml, const std::string& path, const ArchivGauge_t& header)
166{
167 push(xml, path);
168
169 write(xml, "mat_size", header.mat_size);
170 write(xml, "float_size", header.float_size);
171 write(xml, "nrow", header.nrow);
172 write(xml, "boundary", header.boundary);
173 write(xml, "w_plaq", header.w_plaq);
174 write(xml, "link", header.link);
175 write(xml, "ensemble_id", header.ensemble_id);
176 write(xml, "ensemble_label", header.ensemble_label);
177 write(xml, "creator", header.creator);
178 write(xml, "creator_hardware", header.creator_hardware);
179 write(xml, "creation_date", header.creation_date);
180 write(xml, "archive_date", header.archive_date);
181 write(xml, "sequence_number", header.sequence_number);
182
183 // write as a hex
184 {
185 std::ostringstream s;
186 s.setf(std::ios_base::hex, std::ios_base::basefield);
187 s << header.checksum;
188 write(xml, "checksum", s.str());
189 }
190
191 pop(xml);
192}
193
194
195//-----------------------------------------------------------------------
196// Read a QCD archive file header
198
211
212static void readArchivHeader(BinaryReader& cfg_in, ArchivGauge_t& header)
213{
214 if (Nd != 4)
215 {
216 QDPIO::cerr << "Expecting Nd == 4" << std::endl;
217 QDP_abort(1);
218 }
219
220 const size_t max_line_length = 128;
221
222 // The expected lattice size of the gauge field
223 header.nrow.resize(Nd);
224
225 /* For now, read and throw away the header */
226 std::string line;
227
228 QDPIO::cout << "Start of header" << std::endl;
229
230 cfg_in.read(line, max_line_length);
231 QDPIO::cout << line << std::endl;
232
233 if (line != std::string("BEGIN_HEADER"))
234 {
235 QDPIO::cerr << "Missing BEGIN_HEADER" << std::endl;
236 QDP_abort(1);
237 }
238
239 /* assume matrix size is 2*Nc*Nc (matrix is UNcompressed)
240 and change if we find out otherwise */
241 header.mat_size=2*Nc*Nc;
242
243 /* Begin loop on lines */
244 int lat_size_cnt = 0;
245
246 while (1)
247 {
248 cfg_in.read(line, max_line_length);
249 QDPIO::cout << line << std::endl;
250
251 if (line == std::string("END_HEADER")) break;
252
253 int itmp, dd;
254 std::string::size_type off;
255
256 // Snarf the first token
257 char tokenn[max_line_length];
258 if ( sscanf(line.c_str(), "%s", tokenn) != 1 )
259 {
260 QDPIO::cerr << __func__
261 << ": incorrectly parsed header line=XX" << line << "XX" << std::endl;
262 QDP_abort(1);
263 }
264 std::string token = tokenn;
265
266 // Scan for first non-space char after "="
267 off = line.find('=');
268 if ( off == std::string::npos )
269 {
270 QDPIO::cerr << __func__
271 << ": incorrectly parsed header line=XX" << line << "XX" << std::endl;
272 QDP_abort(1);
273 }
274 off = line.find_first_not_of(' ', off+1);
275 std::string value;
276 if ( off == std::string::npos )
277 {
278// QDPIO::cerr << __func__
279// << ": incorrectly parsed header line=XX" << line << "XX" << std::endl;
280// QDP_abort(1);
281 value = "";
282 }
283 else
284 {
285 value = line.substr(off, line.length()-off+1);
286// QDPIO::cout << "value = XX" << value << "XX" << std::endl;
287 }
288
289
290 // Scan for the datatype then scan for it
291 if ( token == std::string("DATATYPE") )
292 {
293 /* Check if it is uncompressed */
294 if ( value == std::string("4D_SU3_GAUGE_3x3") )
295 {
296 header.mat_size=18; /* Uncompressed matrix */
297 if (Nc != 3)
298 {
299 QDPIO::cerr << __func__ << ": expecting Nc == 3" << std::endl;
300 QDP_abort(1);
301 }
302 }
303 else if ( value == std::string("4D_SU3_GAUGE") )
304 {
305 header.mat_size=12; /* Compressed matrix */
306 if (Nc != 3)
307 {
308 QDPIO::cerr << __func__ << ": expecting Nc == 3" << std::endl;
309 QDP_abort(1);
310 }
311 }
312 else if ( value == std::string("4D_SU4_GAUGE") )
313 {
314 if (Nc != 4)
315 {
316 QDPIO::cerr << __func__ << ": expecting Nc == 4" << std::endl;
317 QDP_abort(1);
318 }
319 }
320 else
321 {
322 QDPIO::cerr << __func__
323 << ": unknown gauge type = XX" << value << "XX" << std::endl;
324 QDP_abort(1);
325 }
326 }
327
328
329 // Scan for the plaq
330 double dtmp;
331 if ( sscanf(line.c_str(), "PLAQUETTE = %lf", &dtmp) == 1 )
332 {
333 header.w_plaq = dtmp;
334 }
335
336 // Scan for the link
337 if ( sscanf(line.c_str(), "LINK_TRACE = %lf", &dtmp) == 1 )
338 {
339 header.link = dtmp;
340 }
341
342 // Scan for the checksum
343 unsigned long chk;
344 if ( sscanf(line.c_str(), "CHECKSUM = %lx", &chk) == 1 )
345 {
346 header.checksum = chk;
347 }
348
349 // Scan for the sequence number
350 if ( sscanf(line.c_str(), "SEQUENCE_NUMBER = %d", &itmp) == 1 )
351 {
352 header.sequence_number = itmp;
353 }
354
355 // Scan for the ensemble label
356 if ( token == std::string("ENSEMBLE_LABEL") )
357 {
358 header.ensemble_label = value;
359 }
360
361 // Scan for the ensemble id
362 if ( token == std::string("ENSEMBLE_ID") )
363 {
364 header.ensemble_id = value;
365 }
366
367 // Scan for the creator
368 if ( token == std::string("CREATOR") )
369 {
370 header.creator = value;
371 }
372
373 // Scan for the creator machine
374 if ( token == std::string("CREATOR_MACHINE") )
375 {
376 header.creator_hardware = value;
377 }
378
379 // Scan for the creator hardware
380 if ( token == std::string("CREATOR_HARDWARE") )
381 {
382 header.creator_hardware = value;
383 }
384
385 // Scan for the creation date
386 if ( token == std::string("CREATION_DATE") )
387 {
388 header.creation_date = value;
389 }
390
391 // Scan for the archive date
392 if ( token == std::string("ARCHIVE_DATE") )
393 {
394 header.archive_date = value;
395 }
396
397 // Find the lattice size of the gauge field
398 if ( sscanf(line.c_str(), "DIMENSION_%d = %d", &dd, &itmp) == 2 )
399 {
400 /* Found a lat size */
401 if (dd < 1 || dd > Nd)
402 {
403 QDPIO::cerr << __func__ << ": dimension number out of bounds" << std::endl;
404 QDP_abort(1);
405 }
406
407 header.nrow[dd-1] = itmp;
408 ++lat_size_cnt;
409 }
410
411 // Find the boundary conditions
412 if ( sscanf(line.c_str(), "BOUNDARY_%d = %d", &dd, &itmp) == 2 )
413 {
414 /* Found a lat size */
415 if (dd < 1 || dd > Nd)
416 {
417 QDPIO::cerr << __func__ << ": dimension number out of bounds" << std::endl;
418 QDP_abort(1);
419 }
420
421 header.boundary[dd-1] = itmp;
422 }
423
424 if( token == std::string("FLOATING_POINT") )
425 {
426 if( value == std::string("IEEE32BIG") || value == std::string("IEEE32") )
427 {
428 header.float_size=4;
429 }
430 else if( value == std::string("IEEE64BIG") )
431 {
432 header.float_size=8;
433 }
434 else
435 {
436 QDPIO::cerr << __func__
437 << ": unknown floating point type = XX" << value << "XX" << std::endl;
438 QDP_abort(1);
439 }
440 }
441 }
442
443 QDPIO::cout << "End of header" << std::endl;
444
445 // Sanity check
446 if (lat_size_cnt != Nd)
447 {
448 QDPIO::cerr << __func__ << ": did not find all the lattice sizes" << std::endl;
449 QDP_abort(1);
450 }
451
452 for(int dd=0; dd < Nd; ++dd)
453 if (header.nrow[dd] != Layout::lattSize()[dd])
454 {
455 QDPIO::cerr << __func__ << ": archive lattice size does not agree with current size" << std::endl;
456 QDP_abort(1);
457 }
458}
459
460
461//-----------------------------------------------------------------------
463// See the corresponding qdp_*_specific.cc files
465
484void readArchiv(BinaryReader& cfg_in, multi1d<LatticeColorMatrix>& u,
485 n_uint32_t& checksum, int mat_size, int float_size);
486
487
488
489// Read a QCD (NERSC) Archive format gauge field
490/*
491 * \ingroup io
492 *
493 * \param header structure holding config info ( Modify )
494 * \param u gauge configuration ( Modify )
495 * \param file path ( Read )
496 */
497void readArchiv(ArchivGauge_t& header, multi1d<LatticeColorMatrix>& u, const std::string& file)
498{
499 BinaryFileReader cfg_in(file);
500
501 readArchivHeader(cfg_in, header); // read header
502 n_uint32_t checksum;
503 // expects to be positioned at the beginning of the binary payload
504 readArchiv(cfg_in, u, checksum, header.mat_size, header.float_size);
505
506 if (checksum != header.checksum)
507 {
508 QDPIO::cerr << __func__ << ": checksum mismatch: new=" << checksum
509 << " header value= " << header.checksum << std::endl;
510 QDP_abort(1);
511 }
512
513 Double w_plaq, link;
514 mesplq(w_plaq, link, u);
515 if (toBool(fabs(header.w_plaq - w_plaq) > tol))
516 {
517 QDPIO::cerr << __func__ << ": plaquette out of bounds: new=" << w_plaq
518 << " header value= " << header.w_plaq << std::endl;
519 QDP_abort(1);
520 }
521
522 if (toBool(fabs(header.link - link) > tol))
523 {
524 QDPIO::cerr << __func__ << ": link out of bounds: new=" << link
525 << " header value= " << header.link << std::endl;
526 QDP_abort(1);
527 }
528
529 cfg_in.close();
530}
531
532
533//-----------------------------------------------------------------------
534// Read a Archive configuration file
535/*
536 * \ingroup io
537 *
538 * \param xml xml reader holding config info ( Modify )
539 * \param u gauge configuration ( Modify )
540 * \param cfg_file path ( Read )
541 */
542
543void readArchiv(XMLReader& xml, multi1d<LatticeColorMatrix>& u, const std::string& cfg_file)
544{
545 ArchivGauge_t header;
546
547 // Read the config and its binary header
548 readArchiv(header, u, cfg_file);
549
550 // Now, set up the XML header. Do this by first making a buffer
551 // writer that is then used to make the reader
552 XMLBufferWriter xml_buf;
553 write(xml_buf, "NERSC", header);
554
555 try
556 {
557 xml.open(xml_buf);
558 }
559 catch(const std::string& e)
560 {
561 QDPIO:: cerr << "Error in readArchiv: " << e << std::endl;
562 QDP_abort(1);
563 }
564}
565
566
567
568//-----------------------------------------------------------------------
569// Read a QCD (NERSC) Archive format gauge field
570/*
571 * \ingroup io
572 *
573 * \param u gauge configuration ( Modify )
574 * \param cfg_file path ( Read )
575 */
576void readArchiv(multi1d<LatticeColorMatrix>& u, const std::string& cfg_file)
577{
578 ArchivGauge_t header;
579 readArchiv(header, u, cfg_file); // throw away the header
580}
581
582
583
584
585//-----------------------------------------------------------------------
586// Write a QCD archive file
588
599static void writeArchivHeader(BinaryWriter& cfg_out, const ArchivGauge_t& header)
600{
601 if (Nd != 4)
602 {
603 QDPIO::cerr << "Expecting Nd == 4" << std::endl;
604 QDP_abort(1);
605 }
606
607 if (Nc != 3)
608 {
609 QDPIO::cerr << "Expecting Nc == 3" << std::endl;
610 QDP_abort(1);
611 }
612
613 std::ostringstream head;
614
615 head << "BEGIN_HEADER\n";
616
617 head << "CHECKSUM = ";
618 head.setf(std::ios_base::hex, std::ios_base::basefield);
619 head << header.checksum << std::endl;
620 head.setf(std::ios_base::dec, std::ios_base::basefield);
621 head << "LINK_TRACE = " << header.link << "\n"
622 << "PLAQUETTE = " << header.w_plaq << "\n";
623
624 head << "DATATYPE = 4D_SU3_GAUGE\n"
625 << "HDR_VERSION = 1.0\n"
626 << "STORAGE_FORMAT = 1.0\n";
627
628 for(int i=1; i <= Nd; ++i)
629 head << "DIMENSION_" << i << " = " << Layout::lattSize()[i-1] << "\n";
630
631 for(int i=0; i < Nd; ++i)
632 if (header.boundary[i] == 1)
633 head << "BOUNDARY_" << (i+1) << " = PERIODIC\n";
634 else if (header.boundary[i] == -1)
635 head << "BOUNDARY_" << (i+1) << " = ANTIPERIODIC\n";
636 else
637 {
638 QDPIO::cerr << "writeArchiv: unknown boundary type";
639 QDP_abort(1);
640 }
641
642 head << "ENSEMBLE_ID = " << header.ensemble_id << "\n"
643 << "ENSEMBLE_LABEL = " << header.ensemble_label << "\n"
644 << "SEQUENCE_NUMBER = " << header.sequence_number << "\n"
645 << "CREATOR = " << header.creator << "\n"
646 << "CREATOR_HARDWARE = " << header.creator_hardware << "\n"
647 << "CREATION_DATE = " << header.creation_date << "\n"
648 << "ARCHIVE_DATE = " << header.archive_date << "\n"
649 << "FLOATING_POINT = IEEE32BIG\n";
650
651 head << "END_HEADER\n";
652
653 cfg_out.writeArray(head.str().c_str(), 1, head.str().size());
654}
655
656
657// Write a QCD archive file
658// See the corresponding qdp_*_specific.cc files
659
661
676
677void writeArchiv(BinaryWriter& cfg_out, const multi1d<LatticeColorMatrix>& u,
678 int mat_size);
679
680
681//-----------------------------------------------------------------------
682// Write a QCD archive file
683// Write a QCD (NERSC) Archive format gauge field
684/*
685 * \ingroup io
686 *
687 * \param xml xml writer holding config info ( Modify )
688 * \param u gauge configuration ( Modify )
689 * \param file path ( Read )
690 */
691void writeArchiv(ArchivGauge_t& header, const multi1d<LatticeColorMatrix>& u, const std::string& file)
692{
693 Double w_plaq, link;
694 mesplq(w_plaq, link, u);
695 header.w_plaq = w_plaq;
696 header.link = link;
697 header.checksum = computeChecksum(u, header.mat_size);
698
699 BinaryFileWriter cfg_out(file);
700
701 writeArchivHeader(cfg_out, header); // write header
702 writeArchiv(cfg_out, u, header.mat_size); // continuing writing after header
703
704 cfg_out.close();
705}
706
707
708// Write a Archive configuration file
709/*
710 * \ingroup io
711 *
712 * \param xml xml writer holding config info ( Read )
713 * \param u gauge configuration ( Read )
714 * \param cfg_file path ( Read )
715 */
716
718 const std::string& cfg_file)
719{
720 ArchivGauge_t header;
721 Double w_plaq, link;
722 mesplq(w_plaq, link, u);
723 header.w_plaq = w_plaq;
724 header.link = link;
725 header.checksum = computeChecksum(u, header.mat_size);
726
727 XMLReader xml_in(xml); // use the buffer writer to instantiate a reader
728 read(xml_in, "/NERSC", header);
729
730 writeArchiv(header, u, cfg_file);
731}
732
733
734// Write a Archive configuration file
735/*
736 * \ingroup io
737 *
738 * \param u gauge configuration ( Read )
739 * \param cfg_file path ( Read )
740 */
741
743 const std::string& cfg_file)
744{
745 ArchivGauge_t header;
746 writeArchiv(header, u, cfg_file);
747}
748
749
750} // namespace QDP;
Binary file input class.
Definition qdp_io.h:952
void close()
Closes the last file opened.
Definition qdp_io.cc:981
Binary file output class.
Definition qdp_io.h:1441
void close()
Closes the last file opened.
Definition qdp_io.cc:1409
Binary input base class.
Definition qdp_io.h:372
virtual void read(std::string &result, size_t nbytes)
Read some max number of characters - 1 upto and excluding a newline.
Definition qdp_io.cc:630
Binary writer base class.
Definition qdp_io.h:1010
virtual void writeArray(const char *output, size_t nbytes, size_t nmemb)
Write data from the primary node.
Definition qdp_io.cc:1182
Writes XML metadata to a buffer.
Definition qdp_xmlio.h:1024
XML reader class.
Definition qdp_xmlio.h:44
void open(const std::string &filename)
Opens and reads an XML file.
Definition qdp_xmlio.cc:45
Metadata output class.
Definition qdp_xmlio.h:506
Container for a multi-dimensional 1D array.
Definition qdp_multi.h:25
int size() const
Size of array.
Definition qdp_multi.h:60
void resize(int ns1)
Resize routine, call a templated resize, using *this to disambiguate.
Definition qdp_multi.h:56
OLattice< PScalar< PColorMatrix< RComplex< REAL >, Nc > > > LatticeColorMatrix
OScalar< PScalar< PScalar< RScalar< DOUBLE > > > > Double
UnaryReturn< C, FnSum >::Type_t sum(const QDPType< T, C > &s1)
OScalar = sum(source).
void readArchiv(BinaryReader &cfg_in, multi1d< LatticeColorMatrix > &u, n_uint32_t &checksum, int mat_size, int float_size)
Read a NERSC Gauge Connection Archive file.
ArchivGauge_t()
Initializes a NERSC Archive header with default values.
TextWriter & operator<<(TextWriter &txt, const std::string &output)
Definition qdp_io.cc:283
static void writeArchivHeader(BinaryWriter &cfg_out, const ArchivGauge_t &header)
Write a QCD (NERSC) Archive format gauge field.
void write(BinaryWriter &bin, const std::string &output)
Definition qdp_io.cc:1204
static void readArchivHeader(BinaryReader &cfg_in, ArchivGauge_t &header)
Read a QCD (NERSC) Archive format gauge field header.
void writeArchiv(BinaryWriter &cfg_out, const multi1d< LatticeColorMatrix > &u, int mat_size)
Writes a NERSC Gauge Connection Archive gauge configuration file.
void read(BinaryReader &bin, std::string &input, size_t maxBytes)
Definition qdp_io.cc:778
bool toBool(const IScalar< T > &s)
QDP Boolean to bool primitive in conversion routine.
Definition qdp_inner.h:1639
ArrayBiDirectionalMap shift
Definition of shift function object.
Definition qdp_map.cc:14
const int Nc
Definition qdp_params.h:25
const int Nd
Definition qdp_params.h:24
int NumSpins< RScalar< T > >::value
Definition qdp_qdpio.h:172
const multi1d< int > & lattSize()
Virtual grid (problem grid) lattice size.
int vol()
Total lattice volume.
StandardOutputStream cout
Definition qdp_stdio.cc:21
StandardOutputStream cerr
Definition qdp_stdio.cc:22
Yet another random number generator.
MakeReturn< UnaryNode< FnAdjoint, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnAdjoint >::Type_t >::Expression_t adj(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4842
MakeReturn< UnaryNode< FnReal, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnReal >::Type_t >::Expression_t real(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4972
MakeReturn< UnaryNode< FnFabs, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnFabs >::Type_t >::Expression_t fabs(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5375
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
Definition qdp_util.cc:93
MakeReturn< UnaryNode< FnTrace, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnTrace >::Type_t >::Expression_t trace(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4907
void push(XMLWriter &xml, const std::string &s)
Push a group name.
Definition qdp_xmlio.cc:749
void pop(XMLWriter &xml)
Pop a group name.
Definition qdp_xmlio.cc:752
void QDP_abort(int status)
Panic button.
n_uint32_t computeChecksum(const multi1d< LatticeColorMatrix > &u, int mat_size)
Compute simple NERSC-like checksum of a gauge field.
Primary include file for QDP.
int gethostname(char *, size_t)
Definition qdp_util.cc:19
NERSC Gauge Connection Archive gauge support.
#define FORWARD
Definition qdp_map.h:15
NERSC Archive gauge field header.
Definition qdp_iogauge.h:25
multi1d< int > boundary
Definition qdp_iogauge.h:49
std::string ensemble_id
Definition qdp_iogauge.h:67
std::string ensemble_label
Definition qdp_iogauge.h:68
std::string creator
Definition qdp_iogauge.h:69
std::string creation_date
Definition qdp_iogauge.h:71
std::string creator_hardware
Definition qdp_iogauge.h:70
n_uint32_t checksum
Definition qdp_iogauge.h:65
std::string archive_date
Definition qdp_iogauge.h:72
multi1d< int > nrow
Definition qdp_iogauge.h:48