|
12 | 12 | * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. |
13 | 13 | * ------------------------------------------------------------------------------------------------------------ |
14 | 14 | */ |
15 | | -#include "LayeredMeshPartitioner.hpp" |
| 15 | + |
| 16 | + #include "LayeredMeshPartitioner.hpp" |
16 | 17 | #include "mesh/generators/VTKUtilities.hpp" |
17 | 18 |
|
18 | 19 | namespace geos |
@@ -43,16 +44,15 @@ void LayeredMeshPartitioner::postInputInitialization() |
43 | 44 | MeshPartitioner::postInputInitialization(); |
44 | 45 |
|
45 | 46 | // Validate LayeredMeshPartitioner-specific parameters |
46 | | - GEOS_ERROR_IF( m_indexArrayName.empty(), |
47 | | - "LayeredMeshPartitioner requires 'indexArrayName' to be specified" ); |
| 47 | + GEOS_THROW_IF( m_indexArrayName.empty(), |
| 48 | + "LayeredMeshPartitioner requires 'indexArrayName' to be specified", InputError ); |
48 | 49 |
|
49 | | - GEOS_ERROR_IF_LE( m_numPartZ, 0, |
50 | | - "LayeredMeshPartitioner requires 'numPartZ' > 0, got " << m_numPartZ ); |
| 50 | + GEOS_THROW_IF_LE_MSG( m_numPartZ, 0, |
| 51 | + GEOS_FMT( "LayeredMeshPartitioner requires 'numPartZ' > 0, got {}", m_numPartZ ), InputError ); |
51 | 52 |
|
52 | 53 | int const mpiSize = MpiWrapper::commSize( MPI_COMM_GEOS ); |
53 | | - GEOS_ERROR_IF_NE( mpiSize % m_numPartZ, 0, |
54 | | - "Total MPI ranks (" << mpiSize << ") must be evenly divisible by " |
55 | | - << "numPartZ (" << m_numPartZ << ")" ); |
| 54 | + GEOS_THROW_IF_NE_MSG( mpiSize % m_numPartZ, 0, |
| 55 | + GEOS_FMT( "Total MPI ranks ( {} ) must be evenly divisible by numPartZ ({})", mpiSize, m_numPartZ ), InputError ); |
56 | 56 |
|
57 | 57 | GEOS_LOG_RANK_0( GEOS_FMT( "LayeredMeshPartitioner: {} ranks will be partitioned into {} area partitions x {} layer partitions", |
58 | 58 | mpiSize, mpiSize / m_numPartZ, m_numPartZ ) ); |
@@ -90,9 +90,8 @@ void LayeredMeshPartitioner::processCommandLineOverrides( unsigned int const xpa |
90 | 90 | // Default: partition into commSize parts |
91 | 91 | int const mpiSize = MpiWrapper::commSize( MPI_COMM_GEOS ); |
92 | 92 |
|
93 | | - GEOS_ERROR_IF_NE( mpiSize % m_numPartZ, 0, |
94 | | - "Total MPI ranks (" << mpiSize << ") must be evenly divisible by " |
95 | | - << "numPartZ (" << m_numPartZ << ")" ); |
| 93 | + GEOS_THROW_IF_NE_MSG( mpiSize % m_numPartZ, 0, |
| 94 | + GEOS_FMT( "Total MPI ranks ({}) must be evenly divisible by numPartZ ({})", mpiSize, m_numPartZ ), InputError ); |
96 | 95 |
|
97 | 96 | int const areaPartitions = mpiSize / m_numPartZ; |
98 | 97 | setPartitionCounts( 1, areaPartitions, m_numPartZ ); |
|
0 commit comments