Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/coreComponents/common/format/LogPart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ LogPart::LogPart( string_view logpartName, bool enableOutput )
m_formattedEndDescription.m_title = GEOS_FMT( "{}{}", m_prefixEndTitle, logpartName );

m_enableOutput = enableOutput;

ErrorLogger::global().setCurrentLogPart( std::string( logpartName ) );

}

void LogPart::addDescription( string_view description )
Expand Down Expand Up @@ -190,10 +187,11 @@ string LogPart::outputTitle( LogPart::FormattedDescription & formattedDescriptio

void LogPart::begin( std::ostream & os )
{
ErrorLogger::global().setCurrentLogPart( m_formattedStartDescription.m_title );

if( !m_enableOutput )
return;


if( !m_startDescription.m_names.empty())
{
formatDescriptions( m_startDescription, m_formattedStartDescription );
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/common/format/LogPart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LogPart
/**
* @brief Initialize a LogPart given a title
* @param logPartTitle The title who will be used for top and bottom LogPart
* @param enableOutput Boolean to activate or not csv output
* @param enableOutput Boolean to activate or not log output
*/
LogPart( string_view logPartTitle, bool enableOutput );

Expand Down
1 change: 0 additions & 1 deletion src/coreComponents/common/logger/ErrorHandling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define INITIALIZATION_ERROR_LOGGER_HPP

#include "common/DataTypes.hpp"
#include "common/format/LogPart.hpp"
#include "common/logger/LogHistory.hpp"
#include <mutex>

Expand Down
3 changes: 0 additions & 3 deletions src/coreComponents/common/logger/LogHistory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@

#include "common/DataTypes.hpp"
#include "common/StdContainerWrappers.hpp"
#include "common/format/LogPart.hpp"
#include "common/format/table/TableFormatter.hpp"
#include "DiagnosticMessage.hpp"
#include <string>


namespace geos
{
Expand Down
1 change: 1 addition & 0 deletions src/coreComponents/mainInterface/GeosxState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "mainInterface/initialization.hpp"
#include "mesh/mpiCommunications/CommunicationTools.hpp"
#include "common/Timer.hpp"
#include "common/format/LogPart.hpp"

// TPL includes
#include <conduit.hpp>
Expand Down
14 changes: 8 additions & 6 deletions src/coreComponents/mainInterface/ProblemManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,13 @@ void ProblemManager::problemSetup()
generateMesh();
meshGenerationLog.end();

// initialize_postMeshGeneration();
LogPart numericalMethodLog( "Numerical Methods", MpiWrapper::commRank() == 0 );
numericalMethodLog.begin();
applyNumericalMethods();
numericalMethodLog.end();
// initialize_postMeshGeneration();
{
LogPart numericalMethodLog( "Numerical Methods", MpiWrapper::commRank() == 0 );
numericalMethodLog.begin();
applyNumericalMethods();
numericalMethodLog.end();
}

registerDataOnMeshRecursive( getDomainPartition().getMeshBodies() );

Expand All @@ -288,7 +290,7 @@ void ProblemManager::problemSetup()
logHypredriveInputs( *m_physicsSolverManager, getDomainPartition() );
#endif

LogPart importFieldsLog( "Import fields", MpiWrapper::commRank() == 0 );
LogPart importFieldsLog( "Import Fields", MpiWrapper::commRank() == 0 );
importFieldsLog.begin();
importFields();
importFieldsLog.end();
Expand Down
29 changes: 16 additions & 13 deletions src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,24 +384,27 @@ void PhysicsSolverBase::logEndOfCycleInformation( integer const cycleNumber,
integer const numOfSubSteps,
stdVector< real64 > const & subStepDts ) const
{
LogPart logpart( "Time step", MpiWrapper::commRank() == 0 );
logpart.addEndDescription( "- Cycle ", cycleNumber );
logpart.addEndDescription( "- N substeps ", numOfSubSteps );
std::stringstream logMessage;
for( integer i = 0; i < numOfSubSteps; ++i )
{
if( i > 0 )
LogPart logpart( "Time step", MpiWrapper::commRank() == 0 );
logpart.addEndDescription( "- Cycle ", cycleNumber );
logpart.addEndDescription( "- N substeps ", numOfSubSteps );

std::stringstream logMessage;
for( integer i = 0; i < numOfSubSteps; ++i )
{
logMessage << ", ";
if( i > 0 )
{
logMessage << ", ";
}
logMessage << subStepDts[i] << " " << units::getSymbol( units::Unit::Time );
}
logMessage << subStepDts[i] << " " << units::getSymbol( units::Unit::Time );
}

if( logMessage.rdbuf()->in_avail() == 0 )
logMessage << "/";
if( logMessage.rdbuf()->in_avail() == 0 )
logMessage << "/";

logpart.addEndDescription( "- substep dts ", logMessage.str() );
logpart.end();
logpart.addEndDescription( "- substep dts ", logMessage.str() );
logpart.end();
}

if( isLogLevelActive< logInfo::SolverExecutionDetails >( getLogLevel()))
getIterationStats().outputStatistics();
Expand Down
Loading