1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-04 19:25:56 +01:00

Hadrons: new MIO module namespace, NERSC loader moved there

This commit is contained in:
Antonin Portelli 2017-12-26 14:05:17 +01:00
parent 6718fa8c4f
commit 185da83454
4 changed files with 32 additions and 40 deletions

View File

@ -2,13 +2,12 @@
Grid physics library, www.github.com/paboyle/Grid Grid physics library, www.github.com/paboyle/Grid
Source file: extras/Hadrons/Modules.hpp Source file: Modules.hpp
Copyright (C) 2015 Copyright (C) 2015-2018
Copyright (C) 2016
Copyright (C) 2017
Author: Antonin Portelli <antonin.portelli@me.com> Author: Antonin Portelli <antonin.portelli@me.com>
Author: Lanny91 <andrew.lawson@gmail.com>
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -46,7 +45,6 @@ See the full license in the file "LICENSE" in the top level distribution directo
#include <Grid/Hadrons/Modules/MSink/Smear.hpp> #include <Grid/Hadrons/Modules/MSink/Smear.hpp>
#include <Grid/Hadrons/Modules/MSink/Point.hpp> #include <Grid/Hadrons/Modules/MSink/Point.hpp>
#include <Grid/Hadrons/Modules/MSolver/RBPrecCG.hpp> #include <Grid/Hadrons/Modules/MSolver/RBPrecCG.hpp>
#include <Grid/Hadrons/Modules/MGauge/Load.hpp>
#include <Grid/Hadrons/Modules/MGauge/Unit.hpp> #include <Grid/Hadrons/Modules/MGauge/Unit.hpp>
#include <Grid/Hadrons/Modules/MGauge/Random.hpp> #include <Grid/Hadrons/Modules/MGauge/Random.hpp>
#include <Grid/Hadrons/Modules/MGauge/StochEm.hpp> #include <Grid/Hadrons/Modules/MGauge/StochEm.hpp>
@ -58,3 +56,4 @@ See the full license in the file "LICENSE" in the top level distribution directo
#include <Grid/Hadrons/Modules/MScalar/ChargedProp.hpp> #include <Grid/Hadrons/Modules/MScalar/ChargedProp.hpp>
#include <Grid/Hadrons/Modules/MAction/DWF.hpp> #include <Grid/Hadrons/Modules/MAction/DWF.hpp>
#include <Grid/Hadrons/Modules/MAction/Wilson.hpp> #include <Grid/Hadrons/Modules/MAction/Wilson.hpp>
#include <Grid/Hadrons/Modules/MIO/LoadNersc.hpp>

View File

