diff --git a/src/coreComponents/common/LifoStorageCommon.hpp b/src/coreComponents/common/LifoStorageCommon.hpp index 3183cde65b8..7d18978aa70 100644 --- a/src/coreComponents/common/LifoStorageCommon.hpp +++ b/src/coreComponents/common/LifoStorageCommon.hpp @@ -164,7 +164,7 @@ class LifoStorageCommon GEOS_ERROR( "To use LifoStorage, both _SC_AVPHYS_PAGES and _SC_PAGESIZE must be defined." ); #endif int numberOfBuffersToStoreOnHost = std::max( 1, std::min( ( int )( 0.01 * percent * free / bufferSize ), maxNumberOfBuffers - numberOfBuffersToStoreOnDevice ) ); - double freeGB = ( ( double ) free ) / ( 1024.0 * 1024.0 * 1024.0 ) / MpiWrapper::nodeCommSize(); + GEOS_MAYBE_UNUSED double freeGB = ( ( double ) free ) / ( 1024.0 * 1024.0 * 1024.0 ) / MpiWrapper::nodeCommSize(); LIFO_LOG_RANK( " LIFO : available memory on host " << freeGB << " GB" ); return numberOfBuffersToStoreOnHost; } diff --git a/src/coreComponents/common/TypeDispatch.hpp b/src/coreComponents/common/TypeDispatch.hpp index b38b5858066..70a207b45fc 100644 --- a/src/coreComponents/common/TypeDispatch.hpp +++ b/src/coreComponents/common/TypeDispatch.hpp @@ -376,7 +376,7 @@ bool dispatch( LIST const combinations, if( !success ) { auto typePrinter = []( auto t ){ return LvArray::system::demangle( typeid( typename decltype(t)::type ).name() ); }; - auto typeListPrinter = [typePrinter]( auto tlist ){ return internal::listToString( typename decltype( tlist )::type{}, "\n ", "", typePrinter ); }; + GEOS_MAYBE_UNUSED auto typeListPrinter = [typePrinter]( auto tlist ){ return internal::listToString( typename decltype( tlist )::type{}, "\n ", "", typePrinter ); }; GEOS_ERROR( "Types were not dispatched to the lambda of type\n" << LvArray::system::demangleType< LAMBDA >() << "\n" diff --git a/src/coreComponents/dataRepository/ObjectCatalog.hpp b/src/coreComponents/dataRepository/ObjectCatalog.hpp index 2fd0762c97b..862cd91b704 100644 --- a/src/coreComponents/dataRepository/ObjectCatalog.hpp +++ b/src/coreComponents/dataRepository/ObjectCatalog.hpp @@ -181,7 +181,7 @@ class CatalogInterface */ //START_SPHINX_2 static std::unique_ptr< BASETYPE > factory( std::string const & objectTypeName, - DataContext const & context, + GEOS_MAYBE_UNUSED DataContext const & context, ARGS... args ) { // We stop the simulation if the type to create is not found diff --git a/src/coreComponents/mesh/FaceElementSubRegion.cpp b/src/coreComponents/mesh/FaceElementSubRegion.cpp index b7ee007a270..bade2797db7 100644 --- a/src/coreComponents/mesh/FaceElementSubRegion.cpp +++ b/src/coreComponents/mesh/FaceElementSubRegion.cpp @@ -449,10 +449,11 @@ localIndex FaceElementSubRegion::unpackToFaceRelation( buffer_unit_type const * * @param[in] elem2dToElems3d A mapping. * @param[in,out] elem2dToFaces This mapping will be corrected if needed to match @p elem2dToElems3d. */ -void fixNeighborMappingsInconsistency( string const & fractureName, +void fixNeighborMappingsInconsistency( GEOS_MAYBE_UNUSED string const & fractureName, FixedToManyElementRelation const & elem2dToElems3d, FaceElementSubRegion::FaceMapType & elem2dToFaces ) { + GEOS_MAYBE_UNUSED static constexpr std::string_view mappingInconsistency= "Mapping neighbor inconsistency detected for fracture {}."; { localIndex const num2dElems = elem2dToFaces.size( 0 ); for( int e2d = 0; e2d < num2dElems; ++e2d ) @@ -486,9 +487,9 @@ void fixNeighborMappingsInconsistency( string const & fractureName, { std::swap( elem2dToFaces[e2d][0], elem2dToFaces[e2d][1] ); } - else if( !matchStraight ) + else { - GEOS_ERROR( "Mapping neighbor inconsistency detected for fracture " << fractureName ); + GEOS_ERROR_IF( !matchStraight, GEOS_FMT( mappingInconsistency, fractureName ) ); } } } @@ -608,8 +609,7 @@ buildCollocatedEdgeBuckets( std::map< globalIndex, globalIndex > const & referen std::map< std::pair< globalIndex, globalIndex >, std::set< localIndex > > collocatedEdgeBuckets; for( auto const & p: edgesIds ) { - static constexpr auto nodeNotFound = "Internal error when trying to access the reference collocated node for global node {}."; - GEOS_UNUSED_VAR( nodeNotFound ); // Not used in GPU builds. + GEOS_MAYBE_UNUSED static constexpr auto nodeNotFound = "Internal error when trying to access the reference collocated node for global node {}."; std::pair< globalIndex, globalIndex > const & nodes = p.first; localIndex const & edge = p.second; diff --git a/src/coreComponents/mesh/PerforationData.cpp b/src/coreComponents/mesh/PerforationData.cpp index 69d738abb95..f7d7cd2325b 100644 --- a/src/coreComponents/mesh/PerforationData.cpp +++ b/src/coreComponents/mesh/PerforationData.cpp @@ -143,7 +143,7 @@ void PerforationData::computeWellTransmissibility( MeshLevel const & mesh, if( close_perf ) { m_localPerfStatus[iperf] = PerforationStatus::CLOSED; - WellElementRegion const & wellRegion = dynamicCast< WellElementRegion const & >( wellElemSubRegion.getParent().getParent() ); + GEOS_MAYBE_UNUSED WellElementRegion const & wellRegion = dynamicCast< WellElementRegion const & >( wellElemSubRegion.getParent().getParent() ); GEOS_LOG_RANK( "\n \nWarning! Perforation " << wellRegion.getWellGeneratorName() << " is defined with a zero transmissibility.\n" << "The simulation is going to proceed with this zero transmissibility,\n" << diff --git a/src/coreComponents/mesh/generators/ParMETISInterface.hpp b/src/coreComponents/mesh/generators/ParMETISInterface.hpp index fa1bb2c8545..8e948f762e1 100644 --- a/src/coreComponents/mesh/generators/ParMETISInterface.hpp +++ b/src/coreComponents/mesh/generators/ParMETISInterface.hpp @@ -26,13 +26,8 @@ namespace geos { -#if defined(GEOS_USE_HIP) // still need int32 hypre for the current hip-capable build -/// Typedef to allow us to specify required parmetis integer type. -using pmet_idx_t = int32_t; -#else /// Typedef to allow us to specify required parmetis integer type. using pmet_idx_t = int64_t; -#endif namespace parmetis { diff --git a/src/coreComponents/mesh/generators/WellGeneratorBase.cpp b/src/coreComponents/mesh/generators/WellGeneratorBase.cpp index c92967ed8dc..47926e0da5b 100644 --- a/src/coreComponents/mesh/generators/WellGeneratorBase.cpp +++ b/src/coreComponents/mesh/generators/WellGeneratorBase.cpp @@ -78,7 +78,7 @@ WellGeneratorBase::WellGeneratorBase( string const & name, Group * const parent Group * WellGeneratorBase::createChild( string const & childKey, string const & childName ) { GEOS_LOG_RANK_0( GEOS_FMT( "{}: adding {} {}", getName(), childKey, childName ) ); - const auto childTypes = { viewKeyStruct::perforationString() }; + GEOS_MAYBE_UNUSED const auto childTypes = { viewKeyStruct::perforationString() }; GEOS_ERROR_IF( childKey != viewKeyStruct::perforationString(), CatalogInterface::unknownTypeError( childKey, getDataContext(), childTypes ) ); diff --git a/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp b/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp index 5beecb1842c..fbcd9258750 100644 --- a/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp +++ b/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp @@ -215,7 +215,7 @@ void SpatialPartition::setSizes( real64 const ( &min )[ 3 ], //check to make sure our dimensions agree { - string_view partitionsLogMessage = + GEOS_MAYBE_UNUSED string_view partitionsLogMessage = "The total number of processes = {} does not correspond to the total number of partitions = {}.\n" "The number of cells in an axis cannot be lower that the partition count of this axis\n";