Skip to content
Snippets Groups Projects
Commit 70d9bd96 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[App] additional config checks

parent 832fa6f4
No related branches found
No related tags found
No related merge requests found
......@@ -74,34 +74,48 @@ int main(int argc, char *argv[])
ApplicationsLib::LogogSetup logog_setup;
logog_setup.setLevel(log_level_arg.getValue());
try {
ApplicationsLib::LinearSolverLibrarySetup linear_solver_library_setup(
argc, argv);
try
{
bool solver_succeeded = false;
{
ApplicationsLib::LinearSolverLibrarySetup
linear_solver_library_setup(argc, argv);
auto project_config = BaseLib::makeConfigTree(
project_arg.getValue(), !nonfatal_arg.getValue(),
"OpenGeoSysProject");
auto project_config = BaseLib::makeConfigTree(
project_arg.getValue(), !nonfatal_arg.getValue(), "OpenGeoSysProject");
ProjectData project(*project_config,
BaseLib::extractPath(project_arg.getValue()),
outdir_arg.getValue());
ProjectData project(*project_config, BaseLib::extractPath(project_arg.getValue()),
outdir_arg.getValue());
// Check intermediately that config parsing went fine.
project_config.checkAndInvalidate();
BaseLib::ConfigTree::assertNoSwallowedErrors();
project_config.checkAndInvalidate();
// Create processes.
project.buildProcesses();
BaseLib::ConfigTree::assertNoSwallowedErrors();
// Create processes.
project.buildProcesses();
INFO("Initialize processes.");
for (auto p_it = project.processesBegin();
p_it != project.processesEnd(); ++p_it)
{
(*p_it)->initialize();
}
INFO("Initialize processes.");
for (auto p_it = project.processesBegin(); p_it != project.processesEnd(); ++p_it)
{
(*p_it)->initialize();
}
BaseLib::ConfigTree::assertNoSwallowedErrors();
INFO("Solve processes.");
INFO("Solve processes.");
auto& time_loop = project.getTimeLoop();
solver_succeeded = time_loop.loop(project);
} // This nested scope ensures that everything that could possibly
// possess a ConfigTree is destructed before the final check below is
// done.
auto& time_loop = project.getTimeLoop();
bool solver_succeeded = time_loop.loop(project);
BaseLib::ConfigTree::assertNoSwallowedErrors();
return solver_succeeded ? EXIT_SUCCESS : EXIT_FAILURE;
} catch (std::exception& e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment