From 8435757b8ccd183f6cad2afb3deda2e15e624377 Mon Sep 17 00:00:00 2001 From: Matt Shin Date: Wed, 15 Nov 2023 11:28:54 +0000 Subject: [PATCH] Fix partitioner config exception message Improve logic to eliminate config exception message. --- .../meshgenerator/detail/CubedSphereDualMeshGenerator.cc | 4 +--- src/atlas/meshgenerator/detail/CubedSphereMeshGenerator.cc | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/atlas/meshgenerator/detail/CubedSphereDualMeshGenerator.cc b/src/atlas/meshgenerator/detail/CubedSphereDualMeshGenerator.cc index 953a84ed8..9026d92e8 100644 --- a/src/atlas/meshgenerator/detail/CubedSphereDualMeshGenerator.cc +++ b/src/atlas/meshgenerator/detail/CubedSphereDualMeshGenerator.cc @@ -63,9 +63,7 @@ CubedSphereDualMeshGenerator::CubedSphereDualMeshGenerator(const eckit::Parametr // Get partitioner. std::string partitioner; - try { p.get("partitioner.type", partitioner); } catch( std::exception& ) {} - p.get("partitioner", partitioner); - if( partitioner.size() ) { + if (p.get("partitioner", partitioner) && partitioner.size()) { options.set("partitioner", partitioner); } } diff --git a/src/atlas/meshgenerator/detail/CubedSphereMeshGenerator.cc b/src/atlas/meshgenerator/detail/CubedSphereMeshGenerator.cc index c2bd898ab..250d42ed0 100644 --- a/src/atlas/meshgenerator/detail/CubedSphereMeshGenerator.cc +++ b/src/atlas/meshgenerator/detail/CubedSphereMeshGenerator.cc @@ -73,9 +73,7 @@ CubedSphereMeshGenerator::CubedSphereMeshGenerator(const eckit::Parametrisation& // Get partitioner. std::string partitioner; - try { p.get("partitioner.type", partitioner); } catch( std::exception& ) {} - p.get("partitioner", partitioner); - if( partitioner.size() ) { + if (p.get("partitioner", partitioner) && partitioner.size()) { options.set("partitioner", partitioner); } }