Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Log level documentation on remaining package #3494

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions src/coreComponents/events/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ set( events_headers
HaltEvent.hpp
PeriodicEvent.hpp
SoloEvent.hpp
LogLevelsInfo.hpp
tasks/TaskBase.hpp
tasks/TasksManager.hpp
)
Expand Down
7 changes: 4 additions & 3 deletions src/coreComponents/events/EventBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "EventBase.hpp"
#include <cstring>

#include "events/LogLevelsInfo.hpp"
#include "common/DataTypes.hpp"
#include "common/TimingMacros.hpp"

Expand Down Expand Up @@ -243,9 +244,9 @@ bool EventBase::execute( real64 const time_n,
EventBase * subEvent = static_cast< EventBase * >( this->getSubGroups()[m_currentSubEvent] );

// Print debug information for logLevel >= 1
GEOS_LOG_LEVEL_RANK_0( 1,
" SubEvent: " << m_currentSubEvent << " (" << subEvent->getName() << "), dt_request=" << subEvent->getCurrentEventDtRequest() << ", forecast=" <<
subEvent->getForecast() );
GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::EventExecution,
" SubEvent: " << m_currentSubEvent << " (" << subEvent->getName() << "), dt_request=" << subEvent->getCurrentEventDtRequest() << ", forecast=" <<
subEvent->getForecast() );

if( subEvent->isReadyForExec() )
{
Expand Down
5 changes: 3 additions & 2 deletions src/coreComponents/events/EventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "events/EventBase.hpp"
#include "common/MpiWrapper.hpp"
#include "common/Units.hpp"
#include "events/LogLevelsInfo.hpp"

namespace geos
{
Expand Down Expand Up @@ -182,8 +183,8 @@ bool EventManager::run( DomainPartition & domain )
subEvent->checkEvents( m_time, m_dt, m_cycle, domain );

// Print debug information for logLevel >= 1
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "Event: {} ({}), dt_request={}, forecast={}",
m_currentSubEvent, subEvent->getName(), subEvent->getCurrentEventDtRequest(), subEvent->getForecast() ) );
GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::EventExecution, GEOS_FMT( "Event: {} ({}), dt_request={}, forecast={}",
m_currentSubEvent, subEvent->getName(), subEvent->getCurrentEventDtRequest(), subEvent->getForecast() ) );

// Execute, signal events
bool earlyReturn = false;
Expand Down
57 changes: 57 additions & 0 deletions src/coreComponents/events/LogLevelsInfo.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2018-2020 TotalEnergies
* Copyright (c) 2019- GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file LogLevelsInfo.hpp
* This file contains common log level informations for physics solvers
*/

#ifndef GEOS_EVENTS_LOGLEVELSINFO_HPP
#define GEOS_EVENTS_LOGLEVELSINFO_HPP

#include "common/DataTypes.hpp"

namespace geos
{

namespace logInfo
{

/**
* @name Common LogLevels info structures. They must comply with the `is_log_level_info` trait.
*/
///@{

/// @cond DO_NOT_DOCUMENT

struct Initialization
{
static constexpr int getMinLogLevel() { return 3; }
static constexpr std::string_view getDescription() { return "Information on Initialization"; }
};
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved

struct EventExecution
{
static constexpr int getMinLogLevel() { return 1; }
static constexpr std::string_view getDescription() { return "Informations on events executed"; }
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
};

/// @endcond
///@}

}

}