@ -2,12 +2,10 @@
Grid physics library, www.github.com/paboyle/Grid Grid physics library, www.github.com/paboyle/Grid
Source file: extras/Hadrons/Modules/MGauge/Load.cc Source file: LoadNersc.cc
Copyright (C) 2015 Copyright (C) 2015-2018
Copyright (C) 2016
Author: Antonin Portelli <antonin.portelli@me.com>
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -26,30 +24,29 @@ with this program; if not, write to the Free Software Foundation, Inc.,
See the full license in the file "LICENSE" in the top level distribution directory See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/ *************************************************************************************/
/* END LEGAL */ /* END LEGAL */
#include <Grid/Hadrons/Modules/MIO/LoadNersc.hpp>
#include <Grid/Hadrons/Modules/MGauge/Load.hpp>
using namespace Grid; using namespace Grid;
using namespace Hadrons; using namespace Hadrons;
using namespace MGauge; using namespace MIO;
/****************************************************************************** /******************************************************************************
* TLoad implementation * * TLoadNersc implementation *
******************************************************************************/ ******************************************************************************/
// constructor ///////////////////////////////////////////////////////////////// // constructor /////////////////////////////////////////////////////////////////
TLoad::TLoad(const std::string name) TLoadNersc::TLoadNersc(const std::string name)
: Module<LoadPar>(name) : Module<LoadNerscPar>(name)
{} {}
// dependencies/products /////////////////////////////////////////////////////// // dependencies/products ///////////////////////////////////////////////////////
std::vector<std::string> TLoad::getInput(void) std::vector<std::string> TLoadNersc::getInput(void)
{ {
std::vector<std::string> in; std::vector<std::string> in;
return in; return in;
} }
std::vector<std::string> TLoad::getOutput(void) std::vector<std::string> TLoadNersc::getOutput(void)
{ {
std::vector<std::string> out = {getName()}; std::vector<std::string> out = {getName()};
@ -57,13 +54,13 @@ std::vector<std::string> TLoad::getOutput(void)
} }
// setup /////////////////////////////////////////////////////////////////////// // setup ///////////////////////////////////////////////////////////////////////
void TLoad::setup(void) void TLoadNersc::setup(void)
{ {
envCreateLat(LatticeGaugeField, getName()); envCreateLat(LatticeGaugeField, getName());
} }
// execution /////////////////////////////////////////////////////////////////// // execution ///////////////////////////////////////////////////////////////////
void TLoad::execute(void) void TLoadNersc::execute(void)
{ {
FieldMetaData header; FieldMetaData header;
std::string fileName = par().file + "." std::string fileName = par().file + "."

View File

@ -2,12 +2,10 @@
Grid physics library, www.github.com/paboyle/Grid Grid physics library, www.github.com/paboyle/Grid
Source file: extras/Hadrons/Modules/MGauge/Load.hpp Source file: LoadNersc.hpp
Copyright (C) 2015 Copyright (C) 2015-2018
Copyright (C) 2016
Author: Antonin Portelli <antonin.portelli@me.com>
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -26,9 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
See the full license in the file "LICENSE" in the top level distribution directory See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/ *************************************************************************************/
/* END LEGAL */ /* END LEGAL */
#ifndef Hadrons_MIO_LoadNersc_hpp_
#ifndef Hadrons_MGauge_Load_hpp_ #define Hadrons_MIO_LoadNersc_hpp_
#define Hadrons_MGauge_Load_hpp_
#include <Grid/Hadrons/Global.hpp> #include <Grid/Hadrons/Global.hpp>
#include <Grid/Hadrons/Module.hpp> #include <Grid/Hadrons/Module.hpp>
@ -37,38 +34,37 @@ See the full license in the file "LICENSE" in the top level distribution directo
BEGIN_HADRONS_NAMESPACE BEGIN_HADRONS_NAMESPACE
/****************************************************************************** /******************************************************************************
* Load a NERSC configuration * * Load a NERSC configuration *
******************************************************************************/ ******************************************************************************/
BEGIN_MODULE_NAMESPACE(MGauge) BEGIN_MODULE_NAMESPACE(MIO)
class LoadPar: Serializable class LoadNerscPar: Serializable
{ {
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadPar, GRID_SERIALIZABLE_CLASS_MEMBERS(LoadNerscPar,
std::string, file); std::string, file);
}; };
class TLoad: public Module<LoadPar> class TLoadNersc: public Module<LoadNerscPar>
{ {
public: public:
// constructor // constructor
TLoad(const std::string name); TLoadNersc(const std::string name);
// destructor // destructor
virtual ~TLoad(void) = default; virtual ~TLoadNersc(void) = default;
// dependency relation // dependency relation
virtual std::vector<std::string> getInput(void); virtual std::vector<std::string> getInput(void);
virtual std::vector<std::string> getOutput(void); virtual std::vector<std::string> getOutput(void);
protected:
// setup // setup
virtual void setup(void); virtual void setup(void);
// execution // execution
virtual void execute(void); virtual void execute(void);
}; };
MODULE_REGISTER_NS(Load, TLoad, MGauge); MODULE_REGISTER_NS(LoadNersc, TLoadNersc, MIO);
END_MODULE_NAMESPACE END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE END_HADRONS_NAMESPACE
#endif // Hadrons_MGauge_Load_hpp_ #endif // Hadrons_MIO_LoadNersc_hpp_

View File

@ -2,12 +2,12 @@ modules_cc =\
Modules/MContraction/WeakHamiltonianEye.cc \ Modules/MContraction/WeakHamiltonianEye.cc \
Modules/MContraction/WeakNeutral4ptDisc.cc \ Modules/MContraction/WeakNeutral4ptDisc.cc \
Modules/MContraction/WeakHamiltonianNonEye.cc \ Modules/MContraction/WeakHamiltonianNonEye.cc \
Modules/MGauge/Load.cc \
Modules/MGauge/Unit.cc \ Modules/MGauge/Unit.cc \
Modules/MGauge/StochEm.cc \ Modules/MGauge/StochEm.cc \
Modules/MGauge/Random.cc \ Modules/MGauge/Random.cc \
Modules/MScalar/FreeProp.cc \ Modules/MScalar/FreeProp.cc \
Modules/MScalar/ChargedProp.cc Modules/MScalar/ChargedProp.cc \
Modules/MIO/LoadNersc.cc
modules_hpp =\ modules_hpp =\
Modules/MContraction/Baryon.hpp \ Modules/MContraction/Baryon.hpp \
@ -28,7 +28,6 @@ modules_hpp =\
Modules/MSink/Smear.hpp \ Modules/MSink/Smear.hpp \
Modules/MSink/Point.hpp \ Modules/MSink/Point.hpp \
Modules/MSolver/RBPrecCG.hpp \ Modules/MSolver/RBPrecCG.hpp \
Modules/MGauge/Load.hpp \
Modules/MGauge/Unit.hpp \ Modules/MGauge/Unit.hpp \
Modules/MGauge/Random.hpp \ Modules/MGauge/Random.hpp \
Modules/MGauge/StochEm.hpp \ Modules/MGauge/StochEm.hpp \
@ -39,5 +38,6 @@ modules_hpp =\
Modules/MScalar/Scalar.hpp \ Modules/MScalar/Scalar.hpp \
Modules/MScalar/ChargedProp.hpp \ Modules/MScalar/ChargedProp.hpp \
Modules/MAction/DWF.hpp \ Modules/MAction/DWF.hpp \
Modules/MAction/Wilson.hpp Modules/MAction/Wilson.hpp \
Modules/MIO/LoadNersc.hpp