diff --git a/lib/Log.h b/lib/Log.h index 05676775..70ccf6ed 100644 --- a/lib/Log.h +++ b/lib/Log.h @@ -69,10 +69,10 @@ public: StopWatch.Stop(); GridTime now = StopWatch.Elapsed(); StopWatch.Start(); - stream << BLACK < using Vector = std::vector >; // Aligned allocator?? @@ -88,8 +94,6 @@ template class Lattice : public LatticeBase { public: - - GridBase *_grid; int checkerboard; Vector _odata; @@ -177,8 +181,8 @@ PARALLEL_FOR_LOOP } //GridFromExpression is tricky to do template - Lattice(const LatticeUnaryExpression & expr): _grid(nullptr){ - + Lattice(const LatticeUnaryExpression & expr) { + _grid = nullptr; GridFromExpression(_grid,expr); assert(_grid!=nullptr); @@ -199,7 +203,8 @@ PARALLEL_FOR_LOOP } }; template - Lattice(const LatticeBinaryExpression & expr): _grid(nullptr){ + Lattice(const LatticeBinaryExpression & expr) { + _grid = nullptr; GridFromExpression(_grid,expr); assert(_grid!=nullptr); @@ -220,7 +225,8 @@ PARALLEL_FOR_LOOP } }; template - Lattice(const LatticeTrinaryExpression & expr): _grid(nullptr){ + Lattice(const LatticeTrinaryExpression & expr) { + _grid = nullptr; GridFromExpression(_grid,expr); assert(_grid!=nullptr); @@ -240,7 +246,8 @@ PARALLEL_FOR_LOOP // Constructor requires "grid" passed. // what about a default grid? ////////////////////////////////////////////////////////////////// - Lattice(GridBase *grid) : _grid(grid), _odata(_grid->oSites()) { + Lattice(GridBase *grid) : _odata(grid->oSites()) { + _grid = grid; // _odata.reserve(_grid->oSites()); // _odata.resize(_grid->oSites()); // std::cout << "Constructing lattice object with Grid pointer "<<_grid< strong_inline Lattice & operator = (const sobj & r){ PARALLEL_FOR_LOOP for(int ss=0;ss<_grid->oSites();ss++){ diff --git a/lib/parallelIO/NerscIO.h b/lib/parallelIO/NerscIO.h index 9c280397..79572539 100644 --- a/lib/parallelIO/NerscIO.h +++ b/lib/parallelIO/NerscIO.h @@ -213,37 +213,38 @@ class NerscIO : public BinaryIO { static inline void truncate(std::string file){ std::ofstream fout(file,std::ios::out); } + + #define dump_nersc_header(field, s)\ + s << "BEGIN_HEADER" << std::endl;\ + s << "HDR_VERSION = " << field.hdr_version << std::endl;\ + s << "DATATYPE = " << field.data_type << std::endl;\ + s << "STORAGE_FORMAT = " << field.storage_format << std::endl;\ + for(int i=0;i<4;i++){\ + s << "DIMENSION_" << i+1 << " = " << field.dimension[i] << std::endl ;\ + }\ + s << "LINK_TRACE = " << std::setprecision(10) << field.link_trace << std::endl;\ + s << "PLAQUETTE = " << std::setprecision(10) << field.plaquette << std::endl;\ + for(int i=0;i<4;i++){\ + s << "BOUNDARY_"< + inline std::ostream & operator<<(std::ostream &os, const std::vector &v) + { + os << "["; + for (auto &x: v) + { + os << x << " "; + } + if (v.size() > 0) + { + os << "\b"; + } + os << "]"; + + return os; + } + class Serializable {}; // static polymorphism implemented using CRTP idiom @@ -154,23 +172,6 @@ namespace Grid { r.read(s, output); } - template < class T > - inline std::ostream& operator << (std::ostream& os, const std::vector& v) - { - os << "["; - for (auto &x: v) - { - os << x << " "; - } - if (v.size() > 0) - { - os << "\b"; - } - os << "]"; - - return os; - } - // Writer template implementation //////////////////////////////////////////// template Writer::Writer(void)