Skip to content

Commit

Permalink
remove last old macro
Browse files Browse the repository at this point in the history
  • Loading branch information
arng40 committed Jan 20, 2025
1 parent a747eab commit 2c88cc0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
9 changes: 0 additions & 9 deletions src/coreComponents/common/logger/Logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,6 @@
*/
#define GEOS_ASSERT_GE( lhs, rhs ) GEOS_ASSERT_GE_MSG( lhs, rhs, "" )

/**
* @brief Output messages (with one line per rank) based on current Group's log level.
* @param[in] minLevel minimum log level
* @param[in] msg a message to log (any expression that can be stream inserted)
* @deprecated Will be replaced by GEOS_LOG_LEVEL_INFO_BY_RANK
*/
#define GEOS_LOG_LEVEL_BY_RANK( minLevel, msg ) GEOS_LOG_RANK_IF( this->getLogLevel() >= minLevel, msg )


namespace geos
{

Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/fileIO/LogLevelsInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct ChomboIOInitialization
struct OutputEvents
{
static constexpr int getMinLogLevel() { return 2; }
static constexpr std::string_view getDescription() { return "Information on output events, VTK/ChomboIO"; }
static constexpr std::string_view getDescription() { return "Information on output events (VTK/ChomboIO/HDF5)"; }
};


Expand Down
2 changes: 2 additions & 0 deletions src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ TimeHistoryOutput::TimeHistoryOutput( string const & name,
setDescription( "The current history record to be written, on restart from an earlier time allows use to remove invalid future history." );

addLogLevel< logInfo::DataCollectorInitialization >();
addLogLevel< logInfo::OutputEvents >();
}

void TimeHistoryOutput::initCollectorParallel( DomainPartition const & domain, HistoryCollection & collector )
Expand Down Expand Up @@ -100,6 +101,7 @@ void TimeHistoryOutput::initCollectorParallel( DomainPartition const & domain, H
m_io[idx]->updateCollectingCount( count );
return m_io[idx]->getBufferHead();
} );

m_io.back()->init( !freshInit );
}
};
Expand Down
19 changes: 11 additions & 8 deletions src/coreComponents/fileIO/timeHistory/HDFHistoryIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ void HDFHistoryIO::init( bool existsOkay )
// create a dataset in the file if needed, don't erase file
if( subcomm != MPI_COMM_NULL )
{
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: opening file {}.", m_filename ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3, GEOS_FMT( "TimeHistory: opening file {}.", m_filename ) );
HDFFile target( m_filename, false, true, subcomm );
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: opened file {}.", m_filename ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3, GEOS_FMT( "TimeHistory: opened file {}.", m_filename ) );
bool inTarget = target.hasDataset( m_name );
if( !inTarget )
{
Expand All @@ -238,7 +238,8 @@ void HDFHistoryIO::init( bool existsOkay )
maxFileDims[1] = H5S_UNLIMITED;
hid_t space = H5Screate_simple( m_rank+1, &historyFileDims[0], &maxFileDims[0] );
hid_t dataset = H5Dcreate( target, m_name.c_str(), m_hdfType, space, H5P_DEFAULT, dcplId, H5P_DEFAULT );
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: {}, created hdf5 dataset {}.", m_filename, m_name ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3,
GEOS_FMT( "TimeHistory: {}, created hdf5 dataset {}.", m_filename, m_name ) );
H5Dclose( dataset );
H5Sclose( space );
H5Pclose( dcplId );
Expand All @@ -251,7 +252,7 @@ void HDFHistoryIO::init( bool existsOkay )
{
GEOS_ERROR( "Dataset (" + m_name + ") already exists in output file: " + m_filename );
}
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: closed file {}.", m_filename ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3, GEOS_FMT( "TimeHistory: closed file {}.", m_filename ) );
}
}

Expand Down Expand Up @@ -285,9 +286,9 @@ void HDFHistoryIO::write()

if( m_subcomm != MPI_COMM_NULL )
{
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: opening file {}.", m_filename ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3, GEOS_FMT( "TimeHistory: opening file {}.", m_filename ) );
HDFFile target( m_filename, false, true, m_subcomm );
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: opened file {}.", m_filename ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3, GEOS_FMT( "TimeHistory: opened file {}.", m_filename ) );

if( !target.hasDataset( m_name ) )
{
Expand Down Expand Up @@ -317,7 +318,8 @@ void HDFHistoryIO::write()
hid_t dxplId = H5Pcreate( H5P_DATASET_XFER );
H5Pset_dxpl_mpio( dxplId, H5FD_MPIO_COLLECTIVE );
H5Dwrite( dataset, m_hdfType, memspace, fileHyperslab, dxplId, dataBuffer );
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: wrote row {} of dataset '{}'.", m_writeHead, m_name ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3,
GEOS_FMT( "TimeHistory: wrote row {} of dataset '{}'.", m_writeHead, m_name ) );
H5Pclose( dxplId );

// forward the data buffer pointer to the start of the next row
Expand All @@ -335,7 +337,8 @@ void HDFHistoryIO::write()
H5Sclose( memspace );
H5Sclose( filespace );
H5Dclose( dataset );
GEOS_LOG_LEVEL_BY_RANK( 3, GEOS_FMT( "TimeHistory: closing file {}.", m_filename ) );
GEOS_LOG_RANK_IF( this->getLogLevel() >= 3,
GEOS_FMT( "TimeHistory: closing file {}.", m_filename ) );
}
m_writeHead++;
}
Expand Down
3 changes: 2 additions & 1 deletion src/coreComponents/physicsSolvers/LogLevelsInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace logInfo

/// @cond DO_NOT_DOCUMENT


struct AggregatedSourceFluxStats
{
static constexpr int getMinLogLevel() { return 1; }
Expand All @@ -51,7 +52,7 @@ struct CFL
struct Configuration
{
static constexpr int getMinLogLevel() { return 2; }
static constexpr std::string_view getDescription() { return "Configuration information"; }
static constexpr std::string_view getDescription() { return "Solver runtime settings"; }
};

struct Convergence
Expand Down

0 comments on commit 2c88cc0

Please sign in to comment.