mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	Merge branch 'develop' of https://github.com/paboyle/Grid into develop
This commit is contained in:
		
							
								
								
									
										108
									
								
								benchmarks/Benchmark_IO.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								benchmarks/Benchmark_IO.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,108 @@
 | 
				
			|||||||
 | 
					#include <Grid/Grid.h>
 | 
				
			||||||
 | 
					#ifdef HAVE_LIME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					using namespace Grid;
 | 
				
			||||||
 | 
					using namespace Grid::QCD;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MSG cout << GridLogMessage
 | 
				
			||||||
 | 
					#define SEP \
 | 
				
			||||||
 | 
					"============================================================================="
 | 
				
			||||||
 | 
					#ifndef BENCH_IO_LMAX
 | 
				
			||||||
 | 
					#define BENCH_IO_LMAX 40
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef function<void(const string, LatticeFermion &)> WriterFn;
 | 
				
			||||||
 | 
					typedef function<void(LatticeFermion &, const string)> ReaderFn;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					string filestem(const int l)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return "iobench_l" + to_string(l);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void limeWrite(const string filestem, LatticeFermion &vec)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  emptyUserRecord record;
 | 
				
			||||||
 | 
					  ScidacWriter    binWriter(vec._grid->IsBoss());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  binWriter.open(filestem + ".bin");
 | 
				
			||||||
 | 
					  binWriter.writeScidacFieldRecord(vec, record);
 | 
				
			||||||
 | 
					  binWriter.close();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void limeRead(LatticeFermion &vec, const string filestem)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  emptyUserRecord record;
 | 
				
			||||||
 | 
					  ScidacReader    binReader;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  binReader.open(filestem + ".bin");
 | 
				
			||||||
 | 
					  binReader.readScidacFieldRecord(vec, record);
 | 
				
			||||||
 | 
					  binReader.close();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void writeBenchmark(const int l, const WriterFn &write)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  auto                      mpi  = GridDefaultMpi();
 | 
				
			||||||
 | 
					  auto                      simd = GridDefaultSimd(Nd, vComplex::Nsimd());
 | 
				
			||||||
 | 
					  vector<int>               latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]};
 | 
				
			||||||
 | 
					  unique_ptr<GridCartesian> gPt(SpaceTimeGrid::makeFourDimGrid(latt, simd, mpi));
 | 
				
			||||||
 | 
					  GridCartesian             *g = gPt.get();
 | 
				
			||||||
 | 
					  GridParallelRNG           rng(g);
 | 
				
			||||||
 | 
					  LatticeFermion            vec(g);
 | 
				
			||||||
 | 
					  emptyUserRecord           record;
 | 
				
			||||||
 | 
					  ScidacWriter              binWriter(g->IsBoss());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  cout << "-- Local volume " << l << "^4" << endl;
 | 
				
			||||||
 | 
					  random(rng, vec);
 | 
				
			||||||
 | 
					  write(filestem(l), vec);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void readBenchmark(const int l, const ReaderFn &read)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  auto                      mpi  = GridDefaultMpi();
 | 
				
			||||||
 | 
					  auto                      simd = GridDefaultSimd(Nd, vComplex::Nsimd());
 | 
				
			||||||
 | 
					  vector<int>               latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]};
 | 
				
			||||||
 | 
					  unique_ptr<GridCartesian> gPt(SpaceTimeGrid::makeFourDimGrid(latt, simd, mpi));
 | 
				
			||||||
 | 
					  GridCartesian             *g = gPt.get();
 | 
				
			||||||
 | 
					  LatticeFermion            vec(g);
 | 
				
			||||||
 | 
					  emptyUserRecord           record;
 | 
				
			||||||
 | 
					  ScidacReader              binReader;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  cout << "-- Local volume " << l << "^4" << endl;
 | 
				
			||||||
 | 
					  read(vec, filestem(l));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main (int argc, char ** argv)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  Grid_init(&argc,&argv);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  auto simd = GridDefaultSimd(Nd,vComplex::Nsimd());
 | 
				
			||||||
 | 
					  auto mpi  = GridDefaultMpi();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int64_t threads = GridThread::GetThreads();
 | 
				
			||||||
 | 
					  MSG << "Grid is setup to use " << threads << " threads" << endl;
 | 
				
			||||||
 | 
					  MSG << SEP << endl;
 | 
				
			||||||
 | 
					  MSG << "Benchmark Lime write" << endl;
 | 
				
			||||||
 | 
					  MSG << SEP << endl;
 | 
				
			||||||
 | 
					  for (int l = 4; l <= BENCH_IO_LMAX; l += 2)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    writeBenchmark(l, limeWrite);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  MSG << "Benchmark Lime read" << endl;
 | 
				
			||||||
 | 
					  MSG << SEP << endl;
 | 
				
			||||||
 | 
					  for (int l = 4; l <= BENCH_IO_LMAX; l += 2)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    readBenchmark(l, limeRead);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Grid_finalize();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return EXIT_SUCCESS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					int main (int argc, char ** argv)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return EXIT_SUCCESS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
