2018-10-17 20:26:48 +01:00
|
|
|
/*************************************************************************************
|
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: Hadrons/Utilities/Contractor.cc
|
|
|
|
|
2019-02-05 18:55:24 +00:00
|
|
|
Copyright (C) 2015-2019
|
2018-10-17 20:26:48 +01:00
|
|
|
|
2019-02-05 18:55:24 +00:00
|
|
|
Author: Antonin Portelli <antonin.portelli@me.com>
|
2018-10-17 20:26:48 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
See the full license in the file "LICENSE" in the top level distribution directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2019-08-01 20:35:55 +01:00
|
|
|
|
|
|
|
#include <Hadrons/Utilities/Contractor.hpp>
|
2018-10-17 20:26:48 +01:00
|
|
|
#include <Hadrons/A2AMatrix.hpp>
|
|
|
|
#include <Hadrons/DiskVector.hpp>
|
2018-11-09 16:23:53 +00:00
|
|
|
#include <Hadrons/TimerArray.hpp>
|
2018-10-17 20:26:48 +01:00
|
|
|
|
|
|
|
using namespace Grid;
|
|
|
|
using namespace QCD;
|
|
|
|
using namespace Hadrons;
|
|
|
|
|
2018-11-07 19:16:55 +00:00
|
|
|
void makeTimeSeq(std::vector<std::vector<unsigned int>> &timeSeq,
|
|
|
|
const std::vector<std::set<unsigned int>> ×,
|
|
|
|
std::vector<unsigned int> ¤t,
|
|
|
|
const unsigned int depth)
|
|
|
|
{
|
|
|
|
if (depth > 0)
|
|
|
|
{
|
|
|
|
for (auto t: times[times.size() - depth])
|
|
|
|
{
|
|
|
|
current[times.size() - depth] = t;
|
|
|
|
makeTimeSeq(timeSeq, times, current, depth - 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
timeSeq.push_back(current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void makeTimeSeq(std::vector<std::vector<unsigned int>> &timeSeq,
|
|
|
|
const std::vector<std::set<unsigned int>> ×)
|
|
|
|
{
|
|
|
|
std::vector<unsigned int> current(times.size());
|
|
|
|
|
2019-08-01 20:35:55 +01:00
|
|
|
makeTimeSeq(timeSeq, times, current, static_cast<unsigned int>(times.size()));
|
2018-11-07 19:16:55 +00:00
|
|
|
}
|
|
|
|
|
2019-08-01 20:35:55 +01:00
|
|
|
void saveCorrelator(const Contractor::CorrelatorResult &result, const std::string dir,
|
2018-11-19 15:45:04 +00:00
|
|
|
const unsigned int dt, const unsigned int traj)
|
|
|
|
{
|
2018-11-19 16:17:51 +00:00
|
|
|
std::string fileStem = "", filename;
|
|
|
|
std::vector<std::string> terms = strToVec<std::string>(result.contraction.terms);
|
2018-11-19 15:45:04 +00:00
|
|
|
|
2018-11-19 16:17:51 +00:00
|
|
|
for (unsigned int i = 0; i < terms.size() - 1; i++)
|
2018-11-19 15:45:04 +00:00
|
|
|
{
|
2018-11-19 16:17:51 +00:00
|
|
|
fileStem += terms[i] + "_" + std::to_string(result.times[i]) + "_";
|
2018-11-19 15:45:04 +00:00
|
|
|
}
|
2018-11-19 16:17:51 +00:00
|
|
|
fileStem += terms.back();
|
2018-11-19 15:45:04 +00:00
|
|
|
if (!result.contraction.translationAverage)
|
|
|
|
{
|
|
|
|
fileStem += "_dt_" + std::to_string(dt);
|
|
|
|
}
|
|
|
|
filename = dir + "/" + RESULT_FILE_NAME(fileStem, traj);
|
|
|
|
std::cout << "Saving correlator to '" << filename << "'" << std::endl;
|
|
|
|
makeFileDir(dir);
|
|
|
|
ResultWriter writer(filename);
|
|
|
|
write(writer, fileStem, result);
|
|
|
|
}
|
2018-11-07 19:16:55 +00:00
|
|
|
|
2018-10-18 17:50:35 +01:00
|
|
|
std::set<unsigned int> parseTimeRange(const std::string str, const unsigned int nt)
|
2018-10-17 20:26:48 +01:00
|
|
|
{
|
|
|
|
std::regex rex("([0-9]+)|(([0-9]+)\\.\\.([0-9]+))");
|
|
|
|
std::smatch sm;
|
|
|
|
std::vector<std::string> rstr = strToVec<std::string>(str);
|
2018-10-18 17:50:35 +01:00
|
|
|
std::set<unsigned int> tSet;
|
2018-10-17 20:26:48 +01:00
|
|
|
|
|
|
|
for (auto &s: rstr)
|
|
|
|
{
|
|
|
|
std::regex_match(s, sm, rex);
|
|
|
|
if (sm[1].matched)
|
|
|
|
{
|
2018-10-18 17:50:35 +01:00
|
|
|
unsigned int t;
|
|
|
|
|
|
|
|
t = std::stoi(sm[1].str());
|
|
|
|
if (t >= nt)
|
|
|
|
{
|
|
|
|
HADRONS_ERROR(Range, "time out of range (from expression '" + str + "')");
|
|
|
|
}
|
|
|
|
tSet.insert(t);
|
2018-10-17 20:26:48 +01:00
|
|
|
}
|
|
|
|
else if (sm[2].matched)
|
|
|
|
{
|
|
|
|
unsigned int ta, tb;
|
|
|
|
|
|
|
|
ta = std::stoi(sm[3].str());
|
|
|
|
tb = std::stoi(sm[4].str());
|
2018-10-18 17:50:35 +01:00
|
|
|
if ((ta >= nt) or (tb >= nt))
|
|
|
|
{
|
|
|
|
HADRONS_ERROR(Range, "time out of range (from expression '" + str + "')");
|
|
|
|
}
|
2018-10-17 20:26:48 +01:00
|
|
|
for (unsigned int ti = ta; ti <= tb; ++ti)
|
|
|
|
{
|
2018-10-18 17:50:35 +01:00
|
|
|
tSet.insert(ti);
|
2018-10-17 20:26:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-18 17:50:35 +01:00
|
|
|
return tSet;
|
2018-10-17 20:26:48 +01:00
|
|
|
}
|
|
|
|
|
2018-11-09 16:23:53 +00:00
|
|
|
struct Sec
|
|
|
|
{
|
|
|
|
Sec(const double usec)
|
|
|
|
{
|
|
|
|
seconds = usec/1.0e6;
|
|
|
|
}
|
|
|
|
|
|
|
|
double seconds;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline std::ostream & operator<< (std::ostream& s, const Sec &&sec)
|
|
|
|
{
|
|
|
|
s << std::setw(10) << sec.seconds << " sec";
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
2018-11-08 18:46:28 +00:00
|
|
|
struct Flops
|
2018-11-07 19:59:11 +00:00
|
|
|
{
|
2018-11-08 18:46:28 +00:00
|
|
|
Flops(const double flops, const double fusec)
|
|
|
|
{
|
|
|
|
gFlopsPerSec = flops/fusec/1.0e3;
|
|
|
|
}
|
|
|
|
|
|
|
|
double gFlopsPerSec;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline std::ostream & operator<< (std::ostream& s, const Flops &&f)
|
|
|
|
{
|
|
|
|
s << std::setw(10) << f.gFlopsPerSec << " GFlop/s";
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bytes
|
|
|
|
{
|
|
|
|
Bytes(const double bytes, const double busec)
|
|
|
|
{
|
|
|
|
gBytesPerSec = bytes/busec*1.0e6/1024/1024/1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
double gBytesPerSec;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline std::ostream & operator<< (std::ostream& s, const Bytes &&b)
|
|
|
|
{
|
|
|
|
s << std::setw(10) << b.gBytesPerSec << " GB/s";
|
|
|
|
|
|
|
|
return s;
|
2018-11-07 19:59:11 +00:00
|
|
|
}
|
|
|
|
|
2018-10-17 20:26:48 +01:00
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
// parse command line
|
2019-08-01 20:35:55 +01:00
|
|
|
std::string parFilename;
|
|
|
|
bool SimpleCorrelator{ false };
|
|
|
|
int ArgCount{ 0 };
|
|
|
|
bool bCmdLineError{ false };
|
|
|
|
for( int i = 1; i < argc; i++ ) {
|
|
|
|
if( argv[i][0] == '-' ) {
|
|
|
|
if( argv[i][1] == 's' && argv[i][2] == 0 )
|
|
|
|
SimpleCorrelator = true;
|
|
|
|
else {
|
|
|
|
std::cerr << "Urecognised switch \"" << argv[i] << "\"" << std::endl;
|
|
|
|
bCmdLineError = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch( ++ArgCount ) {
|
|
|
|
case 1:
|
|
|
|
parFilename = argv[i];
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
std::cerr << "Unused argument \"" << argv[i] << "\"" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-10-17 20:26:48 +01:00
|
|
|
|
2019-08-01 20:35:55 +01:00
|
|
|
if (ArgCount != 1 or bCmdLineError)
|
2018-10-17 20:26:48 +01:00
|
|
|
{
|
2019-08-01 20:35:55 +01:00
|
|
|
std::cerr << "usage: " << argv[0] << " <parameter file>"
|
|
|
|
"\n\t-s\tSimple Correlators (only describe A2AMatrices used for contraction)"
|
|
|
|
<< std::endl;
|
2018-10-17 20:26:48 +01:00
|
|
|
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// parse parameter file
|
2019-08-01 20:35:55 +01:00
|
|
|
Contractor::ContractorPar par;
|
2018-10-18 17:50:35 +01:00
|
|
|
unsigned int nMat, nCont;
|
|
|
|
XmlReader reader(parFilename);
|
|
|
|
|
|
|
|
read(reader, "global", par.global);
|
|
|
|
read(reader, "a2aMatrix", par.a2aMatrix);
|
|
|
|
read(reader, "product", par.product);
|
2019-08-01 20:35:55 +01:00
|
|
|
nMat = static_cast<unsigned int>(par.a2aMatrix.size());
|
|
|
|
nCont = static_cast<unsigned int>(par.product.size());
|
2018-10-17 20:26:48 +01:00
|
|
|
|
|
|
|
// create diskvectors
|
|
|
|
std::map<std::string, EigenDiskVector<ComplexD>> a2aMat;
|
|
|
|
|
|
|
|
for (auto &p: par.a2aMatrix)
|
|
|
|
{
|
|
|
|
std::string dirName = par.global.diskVectorDir + "/" + p.name;
|
|
|
|
|
|
|
|
a2aMat.emplace(p.name, EigenDiskVector<ComplexD>(dirName, par.global.nt, p.cacheSize));
|
|
|
|
}
|
|
|
|
|
2018-11-19 15:45:04 +00:00
|
|
|
// trajectory loop
|
|
|
|
for (unsigned int traj = par.global.trajCounter.start;
|
|
|
|
traj < par.global.trajCounter.end; traj += par.global.trajCounter.step)
|
2018-10-17 20:26:48 +01:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
std::cout << ":::::::: Trajectory " << traj << std::endl;
|
2018-10-17 20:26:48 +01:00
|
|
|
|
2018-11-19 15:45:04 +00:00
|
|
|
// load data
|
|
|
|
for (auto &p: par.a2aMatrix)
|
|
|
|
{
|
2018-11-19 16:04:01 +00:00
|
|
|
std::string filename = p.file;
|
2019-08-01 20:35:55 +01:00
|
|
|
double t;
|
2018-10-17 20:26:48 +01:00
|
|
|
|
2018-11-19 16:04:01 +00:00
|
|
|
tokenReplace(filename, "traj", traj);
|
2018-11-19 15:45:04 +00:00
|
|
|
std::cout << "======== Loading '" << filename << "'" << std::endl;
|
2018-10-17 20:26:48 +01:00
|
|
|
|
2018-11-19 15:45:04 +00:00
|
|
|
A2AMatrixIo<HADRONS_A2AM_IO_TYPE> a2aIo(filename, p.dataset, par.global.nt);
|
2018-10-17 20:26:48 +01:00
|
|
|
|
2018-11-19 15:45:04 +00:00
|
|
|
a2aIo.load(a2aMat.at(p.name), &t);
|
|
|
|
std::cout << "Read " << a2aIo.getSize() << " bytes in " << t/1.0e6
|
|
|
|
<< " sec, " << a2aIo.getSize()/t*1.0e6/1024/1024 << " MB/s" << std::endl;
|
2018-10-17 20:26:48 +01:00
|
|
|
}
|
2018-11-12 15:59:54 +00:00
|
|
|
|
2018-11-19 15:45:04 +00:00
|
|
|
// contract
|
|
|
|
EigenDiskVector<ComplexD>::Matrix buf;
|
2018-10-17 20:26:48 +01:00
|
|
|
|
2018-11-19 15:45:04 +00:00
|
|
|
for (auto &p: par.product)
|
2018-10-17 20:26:48 +01:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
std::vector<std::string> term = strToVec<std::string>(p.terms);
|
|
|
|
std::vector<std::set<unsigned int>> times;
|
|
|
|
std::vector<std::vector<unsigned int>> timeSeq;
|
|
|
|
std::set<unsigned int> translations;
|
|
|
|
std::vector<A2AMatrixTr<ComplexD>> lastTerm(par.global.nt);
|
|
|
|
A2AMatrix<ComplexD> prod, buf, tmp;
|
|
|
|
TimerArray tAr;
|
2019-08-01 20:35:55 +01:00
|
|
|
double fusec, busec, flops, bytes;
|
2018-11-19 15:45:04 +00:00
|
|
|
Contractor::CorrelatorResult result;
|
|
|
|
|
|
|
|
tAr.startTimer("Total");
|
|
|
|
std::cout << "======== Contraction tr(";
|
|
|
|
for (unsigned int g = 0; g < term.size(); ++g)
|
2018-11-12 15:59:54 +00:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
std::cout << term[g] << ((g == term.size() - 1) ? ')' : '*');
|
2018-11-12 15:59:54 +00:00
|
|
|
}
|
2018-11-19 15:45:04 +00:00
|
|
|
std::cout << std::endl;
|
|
|
|
if (term.size() != p.times.size() + 1)
|
|
|
|
{
|
|
|
|
HADRONS_ERROR(Size, "number of terms (" + std::to_string(term.size())
|
|
|
|
+ ") different from number of times ("
|
|
|
|
+ std::to_string(p.times.size() + 1) + ")");
|
|
|
|
}
|
|
|
|
for (auto &s: p.times)
|
2018-11-07 19:16:55 +00:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
times.push_back(parseTimeRange(s, par.global.nt));
|
2018-11-07 19:16:55 +00:00
|
|
|
}
|
2018-11-19 15:45:04 +00:00
|
|
|
for (auto &m: par.a2aMatrix)
|
2018-11-07 19:16:55 +00:00
|
|
|
{
|
2019-08-01 20:35:55 +01:00
|
|
|
// For simple correlators, only include A2AMatrix info for correlators in this contraction
|
|
|
|
if ( ( !SimpleCorrelator or std::find( term.begin(), term.end(), m.name ) != term.end() )
|
|
|
|
and std::find(result.a2aMatrix.begin(), result.a2aMatrix.end(), m) == result.a2aMatrix.end())
|
2018-11-07 19:59:11 +00:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
result.a2aMatrix.push_back(m);
|
2018-11-19 16:26:53 +00:00
|
|
|
tokenReplace(result.a2aMatrix.back().file, "traj", traj);
|
2018-11-07 19:59:11 +00:00
|
|
|
}
|
2018-11-19 15:45:04 +00:00
|
|
|
}
|
|
|
|
result.contraction = p;
|
|
|
|
result.correlator.resize(par.global.nt, 0.);
|
|
|
|
|
|
|
|
translations = parseTimeRange(p.translations, par.global.nt);
|
|
|
|
makeTimeSeq(timeSeq, times);
|
|
|
|
std::cout << timeSeq.size()*translations.size()*(term.size() - 2) << " A*B, "
|
|
|
|
<< timeSeq.size()*translations.size()*par.global.nt << " tr(A*B)"
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
std::cout << "* Caching transposed last term" << std::endl;
|
|
|
|
for (unsigned int t = 0; t < par.global.nt; ++t)
|
|
|
|
{
|
2018-11-09 16:23:53 +00:00
|
|
|
tAr.startTimer("Disk vector overhead");
|
2018-11-19 15:45:04 +00:00
|
|
|
const A2AMatrix<ComplexD> &ref = a2aMat.at(term.back())[t];
|
2018-11-09 16:23:53 +00:00
|
|
|
tAr.stopTimer("Disk vector overhead");
|
2018-11-19 15:45:04 +00:00
|
|
|
|
|
|
|
tAr.startTimer("Transpose caching");
|
|
|
|
lastTerm[t].resize(ref.rows(), ref.cols());
|
|
|
|
parallel_for (unsigned int j = 0; j < ref.cols(); ++j)
|
|
|
|
for (unsigned int i = 0; i < ref.rows(); ++i)
|
2018-11-07 19:16:55 +00:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
lastTerm[t](i, j) = ref(i, j);
|
2018-11-07 19:59:11 +00:00
|
|
|
}
|
2018-11-19 15:45:04 +00:00
|
|
|
tAr.stopTimer("Transpose caching");
|
|
|
|
}
|
|
|
|
bytes = par.global.nt*lastTerm[0].rows()*lastTerm[0].cols()*sizeof(ComplexD);
|
|
|
|
std::cout << Sec(tAr.getDTimer("Transpose caching")) << " "
|
2018-11-22 15:44:30 +00:00
|
|
|
<< Bytes(bytes, tAr.getDTimer("Transpose caching")) << std::endl;
|
2018-11-19 15:45:04 +00:00
|
|
|
for (unsigned int i = 0; i < timeSeq.size(); ++i)
|
|
|
|
{
|
|
|
|
unsigned int dti = 0;
|
|
|
|
auto &t = timeSeq[i];
|
|
|
|
|
|
|
|
result.times = t;
|
|
|
|
for (unsigned int tLast = 0; tLast < par.global.nt; ++tLast)
|
2018-11-07 19:59:11 +00:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
result.correlator[tLast] = 0.;
|
2018-11-07 19:16:55 +00:00
|
|
|
}
|
2018-11-19 15:45:04 +00:00
|
|
|
for (auto &dt: translations)
|
2018-11-07 19:16:55 +00:00
|
|
|
{
|
2018-11-19 15:45:04 +00:00
|
|
|
std::cout << "* Step " << i*translations.size() + dti + 1
|
|
|
|
<< "/" << timeSeq.size()*translations.size()
|
|
|
|
<< " -- positions= " << t << ", dt= " << dt << std::endl;
|
|
|
|
if (term.size() > 2)
|
|
|
|
{
|
|
|
|
std::cout << std::setw(8) << "products";
|
|
|
|
}
|
|
|
|
flops = 0.;
|
|
|
|
bytes = 0.;
|
|
|
|
fusec = tAr.getDTimer("A*B algebra");
|
|
|
|
busec = tAr.getDTimer("A*B total");
|
|
|
|
tAr.startTimer("Linear algebra");
|
|
|
|
tAr.startTimer("Disk vector overhead");
|
|
|
|
prod = a2aMat.at(term[0])[TIME_MOD(t[0] + dt)];
|
|
|
|
tAr.stopTimer("Disk vector overhead");
|
|
|
|
for (unsigned int j = 1; j < term.size() - 1; ++j)
|
|
|
|
{
|
|
|
|
tAr.startTimer("Disk vector overhead");
|
|
|
|
const A2AMatrix<ComplexD> &ref = a2aMat.at(term[j])[TIME_MOD(t[j] + dt)];
|
|
|
|
tAr.stopTimer("Disk vector overhead");
|
|
|
|
|
|
|
|
tAr.startTimer("A*B total");
|
|
|
|
tAr.startTimer("A*B algebra");
|
|
|
|
A2AContraction::mul(tmp, prod, ref);
|
|
|
|
tAr.stopTimer("A*B algebra");
|
|
|
|
flops += A2AContraction::mulFlops(prod, ref);
|
|
|
|
prod = tmp;
|
|
|
|
tAr.stopTimer("A*B total");
|
|
|
|
bytes += 3.*tmp.rows()*tmp.cols()*sizeof(ComplexD);
|
|
|
|
}
|
|
|
|
if (term.size() > 2)
|
|
|
|
{
|
|
|
|
std::cout << Sec(tAr.getDTimer("A*B total") - busec) << " "
|
|
|
|
<< Flops(flops, tAr.getDTimer("A*B algebra") - fusec) << " "
|
|
|
|
<< Bytes(bytes, tAr.getDTimer("A*B total") - busec) << std::endl;
|
|
|
|
}
|
|
|
|
std::cout << std::setw(8) << "traces";
|
|
|
|
flops = 0.;
|
|
|
|
bytes = 0.;
|
|
|
|
fusec = tAr.getDTimer("tr(A*B)");
|
|
|
|
busec = tAr.getDTimer("tr(A*B)");
|
|
|
|
for (unsigned int tLast = 0; tLast < par.global.nt; ++tLast)
|
|
|
|
{
|
|
|
|
tAr.startTimer("tr(A*B)");
|
|
|
|
A2AContraction::accTrMul(result.correlator[TIME_MOD(tLast - dt)], prod, lastTerm[tLast]);
|
|
|
|
tAr.stopTimer("tr(A*B)");
|
|
|
|
flops += A2AContraction::accTrMulFlops(prod, lastTerm[tLast]);
|
|
|
|
bytes += 2.*prod.rows()*prod.cols()*sizeof(ComplexD);
|
|
|
|
}
|
|
|
|
tAr.stopTimer("Linear algebra");
|
|
|
|
std::cout << Sec(tAr.getDTimer("tr(A*B)") - busec) << " "
|
|
|
|
<< Flops(flops, tAr.getDTimer("tr(A*B)") - fusec) << " "
|
|
|
|
<< Bytes(bytes, tAr.getDTimer("tr(A*B)") - busec) << std::endl;
|
|
|
|
if (!p.translationAverage)
|
|
|
|
{
|
|
|
|
saveCorrelator(result, par.global.output, dt, traj);
|
|
|
|
for (unsigned int tLast = 0; tLast < par.global.nt; ++tLast)
|
|
|
|
{
|
|
|
|
result.correlator[tLast] = 0.;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dti++;
|
|
|
|
}
|
|
|
|
if (p.translationAverage)
|
|
|
|
{
|
|
|
|
for (unsigned int tLast = 0; tLast < par.global.nt; ++tLast)
|
|
|
|
{
|
|
|
|
result.correlator[tLast] /= translations.size();
|
|
|
|
}
|
|
|
|
saveCorrelator(result, par.global.output, 0, traj);
|
2018-11-07 19:16:55 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-19 15:45:04 +00:00
|
|
|
tAr.stopTimer("Total");
|
|
|
|
printTimeProfile(tAr.getTimings(), tAr.getTimer("Total"));
|
2018-10-17 20:26:48 +01:00
|
|
|
}
|
2018-11-07 19:16:55 +00:00
|
|
|
}
|
2018-10-17 20:26:48 +01:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|