From 2e2e5ce596c72b22632e019a3255ed4d63d8d5de Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Fri, 19 Oct 2018 20:36:32 +0100 Subject: [PATCH 1/3] SciDAC I/O print data checksums --- Grid/parallelIO/IldgIO.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Grid/parallelIO/IldgIO.h b/Grid/parallelIO/IldgIO.h index 16951a26..518a84a9 100644 --- a/Grid/parallelIO/IldgIO.h +++ b/Grid/parallelIO/IldgIO.h @@ -233,7 +233,8 @@ class GridLimeReader : public BinaryIO { // std::cout << " ReadLatticeObject from offset "< munge; BinaryIO::readLatticeObject< vobj, sobj >(field, filename, munge, offset, format,nersc_csum,scidac_csuma,scidac_csumb); - + std::cout << GridLogMessage << "SciDAC checksum A " << std::hex << scidac_csuma << std::dec << std::endl; + std::cout << GridLogMessage << "SciDAC checksum B " << std::hex << scidac_csumb << std::dec << std::endl; ///////////////////////////////////////////// // Insist checksum is next record ///////////////////////////////////////////// From 1982cc58dd5737e1649bfbcdc7d1c249544fa70f Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Sun, 21 Oct 2018 01:20:05 +0100 Subject: [PATCH 2/3] Hadrons: A2A vectors I/O filename fix --- Hadrons/A2AVectors.hpp | 4 ++-- Hadrons/Modules/MSolver/A2AVectors.hpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Hadrons/A2AVectors.hpp b/Hadrons/A2AVectors.hpp index ff32ff5e..f55eb6d7 100644 --- a/Hadrons/A2AVectors.hpp +++ b/Hadrons/A2AVectors.hpp @@ -263,7 +263,7 @@ void A2AVectorsIo::write(const std::string fileStem, std::vector &vec, Record record; GridBase *grid = vec[0]._grid; ScidacWriter binWriter(grid->IsBoss()); - std::string filename = vecFilename(fileStem, multiFile, trajectory); + std::string filename = vecFilename(fileStem, trajectory, multiFile); if (multiFile) { @@ -301,7 +301,7 @@ void A2AVectorsIo::read(std::vector &vec, const std::string fileStem, { Record record; ScidacReader binReader; - std::string filename = vecFilename(fileStem, multiFile, trajectory); + std::string filename = vecFilename(fileStem, trajectory, multiFile); if (multiFile) { diff --git a/Hadrons/Modules/MSolver/A2AVectors.hpp b/Hadrons/Modules/MSolver/A2AVectors.hpp index 47ae6aee..f9980ee3 100644 --- a/Hadrons/Modules/MSolver/A2AVectors.hpp +++ b/Hadrons/Modules/MSolver/A2AVectors.hpp @@ -242,8 +242,12 @@ void TA2AVectors::execute(void) // I/O if necessary if (!par().output.empty()) { - A2AVectorsIo::write(par().output + "_w", w, par().multiFile, vm().getTrajectory()); + startTimer("V I/O"); A2AVectorsIo::write(par().output + "_v", v, par().multiFile, vm().getTrajectory()); + stopTimer("V I/O"); + startTimer("W I/O"); + A2AVectorsIo::write(par().output + "_w", w, par().multiFile, vm().getTrajectory()); + stopTimer("W I/O"); } } From 6b559d68aab01e8e969f600bb9b233261a31f9c2 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Mon, 22 Oct 2018 11:10:18 +0100 Subject: [PATCH 3/3] Hadrons: eigenpack converter can do test reads --- Hadrons/Utilities/EigenPackCast.cc | 36 +++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/Hadrons/Utilities/EigenPackCast.cc b/Hadrons/Utilities/EigenPackCast.cc index 8f2755e3..8c3a2b3f 100644 --- a/Hadrons/Utilities/EigenPackCast.cc +++ b/Hadrons/Utilities/EigenPackCast.cc @@ -35,7 +35,7 @@ using namespace Hadrons; template void convert(const std::string outFilename, const std::string inFilename, const unsigned int Ls, const bool rb, const unsigned int size, - const bool multiFile) + const bool multiFile, const bool testRead) { assert(outFilename != inFilename); @@ -102,6 +102,7 @@ void convert(const std::string outFilename, const std::string inFilename, LOG(Message) << "Out type : " << typeName() << std::endl; LOG(Message) << "#vectors : " << size << std::endl; LOG(Message) << "Multifile : " << (multiFile ? "yes" : "no") << std::endl; + LOG(Message) << "Test read : " << (testRead ? "yes" : "no") << std::endl; if (multiFile) { for(unsigned int k = 0; k < size; ++k) @@ -112,6 +113,8 @@ void convert(const std::string outFilename, const std::string inFilename, LOG(Message) << "==== Converting vector " << k << std::endl; LOG(Message) << "In : " << inV << std::endl; LOG(Message) << "Out: " << outV << std::endl; + // conversion + LOG(Message) << "-- Doing conversion" << std::endl; makeFileDir(outV, gOut); binWriter.open(outV); binReader.open(inV); @@ -121,10 +124,20 @@ void convert(const std::string outFilename, const std::string inFilename, EigenPackIo::writeElement(binWriter, bufIn, eval, k, &bufOut, &testIn); binWriter.close(); binReader.close(); + // read test + if (testRead) + { + LOG(Message) << "-- Test read" << std::endl; + binReader.open(outV); + EigenPackIo::readElement(bufOut, eval, k, binReader); + binReader.close(); + } } } else { + // conversion + LOG(Message) << "-- Doing conversion" << std::endl; makeFileDir(outFilename, gOut); binWriter.open(outFilename); binReader.open(inFilename); @@ -137,6 +150,18 @@ void convert(const std::string outFilename, const std::string inFilename, } binWriter.close(); binReader.close(); + // read test + if (testRead) + { + LOG(Message) << "-- Test read" << std::endl; + binReader.open(outFilename); + EigenPackIo::readHeader(record, binReader); + for(unsigned int k = 0; k < size; ++k) + { + EigenPackIo::readElement(bufOut, eval, k, binReader); + } + binReader.close(); + } } } @@ -154,11 +179,11 @@ int main(int argc, char *argv[]) // parse command line std::string outFilename, inFilename; unsigned int size, Ls; - bool rb, multiFile; + bool rb, multiFile, testRead; - if (argc < 7) + if (argc < 8) { - std::cerr << "usage: " << argv[0] << " <#vector> [Grid options]"; + std::cerr << "usage: " << argv[0] << " <#vector> [Grid options]"; std::cerr << std::endl; std::exit(EXIT_FAILURE); } @@ -168,6 +193,7 @@ int main(int argc, char *argv[]) rb = (std::string(argv[4]) != "0"); size = std::stoi(std::string(argv[5])); multiFile = (std::string(argv[6]) != "0"); + testRead = (std::string(argv[7]) != "0"); // initialization Grid_init(&argc, &argv); @@ -176,7 +202,7 @@ int main(int argc, char *argv[]) // execution try { - convert(outFilename, inFilename, Ls, rb, size, multiFile); + convert(outFilename, inFilename, Ls, rb, size, multiFile, testRead); } catch (const std::exception& e) {