@@ -372,7 +372,7 @@ class BinaryIO {
 | 
				
			|||||||
	std::cout << GridLogMessage <<"IOobject: C++ read I/O " << file << " : "
 | 
						std::cout << GridLogMessage <<"IOobject: C++ read I/O " << file << " : "
 | 
				
			||||||
                  << iodata.size() * sizeof(fobj) << " bytes" << std::endl;
 | 
					                  << iodata.size() * sizeof(fobj) << " bytes" << std::endl;
 | 
				
			||||||
        std::ifstream fin;
 | 
					        std::ifstream fin;
 | 
				
			||||||
        fin.open(file, std::ios::binary | std::ios::in);
 | 
						fin.open(file, std::ios::binary | std::ios::in);
 | 
				
			||||||
        if (control & BINARYIO_MASTER_APPEND)
 | 
					        if (control & BINARYIO_MASTER_APPEND)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          fin.seekg(-sizeof(fobj), fin.end);
 | 
					          fin.seekg(-sizeof(fobj), fin.end);
 | 
				
			||||||
@@ -453,11 +453,15 @@ class BinaryIO {
 | 
				
			|||||||
	std::ofstream fout; 
 | 
						std::ofstream fout; 
 | 
				
			||||||
	fout.exceptions ( std::fstream::failbit | std::fstream::badbit );
 | 
						fout.exceptions ( std::fstream::failbit | std::fstream::badbit );
 | 
				
			||||||
	try {
 | 
						try {
 | 
				
			||||||
	  fout.open(file,std::ios::binary|std::ios::out|std::ios::in);
 | 
						  if (offset) { // Must already exist and contain data
 | 
				
			||||||
 | 
						    fout.open(file,std::ios::binary|std::ios::out|std::ios::in);
 | 
				
			||||||
 | 
						  } else {     // Allow create
 | 
				
			||||||
 | 
						    fout.open(file,std::ios::binary|std::ios::out);
 | 
				
			||||||
 | 
						  }
 | 
				
			||||||
	} catch (const std::fstream::failure& exc) {
 | 
						} catch (const std::fstream::failure& exc) {
 | 
				
			||||||
	  std::cout << GridLogError << "Error in opening the file " << file << " for output" <<std::endl;
 | 
						  std::cout << GridLogError << "Error in opening the file " << file << " for output" <<std::endl;
 | 
				
			||||||
	  std::cout << GridLogError << "Exception description: " << exc.what() << std::endl;
 | 
						  std::cout << GridLogError << "Exception description: " << exc.what() << std::endl;
 | 
				
			||||||
	  std::cout << GridLogError << "Probable cause: wrong path, inaccessible location "<< std::endl;
 | 
						  //	  std::cout << GridLogError << "Probable cause: wrong path, inaccessible location "<< std::endl;
 | 
				
			||||||
#ifdef USE_MPI_IO
 | 
					#ifdef USE_MPI_IO
 | 
				
			||||||
	  MPI_Abort(MPI_COMM_WORLD,1);
 | 
						  MPI_Abort(MPI_COMM_WORLD,1);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -248,7 +248,6 @@ class GridLimeReader : public BinaryIO {
 | 
				
			|||||||
  template<class serialisable_object>
 | 
					  template<class serialisable_object>
 | 
				
			||||||
  void readLimeObject(serialisable_object &object,std::string object_name,std::string record_name)
 | 
					  void readLimeObject(serialisable_object &object,std::string object_name,std::string record_name)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    std::string xmlstring;
 | 
					 | 
				
			||||||
    // should this be a do while; can we miss a first record??
 | 
					    // should this be a do while; can we miss a first record??
 | 
				
			||||||
    while ( limeReaderNextRecord(LimeR) == LIME_SUCCESS ) { 
 | 
					    while ( limeReaderNextRecord(LimeR) == LIME_SUCCESS ) { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -262,7 +261,8 @@ class GridLimeReader : public BinaryIO {
 | 
				
			|||||||
	limeReaderReadData((void *)&xmlc[0], &nbytes, LimeR);    
 | 
						limeReaderReadData((void *)&xmlc[0], &nbytes, LimeR);    
 | 
				
			||||||
	//	std::cout << GridLogMessage<< " readLimeObject matches XML " << &xmlc[0] <<std::endl;
 | 
						//	std::cout << GridLogMessage<< " readLimeObject matches XML " << &xmlc[0] <<std::endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	XmlReader RD(&xmlc[0],"");
 | 
					  std::string xmlstring(&xmlc[0]);
 | 
				
			||||||
 | 
						XmlReader RD(xmlstring, true, "");
 | 
				
			||||||
	read(RD,object_name,object);
 | 
						read(RD,object_name,object);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -272,8 +272,10 @@ class GridLimeReader : public BinaryIO {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GridLimeWriter : public BinaryIO {
 | 
					class GridLimeWriter : public BinaryIO 
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   ///////////////////////////////////////////////////
 | 
					   ///////////////////////////////////////////////////
 | 
				
			||||||
   // FIXME: format for RNG? Now just binary out instead
 | 
					   // FIXME: format for RNG? Now just binary out instead
 | 
				
			||||||
   // FIXME: collective calls or not ?
 | 
					   // FIXME: collective calls or not ?
 | 
				
			||||||
@@ -282,17 +284,24 @@ class GridLimeWriter : public BinaryIO {
 | 
				
			|||||||
   FILE       *File;
 | 
					   FILE       *File;
 | 
				
			||||||
   LimeWriter *LimeW;
 | 
					   LimeWriter *LimeW;
 | 
				
			||||||
   std::string filename;
 | 
					   std::string filename;
 | 
				
			||||||
 | 
					   bool        boss_node;
 | 
				
			||||||
 | 
					   GridLimeWriter( bool isboss = true) {
 | 
				
			||||||
 | 
					     boss_node = isboss;
 | 
				
			||||||
 | 
					   }
 | 
				
			||||||
   void open(const std::string &_filename) { 
 | 
					   void open(const std::string &_filename) { 
 | 
				
			||||||
     filename= _filename;
 | 
					     filename= _filename;
 | 
				
			||||||
     File = fopen(filename.c_str(), "w");
 | 
					     if ( boss_node ) {
 | 
				
			||||||
     LimeW = limeCreateWriter(File); assert(LimeW != NULL );
 | 
					       File = fopen(filename.c_str(), "w");
 | 
				
			||||||
 | 
					       LimeW = limeCreateWriter(File); assert(LimeW != NULL );
 | 
				
			||||||
 | 
					     }
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
   /////////////////////////////////////////////
 | 
					   /////////////////////////////////////////////
 | 
				
			||||||
   // Close the file
 | 
					   // Close the file
 | 
				
			||||||
   /////////////////////////////////////////////
 | 
					   /////////////////////////////////////////////
 | 
				
			||||||
   void close(void) {
 | 
					   void close(void) {
 | 
				
			||||||
     fclose(File);
 | 
					     if ( boss_node ) {
 | 
				
			||||||
 | 
					       fclose(File);
 | 
				
			||||||
 | 
					     }
 | 
				
			||||||
     //  limeDestroyWriter(LimeW);
 | 
					     //  limeDestroyWriter(LimeW);
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
  ///////////////////////////////////////////////////////
 | 
					  ///////////////////////////////////////////////////////
 | 
				
			||||||
@@ -300,10 +309,12 @@ class GridLimeWriter : public BinaryIO {
 | 
				
			|||||||
  ///////////////////////////////////////////////////////
 | 
					  ///////////////////////////////////////////////////////
 | 
				
			||||||
  int createLimeRecordHeader(std::string message, int MB, int ME, size_t PayloadSize)
 | 
					  int createLimeRecordHeader(std::string message, int MB, int ME, size_t PayloadSize)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    LimeRecordHeader *h;
 | 
					    if ( boss_node ) {
 | 
				
			||||||
    h = limeCreateHeader(MB, ME, const_cast<char *>(message.c_str()), PayloadSize);
 | 
					      LimeRecordHeader *h;
 | 
				
			||||||
    assert(limeWriteRecordHeader(h, LimeW) >= 0);
 | 
					      h = limeCreateHeader(MB, ME, const_cast<char *>(message.c_str()), PayloadSize);
 | 
				
			||||||
    limeDestroyHeader(h);
 | 
					      assert(limeWriteRecordHeader(h, LimeW) >= 0);
 | 
				
			||||||
 | 
					      limeDestroyHeader(h);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    return LIME_SUCCESS;
 | 
					    return LIME_SUCCESS;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  ////////////////////////////////////////////
 | 
					  ////////////////////////////////////////////
 | 
				
			||||||
@@ -312,28 +323,31 @@ class GridLimeWriter : public BinaryIO {
 | 
				
			|||||||
  template<class serialisable_object>
 | 
					  template<class serialisable_object>
 | 
				
			||||||
  void writeLimeObject(int MB,int ME,serialisable_object &object,std::string object_name,std::string record_name)
 | 
					  void writeLimeObject(int MB,int ME,serialisable_object &object,std::string object_name,std::string record_name)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    std::string xmlstring;
 | 
					    if ( boss_node ) {
 | 
				
			||||||
    {
 | 
					      std::string xmlstring;
 | 
				
			||||||
      XmlWriter WR("","");
 | 
					      {
 | 
				
			||||||
      write(WR,object_name,object);
 | 
						XmlWriter WR("","");
 | 
				
			||||||
      xmlstring = WR.XmlString();
 | 
						write(WR,object_name,object);
 | 
				
			||||||
 | 
						xmlstring = WR.XmlString();
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      //    std::cout << "WriteLimeObject" << record_name <<std::endl;
 | 
				
			||||||
 | 
					      uint64_t nbytes = xmlstring.size();
 | 
				
			||||||
 | 
					      //    std::cout << " xmlstring "<< nbytes<< " " << xmlstring <<std::endl;
 | 
				
			||||||
 | 
					      int err;
 | 
				
			||||||
 | 
					      LimeRecordHeader *h = limeCreateHeader(MB, ME,const_cast<char *>(record_name.c_str()), nbytes); 
 | 
				
			||||||
 | 
					      assert(h!= NULL);
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					      err=limeWriteRecordHeader(h, LimeW);                    assert(err>=0);
 | 
				
			||||||
 | 
					      err=limeWriteRecordData(&xmlstring[0], &nbytes, LimeW); assert(err>=0);
 | 
				
			||||||
 | 
					      err=limeWriterCloseRecord(LimeW);                       assert(err>=0);
 | 
				
			||||||
 | 
					      limeDestroyHeader(h);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //    std::cout << "WriteLimeObject" << record_name <<std::endl;
 | 
					 | 
				
			||||||
    uint64_t nbytes = xmlstring.size();
 | 
					 | 
				
			||||||
    //    std::cout << " xmlstring "<< nbytes<< " " << xmlstring <<std::endl;
 | 
					 | 
				
			||||||
    int err;
 | 
					 | 
				
			||||||
    LimeRecordHeader *h = limeCreateHeader(MB, ME,const_cast<char *>(record_name.c_str()), nbytes); 
 | 
					 | 
				
			||||||
    assert(h!= NULL);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    err=limeWriteRecordHeader(h, LimeW);                    assert(err>=0);
 | 
					 | 
				
			||||||
    err=limeWriteRecordData(&xmlstring[0], &nbytes, LimeW); assert(err>=0);
 | 
					 | 
				
			||||||
    err=limeWriterCloseRecord(LimeW);                       assert(err>=0);
 | 
					 | 
				
			||||||
    limeDestroyHeader(h);
 | 
					 | 
				
			||||||
    //    std::cout << " File offset is now"<<ftello(File) << std::endl;
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  ////////////////////////////////////////////
 | 
					  ////////////////////////////////////////////////////
 | 
				
			||||||
  // Write a generic lattice field and csum
 | 
					  // Write a generic lattice field and csum
 | 
				
			||||||
  ////////////////////////////////////////////
 | 
					  // This routine is Collectively called by all nodes
 | 
				
			||||||
 | 
					  // in communicator used by the field._grid
 | 
				
			||||||
 | 
					  ////////////////////////////////////////////////////
 | 
				
			||||||
  template<class vobj>
 | 
					  template<class vobj>
 | 
				
			||||||
  void writeLimeLatticeBinaryObject(Lattice<vobj> &field,std::string record_name)
 | 
					  void writeLimeLatticeBinaryObject(Lattice<vobj> &field,std::string record_name)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
@@ -350,6 +364,9 @@ class GridLimeWriter : public BinaryIO {
 | 
				
			|||||||
    // iv) fseek on FILE * to end of this disjoint section.
 | 
					    // iv) fseek on FILE * to end of this disjoint section.
 | 
				
			||||||
    //  v) Continue writing scidac record.
 | 
					    //  v) Continue writing scidac record.
 | 
				
			||||||
    ////////////////////////////////////////////////////////////////////
 | 
					    ////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    GridBase *grid = field._grid;
 | 
				
			||||||
 | 
					    assert(boss_node == field._grid->IsBoss() );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ////////////////////////////////////////////
 | 
					    ////////////////////////////////////////////
 | 
				
			||||||
    // Create record header
 | 
					    // Create record header
 | 
				
			||||||
@@ -357,19 +374,28 @@ class GridLimeWriter : public BinaryIO {
 | 
				
			|||||||
    typedef typename vobj::scalar_object sobj;
 | 
					    typedef typename vobj::scalar_object sobj;
 | 
				
			||||||
    int err;
 | 
					    int err;
 | 
				
			||||||
    uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
					    uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
				
			||||||
    uint64_t PayloadSize = sizeof(sobj) * field._grid->_gsites;
 | 
					    uint64_t PayloadSize = sizeof(sobj) * grid->_gsites;
 | 
				
			||||||
    createLimeRecordHeader(record_name, 0, 0, PayloadSize);
 | 
					    if ( boss_node ) {
 | 
				
			||||||
 | 
					      createLimeRecordHeader(record_name, 0, 0, PayloadSize);
 | 
				
			||||||
 | 
					      fflush(File);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    //    std::cout << "W sizeof(sobj)"      <<sizeof(sobj)<<std::endl;
 | 
					    //    std::cout << "W sizeof(sobj)"      <<sizeof(sobj)<<std::endl;
 | 
				
			||||||
    //    std::cout << "W Gsites "           <<field._grid->_gsites<<std::endl;
 | 
					    //    std::cout << "W Gsites "           <<field._grid->_gsites<<std::endl;
 | 
				
			||||||
    //    std::cout << "W Payload expected " <<PayloadSize<<std::endl;
 | 
					    //    std::cout << "W Payload expected " <<PayloadSize<<std::endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fflush(File);
 | 
					    ////////////////////////////////////////////////
 | 
				
			||||||
 | 
					    // Check all nodes agree on file position
 | 
				
			||||||
 | 
					    ////////////////////////////////////////////////
 | 
				
			||||||
 | 
					    uint64_t offset1;
 | 
				
			||||||
 | 
					    if ( boss_node ) {
 | 
				
			||||||
 | 
					      offset1 = ftello(File);    
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    grid->Broadcast(0,(void *)&offset1,sizeof(offset1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ///////////////////////////////////////////
 | 
					    ///////////////////////////////////////////
 | 
				
			||||||
    // Write by other means into the binary record
 | 
					    // The above is collective. Write by other means into the binary record
 | 
				
			||||||
    ///////////////////////////////////////////
 | 
					    ///////////////////////////////////////////
 | 
				
			||||||
    uint64_t offset1 = ftello(File);    //    std::cout << " Writing to offset "<<offset1 << std::endl;
 | 
					 | 
				
			||||||
    std::string format = getFormatString<vobj>();
 | 
					    std::string format = getFormatString<vobj>();
 | 
				
			||||||
    BinarySimpleMunger<sobj,sobj> munge;
 | 
					    BinarySimpleMunger<sobj,sobj> munge;
 | 
				
			||||||
    BinaryIO::writeLatticeObject<vobj,sobj>(field, filename, munge, offset1, format,nersc_csum,scidac_csuma,scidac_csumb);
 | 
					    BinaryIO::writeLatticeObject<vobj,sobj>(field, filename, munge, offset1, format,nersc_csum,scidac_csuma,scidac_csumb);
 | 
				
			||||||
@@ -377,13 +403,19 @@ class GridLimeWriter : public BinaryIO {
 | 
				
			|||||||
    ///////////////////////////////////////////
 | 
					    ///////////////////////////////////////////
 | 
				
			||||||
    // Wind forward and close the record
 | 
					    // Wind forward and close the record
 | 
				
			||||||
    ///////////////////////////////////////////
 | 
					    ///////////////////////////////////////////
 | 
				
			||||||
    fseek(File,0,SEEK_END);             
 | 
					    if ( boss_node ) {
 | 
				
			||||||
    uint64_t offset2 = ftello(File);     //    std::cout << " now at offset "<<offset2 << std::endl;
 | 
					      fseek(File,0,SEEK_END);             
 | 
				
			||||||
 | 
					      uint64_t offset2 = ftello(File);     //    std::cout << " now at offset "<<offset2 << std::endl;
 | 
				
			||||||
 | 
					      assert( (offset2-offset1) == PayloadSize);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert((offset2-offset1) == PayloadSize);
 | 
					    /////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					    // Check MPI-2 I/O did what we expect to file
 | 
				
			||||||
    err=limeWriterCloseRecord(LimeW);  assert(err>=0);
 | 
					    /////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ( boss_node ) { 
 | 
				
			||||||
 | 
					      err=limeWriterCloseRecord(LimeW);  assert(err>=0);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    ////////////////////////////////////////
 | 
					    ////////////////////////////////////////
 | 
				
			||||||
    // Write checksum element, propagaing forward from the BinaryIO
 | 
					    // Write checksum element, propagaing forward from the BinaryIO
 | 
				
			||||||
    // Always pair a checksum with a binary object, and close message
 | 
					    // Always pair a checksum with a binary object, and close message
 | 
				
			||||||
@@ -393,21 +425,26 @@ class GridLimeWriter : public BinaryIO {
 | 
				
			|||||||
    std::stringstream streamb; streamb << std::hex << scidac_csumb;
 | 
					    std::stringstream streamb; streamb << std::hex << scidac_csumb;
 | 
				
			||||||
    checksum.suma= streama.str();
 | 
					    checksum.suma= streama.str();
 | 
				
			||||||
    checksum.sumb= streamb.str();
 | 
					    checksum.sumb= streamb.str();
 | 
				
			||||||
    //    std::cout << GridLogMessage<<" writing scidac checksums "<<std::hex<<scidac_csuma<<"/"<<scidac_csumb<<std::dec<<std::endl;
 | 
					    if ( boss_node ) { 
 | 
				
			||||||
    writeLimeObject(0,1,checksum,std::string("scidacChecksum"),std::string(SCIDAC_CHECKSUM));
 | 
					      writeLimeObject(0,1,checksum,std::string("scidacChecksum"),std::string(SCIDAC_CHECKSUM));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ScidacWriter : public GridLimeWriter {
 | 
					class ScidacWriter : public GridLimeWriter {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   template<class SerialisableUserFile>
 | 
					  ScidacWriter(bool isboss =true ) : GridLimeWriter(isboss)  { };
 | 
				
			||||||
   void writeScidacFileRecord(GridBase *grid,SerialisableUserFile &_userFile)
 | 
					
 | 
				
			||||||
   {
 | 
					  template<class SerialisableUserFile>
 | 
				
			||||||
     scidacFile    _scidacFile(grid);
 | 
					  void writeScidacFileRecord(GridBase *grid,SerialisableUserFile &_userFile)
 | 
				
			||||||
     writeLimeObject(1,0,_scidacFile,_scidacFile.SerialisableClassName(),std::string(SCIDAC_PRIVATE_FILE_XML));
 | 
					  {
 | 
				
			||||||
     writeLimeObject(0,1,_userFile,_userFile.SerialisableClassName(),std::string(SCIDAC_FILE_XML));
 | 
					    scidacFile    _scidacFile(grid);
 | 
				
			||||||
   }
 | 
					    if ( this->boss_node ) {
 | 
				
			||||||
 | 
					      writeLimeObject(1,0,_scidacFile,_scidacFile.SerialisableClassName(),std::string(SCIDAC_PRIVATE_FILE_XML));
 | 
				
			||||||
 | 
					      writeLimeObject(0,1,_userFile,_userFile.SerialisableClassName(),std::string(SCIDAC_FILE_XML));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  ////////////////////////////////////////////////
 | 
					  ////////////////////////////////////////////////
 | 
				
			||||||
  // Write generic lattice field in scidac format
 | 
					  // Write generic lattice field in scidac format
 | 
				
			||||||
  ////////////////////////////////////////////////
 | 
					  ////////////////////////////////////////////////
 | 
				
			||||||
@@ -428,9 +465,12 @@ class ScidacWriter : public GridLimeWriter {
 | 
				
			|||||||
    //////////////////////////////////////////////
 | 
					    //////////////////////////////////////////////
 | 
				
			||||||
    // Fill the Lime file record by record
 | 
					    // Fill the Lime file record by record
 | 
				
			||||||
    //////////////////////////////////////////////
 | 
					    //////////////////////////////////////////////
 | 
				
			||||||
    writeLimeObject(1,0,header ,std::string("FieldMetaData"),std::string(GRID_FORMAT)); // Open message 
 | 
					    if ( this->boss_node ) {
 | 
				
			||||||
    writeLimeObject(0,0,_userRecord,_userRecord.SerialisableClassName(),std::string(SCIDAC_RECORD_XML));
 | 
					      writeLimeObject(1,0,header ,std::string("FieldMetaData"),std::string(GRID_FORMAT)); // Open message 
 | 
				
			||||||
    writeLimeObject(0,0,_scidacRecord,_scidacRecord.SerialisableClassName(),std::string(SCIDAC_PRIVATE_RECORD_XML));
 | 
					      writeLimeObject(0,0,_userRecord,_userRecord.SerialisableClassName(),std::string(SCIDAC_RECORD_XML));
 | 
				
			||||||
 | 
					      writeLimeObject(0,0,_scidacRecord,_scidacRecord.SerialisableClassName(),std::string(SCIDAC_PRIVATE_RECORD_XML));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    // Collective call
 | 
				
			||||||
    writeLimeLatticeBinaryObject(field,std::string(ILDG_BINARY_DATA));      // Closes message with checksum
 | 
					    writeLimeLatticeBinaryObject(field,std::string(ILDG_BINARY_DATA));      // Closes message with checksum
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
@@ -497,6 +537,8 @@ class ScidacReader : public GridLimeReader {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class IldgWriter : public ScidacWriter {
 | 
					class IldgWriter : public ScidacWriter {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  IldgWriter(bool isboss) : ScidacWriter(isboss) {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ///////////////////////////////////
 | 
					  ///////////////////////////////////
 | 
				
			||||||
  // A little helper
 | 
					  // A little helper
 | 
				
			||||||
@@ -656,9 +698,11 @@ class IldgReader : public GridLimeReader {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	//////////////////////////////////
 | 
						//////////////////////////////////
 | 
				
			||||||
	// ILDG format record
 | 
						// ILDG format record
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  std::string xmlstring(&xmlc[0]);
 | 
				
			||||||
	if ( !strncmp(limeReaderType(LimeR), ILDG_FORMAT,strlen(ILDG_FORMAT)) ) { 
 | 
						if ( !strncmp(limeReaderType(LimeR), ILDG_FORMAT,strlen(ILDG_FORMAT)) ) { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  XmlReader RD(&xmlc[0],"");
 | 
						  XmlReader RD(xmlstring, true, "");
 | 
				
			||||||
	  read(RD,"ildgFormat",ildgFormat_);
 | 
						  read(RD,"ildgFormat",ildgFormat_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  if ( ildgFormat_.precision == 64 ) format = std::string("IEEE64BIG");
 | 
						  if ( ildgFormat_.precision == 64 ) format = std::string("IEEE64BIG");
 | 
				
			||||||
@@ -673,13 +717,13 @@ class IldgReader : public GridLimeReader {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ( !strncmp(limeReaderType(LimeR), ILDG_DATA_LFN,strlen(ILDG_DATA_LFN)) ) {
 | 
						if ( !strncmp(limeReaderType(LimeR), ILDG_DATA_LFN,strlen(ILDG_DATA_LFN)) ) {
 | 
				
			||||||
	  FieldMetaData_.ildg_lfn = std::string(&xmlc[0]);
 | 
						  FieldMetaData_.ildg_lfn = xmlstring;
 | 
				
			||||||
	  found_ildgLFN = 1;
 | 
						  found_ildgLFN = 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ( !strncmp(limeReaderType(LimeR), GRID_FORMAT,strlen(ILDG_FORMAT)) ) { 
 | 
						if ( !strncmp(limeReaderType(LimeR), GRID_FORMAT,strlen(ILDG_FORMAT)) ) { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  XmlReader RD(&xmlc[0],"");
 | 
						  XmlReader RD(xmlstring, true, "");
 | 
				
			||||||
	  read(RD,"FieldMetaData",FieldMetaData_);
 | 
						  read(RD,"FieldMetaData",FieldMetaData_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  format = FieldMetaData_.floating_point;
 | 
						  format = FieldMetaData_.floating_point;
 | 
				
			||||||
@@ -693,18 +737,17 @@ class IldgReader : public GridLimeReader {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ( !strncmp(limeReaderType(LimeR), SCIDAC_RECORD_XML,strlen(SCIDAC_RECORD_XML)) ) { 
 | 
						if ( !strncmp(limeReaderType(LimeR), SCIDAC_RECORD_XML,strlen(SCIDAC_RECORD_XML)) ) { 
 | 
				
			||||||
	  std::string xmls(&xmlc[0]);
 | 
					 | 
				
			||||||
	  // is it a USQCD info field
 | 
						  // is it a USQCD info field
 | 
				
			||||||
	  if ( xmls.find(std::string("usqcdInfo")) != std::string::npos ) { 
 | 
						  if ( xmlstring.find(std::string("usqcdInfo")) != std::string::npos ) { 
 | 
				
			||||||
	    //	    std::cout << GridLogMessage<<"...found a usqcdInfo field"<<std::endl;
 | 
						    //	    std::cout << GridLogMessage<<"...found a usqcdInfo field"<<std::endl;
 | 
				
			||||||
	    XmlReader RD(&xmlc[0],"");
 | 
						    XmlReader RD(xmlstring, true, "");
 | 
				
			||||||
	    read(RD,"usqcdInfo",usqcdInfo_);
 | 
						    read(RD,"usqcdInfo",usqcdInfo_);
 | 
				
			||||||
	    found_usqcdInfo = 1;
 | 
						    found_usqcdInfo = 1;
 | 
				
			||||||
	  }
 | 
						  }
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ( !strncmp(limeReaderType(LimeR), SCIDAC_CHECKSUM,strlen(SCIDAC_CHECKSUM)) ) { 
 | 
						if ( !strncmp(limeReaderType(LimeR), SCIDAC_CHECKSUM,strlen(SCIDAC_CHECKSUM)) ) { 
 | 
				
			||||||
	  XmlReader RD(&xmlc[0],"");
 | 
						  XmlReader RD(xmlstring, true, "");
 | 
				
			||||||
	  read(RD,"scidacChecksum",scidacChecksum_);
 | 
						  read(RD,"scidacChecksum",scidacChecksum_);
 | 
				
			||||||
	  found_scidacChecksum = 1;
 | 
						  found_scidacChecksum = 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -136,8 +136,9 @@ struct scidacRecord : Serializable {
 | 
				
			|||||||
				  int, typesize,
 | 
									  int, typesize,
 | 
				
			||||||
				  int, datacount);
 | 
									  int, datacount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scidacRecord() { version =1.0; }
 | 
					  scidacRecord()
 | 
				
			||||||
 | 
					  : version(1.0), recordtype(0), colors(0), spins(0), typesize(0), datacount(0)
 | 
				
			||||||
 | 
					  {}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
////////////////////////
 | 
					////////////////////////
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -81,18 +81,16 @@ namespace Grid {
 | 
				
			|||||||
				      std::string, creation_date,
 | 
									      std::string, creation_date,
 | 
				
			||||||
				      std::string, archive_date,
 | 
									      std::string, archive_date,
 | 
				
			||||||
				      std::string, floating_point);
 | 
									      std::string, floating_point);
 | 
				
			||||||
      FieldMetaData(void) { 
 | 
					      // WARNING: non-initialised values might lead to twisted parallel IO
 | 
				
			||||||
	nd=4;
 | 
					      // issues, std::string are fine because they initliase to size 0
 | 
				
			||||||
	dimension.resize(4);
 | 
					      // as per C++ standard.
 | 
				
			||||||
	boundary.resize(4);
 | 
					      FieldMetaData(void) 
 | 
				
			||||||
	scidac_checksuma=0;
 | 
					      : nd(4), dimension(4,0), boundary(4, ""), data_start(0),
 | 
				
			||||||
	scidac_checksumb=0;
 | 
					      link_trace(0.), plaquette(0.), checksum(0),
 | 
				
			||||||
	checksum=0;
 | 
					      scidac_checksuma(0), scidac_checksumb(0), sequence_number(0)
 | 
				
			||||||
      }
 | 
					      {}
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  namespace QCD {
 | 
					  namespace QCD {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    using namespace Grid;
 | 
					    using namespace Grid;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -237,20 +237,24 @@ namespace Grid {
 | 
				
			|||||||
	MachineCharacteristics(header);
 | 
						MachineCharacteristics(header);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint64_t offset;
 | 
						uint64_t offset;
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
	truncate(file);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Sod it -- always write 3x3 double
 | 
						// Sod it -- always write 3x3 double
 | 
				
			||||||
	header.floating_point = std::string("IEEE64BIG");
 | 
						header.floating_point = std::string("IEEE64BIG");
 | 
				
			||||||
	header.data_type      = std::string("4D_SU3_GAUGE_3x3");
 | 
						header.data_type      = std::string("4D_SU3_GAUGE_3x3");
 | 
				
			||||||
	GaugeSimpleUnmunger<fobj3D,sobj> munge;
 | 
						GaugeSimpleUnmunger<fobj3D,sobj> munge;
 | 
				
			||||||
	offset = writeHeader(header,file);
 | 
						if ( grid->IsBoss() ) { 
 | 
				
			||||||
 | 
						  truncate(file);
 | 
				
			||||||
 | 
						  offset = writeHeader(header,file);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						grid->Broadcast(0,(void *)&offset,sizeof(offset));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
						uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
				
			||||||
	BinaryIO::writeLatticeObject<vobj,fobj3D>(Umu,file,munge,offset,header.floating_point,
 | 
						BinaryIO::writeLatticeObject<vobj,fobj3D>(Umu,file,munge,offset,header.floating_point,
 | 
				
			||||||
								  nersc_csum,scidac_csuma,scidac_csumb);
 | 
													  nersc_csum,scidac_csuma,scidac_csumb);
 | 
				
			||||||
	header.checksum = nersc_csum;
 | 
						header.checksum = nersc_csum;
 | 
				
			||||||
	writeHeader(header,file);
 | 
						if ( grid->IsBoss() ) { 
 | 
				
			||||||
 | 
						  writeHeader(header,file);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	std::cout<<GridLogMessage <<"Written NERSC Configuration on "<< file << " checksum "
 | 
						std::cout<<GridLogMessage <<"Written NERSC Configuration on "<< file << " checksum "
 | 
				
			||||||
		 <<std::hex<<header.checksum
 | 
							 <<std::hex<<header.checksum
 | 
				
			||||||
@@ -293,12 +297,18 @@ namespace Grid {
 | 
				
			|||||||
	header.data_type      = std::string("SITMO");
 | 
						header.data_type      = std::string("SITMO");
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	truncate(file);
 | 
						if ( grid->IsBoss() ) { 
 | 
				
			||||||
	offset = writeHeader(header,file);
 | 
						  truncate(file);
 | 
				
			||||||
 | 
						  offset = writeHeader(header,file);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						grid->Broadcast(0,(void *)&offset,sizeof(offset));
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
						uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
				
			||||||
	BinaryIO::writeRNG(serial,parallel,file,offset,nersc_csum,scidac_csuma,scidac_csumb);
 | 
						BinaryIO::writeRNG(serial,parallel,file,offset,nersc_csum,scidac_csuma,scidac_csumb);
 | 
				
			||||||
	header.checksum = nersc_csum;
 | 
						header.checksum = nersc_csum;
 | 
				
			||||||
	offset = writeHeader(header,file);
 | 
						if ( grid->IsBoss() ) { 
 | 
				
			||||||
 | 
						  offset = writeHeader(header,file);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	std::cout<<GridLogMessage 
 | 
						std::cout<<GridLogMessage 
 | 
				
			||||||
		 <<"Written NERSC RNG STATE "<<file<< " checksum "
 | 
							 <<"Written NERSC RNG STATE "<<file<< " checksum "
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,44 +0,0 @@
 | 
				
			|||||||
pugixml [](https://travis-ci.org/zeux/pugixml) [](https://ci.appveyor.com/project/zeux/pugixml)
 | 
					 | 
				
			||||||
=======
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pugixml is a C++ XML processing library, which consists of a DOM-like interface with rich traversal/modification
 | 
					 | 
				
			||||||
capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer, and an XPath 1.0
 | 
					 | 
				
			||||||
implementation for complex data-driven tree queries. Full Unicode support is also available, with Unicode interface
 | 
					 | 
				
			||||||
variants and conversions between different Unicode encodings (which happen automatically during parsing/saving).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pugixml is used by a lot of projects, both open-source and proprietary, for performance and easy-to-use interface.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Documentation
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Documentation for the current release of pugixml is available on-line as two separate documents:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* [Quick-start guide](http://pugixml.org/docs/quickstart.html), that aims to provide enough information to start using the library;
 | 
					 | 
				
			||||||
* [Complete reference manual](http://pugixml.org/docs/manual.html), that describes all features of the library in detail.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
You’re advised to start with the quick-start guide; however, many important library features are either not described in it at all or only mentioned briefly; if you require more information you should read the complete manual.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## License
 | 
					 | 
				
			||||||
This library is available to anybody free of charge, under the terms of MIT License:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Copyright (c) 2006-2015 Arseny Kapoulkine
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Permission is hereby granted, free of charge, to any person
 | 
					 | 
				
			||||||
obtaining a copy of this software and associated documentation
 | 
					 | 
				
			||||||
files (the "Software"), to deal in the Software without
 | 
					 | 
				
			||||||
restriction, including without limitation the rights to use,
 | 
					 | 
				
			||||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
					 | 
				
			||||||
copies of the Software, and to permit persons to whom the
 | 
					 | 
				
			||||||
Software is furnished to do so, subject to the following
 | 
					 | 
				
			||||||
conditions:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The above copyright notice and this permission notice shall be
 | 
					 | 
				
			||||||
included in all copies or substantial portions of the Software.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
					 | 
				
			||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 | 
					 | 
				
			||||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
					 | 
				
			||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 | 
					 | 
				
			||||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 | 
					 | 
				
			||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 | 
					 | 
				
			||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 | 
					 | 
				
			||||||
OTHER DEALINGS IN THE SOFTWARE.
 | 
					 | 
				
			||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * pugixml parser - version 1.6
 | 
					 * pugixml parser - version 1.9
 | 
				
			||||||
 * --------------------------------------------------------
 | 
					 * --------------------------------------------------------
 | 
				
			||||||
 * Copyright (C) 2006-2015, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
 | 
					 * Copyright (C) 2006-2018, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
 | 
				
			||||||
 * Report bugs and download new versions at http://pugixml.org/
 | 
					 * Report bugs and download new versions at http://pugixml.org/
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This library is distributed under the MIT License. See notice at the end
 | 
					 * This library is distributed under the MIT License. See notice at the end
 | 
				
			||||||
@@ -17,6 +17,9 @@
 | 
				
			|||||||
// Uncomment this to enable wchar_t mode
 | 
					// Uncomment this to enable wchar_t mode
 | 
				
			||||||
// #define PUGIXML_WCHAR_MODE
 | 
					// #define PUGIXML_WCHAR_MODE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Uncomment this to enable compact mode
 | 
				
			||||||
 | 
					// #define PUGIXML_COMPACT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Uncomment this to disable XPath
 | 
					// Uncomment this to disable XPath
 | 
				
			||||||
// #define PUGIXML_NO_XPATH
 | 
					// #define PUGIXML_NO_XPATH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -46,7 +49,7 @@
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Copyright (c) 2006-2015 Arseny Kapoulkine
 | 
					 * Copyright (c) 2006-2018 Arseny Kapoulkine
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Permission is hereby granted, free of charge, to any person
 | 
					 * Permission is hereby granted, free of charge, to any person
 | 
				
			||||||
 * obtaining a copy of this software and associated documentation
 | 
					 * obtaining a copy of this software and associated documentation
 | 
				
			||||||
@@ -59,7 +62,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * The above copyright notice and this permission notice shall be
 | 
					 * The above copyright notice and this permission notice shall be
 | 
				
			||||||
 * included in all copies or substantial portions of the Software.
 | 
					 * included in all copies or substantial portions of the Software.
 | 
				
			||||||
 * 
 | 
					 *
 | 
				
			||||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
					 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
				
			||||||
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 | 
					 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 | 
				
			||||||
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
					 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,7 +1,7 @@
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * pugixml parser - version 1.6
 | 
					 * pugixml parser - version 1.9
 | 
				
			||||||
 * --------------------------------------------------------
 | 
					 * --------------------------------------------------------
 | 
				
			||||||
 * Copyright (C) 2006-2015, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
 | 
					 * Copyright (C) 2006-2018, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
 | 
				
			||||||
 * Report bugs and download new versions at http://pugixml.org/
 | 
					 * Report bugs and download new versions at http://pugixml.org/
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This library is distributed under the MIT License. See notice at the end
 | 
					 * This library is distributed under the MIT License. See notice at the end
 | 
				
			||||||
@@ -13,7 +13,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#ifndef PUGIXML_VERSION
 | 
					#ifndef PUGIXML_VERSION
 | 
				
			||||||
// Define version macro; evaluates to major * 100 + minor so that it's safe to use in less-than comparisons
 | 
					// Define version macro; evaluates to major * 100 + minor so that it's safe to use in less-than comparisons
 | 
				
			||||||
#	define PUGIXML_VERSION 160
 | 
					#	define PUGIXML_VERSION 190
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Include user configuration file (this can define various configuration macros)
 | 
					// Include user configuration file (this can define various configuration macros)
 | 
				
			||||||
@@ -72,6 +72,44 @@
 | 
				
			|||||||
#	endif
 | 
					#	endif
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// If the platform is known to have move semantics support, compile move ctor/operator implementation
 | 
				
			||||||
 | 
					#ifndef PUGIXML_HAS_MOVE
 | 
				
			||||||
 | 
					#	if __cplusplus >= 201103
 | 
				
			||||||
 | 
					#		define PUGIXML_HAS_MOVE
 | 
				
			||||||
 | 
					#	elif defined(_MSC_VER) && _MSC_VER >= 1600
 | 
				
			||||||
 | 
					#		define PUGIXML_HAS_MOVE
 | 
				
			||||||
 | 
					#	endif
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// If C++ is 2011 or higher, add 'noexcept' specifiers
 | 
				
			||||||
 | 
					#ifndef PUGIXML_NOEXCEPT
 | 
				
			||||||
 | 
					#	if __cplusplus >= 201103
 | 
				
			||||||
 | 
					#		define PUGIXML_NOEXCEPT noexcept
 | 
				
			||||||
 | 
					#	elif defined(_MSC_VER) && _MSC_VER >= 1900
 | 
				
			||||||
 | 
					#		define PUGIXML_NOEXCEPT noexcept
 | 
				
			||||||
 | 
					#	else
 | 
				
			||||||
 | 
					#		define PUGIXML_NOEXCEPT
 | 
				
			||||||
 | 
					#	endif
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Some functions can not be noexcept in compact mode
 | 
				
			||||||
 | 
					#ifdef PUGIXML_COMPACT
 | 
				
			||||||
 | 
					#	define PUGIXML_NOEXCEPT_IF_NOT_COMPACT
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#	define PUGIXML_NOEXCEPT_IF_NOT_COMPACT PUGIXML_NOEXCEPT
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// If C++ is 2011 or higher, add 'override' qualifiers
 | 
				
			||||||
 | 
					#ifndef PUGIXML_OVERRIDE
 | 
				
			||||||
 | 
					#	if __cplusplus >= 201103
 | 
				
			||||||
 | 
					#		define PUGIXML_OVERRIDE override
 | 
				
			||||||
 | 
					#	elif defined(_MSC_VER) && _MSC_VER >= 1700
 | 
				
			||||||
 | 
					#		define PUGIXML_OVERRIDE override
 | 
				
			||||||
 | 
					#	else
 | 
				
			||||||
 | 
					#		define PUGIXML_OVERRIDE
 | 
				
			||||||
 | 
					#	endif
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Character interface macros
 | 
					// Character interface macros
 | 
				
			||||||
#ifdef PUGIXML_WCHAR_MODE
 | 
					#ifdef PUGIXML_WCHAR_MODE
 | 
				
			||||||
#	define PUGIXML_TEXT(t) L ## t
 | 
					#	define PUGIXML_TEXT(t) L ## t
 | 
				
			||||||
@@ -133,13 +171,13 @@ namespace pugi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// This flag determines if EOL characters are normalized (converted to #xA) during parsing. This flag is on by default.
 | 
						// This flag determines if EOL characters are normalized (converted to #xA) during parsing. This flag is on by default.
 | 
				
			||||||
	const unsigned int parse_eol = 0x0020;
 | 
						const unsigned int parse_eol = 0x0020;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// This flag determines if attribute values are normalized using CDATA normalization rules during parsing. This flag is on by default.
 | 
						// This flag determines if attribute values are normalized using CDATA normalization rules during parsing. This flag is on by default.
 | 
				
			||||||
	const unsigned int parse_wconv_attribute = 0x0040;
 | 
						const unsigned int parse_wconv_attribute = 0x0040;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// This flag determines if attribute values are normalized using NMTOKENS normalization rules during parsing. This flag is off by default.
 | 
						// This flag determines if attribute values are normalized using NMTOKENS normalization rules during parsing. This flag is off by default.
 | 
				
			||||||
	const unsigned int parse_wnorm_attribute = 0x0080;
 | 
						const unsigned int parse_wnorm_attribute = 0x0080;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// This flag determines if document declaration (node_declaration) is added to the DOM tree. This flag is off by default.
 | 
						// This flag determines if document declaration (node_declaration) is added to the DOM tree. This flag is off by default.
 | 
				
			||||||
	const unsigned int parse_declaration = 0x0100;
 | 
						const unsigned int parse_declaration = 0x0100;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -158,6 +196,11 @@ namespace pugi
 | 
				
			|||||||
	// is a valid document. This flag is off by default.
 | 
						// is a valid document. This flag is off by default.
 | 
				
			||||||
	const unsigned int parse_fragment = 0x1000;
 | 
						const unsigned int parse_fragment = 0x1000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// This flag determines if plain character data is be stored in the parent element's value. This significantly changes the structure of
 | 
				
			||||||
 | 
						// the document; this flag is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments.
 | 
				
			||||||
 | 
						// This flag is off by default.
 | 
				
			||||||
 | 
						const unsigned int parse_embed_pcdata = 0x2000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// The default parsing mode.
 | 
						// The default parsing mode.
 | 
				
			||||||
	// Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
 | 
						// Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
 | 
				
			||||||
	// End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
 | 
						// End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
 | 
				
			||||||
@@ -184,16 +227,16 @@ namespace pugi
 | 
				
			|||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Formatting flags
 | 
						// Formatting flags
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// Indent the nodes that are written to output stream with as many indentation strings as deep the node is in DOM tree. This flag is on by default.
 | 
						// Indent the nodes that are written to output stream with as many indentation strings as deep the node is in DOM tree. This flag is on by default.
 | 
				
			||||||
	const unsigned int format_indent = 0x01;
 | 
						const unsigned int format_indent = 0x01;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// Write encoding-specific BOM to the output stream. This flag is off by default.
 | 
						// Write encoding-specific BOM to the output stream. This flag is off by default.
 | 
				
			||||||
	const unsigned int format_write_bom = 0x02;
 | 
						const unsigned int format_write_bom = 0x02;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Use raw output mode (no indentation and no line breaks are written). This flag is off by default.
 | 
						// Use raw output mode (no indentation and no line breaks are written). This flag is off by default.
 | 
				
			||||||
	const unsigned int format_raw = 0x04;
 | 
						const unsigned int format_raw = 0x04;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// Omit default XML declaration even if there is no declaration in the document. This flag is off by default.
 | 
						// Omit default XML declaration even if there is no declaration in the document. This flag is off by default.
 | 
				
			||||||
	const unsigned int format_no_declaration = 0x08;
 | 
						const unsigned int format_no_declaration = 0x08;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -206,6 +249,9 @@ namespace pugi
 | 
				
			|||||||
	// Write every attribute on a new line with appropriate indentation. This flag is off by default.
 | 
						// Write every attribute on a new line with appropriate indentation. This flag is off by default.
 | 
				
			||||||
	const unsigned int format_indent_attributes = 0x40;
 | 
						const unsigned int format_indent_attributes = 0x40;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Don't output empty element tags, instead writing an explicit start and end tag even if there are no children. This flag is off by default.
 | 
				
			||||||
 | 
						const unsigned int format_no_empty_element_tags = 0x80;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// The default set of formatting flags.
 | 
						// The default set of formatting flags.
 | 
				
			||||||
	// Nodes are indented depending on their depth in DOM tree, a default declaration is output if document has none.
 | 
						// Nodes are indented depending on their depth in DOM tree, a default declaration is output if document has none.
 | 
				
			||||||
	const unsigned int format_default = format_indent;
 | 
						const unsigned int format_default = format_indent;
 | 
				
			||||||
@@ -225,7 +271,7 @@ namespace pugi
 | 
				
			|||||||
	class xml_node;
 | 
						class xml_node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	class xml_text;
 | 
						class xml_text;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	#ifndef PUGIXML_NO_XPATH
 | 
						#ifndef PUGIXML_NO_XPATH
 | 
				
			||||||
	class xpath_node;
 | 
						class xpath_node;
 | 
				
			||||||
	class xpath_node_set;
 | 
						class xpath_node_set;
 | 
				
			||||||
@@ -268,7 +314,7 @@ namespace pugi
 | 
				
			|||||||
		// Construct writer from a FILE* object; void* is used to avoid header dependencies on stdio
 | 
							// Construct writer from a FILE* object; void* is used to avoid header dependencies on stdio
 | 
				
			||||||
		xml_writer_file(void* file);
 | 
							xml_writer_file(void* file);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		virtual void write(const void* data, size_t size);
 | 
							virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
		void* file;
 | 
							void* file;
 | 
				
			||||||
@@ -283,7 +329,7 @@ namespace pugi
 | 
				
			|||||||
		xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream);
 | 
							xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream);
 | 
				
			||||||
		xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream);
 | 
							xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		virtual void write(const void* data, size_t size);
 | 
							virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
		std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
 | 
							std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
 | 
				
			||||||
@@ -299,13 +345,13 @@ namespace pugi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
		xml_attribute_struct* _attr;
 | 
							xml_attribute_struct* _attr;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
		typedef void (*unspecified_bool_type)(xml_attribute***);
 | 
							typedef void (*unspecified_bool_type)(xml_attribute***);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		// Default constructor. Constructs an empty attribute.
 | 
							// Default constructor. Constructs an empty attribute.
 | 
				
			||||||
		xml_attribute();
 | 
							xml_attribute();
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Constructs attribute from internal pointer
 | 
							// Constructs attribute from internal pointer
 | 
				
			||||||
		explicit xml_attribute(xml_attribute_struct* attr);
 | 
							explicit xml_attribute(xml_attribute_struct* attr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -354,6 +400,8 @@ namespace pugi
 | 
				
			|||||||
		// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 | 
							// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 | 
				
			||||||
		bool set_value(int rhs);
 | 
							bool set_value(int rhs);
 | 
				
			||||||
		bool set_value(unsigned int rhs);
 | 
							bool set_value(unsigned int rhs);
 | 
				
			||||||
 | 
							bool set_value(long rhs);
 | 
				
			||||||
 | 
							bool set_value(unsigned long rhs);
 | 
				
			||||||
		bool set_value(double rhs);
 | 
							bool set_value(double rhs);
 | 
				
			||||||
		bool set_value(float rhs);
 | 
							bool set_value(float rhs);
 | 
				
			||||||
		bool set_value(bool rhs);
 | 
							bool set_value(bool rhs);
 | 
				
			||||||
@@ -367,6 +415,8 @@ namespace pugi
 | 
				
			|||||||
		xml_attribute& operator=(const char_t* rhs);
 | 
							xml_attribute& operator=(const char_t* rhs);
 | 
				
			||||||
		xml_attribute& operator=(int rhs);
 | 
							xml_attribute& operator=(int rhs);
 | 
				
			||||||
		xml_attribute& operator=(unsigned int rhs);
 | 
							xml_attribute& operator=(unsigned int rhs);
 | 
				
			||||||
 | 
							xml_attribute& operator=(long rhs);
 | 
				
			||||||
 | 
							xml_attribute& operator=(unsigned long rhs);
 | 
				
			||||||
		xml_attribute& operator=(double rhs);
 | 
							xml_attribute& operator=(double rhs);
 | 
				
			||||||
		xml_attribute& operator=(float rhs);
 | 
							xml_attribute& operator=(float rhs);
 | 
				
			||||||
		xml_attribute& operator=(bool rhs);
 | 
							xml_attribute& operator=(bool rhs);
 | 
				
			||||||
@@ -417,7 +467,7 @@ namespace pugi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		// Borland C++ workaround
 | 
							// Borland C++ workaround
 | 
				
			||||||
		bool operator!() const;
 | 
							bool operator!() const;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
		// Comparison operators (compares wrapped node pointers)
 | 
							// Comparison operators (compares wrapped node pointers)
 | 
				
			||||||
		bool operator==(const xml_node& r) const;
 | 
							bool operator==(const xml_node& r) const;
 | 
				
			||||||
		bool operator!=(const xml_node& r) const;
 | 
							bool operator!=(const xml_node& r) const;
 | 
				
			||||||
@@ -438,7 +488,7 @@ namespace pugi
 | 
				
			|||||||
		// Get node value, or "" if node is empty or it has no value
 | 
							// Get node value, or "" if node is empty or it has no value
 | 
				
			||||||
		// Note: For <node>text</node> node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes.
 | 
							// Note: For <node>text</node> node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes.
 | 
				
			||||||
		const char_t* value() const;
 | 
							const char_t* value() const;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
		// Get attribute list
 | 
							// Get attribute list
 | 
				
			||||||
		xml_attribute first_attribute() const;
 | 
							xml_attribute first_attribute() const;
 | 
				
			||||||
		xml_attribute last_attribute() const;
 | 
							xml_attribute last_attribute() const;
 | 
				
			||||||
@@ -450,7 +500,7 @@ namespace pugi
 | 
				
			|||||||
		// Get next/previous sibling in the children list of the parent node
 | 
							// Get next/previous sibling in the children list of the parent node
 | 
				
			||||||
		xml_node next_sibling() const;
 | 
							xml_node next_sibling() const;
 | 
				
			||||||
		xml_node previous_sibling() const;
 | 
							xml_node previous_sibling() const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Get parent node
 | 
							// Get parent node
 | 
				
			||||||
		xml_node parent() const;
 | 
							xml_node parent() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -478,7 +528,7 @@ namespace pugi
 | 
				
			|||||||
		// Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
 | 
							// Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
 | 
				
			||||||
		bool set_name(const char_t* rhs);
 | 
							bool set_name(const char_t* rhs);
 | 
				
			||||||
		bool set_value(const char_t* rhs);
 | 
							bool set_value(const char_t* rhs);
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Add attribute with specified name. Returns added attribute, or empty attribute on errors.
 | 
							// Add attribute with specified name. Returns added attribute, or empty attribute on errors.
 | 
				
			||||||
		xml_attribute append_attribute(const char_t* name);
 | 
							xml_attribute append_attribute(const char_t* name);
 | 
				
			||||||
		xml_attribute prepend_attribute(const char_t* name);
 | 
							xml_attribute prepend_attribute(const char_t* name);
 | 
				
			||||||
@@ -532,11 +582,11 @@ namespace pugi
 | 
				
			|||||||
		template <typename Predicate> xml_attribute find_attribute(Predicate pred) const
 | 
							template <typename Predicate> xml_attribute find_attribute(Predicate pred) const
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			if (!_root) return xml_attribute();
 | 
								if (!_root) return xml_attribute();
 | 
				
			||||||
			
 | 
					
 | 
				
			||||||
			for (xml_attribute attrib = first_attribute(); attrib; attrib = attrib.next_attribute())
 | 
								for (xml_attribute attrib = first_attribute(); attrib; attrib = attrib.next_attribute())
 | 
				
			||||||
				if (pred(attrib))
 | 
									if (pred(attrib))
 | 
				
			||||||
					return attrib;
 | 
										return attrib;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
			return xml_attribute();
 | 
								return xml_attribute();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -544,11 +594,11 @@ namespace pugi
 | 
				
			|||||||
		template <typename Predicate> xml_node find_child(Predicate pred) const
 | 
							template <typename Predicate> xml_node find_child(Predicate pred) const
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			if (!_root) return xml_node();
 | 
								if (!_root) return xml_node();
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
			for (xml_node node = first_child(); node; node = node.next_sibling())
 | 
								for (xml_node node = first_child(); node; node = node.next_sibling())
 | 
				
			||||||
				if (pred(node))
 | 
									if (pred(node))
 | 
				
			||||||
					return node;
 | 
										return node;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
			return xml_node();
 | 
								return xml_node();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -558,7 +608,7 @@ namespace pugi
 | 
				
			|||||||
			if (!_root) return xml_node();
 | 
								if (!_root) return xml_node();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			xml_node cur = first_child();
 | 
								xml_node cur = first_child();
 | 
				
			||||||
			
 | 
					
 | 
				
			||||||
			while (cur._root && cur._root != _root)
 | 
								while (cur._root && cur._root != _root)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				if (pred(cur)) return cur;
 | 
									if (pred(cur)) return cur;
 | 
				
			||||||
@@ -590,7 +640,7 @@ namespace pugi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		// Recursively traverse subtree with xml_tree_walker
 | 
							// Recursively traverse subtree with xml_tree_walker
 | 
				
			||||||
		bool traverse(xml_tree_walker& walker);
 | 
							bool traverse(xml_tree_walker& walker);
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	#ifndef PUGIXML_NO_XPATH
 | 
						#ifndef PUGIXML_NO_XPATH
 | 
				
			||||||
		// Select single node by evaluating XPath query. Returns first node from the resulting node set.
 | 
							// Select single node by evaluating XPath query. Returns first node from the resulting node set.
 | 
				
			||||||
		xpath_node select_node(const char_t* query, xpath_variable_set* variables = 0) const;
 | 
							xpath_node select_node(const char_t* query, xpath_variable_set* variables = 0) const;
 | 
				
			||||||
@@ -601,11 +651,11 @@ namespace pugi
 | 
				
			|||||||
		xpath_node_set select_nodes(const xpath_query& query) const;
 | 
							xpath_node_set select_nodes(const xpath_query& query) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// (deprecated: use select_node instead) Select single node by evaluating XPath query.
 | 
							// (deprecated: use select_node instead) Select single node by evaluating XPath query.
 | 
				
			||||||
		xpath_node select_single_node(const char_t* query, xpath_variable_set* variables = 0) const;
 | 
							PUGIXML_DEPRECATED xpath_node select_single_node(const char_t* query, xpath_variable_set* variables = 0) const;
 | 
				
			||||||
		xpath_node select_single_node(const xpath_query& query) const;
 | 
							PUGIXML_DEPRECATED xpath_node select_single_node(const xpath_query& query) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	#endif
 | 
						#endif
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Print subtree using a writer object
 | 
							// Print subtree using a writer object
 | 
				
			||||||
		void print(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
 | 
							void print(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -701,6 +751,8 @@ namespace pugi
 | 
				
			|||||||
		// Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 | 
							// Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 | 
				
			||||||
		bool set(int rhs);
 | 
							bool set(int rhs);
 | 
				
			||||||
		bool set(unsigned int rhs);
 | 
							bool set(unsigned int rhs);
 | 
				
			||||||
 | 
							bool set(long rhs);
 | 
				
			||||||
 | 
							bool set(unsigned long rhs);
 | 
				
			||||||
		bool set(double rhs);
 | 
							bool set(double rhs);
 | 
				
			||||||
		bool set(float rhs);
 | 
							bool set(float rhs);
 | 
				
			||||||
		bool set(bool rhs);
 | 
							bool set(bool rhs);
 | 
				
			||||||
@@ -714,6 +766,8 @@ namespace pugi
 | 
				
			|||||||
		xml_text& operator=(const char_t* rhs);
 | 
							xml_text& operator=(const char_t* rhs);
 | 
				
			||||||
		xml_text& operator=(int rhs);
 | 
							xml_text& operator=(int rhs);
 | 
				
			||||||
		xml_text& operator=(unsigned int rhs);
 | 
							xml_text& operator=(unsigned int rhs);
 | 
				
			||||||
 | 
							xml_text& operator=(long rhs);
 | 
				
			||||||
 | 
							xml_text& operator=(unsigned long rhs);
 | 
				
			||||||
		xml_text& operator=(double rhs);
 | 
							xml_text& operator=(double rhs);
 | 
				
			||||||
		xml_text& operator=(float rhs);
 | 
							xml_text& operator=(float rhs);
 | 
				
			||||||
		xml_text& operator=(bool rhs);
 | 
							xml_text& operator=(bool rhs);
 | 
				
			||||||
@@ -867,11 +921,11 @@ namespace pugi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
		int _depth;
 | 
							int _depth;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	protected:
 | 
						protected:
 | 
				
			||||||
		// Get current traversal depth
 | 
							// Get current traversal depth
 | 
				
			||||||
		int depth() const;
 | 
							int depth() const;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		xml_tree_walker();
 | 
							xml_tree_walker();
 | 
				
			||||||
		virtual ~xml_tree_walker();
 | 
							virtual ~xml_tree_walker();
 | 
				
			||||||
@@ -942,13 +996,14 @@ namespace pugi
 | 
				
			|||||||
		char_t* _buffer;
 | 
							char_t* _buffer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		char _memory[192];
 | 
							char _memory[192];
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Non-copyable semantics
 | 
							// Non-copyable semantics
 | 
				
			||||||
		xml_document(const xml_document&);
 | 
							xml_document(const xml_document&);
 | 
				
			||||||
		const xml_document& operator=(const xml_document&);
 | 
							xml_document& operator=(const xml_document&);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		void create();
 | 
							void _create();
 | 
				
			||||||
		void destroy();
 | 
							void _destroy();
 | 
				
			||||||
 | 
							void _move(xml_document& rhs) PUGIXML_NOEXCEPT_IF_NOT_COMPACT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		// Default constructor, makes empty document
 | 
							// Default constructor, makes empty document
 | 
				
			||||||
@@ -957,6 +1012,12 @@ namespace pugi
 | 
				
			|||||||
		// Destructor, invalidates all node/attribute handles to this document
 | 
							// Destructor, invalidates all node/attribute handles to this document
 | 
				
			||||||
		~xml_document();
 | 
							~xml_document();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						#ifdef PUGIXML_HAS_MOVE
 | 
				
			||||||
 | 
							// Move semantics support
 | 
				
			||||||
 | 
							xml_document(xml_document&& rhs) PUGIXML_NOEXCEPT_IF_NOT_COMPACT;
 | 
				
			||||||
 | 
							xml_document& operator=(xml_document&& rhs) PUGIXML_NOEXCEPT_IF_NOT_COMPACT;
 | 
				
			||||||
 | 
						#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Removes all nodes, leaving the empty document
 | 
							// Removes all nodes, leaving the empty document
 | 
				
			||||||
		void reset();
 | 
							void reset();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -970,7 +1031,7 @@ namespace pugi
 | 
				
			|||||||
	#endif
 | 
						#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied.
 | 
							// (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied.
 | 
				
			||||||
		xml_parse_result load(const char_t* contents, unsigned int options = parse_default);
 | 
							PUGIXML_DEPRECATED xml_parse_result load(const char_t* contents, unsigned int options = parse_default);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Load document from zero-terminated string. No encoding conversions are applied.
 | 
							// Load document from zero-terminated string. No encoding conversions are applied.
 | 
				
			||||||
		xml_parse_result load_string(const char_t* contents, unsigned int options = parse_default);
 | 
							xml_parse_result load_string(const char_t* contents, unsigned int options = parse_default);
 | 
				
			||||||
@@ -1051,7 +1112,7 @@ namespace pugi
 | 
				
			|||||||
		// Non-copyable semantics
 | 
							// Non-copyable semantics
 | 
				
			||||||
		xpath_variable(const xpath_variable&);
 | 
							xpath_variable(const xpath_variable&);
 | 
				
			||||||
		xpath_variable& operator=(const xpath_variable&);
 | 
							xpath_variable& operator=(const xpath_variable&);
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		// Get variable name
 | 
							// Get variable name
 | 
				
			||||||
		const char_t* name() const;
 | 
							const char_t* name() const;
 | 
				
			||||||
@@ -1095,10 +1156,10 @@ namespace pugi
 | 
				
			|||||||
		xpath_variable_set(const xpath_variable_set& rhs);
 | 
							xpath_variable_set(const xpath_variable_set& rhs);
 | 
				
			||||||
		xpath_variable_set& operator=(const xpath_variable_set& rhs);
 | 
							xpath_variable_set& operator=(const xpath_variable_set& rhs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	#if __cplusplus >= 201103
 | 
						#ifdef PUGIXML_HAS_MOVE
 | 
				
			||||||
		// Move semantics support
 | 
							// Move semantics support
 | 
				
			||||||
		xpath_variable_set(xpath_variable_set&& rhs);
 | 
							xpath_variable_set(xpath_variable_set&& rhs) PUGIXML_NOEXCEPT;
 | 
				
			||||||
		xpath_variable_set& operator=(xpath_variable_set&& rhs);
 | 
							xpath_variable_set& operator=(xpath_variable_set&& rhs) PUGIXML_NOEXCEPT;
 | 
				
			||||||
	#endif
 | 
						#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Add a new variable or get the existing one, if the types match
 | 
							// Add a new variable or get the existing one, if the types match
 | 
				
			||||||
@@ -1139,29 +1200,29 @@ namespace pugi
 | 
				
			|||||||
		// Destructor
 | 
							// Destructor
 | 
				
			||||||
		~xpath_query();
 | 
							~xpath_query();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	#if __cplusplus >= 201103
 | 
						#ifdef PUGIXML_HAS_MOVE
 | 
				
			||||||
		// Move semantics support
 | 
							// Move semantics support
 | 
				
			||||||
		xpath_query(xpath_query&& rhs);
 | 
							xpath_query(xpath_query&& rhs) PUGIXML_NOEXCEPT;
 | 
				
			||||||
		xpath_query& operator=(xpath_query&& rhs);
 | 
							xpath_query& operator=(xpath_query&& rhs) PUGIXML_NOEXCEPT;
 | 
				
			||||||
	#endif
 | 
						#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Get query expression return type
 | 
							// Get query expression return type
 | 
				
			||||||
		xpath_value_type return_type() const;
 | 
							xpath_value_type return_type() const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Evaluate expression as boolean value in the specified context; performs type conversion if necessary.
 | 
							// Evaluate expression as boolean value in the specified context; performs type conversion if necessary.
 | 
				
			||||||
		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
							// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
				
			||||||
		bool evaluate_boolean(const xpath_node& n) const;
 | 
							bool evaluate_boolean(const xpath_node& n) const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Evaluate expression as double value in the specified context; performs type conversion if necessary.
 | 
							// Evaluate expression as double value in the specified context; performs type conversion if necessary.
 | 
				
			||||||
		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
							// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
				
			||||||
		double evaluate_number(const xpath_node& n) const;
 | 
							double evaluate_number(const xpath_node& n) const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
	#ifndef PUGIXML_NO_STL
 | 
						#ifndef PUGIXML_NO_STL
 | 
				
			||||||
		// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 | 
							// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 | 
				
			||||||
		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
							// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
				
			||||||
		string_t evaluate_string(const xpath_node& n) const;
 | 
							string_t evaluate_string(const xpath_node& n) const;
 | 
				
			||||||
	#endif
 | 
						#endif
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 | 
							// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 | 
				
			||||||
		// At most capacity characters are written to the destination buffer, full result size is returned (includes terminating zero).
 | 
							// At most capacity characters are written to the destination buffer, full result size is returned (includes terminating zero).
 | 
				
			||||||
		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
							// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 | 
				
			||||||
@@ -1188,7 +1249,7 @@ namespace pugi
 | 
				
			|||||||
		// Borland C++ workaround
 | 
							// Borland C++ workaround
 | 
				
			||||||
		bool operator!() const;
 | 
							bool operator!() const;
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	#ifndef PUGIXML_NO_EXCEPTIONS
 | 
						#ifndef PUGIXML_NO_EXCEPTIONS
 | 
				
			||||||
	// XPath exception class
 | 
						// XPath exception class
 | 
				
			||||||
	class PUGIXML_CLASS xpath_exception: public std::exception
 | 
						class PUGIXML_CLASS xpath_exception: public std::exception
 | 
				
			||||||
@@ -1201,26 +1262,26 @@ namespace pugi
 | 
				
			|||||||
		explicit xpath_exception(const xpath_parse_result& result);
 | 
							explicit xpath_exception(const xpath_parse_result& result);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Get error message
 | 
							// Get error message
 | 
				
			||||||
		virtual const char* what() const throw();
 | 
							virtual const char* what() const throw() PUGIXML_OVERRIDE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Get parse result
 | 
							// Get parse result
 | 
				
			||||||
		const xpath_parse_result& result() const;
 | 
							const xpath_parse_result& result() const;
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	#endif
 | 
						#endif
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// XPath node class (either xml_node or xml_attribute)
 | 
						// XPath node class (either xml_node or xml_attribute)
 | 
				
			||||||
	class PUGIXML_CLASS xpath_node
 | 
						class PUGIXML_CLASS xpath_node
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
		xml_node _node;
 | 
							xml_node _node;
 | 
				
			||||||
		xml_attribute _attribute;
 | 
							xml_attribute _attribute;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
		typedef void (*unspecified_bool_type)(xpath_node***);
 | 
							typedef void (*unspecified_bool_type)(xpath_node***);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		// Default constructor; constructs empty XPath node
 | 
							// Default constructor; constructs empty XPath node
 | 
				
			||||||
		xpath_node();
 | 
							xpath_node();
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Construct XPath node from XML node/attribute
 | 
							// Construct XPath node from XML node/attribute
 | 
				
			||||||
		xpath_node(const xml_node& node);
 | 
							xpath_node(const xml_node& node);
 | 
				
			||||||
		xpath_node(const xml_attribute& attribute, const xml_node& parent);
 | 
							xpath_node(const xml_attribute& attribute, const xml_node& parent);
 | 
				
			||||||
@@ -1228,13 +1289,13 @@ namespace pugi
 | 
				
			|||||||
		// Get node/attribute, if any
 | 
							// Get node/attribute, if any
 | 
				
			||||||
		xml_node node() const;
 | 
							xml_node node() const;
 | 
				
			||||||
		xml_attribute attribute() const;
 | 
							xml_attribute attribute() const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Get parent of contained node/attribute
 | 
							// Get parent of contained node/attribute
 | 
				
			||||||
		xml_node parent() const;
 | 
							xml_node parent() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Safe bool conversion operator
 | 
							// Safe bool conversion operator
 | 
				
			||||||
		operator unspecified_bool_type() const;
 | 
							operator unspecified_bool_type() const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Borland C++ workaround
 | 
							// Borland C++ workaround
 | 
				
			||||||
		bool operator!() const;
 | 
							bool operator!() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1260,13 +1321,13 @@ namespace pugi
 | 
				
			|||||||
			type_sorted,			// Sorted by document order (ascending)
 | 
								type_sorted,			// Sorted by document order (ascending)
 | 
				
			||||||
			type_sorted_reverse		// Sorted by document order (descending)
 | 
								type_sorted_reverse		// Sorted by document order (descending)
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Constant iterator type
 | 
							// Constant iterator type
 | 
				
			||||||
		typedef const xpath_node* const_iterator;
 | 
							typedef const xpath_node* const_iterator;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// We define non-constant iterator to be the same as constant iterator so that various generic algorithms (i.e. boost foreach) work
 | 
							// We define non-constant iterator to be the same as constant iterator so that various generic algorithms (i.e. boost foreach) work
 | 
				
			||||||
		typedef const xpath_node* iterator;
 | 
							typedef const xpath_node* iterator;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
		// Default constructor. Constructs empty set.
 | 
							// Default constructor. Constructs empty set.
 | 
				
			||||||
		xpath_node_set();
 | 
							xpath_node_set();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1275,49 +1336,49 @@ namespace pugi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		// Destructor
 | 
							// Destructor
 | 
				
			||||||
		~xpath_node_set();
 | 
							~xpath_node_set();
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Copy constructor/assignment operator
 | 
							// Copy constructor/assignment operator
 | 
				
			||||||
		xpath_node_set(const xpath_node_set& ns);
 | 
							xpath_node_set(const xpath_node_set& ns);
 | 
				
			||||||
		xpath_node_set& operator=(const xpath_node_set& ns);
 | 
							xpath_node_set& operator=(const xpath_node_set& ns);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	#if __cplusplus >= 201103
 | 
						#ifdef PUGIXML_HAS_MOVE
 | 
				
			||||||
		// Move semantics support
 | 
							// Move semantics support
 | 
				
			||||||
		xpath_node_set(xpath_node_set&& rhs);
 | 
							xpath_node_set(xpath_node_set&& rhs) PUGIXML_NOEXCEPT;
 | 
				
			||||||
		xpath_node_set& operator=(xpath_node_set&& rhs);
 | 
							xpath_node_set& operator=(xpath_node_set&& rhs) PUGIXML_NOEXCEPT;
 | 
				
			||||||
	#endif
 | 
						#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Get collection type
 | 
							// Get collection type
 | 
				
			||||||
		type_t type() const;
 | 
							type_t type() const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Get collection size
 | 
							// Get collection size
 | 
				
			||||||
		size_t size() const;
 | 
							size_t size() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Indexing operator
 | 
							// Indexing operator
 | 
				
			||||||
		const xpath_node& operator[](size_t index) const;
 | 
							const xpath_node& operator[](size_t index) const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Collection iterators
 | 
							// Collection iterators
 | 
				
			||||||
		const_iterator begin() const;
 | 
							const_iterator begin() const;
 | 
				
			||||||
		const_iterator end() const;
 | 
							const_iterator end() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Sort the collection in ascending/descending order by document order
 | 
							// Sort the collection in ascending/descending order by document order
 | 
				
			||||||
		void sort(bool reverse = false);
 | 
							void sort(bool reverse = false);
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Get first node in the collection by document order
 | 
							// Get first node in the collection by document order
 | 
				
			||||||
		xpath_node first() const;
 | 
							xpath_node first() const;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		// Check if collection is empty
 | 
							// Check if collection is empty
 | 
				
			||||||
		bool empty() const;
 | 
							bool empty() const;
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
		type_t _type;
 | 
							type_t _type;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		xpath_node _storage;
 | 
							xpath_node _storage;
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		xpath_node* _begin;
 | 
							xpath_node* _begin;
 | 
				
			||||||
		xpath_node* _end;
 | 
							xpath_node* _end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		void _assign(const_iterator begin, const_iterator end, type_t type);
 | 
							void _assign(const_iterator begin, const_iterator end, type_t type);
 | 
				
			||||||
		void _move(xpath_node_set& rhs);
 | 
							void _move(xpath_node_set& rhs) PUGIXML_NOEXCEPT;
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1325,7 +1386,7 @@ namespace pugi
 | 
				
			|||||||
	// Convert wide string to UTF8
 | 
						// Convert wide string to UTF8
 | 
				
			||||||
	std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str);
 | 
						std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str);
 | 
				
			||||||
	std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >& str);
 | 
						std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >& str);
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// Convert UTF8 to wide string
 | 
						// Convert UTF8 to wide string
 | 
				
			||||||
	std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
 | 
						std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
 | 
				
			||||||
	std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >& str);
 | 
						std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >& str);
 | 
				
			||||||
@@ -1333,13 +1394,13 @@ namespace pugi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Memory allocation function interface; returns pointer to allocated memory or NULL on failure
 | 
						// Memory allocation function interface; returns pointer to allocated memory or NULL on failure
 | 
				
			||||||
	typedef void* (*allocation_function)(size_t size);
 | 
						typedef void* (*allocation_function)(size_t size);
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// Memory deallocation function interface
 | 
						// Memory deallocation function interface
 | 
				
			||||||
	typedef void (*deallocation_function)(void* ptr);
 | 
						typedef void (*deallocation_function)(void* ptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Override default memory management functions. All subsequent allocations/deallocations will be performed via supplied functions.
 | 
						// Override default memory management functions. All subsequent allocations/deallocations will be performed via supplied functions.
 | 
				
			||||||
	void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
 | 
						void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
	// Get current memory management functions
 | 
						// Get current memory management functions
 | 
				
			||||||
	allocation_function PUGIXML_FUNCTION get_memory_allocation_function();
 | 
						allocation_function PUGIXML_FUNCTION get_memory_allocation_function();
 | 
				
			||||||
	deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function();
 | 
						deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function();
 | 
				
			||||||
@@ -1375,7 +1436,7 @@ namespace std
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Copyright (c) 2006-2015 Arseny Kapoulkine
 | 
					 * Copyright (c) 2006-2018 Arseny Kapoulkine
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Permission is hereby granted, free of charge, to any person
 | 
					 * Permission is hereby granted, free of charge, to any person
 | 
				
			||||||
 * obtaining a copy of this software and associated documentation
 | 
					 * obtaining a copy of this software and associated documentation
 | 
				
			||||||
@@ -1388,7 +1449,7 @@ namespace std
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * The above copyright notice and this permission notice shall be
 | 
					 * The above copyright notice and this permission notice shall be
 | 
				
			||||||
 * included in all copies or substantial portions of the Software.
 | 
					 * included in all copies or substantial portions of the Software.
 | 
				
			||||||
 * 
 | 
					 *
 | 
				
			||||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
					 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
				
			||||||
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 | 
					 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 | 
				
			||||||
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
					 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
pugixml 1.6 - an XML processing library
 | 
					pugixml 1.9 - an XML processing library
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Copyright (C) 2006-2015, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
 | 
					Copyright (C) 2006-2018, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
 | 
				
			||||||
Report bugs and download new versions at http://pugixml.org/
 | 
					Report bugs and download new versions at http://pugixml.org/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This is the distribution of pugixml, which is a C++ XML processing library,
 | 
					This is the distribution of pugixml, which is a C++ XML processing library,
 | 
				
			||||||
@@ -28,7 +28,7 @@ The distribution contains the following folders:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
This library is distributed under the MIT License:
 | 
					This library is distributed under the MIT License:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Copyright (c) 2006-2015 Arseny Kapoulkine
 | 
					Copyright (c) 2006-2018 Arseny Kapoulkine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Permission is hereby granted, free of charge, to any person
 | 
					Permission is hereby granted, free of charge, to any person
 | 
				
			||||||
obtaining a copy of this software and associated documentation
 | 
					obtaining a copy of this software and associated documentation
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -74,10 +74,10 @@ class ILDGHmcCheckpointer : public BaseHmcCheckpointer<Implementation> {
 | 
				
			|||||||
    if ((traj % Params.saveInterval) == 0) {
 | 
					    if ((traj % Params.saveInterval) == 0) {
 | 
				
			||||||
      std::string config, rng;
 | 
					      std::string config, rng;
 | 
				
			||||||
      this->build_filenames(traj, Params, config, rng);
 | 
					      this->build_filenames(traj, Params, config, rng);
 | 
				
			||||||
      
 | 
					      GridBase *grid = U._grid;
 | 
				
			||||||
      uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
					      uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
				
			||||||
      BinaryIO::writeRNG(sRNG, pRNG, rng, 0,nersc_csum,scidac_csuma,scidac_csumb);
 | 
					      BinaryIO::writeRNG(sRNG, pRNG, rng, 0,nersc_csum,scidac_csuma,scidac_csumb);
 | 
				
			||||||
      IldgWriter _IldgWriter;
 | 
					      IldgWriter _IldgWriter(grid->IsBoss());
 | 
				
			||||||
      _IldgWriter.open(config);
 | 
					      _IldgWriter.open(config);
 | 
				
			||||||
      _IldgWriter.writeConfiguration(U, traj, config, config);
 | 
					      _IldgWriter.writeConfiguration(U, traj, config, config);
 | 
				
			||||||
      _IldgWriter.close();
 | 
					      _IldgWriter.close();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,6 +31,17 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
 | 
				
			|||||||
using namespace Grid;
 | 
					using namespace Grid;
 | 
				
			||||||
using namespace std;
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void Grid::xmlCheckParse(const pugi::xml_parse_result &result, const std::string name)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if (!result) 
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    std::cerr << "XML parsing error for " << name << std::endl;
 | 
				
			||||||
 | 
					    std::cerr << "XML error description: " << result.description() << std::endl;
 | 
				
			||||||
 | 
					    std::cerr << "XML error offset     : " << result.offset << std::endl;
 | 
				
			||||||
 | 
					    abort();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Writer implementation ///////////////////////////////////////////////////////
 | 
					// Writer implementation ///////////////////////////////////////////////////////
 | 
				
			||||||
XmlWriter::XmlWriter(const string &fileName, string toplev) : fileName_(fileName)
 | 
					XmlWriter::XmlWriter(const string &fileName, string toplev) : fileName_(fileName)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -54,6 +65,19 @@ void XmlWriter::push(const string &s)
 | 
				
			|||||||
  node_ = node_.append_child(s.c_str());
 | 
					  node_ = node_.append_child(s.c_str());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void XmlWriter::pushXmlString(const std::string &s)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  pugi::xml_document doc;
 | 
				
			||||||
 | 
					  auto               result = doc.load_buffer(s.c_str(), s.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xmlCheckParse(result, "fragment\n'" + s +"'");
 | 
				
			||||||
 | 
					  for (pugi::xml_node child = doc.first_child(); child; child = child.next_sibling())
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					      node_ = node_.append_copy(child);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  pop();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void XmlWriter::pop(void)
 | 
					void XmlWriter::pop(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  node_ = node_.parent();
 | 
					  node_ = node_.parent();
 | 
				
			||||||
@@ -65,40 +89,32 @@ std::string XmlWriter::XmlString(void)
 | 
				
			|||||||
  return oss.str();
 | 
					  return oss.str();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
XmlReader::XmlReader(const char *xmlstring,string toplev) : fileName_("")
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  pugi::xml_parse_result result;
 | 
					 | 
				
			||||||
  result = doc_.load_string(xmlstring);
 | 
					 | 
				
			||||||
  if ( !result ) {
 | 
					 | 
				
			||||||
    cerr << "XML error description (from char *): " << result.description() << "\nXML\n"<< xmlstring << "\n";
 | 
					 | 
				
			||||||
    cerr << "XML error offset      (from char *) " << result.offset         << "\nXML\n"<< xmlstring <<"\n";
 | 
					 | 
				
			||||||
    abort();
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  if ( toplev == std::string("") ) {
 | 
					 | 
				
			||||||
    node_ = doc_;
 | 
					 | 
				
			||||||
  } else { 
 | 
					 | 
				
			||||||
    node_ = doc_.child(toplev.c_str());
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Reader implementation ///////////////////////////////////////////////////////
 | 
					// Reader implementation ///////////////////////////////////////////////////////
 | 
				
			||||||
XmlReader::XmlReader(const string &fileName,string toplev) : fileName_(fileName)
 | 
					XmlReader::XmlReader(const std::string &s,  const bool isBuffer, 
 | 
				
			||||||
 | 
					                     std::string toplev) 
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  pugi::xml_parse_result result;
 | 
					  pugi::xml_parse_result result;
 | 
				
			||||||
  result = doc_.load_file(fileName_.c_str());
 | 
					  
 | 
				
			||||||
  if ( !result ) {
 | 
					  if (isBuffer)
 | 
				
			||||||
    cerr << "XML error description: " << result.description() <<" "<< fileName_ <<"\n";
 | 
					  {
 | 
				
			||||||
    cerr << "XML error offset     : " << result.offset        <<" "<< fileName_ <<"\n";
 | 
					    fileName_ = "<string>";
 | 
				
			||||||
    abort();
 | 
					    result    = doc_.load_string(s.c_str());
 | 
				
			||||||
 | 
					    xmlCheckParse(result, "string\n'" + s + "'");
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    fileName_ = s;
 | 
				
			||||||
 | 
					    result    = doc_.load_file(s.c_str());
 | 
				
			||||||
 | 
					    xmlCheckParse(result, "file '" + fileName_ + "'");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if ( toplev == std::string("") ) {
 | 
					  if ( toplev == std::string("") ) {
 | 
				
			||||||
    node_ = doc_;
 | 
					  node_ = doc_;
 | 
				
			||||||
  } else { 
 | 
					  } else { 
 | 
				
			||||||
    node_ = doc_.child(toplev.c_str());
 | 
					    node_ = doc_.child(toplev.c_str());
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool XmlReader::push(const string &s)
 | 
					bool XmlReader::push(const std::string &s)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  if (node_.child(s.c_str()))
 | 
					  if (node_.child(s.c_str()))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
@@ -129,7 +145,6 @@ bool XmlReader::nextElement(const std::string &s)
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template <>
 | 
					template <>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -43,13 +43,15 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace Grid
 | 
					namespace Grid
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  void xmlCheckParse(const pugi::xml_parse_result &result, const std::string name);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  class XmlWriter: public Writer<XmlWriter>
 | 
					  class XmlWriter: public Writer<XmlWriter>
 | 
				
			||||||
  {    
 | 
					  {    
 | 
				
			||||||
  public:
 | 
					  public:
 | 
				
			||||||
    XmlWriter(const std::string &fileName,std::string toplev = std::string("grid") );
 | 
					    XmlWriter(const std::string &fileName, std::string toplev = std::string("grid") );
 | 
				
			||||||
    virtual ~XmlWriter(void);
 | 
					    virtual ~XmlWriter(void);
 | 
				
			||||||
    void push(const std::string &s);
 | 
					    void push(const std::string &s);
 | 
				
			||||||
 | 
					    void pushXmlString(const std::string &s);
 | 
				
			||||||
    void pop(void);
 | 
					    void pop(void);
 | 
				
			||||||
    template <typename U>
 | 
					    template <typename U>
 | 
				
			||||||
    void writeDefault(const std::string &s, const U &x);
 | 
					    void writeDefault(const std::string &s, const U &x);
 | 
				
			||||||
@@ -65,8 +67,8 @@ namespace Grid
 | 
				
			|||||||
  class XmlReader: public Reader<XmlReader>
 | 
					  class XmlReader: public Reader<XmlReader>
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
  public:
 | 
					  public:
 | 
				
			||||||
    XmlReader(const char *xmlstring,std::string toplev = std::string("grid") );
 | 
					    XmlReader(const std::string &fileName, const bool isBuffer = false, 
 | 
				
			||||||
    XmlReader(const std::string &fileName,std::string toplev = std::string("grid") );
 | 
					              std::string toplev = std::string("grid") );
 | 
				
			||||||
    virtual ~XmlReader(void) = default;
 | 
					    virtual ~XmlReader(void) = default;
 | 
				
			||||||
    bool push(const std::string &s);
 | 
					    bool push(const std::string &s);
 | 
				
			||||||
    void pop(void);
 | 
					    void pop(void);
 | 
				
			||||||
@@ -75,6 +77,8 @@ namespace Grid
 | 
				
			|||||||
    void readDefault(const std::string &s, U &output);
 | 
					    void readDefault(const std::string &s, U &output);
 | 
				
			||||||
    template <typename U>
 | 
					    template <typename U>
 | 
				
			||||||
    void readDefault(const std::string &s, std::vector<U> &output);
 | 
					    void readDefault(const std::string &s, std::vector<U> &output);
 | 
				
			||||||
 | 
					  private:
 | 
				
			||||||
 | 
					    void checkParse(const pugi::xml_parse_result &result, const std::string name);
 | 
				
			||||||
  private:
 | 
					  private:
 | 
				
			||||||
    pugi::xml_document doc_;
 | 
					    pugi::xml_document doc_;
 | 
				
			||||||
    pugi::xml_node     node_;
 | 
					    pugi::xml_node     node_;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,7 +79,7 @@ int main (int argc, char ** argv)
 | 
				
			|||||||
  std::cout <<GridLogMessage<<"** Writing out  ILDG conf    *********"<<std::endl;
 | 
					  std::cout <<GridLogMessage<<"** Writing out  ILDG conf    *********"<<std::endl;
 | 
				
			||||||
  std::cout <<GridLogMessage<<"**************************************"<<std::endl;
 | 
					  std::cout <<GridLogMessage<<"**************************************"<<std::endl;
 | 
				
			||||||
  std::string file("./ckpoint_ildg.4000");
 | 
					  std::string file("./ckpoint_ildg.4000");
 | 
				
			||||||
  IldgWriter _IldgWriter;
 | 
					  IldgWriter _IldgWriter(Fine.IsBoss());
 | 
				
			||||||
  _IldgWriter.open(file);
 | 
					  _IldgWriter.open(file);
 | 
				
			||||||
  _IldgWriter.writeConfiguration(Umu,4000,std::string("dummy_ildg_LFN"),std::string("dummy_config"));
 | 
					  _IldgWriter.writeConfiguration(Umu,4000,std::string("dummy_ildg_LFN"),std::string("dummy_config"));
 | 
				
			||||||
  _IldgWriter.close();
 | 
					  _IldgWriter.close();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,7 @@ public:
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    assert(this->subspace.size()==nbasis);
 | 
					    assert(this->subspace.size()==nbasis);
 | 
				
			||||||
    emptyUserRecord record;
 | 
					    emptyUserRecord record;
 | 
				
			||||||
    Grid::QCD::ScidacWriter WR;
 | 
					    Grid::QCD::ScidacWriter WR(this->_FineGrid->IsBoss());
 | 
				
			||||||
    WR.open(evecs_file);
 | 
					    WR.open(evecs_file);
 | 
				
			||||||
    for(int k=0;k<nbasis;k++) {
 | 
					    for(int k=0;k<nbasis;k++) {
 | 
				
			||||||
      WR.writeScidacFieldRecord(this->subspace[k],record);
 | 
					      WR.writeScidacFieldRecord(this->subspace[k],record);
 | 
				
			||||||
@@ -96,7 +96,7 @@ public:
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    int n = this->evec_coarse.size();
 | 
					    int n = this->evec_coarse.size();
 | 
				
			||||||
    emptyUserRecord record;
 | 
					    emptyUserRecord record;
 | 
				
			||||||
    Grid::QCD::ScidacWriter WR;
 | 
					    Grid::QCD::ScidacWriter WR(this->_CoarseGrid->IsBoss());
 | 
				
			||||||
    WR.open(evecs_file);
 | 
					    WR.open(evecs_file);
 | 
				
			||||||
    for(int k=0;k<n;k++) {
 | 
					    for(int k=0;k<n;k++) {
 | 
				
			||||||
      WR.writeScidacFieldRecord(this->evec_coarse[k],record);
 | 
					      WR.writeScidacFieldRecord(this->evec_coarse[k],record);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -114,7 +114,7 @@ int main (int argc, char ** argv)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    FGrid->Barrier();
 | 
					    FGrid->Barrier();
 | 
				
			||||||
    ScidacWriter _ScidacWriter;
 | 
					    ScidacWriter _ScidacWriter(FGrid->IsBoss());
 | 
				
			||||||
    _ScidacWriter.open(file);
 | 
					    _ScidacWriter.open(file);
 | 
				
			||||||
    std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
 | 
					    std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
 | 
				
			||||||
    std::cout << GridLogMessage << " Writing out gauge field "<<std::endl;
 | 
					    std::cout << GridLogMessage << " Writing out gauge field "<<std::endl;
 | 
				
			||||||
@@ -144,7 +144,7 @@ int main (int argc, char ** argv)
 | 
				
			|||||||
      std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
 | 
					      std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      std::stringstream filefn;      filefn << filef << "."<< n;
 | 
					      std::stringstream filefn;      filefn << filef << "."<< n;
 | 
				
			||||||
      ScidacWriter _ScidacWriter;
 | 
					      ScidacWriter _ScidacWriter(FGrid->IsBoss());
 | 
				
			||||||
      _ScidacWriter.open(filefn.str());
 | 
					      _ScidacWriter.open(filefn.str());
 | 
				
			||||||
      _ScidacWriter.writeScidacFieldRecord(src[n],record);
 | 
					      _ScidacWriter.writeScidacFieldRecord(src[n],record);
 | 
				
			||||||
      _ScidacWriter.close();
 | 
					      _ScidacWriter.close();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user