#endif // GEOS_EVENTS_LOGLEVELSINFO_HPP
3 changes: 3 additions & 0 deletions src/coreComponents/events/tasks/TaskBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ TaskBase::TaskBase( string const & name,
ExecutableGroup( name, parent )
{
setInputFlags( InputFlags::OPTIONAL_NONUNIQUE );

addLogLevel< logInfo::Initialization >();
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
addLogLevel< logInfo::EventExecution >();
}

TaskBase::~TaskBase()
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/events/tasks/TaskBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#define GEOS_EVENTS_TASKS_TASKBASE_HPP_


#include <limits>

#include <limits>
#include "events/LogLevelsInfo.hpp"
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
#include "dataRepository/ExecutableGroup.hpp"
#include "common/DataTypes.hpp"
namespace geos
Expand Down
1 change: 1 addition & 0 deletions src/coreComponents/fileIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Contains:
# Specify all headers
#
set( fileIO_headers
LogLevelsInfo.hpp
Outputs/BlueprintOutput.hpp
Outputs/OutputBase.hpp
Outputs/OutputManager.hpp
Expand Down
58 changes: 58 additions & 0 deletions src/coreComponents/fileIO/LogLevelsInfo.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2018-2020 TotalEnergies
* Copyright (c) 2019- GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file LogLevelsInfo.hpp
* This file contains common log level informations for physics solvers
*/

#ifndef GEOS_FILEIO_LOGLEVELSINFO_HPP
#define GEOS_FILEIO_LOGLEVELSINFO_HPP

#include "common/DataTypes.hpp"

namespace geos
{

namespace logInfo
{

/**
* @name Common LogLevels info structures. They must comply with the `is_log_level_info` trait.
*/
///@{

/// @cond DO_NOT_DOCUMENT

struct OutputEvents
{
static constexpr int getMinLogLevel() { return 1; }
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
static constexpr std::string_view getDescription() { return "Information on output events, VTK/ChomboIO"; }
};


struct Writing
{
static constexpr int getMinLogLevel() { return 3; }
static constexpr std::string_view getDescription() { return "Information on buffered data in an HDF5 file "; }
};
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved

/// @endcond
///@}

}

}

#endif // GEOS_FILEIO_LOGLEVELSINFO_HPP
5 changes: 4 additions & 1 deletion src/coreComponents/fileIO/Outputs/ChomboIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ChomboIO.hpp"
#include "mesh/MeshLevel.hpp"
#include "mesh/DomainPartition.hpp"
#include "fileIO/LogLevelsInfo.hpp"
#include "fileIO/coupling/ChomboCoupler.hpp"

#include <fstream>
Expand Down Expand Up @@ -75,6 +76,8 @@ ChomboIO::ChomboIO( string const & name, Group * const parent ):
setInputFlag( InputFlags::OPTIONAL ).
setDefaultValue( 0 ).
setDescription( "True iff geos should use the pressures chombo writes out." );

addLogLevel< logInfo::OutputEvents >();
}

ChomboIO::~ChomboIO()
Expand All @@ -100,7 +103,7 @@ bool ChomboIO::execute( real64 const GEOS_UNUSED_PARAM( time_n ),
{
GEOS_ERROR_IF( m_waitForInput && m_inputPath == "/INVALID_INPUT_PATH", "Waiting for input but no input path was specified." );

GEOS_LOG_LEVEL_RANK_0( 1, "Initializing chombo coupling" );
GEOS_LOG_LEVEL_INFO( logInfo::OutputEvents, "Initializing chombo coupling" );
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved

m_coupler = new ChomboCoupler( MPI_COMM_GEOS, m_outputPath, m_inputPath, domain.getMeshBody( 0 ).getBaseDiscretization() );

Expand Down
4 changes: 3 additions & 1 deletion src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "TimeHistoryOutput.hpp"

#include "fileIO/timeHistory/HDFFile.hpp"
#include "fileIO/LogLevelsInfo.hpp"

#if defined(GEOS_USE_PYGEOSX)
#include "fileIO/python/PyHistoryOutputType.hpp"
Expand Down Expand Up @@ -71,6 +72,7 @@ TimeHistoryOutput::TimeHistoryOutput( string const & name,
setRestartFlags( RestartFlags::WRITE_AND_READ ).
setDescription( "The current history record to be written, on restart from an earlier time allows use to remove invalid future history." );

addLogLevel< logInfo::Initialization >();
}

void TimeHistoryOutput::initCollectorParallel( DomainPartition const & domain, HistoryCollection & collector )
Expand Down Expand Up @@ -143,7 +145,7 @@ void TimeHistoryOutput::initializePostInitialConditionsPostSubGroups()
}

DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: '{}' initializing data collectors.", this->getName() ) );
GEOS_LOG_LEVEL_INFO_BY_RANK( logInfo::Initialization, GEOS_FMT( "TimeHistory: '{}' initializing data collectors.", this->getName() ) );
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
for( auto collectorPath : m_collectorPaths )
{
try
Expand Down
8 changes: 4 additions & 4 deletions src/coreComponents/fileIO/Outputs/VTKOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include "VTKOutput.hpp"
#include "fileIO/LogLevelsInfo.hpp"
#include "common/MpiWrapper.hpp"

#if defined(GEOS_USE_PYGEOSX)
Expand Down Expand Up @@ -109,6 +110,8 @@ VTKOutput::VTKOutput( string const & name,
setApplyDefaultValue( m_outputRegionType ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Output region types. Valid options: ``" + EnumStrings< vtk::VTKRegionTypes >::concat( "``, ``" ) + "``" );

addLogLevel< logInfo::OutputEvents >();
}

VTKOutput::~VTKOutput()
Expand Down Expand Up @@ -173,11 +176,8 @@ bool VTKOutput::execute( real64 const time_n,
real64 const GEOS_UNUSED_PARAM ( eventProgress ),
DomainPartition & domain )
{
GEOS_MARK_FUNCTION;

GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{}: writing {} at time {} s (cycle number {})", getName(), m_fieldNames, time_n + dt, cycleNumber ));

{
GEOS_LOG_LEVEL_INFO( logInfo::OutputEvents, GEOS_FMT( "{}: writing {} at time {} s (cycle number {})", getName(), m_fieldNames, time_n + dt, cycleNumber ));
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
Timer timer( m_outputTimer );

m_writer.setWriteGhostCells( m_writeGhostCells );
Expand Down
1 change: 1 addition & 0 deletions src/coreComponents/mesh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ set( mesh_headers
ExternalDataSourceManager.hpp
EmbeddedSurfaceNodeManager.hpp
EmbeddedSurfaceSubRegion.hpp
LogLevelsInfo.hpp
MeshFields.hpp
FaceElementSubRegion.hpp
FaceManager.hpp
Expand Down
5 changes: 4 additions & 1 deletion src/coreComponents/mesh/DomainPartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "mesh/ObjectManagerBase.hpp"
#include "mesh/mpiCommunications/CommunicationTools.hpp"
#include "mesh/mpiCommunications/SpatialPartition.hpp"
#include "mesh/LogLevelsInfo.hpp"


namespace geos
Expand All @@ -45,6 +46,8 @@ DomainPartition::DomainPartition( string const & name,

registerGroup( groupKeys.meshBodies );
registerGroup< constitutive::ConstitutiveManager >( groupKeys.constitutiveManager );

addLogLevel< logInfo::PartitionCommunication >();
}


Expand Down Expand Up @@ -262,7 +265,7 @@ void DomainPartition::setupCommunications( bool use_nonblocking )
}
else
{
GEOS_LOG_LEVEL_RANK_0( 3, "No communication setup is needed since it is a shallow copy of the base discretization." );
GEOS_LOG_LEVEL_INFO_RANK_0( logInfo::PartitionCommunication, "No communication setup is needed since it is a shallow copy of the base discretization." );
}
}
} );
Expand Down
70 changes: 70 additions & 0 deletions src/coreComponents/mesh/LogLevelsInfo.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2018-2020 TotalEnergies
* Copyright (c) 2019- GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file LogLevelsInfo.hpp
* This file contains common log level informations for physics solvers
*/

#ifndef GEOS_PHYSICSSOLVERS_LOGLEVELSINFO_HPP
#define GEOS_PHYSICSSOLVERS_LOGLEVELSINFO_HPP

#include "common/DataTypes.hpp"

namespace geos
{

namespace logInfo
{

/**
* @name Common LogLevels info structures. They must comply with the `is_log_level_info` trait.
*/
///@{

/// @cond DO_NOT_DOCUMENT

struct MeshState
{
static constexpr int getMinLogLevel() { return 2; }
static constexpr std::string_view getDescription() { return "Well phase volume fraction change information"; }
};

struct Statistics
{
static constexpr int getMinLogLevel() { return 2; }
static constexpr std::string_view getDescription() { return "well statistics information"; }
};

struct PartitionCommunication
{
static constexpr int getMinLogLevel() { return 3; }
static constexpr std::string_view getDescription() { return "Domain partition setup communication"; }
};

struct VTKSteps
{
static constexpr int getMinLogLevel() { return 2; }
static constexpr std::string_view getDescription() { return "Display VTK mesh generator steps"; }
};


/// @endcond
///@}

}

}

#endif // GEOS_PHYSICSSOLVERS_LOGLEVELSINFO_HPP
Loading
Loading