Skip to content

Commit 8001ef2

Browse files
committed
Some of the unit tests use a ton of memory, so add a pool multiplier option
1 parent 9487354 commit 8001ef2

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

components/eamxx/cime_config/namelist_defaults_scream.xml

+1
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ be lost if SCREAM_HACK_XML is not enabled.
531531
<do_subcol_sampling type="logical" doc="Flag to turn on/off subcolumn sampling of optical properties; if false treat cells as either completely clear or cloudy">
532532
true
533533
</do_subcol_sampling>
534+
<pool_size_multiplier type="real">1.0</pool_size_multiplier>
534535
</rrtmgp>
535536

536537
<mac_aero_mic inherit="atm_proc_group">

components/eamxx/src/physics/rrtmgp/eamxx_rrtmgp_process_interface.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@ void RRTMGPRadiation::initialize_impl(const RunType /* run_type */) {
636636
m_n2vmr = m_params.get<double>("n2vmr", 0.7906);
637637
m_covmr = m_params.get<double>("covmr", 1.0e-7);
638638

639+
const double multiplier = m_params.get<double>("pool_size_multiplier", 1.0);
640+
639641
// Whether or not to do MCICA subcolumn sampling
640642
m_do_subcol_sampling = m_params.get<bool>("do_subcol_sampling",true);
641643

@@ -676,7 +678,8 @@ void RRTMGPRadiation::initialize_impl(const RunType /* run_type */) {
676678
m_gas_concs_k,
677679
coefficients_file_sw, coefficients_file_lw,
678680
cloud_optics_file_sw, cloud_optics_file_lw,
679-
m_atm_logger
681+
m_atm_logger,
682+
multiplier
680683
);
681684
VALIDATE_KOKKOS(m_gas_concs, m_gas_concs_k);
682685
VALIDATE_KOKKOS(rrtmgp::k_dist_sw, interface_t::k_dist_sw_k);

components/eamxx/src/physics/rrtmgp/scream_rrtmgp_interface.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,14 @@ static inline cloud_optics_t cloud_optics_lw_k;
214214
static inline bool initialized_k = false;
215215

216216
/*
217-
* Initialize data for RRTMGP driver
217+
* Initialize data for RRTMGP driver. Increase multiplier to allocate more pool space.
218218
*/
219219
static void rrtmgp_initialize(
220220
const gas_concs_t &gas_concs,
221221
const std::string& coefficients_file_sw, const std::string& coefficients_file_lw,
222222
const std::string& cloud_optics_file_sw, const std::string& cloud_optics_file_lw,
223-
const std::shared_ptr<spdlog::logger>& logger)
223+
const std::shared_ptr<spdlog::logger>& logger,
224+
const double multiplier = 1.0)
224225
{
225226
// If we've already initialized, just exit
226227
if (initialized_k) {
@@ -246,7 +247,7 @@ static void rrtmgp_initialize(
246247
const size_t nlay = gas_concs.nlay;
247248
const size_t nlev = SCREAM_NUM_VERTICAL_LEV;
248249
const size_t my_size_ref = ncol * nlay * nlev;
249-
pool_t::init(2e6 * (float(my_size_ref) / base_ref));
250+
pool_t::init(2e6 * (float(my_size_ref) / base_ref) * multiplier);
250251

251252
// We are now initialized!
252253
initialized_k = true;

components/eamxx/src/physics/rrtmgp/tests/rrtmgp_tests.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ int run_kokkos(int argc, char** argv) {
401401

402402
// Initialize absorption coefficients
403403
logger->info("Initialize RRTMGP...\n");
404-
interface_t::rrtmgp_initialize(gas_concs, coefficients_file_sw, coefficients_file_lw, cloud_optics_file_sw, cloud_optics_file_lw, logger);
404+
interface_t::rrtmgp_initialize(gas_concs, coefficients_file_sw, coefficients_file_lw, cloud_optics_file_sw, cloud_optics_file_lw, logger, 2.0);
405405

406406
// Setup our dummy atmosphere based on the input data we read in
407407
logger->info("Setup dummy atmos...\n");

components/eamxx/tests/single-process/rrtmgp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if (SCREAM_ENABLE_BASELINE_TESTS AND NOT SCREAM_ONLY_GENERATE_BASELINES)
1818
CreateUnitTest(${TEST_BASE_NAME}_unit rrtmgp_standalone_unit.cpp
1919
LABELS rrtmgp physics driver
2020
LIBS scream_rrtmgp rrtmgp scream_control ${YAKL_LIB_NAME} diagnostics rrtmgp_test_utils
21-
EXE_ARGS "--args --inputfile ${SCREAM_DATA_DIR}/init/rrtmgp-allsky.nc --baseline ${SCREAM_BASELINES_DIR}/data/rrtmgp-allsky-baseline.nc"
21+
EXE_ARGS "--args --rrtmgp_inputfile ${SCREAM_DATA_DIR}/init/rrtmgp-allsky.nc --rrtmgp_baseline ${SCREAM_BASELINES_DIR}/data/rrtmgp-allsky-baseline.nc"
2222
)
2323
endif()
2424

components/eamxx/tests/single-process/rrtmgp/input_unit.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ atmosphere_processes:
2121
rrtmgp_coefficients_file_lw: ${SCREAM_DATA_DIR}/init/rrtmgp-data-lw-g256-2018-12-04.nc
2222
rrtmgp_cloud_optics_file_sw: ${SCREAM_DATA_DIR}/init/rrtmgp-cloud-optics-coeffs-sw.nc
2323
rrtmgp_cloud_optics_file_lw: ${SCREAM_DATA_DIR}/init/rrtmgp-cloud-optics-coeffs-lw.nc
24+
pool_size_multiplier: 2.0
2425

2526
grids_manager:
2627
Type: Mesh Free

0 commit comments

Comments
 (0)