1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

First commit for measurement software 'Hadrons'

This commit is contained in:
Antonin Portelli 2015-10-27 17:33:18 +00:00
parent 8709117aea
commit 538b16610b
10 changed files with 238 additions and 1 deletions

View File

@ -1,5 +1,5 @@
# additional include paths necessary to compile the C++ library
AM_CXXFLAGS = -I$(top_srcdir)/
SUBDIRS = lib tests benchmarks
SUBDIRS = lib tests benchmarks programs
filelist: $(SUBDIRS)

6
configure vendored
View File

@ -6536,6 +6536,10 @@ ac_config_files="$ac_config_files tests/Makefile"
ac_config_files="$ac_config_files benchmarks/Makefile"
ac_config_files="$ac_config_files programs/Makefile"
ac_config_files="$ac_config_files programs/Hadrons/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@ -7279,6 +7283,8 @@ do
"lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"benchmarks/Makefile") CONFIG_FILES="$CONFIG_FILES benchmarks/Makefile" ;;
"programs/Makefile") CONFIG_FILES="$CONFIG_FILES programs/Makefile" ;;
"programs/Hadrons/Makefile") CONFIG_FILES="$CONFIG_FILES programs/Hadrons/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac

View File

@ -175,6 +175,8 @@ AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(lib/Makefile)
AC_CONFIG_FILES(tests/Makefile)
AC_CONFIG_FILES(benchmarks/Makefile)
AC_CONFIG_FILES(programs/Makefile)
AC_CONFIG_FILES(programs/Hadrons/Makefile)
AC_OUTPUT

View File

@ -0,0 +1,58 @@
/*
* Application.cc, part of Grid
*
* Copyright (C) 2015 Antonin Portelli
*
* Grid 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 3 of the License, or
* (at your option) any later version.
*
* Grid 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 Grid. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Hadrons/Application.hpp>
using namespace std;
using namespace Grid;
using namespace Hadrons;
/******************************************************************************
* Application implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
Application::Application(int argc, char *argv[])
{
if (argc < 2)
{
cerr << "usage: " << argv[0] << " <parameter file> [Grid options]";
cerr << endl;
exit(EXIT_FAILURE);
}
parameterFileName_ = argv[1];
Grid_init(&argc, &argv);
HadronsLogError.Active(GridLogError.isActive());
HadronsLogWarning.Active(GridLogWarning.isActive());
HadronsLogMessage.Active(GridLogMessage.isActive());
HadronsLogDebug.Active(GridLogDebug.isActive());
LOG(Message) << "Grid initialized" << endl;
}
// destructor //////////////////////////////////////////////////////////////////
Application::~Application(void)
{
LOG(Message) << "Grid is finalizing now" << endl;
Grid_finalize();
}
// execute /////////////////////////////////////////////////////////////////////
void Application::run(void)
{
}

View File

@ -0,0 +1,47 @@
/*
* Application.hpp, part of Grid
*
* Copyright (C) 2015 Antonin Portelli
*
* Grid 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 3 of the License, or
* (at your option) any later version.
*
* Grid 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 Grid. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef Hadrons_Application_hpp_
#define Hadrons_Application_hpp_
#include <Hadrons/Global.hpp>
BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Main program manager *
******************************************************************************/
class Application
{
public:
// constructor
Application(int argc, char *argv[]);
// destructor
virtual ~Application(void);
// execute
void run(void);
private:
void parseParameters(void);
private:
std::string parameterFileName_;
};
END_HADRONS_NAMESPACE
#endif // Hadrons_Application_hpp_

View File

@ -0,0 +1,31 @@
/*
* Application.cc, part of Grid
*
* Copyright (C) 2015 Antonin Portelli
*
* Grid 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 3 of the License, or
* (at your option) any later version.
*
* Grid 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 Grid. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Hadrons/Global.hpp>
using namespace std;
using namespace Grid;
using namespace Hadrons;
HadronsLogger Hadrons::HadronsLogError(1,"Error");
HadronsLogger Hadrons::HadronsLogWarning(1,"Warning");
HadronsLogger Hadrons::HadronsLogMessage(1,"Message");
HadronsLogger Hadrons::HadronsLogDebug(1,"Debug");

View File

@ -0,0 +1,47 @@
/*
* Globals.hpp, part of Grid
*
* Copyright (C) 2015 Antonin Portelli
*
* LatCore 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 3 of the License, or
* (at your option) any later version.
*
* LatCore 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 LatCore. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef Hadrons_Global_hpp_
#define Hadrons_Global_hpp_
#include <Grid.h>
#define BEGIN_HADRONS_NAMESPACE \
namespace Hadrons {\
using namespace Grid;
#define END_HADRONS_NAMESPACE }
BEGIN_HADRONS_NAMESPACE
class HadronsLogger: public Logger
{
public:
HadronsLogger(int on, std::string nm): Logger("Hadrons", on, nm){};
};
#define LOG(channel) std::cout << HadronsLog##channel
extern HadronsLogger HadronsLogError;
extern HadronsLogger HadronsLogWarning;
extern HadronsLogger HadronsLogMessage;
extern HadronsLogger HadronsLogDebug;
END_HADRONS_NAMESPACE
#endif // Hadrons_Global_hpp_

View File

@ -0,0 +1,32 @@
/*
* Hadrons.cc, part of Grid
*
* Copyright (C) 2015 Antonin Portelli
*
* LatCore 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 3 of the License, or
* (at your option) any later version.
*
* LatCore 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 LatCore. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Hadrons/Application.hpp>
using namespace std;
using namespace Hadrons;
int main(int argc, char *argv[])
{
Application application(argc, argv);
application.run();
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,13 @@
AM_CXXFLAGS = -I$(top_srcdir)/programs -I$(top_srcdir)/lib
AM_LDFLAGS = -L$(top_builddir)/lib
bin_PROGRAMS = Hadrons
Hadrons_SOURCES = \
Application.cc \
Application.hpp \
Global.hpp \
Global.cc \
Hadrons.cc
Hadrons_LDADD = -lGrid

1
programs/Makefile.am Normal file
View File

@ -0,0 +1 @@
SUBDIRS = Hadrons