1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Hadrons: the XML runner can use a precomputed schedule

This commit is contained in:
Antonin Portelli 2016-12-14 19:41:30 +00:00
parent ab92de89ab
commit f63fac0c69

View File

@ -1,7 +1,7 @@
/******************************************************************************* /*******************************************************************************
Grid physics library, www.github.com/paboyle/Grid Grid physics library, www.github.com/paboyle/Grid
Source file: programs/Hadrons/Hadrons.cc Source file: programs/Hadrons/HadronsXmlRun.cc
Copyright (C) 2015 Copyright (C) 2015
@ -34,15 +34,22 @@ using namespace Hadrons;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// parse command line // parse command line
std::string parameterFileName; std::string parameterFileName, scheduleFileName = "";
if (argc < 2) if (argc < 2)
{ {
std::cerr << "usage: " << argv[0] << " <parameter file> [Grid options]"; std::cerr << "usage: " << argv[0] << " <parameter file> [<precomputed schedule>] [Grid options]";
std::cerr << std::endl; std::cerr << std::endl;
std::exit(EXIT_FAILURE); std::exit(EXIT_FAILURE);
} }
parameterFileName = argv[1]; parameterFileName = argv[1];
if (argc > 2)
{
if (argv[2][0] != '-')
{
scheduleFileName = argv[2];
}
}
// initialization // initialization
Grid_init(&argc, &argv); Grid_init(&argc, &argv);
@ -56,6 +63,11 @@ int main(int argc, char *argv[])
// execution // execution
Application application(parameterFileName); Application application(parameterFileName);
application.parseParameterFile(parameterFileName);
if (!scheduleFileName.empty())
{
application.loadSchedule(scheduleFileName);
}
application.run(); application.run();
// epilogue // epilogue