From 966ace2c536929c9f3b9cf5581a0908e065e8f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 9 Dec 2015 11:20:53 +0100 Subject: [PATCH] Split out printStartupMessage() method. --- opm/autodiff/FlowMain.hpp | 57 ++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/opm/autodiff/FlowMain.hpp b/opm/autodiff/FlowMain.hpp index fdb082d0a..63f5321a2 100644 --- a/opm/autodiff/FlowMain.hpp +++ b/opm/autodiff/FlowMain.hpp @@ -125,34 +125,20 @@ namespace Opm int execute(int argc, char** argv) try { setupParallelism(argc, argv); - - if (output_cout_) - { - std::string version = moduleVersionName(); - std::cout << "**********************************************************************\n"; - std::cout << "* *\n"; - std::cout << "* This is Flow (version " << version << ")" - << std::string(26 - version.size(), ' ') << "*\n"; - std::cout << "* *\n"; - std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n"; - std::cout << "* and is part of OPM. For more information see: *\n"; - std::cout << "* http://opm-project.org *\n"; - std::cout << "* *\n"; - std::cout << "**********************************************************************\n\n"; - } + printStartupMessage(); // Read parameters, see if a deck was specified on the command line. if ( output_cout_ ) { std::cout << "--------------- Reading parameters ---------------" << std::endl; } - parameter::ParameterGroup param(argc, argv, false, output_cout_); if( !output_cout_ ) { param.disableOutput(); } + if (!param.unhandledArguments().empty()) { if (param.unhandledArguments().size() != 1) { std::cerr << "You can only specify a single input deck on the command line.\n"; @@ -427,11 +413,27 @@ namespace Opm // ------------ Data members ------------ + + + + bool output_cout_ = false; bool must_distribute_ = false; + + + + // ------------ Methods ------------ + + + + + // Set up MPI and OpenMP. + // Writes to: + // output_cout_ + // must_distribute_ void setupParallelism(int argc, char** argv) { // MPI setup. @@ -467,6 +469,29 @@ namespace Opm } + + + + // Print startup message if on output rank. + void printStartupMessage() + { + if (output_cout_) { + const std::string version = moduleVersionName(); + std::cout << "**********************************************************************\n"; + std::cout << "* *\n"; + std::cout << "* This is Flow (version " << version << ")" + << std::string(26 - version.size(), ' ') << "*\n"; + std::cout << "* *\n"; + std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n"; + std::cout << "* and is part of OPM. For more information see: *\n"; + std::cout << "* http://opm-project.org *\n"; + std::cout << "* *\n"; + std::cout << "**********************************************************************\n\n"; + } + } + + + }; // class FlowMain