2016-12-15 18:26:39 +00:00
|
|
|
/*************************************************************************************
|
|
|
|
|
2016-05-04 01:07:00 +01:00
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
2016-12-15 18:26:39 +00:00
|
|
|
Source file: extras/Hadrons/Modules/MGauge/Load.cc
|
2016-05-04 01:07:00 +01:00
|
|
|
|
2016-12-15 18:26:39 +00:00
|
|
|
Copyright (C) 2015
|
2016-05-04 01:07:00 +01:00
|
|
|
Copyright (C) 2016
|
|
|
|
|
|
|
|
Author: Antonin Portelli <antonin.portelli@me.com>
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2016-12-15 18:26:39 +00:00
|
|
|
See the full license in the file "LICENSE" in the top level distribution directory
|
|
|
|
*************************************************************************************/
|
2016-12-15 18:21:52 +00:00
|
|
|
/* END LEGAL */
|
2016-05-04 01:07:00 +01:00
|
|
|
|
2016-12-05 04:53:31 +00:00
|
|
|
#include <Grid/Hadrons/Modules/MGauge/Load.hpp>
|
2016-05-04 01:07:00 +01:00
|
|
|
|
|
|
|
using namespace Grid;
|
|
|
|
using namespace Hadrons;
|
2016-12-05 04:53:31 +00:00
|
|
|
using namespace MGauge;
|
2016-05-04 01:07:00 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
2016-12-14 17:59:45 +00:00
|
|
|
* TLoad implementation *
|
2016-05-04 01:07:00 +01:00
|
|
|
******************************************************************************/
|
|
|
|
// constructor /////////////////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
TLoad::TLoad(const std::string name)
|
2016-12-05 04:53:31 +00:00
|
|
|
: Module<LoadPar>(name)
|
2016-05-04 01:07:00 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
// dependencies/products ///////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
std::vector<std::string> TLoad::getInput(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
|
|
|
std::vector<std::string> in;
|
|
|
|
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2016-12-14 17:59:45 +00:00
|
|
|
std::vector<std::string> TLoad::getOutput(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
|
|
|
std::vector<std::string> out = {getName()};
|
|
|
|
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
2016-05-07 21:19:38 +01:00
|
|
|
// setup ///////////////////////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
void TLoad::setup(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
2016-05-07 21:19:38 +01:00
|
|
|
env().registerLattice<LatticeGaugeField>(getName());
|
2016-05-04 01:07:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// execution ///////////////////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
void TLoad::execute(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
2017-06-11 23:14:10 +01:00
|
|
|
FieldMetaData header;
|
2016-05-12 11:59:28 +01:00
|
|
|
std::string fileName = par().file + "."
|
2016-05-05 03:11:03 +01:00
|
|
|
+ std::to_string(env().getTrajectory());
|
2016-05-04 01:07:00 +01:00
|
|
|
|
2016-05-04 20:17:27 +01:00
|
|
|
LOG(Message) << "Loading NERSC configuration from file '" << fileName
|
2016-05-04 02:17:58 +01:00
|
|
|
<< "'" << std::endl;
|
2016-06-06 17:45:37 +01:00
|
|
|
LatticeGaugeField &U = *env().createLattice<LatticeGaugeField>(getName());
|
2016-05-07 21:19:38 +01:00
|
|
|
NerscIO::readConfiguration(U, header, fileName);
|
2016-05-04 20:17:27 +01:00
|
|
|
LOG(Message) << "NERSC header:" << std::endl;
|
2017-06-11 23:14:10 +01:00
|
|
|
dump_meta_data(header, LOG(Message));
|
2016-05-04 01:07:00 +01:00
|
|
|
}
|