Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParmPaser::queryAdd #2573

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions Src/Amr/AMReX_Amr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,27 +256,27 @@ Amr::InitAmr ()
//
// Check for command line flags.
//
pp.query("regrid_on_restart",regrid_on_restart);
pp.query("use_efficient_regrid",use_efficient_regrid);
pp.query("plotfile_on_restart",plotfile_on_restart);
pp.query("insitu_on_restart",insitu_on_restart);
pp.query("checkpoint_on_restart",checkpoint_on_restart);
pp.queryAdd("regrid_on_restart",regrid_on_restart);
pp.queryAdd("use_efficient_regrid",use_efficient_regrid);
pp.queryAdd("plotfile_on_restart",plotfile_on_restart);
pp.queryAdd("insitu_on_restart",insitu_on_restart);
pp.queryAdd("checkpoint_on_restart",checkpoint_on_restart);

pp.query("compute_new_dt_on_regrid",compute_new_dt_on_regrid);
pp.queryAdd("compute_new_dt_on_regrid",compute_new_dt_on_regrid);

pp.query("mffile_nstreams", mffile_nstreams);
pp.queryAdd("mffile_nstreams", mffile_nstreams);

#ifndef AMREX_NO_PROBINIT
pp.query("probinit_natonce", probinit_natonce);
pp.queryAdd("probinit_natonce", probinit_natonce);
probinit_natonce = std::max(1, std::min(ParallelDescriptor::NProcs(), probinit_natonce));
#endif

pp.query("file_name_digits", file_name_digits);
pp.queryAdd("file_name_digits", file_name_digits);

pp.query("initial_grid_file",initial_grids_file);
pp.query("regrid_file" , regrid_grids_file);
pp.queryAdd("initial_grid_file",initial_grids_file);
pp.queryAdd("regrid_file" , regrid_grids_file);

pp.query("message_int", message_int);
pp.queryAdd("message_int", message_int);

if (pp.contains("run_log"))
{
Expand Down Expand Up @@ -318,11 +318,11 @@ Amr::InitAmr ()
//
// If set, then restart from checkpoint file.
//
pp.query("restart", restart_chkfile);
pp.queryAdd("restart", restart_chkfile);
//
// If set, then restart from plotfile.
//
pp.query("restart_from_plotfile", restart_pltfile);
pp.queryAdd("restart_from_plotfile", restart_pltfile);

int nlev = max_level+1;
dt_level.resize(nlev);
Expand Down Expand Up @@ -492,13 +492,13 @@ Amr::InitAmr ()
}

loadbalance_with_workestimates = 0;
pp.query("loadbalance_with_workestimates", loadbalance_with_workestimates);
pp.queryAdd("loadbalance_with_workestimates", loadbalance_with_workestimates);

loadbalance_level0_int = 2;
pp.query("loadbalance_level0_int", loadbalance_level0_int);
pp.queryAdd("loadbalance_level0_int", loadbalance_level0_int);

loadbalance_max_fac = 1.5;
pp.query("loadbalance_max_fac", loadbalance_max_fac);
pp.queryAdd("loadbalance_max_fac", loadbalance_max_fac);
}

int
Expand Down Expand Up @@ -3093,7 +3093,7 @@ Amr::initSubcycle ()
else
{
subcycling_mode = "Auto";
pp.query("subcycling_mode",subcycling_mode);
pp.queryAdd("subcycling_mode",subcycling_mode);
}

if (subcycling_mode == "None")
Expand Down Expand Up @@ -3176,25 +3176,25 @@ Amr::initPltAndChk ()
{
ParmParse pp("amr");

pp.query("checkpoint_files_output", checkpoint_files_output);
pp.query("plot_files_output", plot_files_output);
pp.queryAdd("checkpoint_files_output", checkpoint_files_output);
pp.queryAdd("plot_files_output", plot_files_output);

pp.query("plot_nfiles", plot_nfiles);
pp.query("checkpoint_nfiles", checkpoint_nfiles);
pp.queryAdd("plot_nfiles", plot_nfiles);
pp.queryAdd("checkpoint_nfiles", checkpoint_nfiles);
//
// -1 ==> use ParallelDescriptor::NProcs().
//
if (plot_nfiles == -1) plot_nfiles = ParallelDescriptor::NProcs();
if (checkpoint_nfiles == -1) checkpoint_nfiles = ParallelDescriptor::NProcs();

check_file_root = "chk";
pp.query("check_file",check_file_root);
pp.queryAdd("check_file",check_file_root);

check_int = -1;
pp.query("check_int",check_int);
pp.queryAdd("check_int",check_int);

check_per = -1.0;
pp.query("check_per",check_per);
pp.queryAdd("check_per",check_per);

if (check_int > 0 && check_per > 0)
{
Expand All @@ -3203,16 +3203,16 @@ Amr::initPltAndChk ()
}

plot_file_root = "plt";
pp.query("plot_file",plot_file_root);
pp.queryAdd("plot_file",plot_file_root);

plot_int = -1;
pp.query("plot_int",plot_int);
pp.queryAdd("plot_int",plot_int);

plot_per = -1.0;
pp.query("plot_per",plot_per);
pp.queryAdd("plot_per",plot_per);

plot_log_per = -1.0;
pp.query("plot_log_per",plot_log_per);
pp.queryAdd("plot_log_per",plot_log_per);

if (plot_int > 0 && plot_per > 0)
{
Expand All @@ -3221,16 +3221,16 @@ Amr::initPltAndChk ()
}

small_plot_file_root = "smallplt";
pp.query("small_plot_file",small_plot_file_root);
pp.queryAdd("small_plot_file",small_plot_file_root);

small_plot_int = -1;
pp.query("small_plot_int",small_plot_int);
pp.queryAdd("small_plot_int",small_plot_int);

small_plot_per = -1.0;
pp.query("small_plot_per",small_plot_per);
pp.queryAdd("small_plot_per",small_plot_per);

small_plot_log_per = -1.0;
pp.query("small_plot_log_per",small_plot_log_per);
pp.queryAdd("small_plot_log_per",small_plot_log_per);

if (small_plot_int > 0 && small_plot_per > 0)
{
Expand All @@ -3239,24 +3239,24 @@ Amr::initPltAndChk ()
}

write_plotfile_with_checkpoint = 1;
pp.query("write_plotfile_with_checkpoint",write_plotfile_with_checkpoint);
pp.queryAdd("write_plotfile_with_checkpoint",write_plotfile_with_checkpoint);

stream_max_tries = 4;
pp.query("stream_max_tries",stream_max_tries);
pp.queryAdd("stream_max_tries",stream_max_tries);
stream_max_tries = std::max(stream_max_tries, 1);

abort_on_stream_retry_failure = false;
pp.query("abort_on_stream_retry_failure",abort_on_stream_retry_failure);
pp.queryAdd("abort_on_stream_retry_failure",abort_on_stream_retry_failure);

pp.query("precreateDirectories", precreateDirectories);
pp.query("prereadFAHeaders", prereadFAHeaders);
pp.queryAdd("precreateDirectories", precreateDirectories);
pp.queryAdd("prereadFAHeaders", prereadFAHeaders);

int phvInt(plot_headerversion), chvInt(checkpoint_headerversion);
pp.query("plot_headerversion", phvInt);
pp.queryAdd("plot_headerversion", phvInt);
if(phvInt != plot_headerversion) {
plot_headerversion = static_cast<VisMF::Header::Version> (phvInt);
}
pp.query("checkpoint_headerversion", chvInt);
pp.queryAdd("checkpoint_headerversion", chvInt);
if(chvInt != checkpoint_headerversion) {
checkpoint_headerversion = static_cast<VisMF::Header::Version> (chvInt);
}
Expand Down
16 changes: 8 additions & 8 deletions Src/AmrCore/AMReX_AmrMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ AmrMesh::InitAmrMesh (int max_level_in, const Vector<int>& n_cell_in,
{
ParmParse pp("amr");

pp.query("v",verbose);
pp.queryAdd("v",verbose);

if (max_level_in == -1) {
pp.get("max_level", max_level);
Expand Down Expand Up @@ -103,8 +103,8 @@ AmrMesh::InitAmrMesh (int max_level_in, const Vector<int>& n_cell_in,
ref_ratio[i] = 2 * IntVect::TheUnitVector();
}

pp.query("n_proper",n_proper);
pp.query("grid_eff",grid_eff);
pp.queryAdd("n_proper",n_proper);
pp.queryAdd("grid_eff",grid_eff);
int cnt = pp.countval("n_error_buf");
if (cnt > 0) {
Vector<int> neb;
Expand Down Expand Up @@ -360,17 +360,17 @@ AmrMesh::InitAmrMesh (int max_level_in, const Vector<int>& n_cell_in,

//chop up grids to have the number of grids be no less the number of procs
{
pp.query("refine_grid_layout", refine_grid_layout);
pp.queryAdd("refine_grid_layout", refine_grid_layout);

refine_grid_layout_dims = IntVect(refine_grid_layout);
AMREX_D_TERM(pp.query("refine_grid_layout_x", refine_grid_layout_dims[0]);,
pp.query("refine_grid_layout_y", refine_grid_layout_dims[1]);,
pp.query("refine_grid_layout_z", refine_grid_layout_dims[2]));
AMREX_D_TERM(pp.queryAdd("refine_grid_layout_x", refine_grid_layout_dims[0]);,
pp.queryAdd("refine_grid_layout_y", refine_grid_layout_dims[1]);,
pp.queryAdd("refine_grid_layout_z", refine_grid_layout_dims[2]));

refine_grid_layout = refine_grid_layout_dims != 0;
}

pp.query("check_input", check_input);
pp.queryAdd("check_input", check_input);

finest_level = -1;

Expand Down
24 changes: 12 additions & 12 deletions Src/Base/AMReX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,

{
ParmParse pp("amrex");
pp.query("v", system::verbose);
pp.query("verbose", system::verbose);
pp.queryAdd("v", system::verbose);
pp.queryAdd("verbose", system::verbose);
}

#ifdef AMREX_USE_GPU
Expand All @@ -441,11 +441,11 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,

{
ParmParse pp("amrex");
pp.query("regtest_reduction", system::regtest_reduction);
pp.query("signal_handling", system::signal_handling);
pp.query("throw_exception", system::throw_exception);
pp.query("call_addr2line", system::call_addr2line);
pp.query("abort_on_unused_inputs", system::abort_on_unused_inputs);
pp.queryAdd("regtest_reduction", system::regtest_reduction);
pp.queryAdd("signal_handling", system::signal_handling);
pp.queryAdd("throw_exception", system::throw_exception);
pp.queryAdd("call_addr2line", system::call_addr2line);
pp.queryAdd("abort_on_unused_inputs", system::abort_on_unused_inputs);

if (system::signal_handling)
{
Expand All @@ -455,7 +455,7 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,
prev_handler_sigabrt = signal(SIGABRT, BLBackTrace::handler);

int term = 0;
pp.query("handle_sigterm", term);
pp.queryAdd("handle_sigterm", term);
if (term) {
prev_handler_sigterm = signal(SIGTERM, BLBackTrace::handler);
} else {
Expand All @@ -465,9 +465,9 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,
prev_handler_sigfpe = SIG_ERR;

int invalid = 0, divbyzero=0, overflow=0;
pp.query("fpe_trap_invalid", invalid);
pp.query("fpe_trap_zero", divbyzero);
pp.query("fpe_trap_overflow", overflow);
pp.queryAdd("fpe_trap_invalid", invalid);
pp.queryAdd("fpe_trap_zero", divbyzero);
pp.queryAdd("fpe_trap_overflow", overflow);

#if defined(__linux__)
curr_fpe_excepts = 0;
Expand Down Expand Up @@ -497,7 +497,7 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,
}

#ifdef AMREX_USE_HYPRE
pp.query("init_hypre", init_hypre);
pp.queryAdd("init_hypre", init_hypre);
#endif
}

Expand Down
22 changes: 11 additions & 11 deletions Src/Base/AMReX_Arena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,17 @@ Arena::Initialize ()
#endif

ParmParse pp("amrex");
pp.query( "the_arena_init_size", the_arena_init_size);
pp.query( "the_device_arena_init_size", the_device_arena_init_size);
pp.query("the_managed_arena_init_size", the_managed_arena_init_size);
pp.query( "the_pinned_arena_init_size", the_pinned_arena_init_size);
pp.query( "the_arena_release_threshold" , the_arena_release_threshold);
pp.query( "the_device_arena_release_threshold", the_device_arena_release_threshold);
pp.query("the_managed_arena_release_threshold", the_managed_arena_release_threshold);
pp.query( "the_pinned_arena_release_threshold", the_pinned_arena_release_threshold);
pp.query( "the_async_arena_release_threshold", the_async_arena_release_threshold);
pp.query("the_arena_is_managed", the_arena_is_managed);
pp.query("abort_on_out_of_gpu_memory", abort_on_out_of_gpu_memory);
pp.queryAdd( "the_arena_init_size", the_arena_init_size);
pp.queryAdd( "the_device_arena_init_size", the_device_arena_init_size);
pp.queryAdd("the_managed_arena_init_size", the_managed_arena_init_size);
pp.queryAdd( "the_pinned_arena_init_size", the_pinned_arena_init_size);
pp.queryAdd( "the_arena_release_threshold" , the_arena_release_threshold);
pp.queryAdd( "the_device_arena_release_threshold", the_device_arena_release_threshold);
pp.queryAdd("the_managed_arena_release_threshold", the_managed_arena_release_threshold);
pp.queryAdd( "the_pinned_arena_release_threshold", the_pinned_arena_release_threshold);
pp.queryAdd( "the_async_arena_release_threshold", the_async_arena_release_threshold);
pp.queryAdd("the_arena_is_managed", the_arena_is_managed);
pp.queryAdd("abort_on_out_of_gpu_memory", abort_on_out_of_gpu_memory);

{
#if defined(BL_COALESCE_FABS) || defined(AMREX_USE_GPU)
Expand Down
4 changes: 2 additions & 2 deletions Src/Base/AMReX_AsyncOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ void Initialize ()
amrex::ignore_unused(s_comm,s_info);

ParmParse pp("amrex");
pp.query("async_out", s_asyncout);
pp.query("async_out_nfiles", s_noutfiles);
pp.queryAdd("async_out", s_asyncout);
pp.queryAdd("async_out_nfiles", s_noutfiles);

int nprocs = ParallelDescriptor::NProcs();
s_noutfiles = std::min(s_noutfiles, nprocs);
Expand Down
20 changes: 6 additions & 14 deletions Src/Base/AMReX_BLProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,20 +272,12 @@ void BLProfiler::Initialize() {

void BLProfiler::InitParams() {
ParmParse pParse("blprofiler");
pParse.query("prof_nfiles", nProfFiles);
pParse.query("prof_csflushsize", csFlushSize);
pParse.query("prof_traceflushsize", traceFlushSize);
pParse.query("prof_flushinterval", flushInterval);
pParse.query("prof_flushtimeinterval", flushTimeInterval);
pParse.query("prof_flushprint", bFlushPrint);
#if 0
amrex::Print() << "PPPPPPPP:: nProfFiles = " << nProfFiles << '\n';
amrex::Print() << "PPPPPPPP:: csFlushSize = " << csFlushSize << '\n';
amrex::Print() << "PPPPPPPP:: traceFlushSize = " << traceFlushSize << '\n';
amrex::Print() << "PPPPPPPP:: flushInterval = " << flushInterval << '\n';
amrex::Print() << "PPPPPPPP:: flushTimeInterval = " << flushTimeInterval << " s." << '\n';
amrex::Print() << "PPPPPPPP:: flushPrint = " << bFlushPrint << '\n';
#endif
pParse.queryAdd("prof_nfiles", nProfFiles);
pParse.queryAdd("prof_csflushsize", csFlushSize);
pParse.queryAdd("prof_traceflushsize", traceFlushSize);
pParse.queryAdd("prof_flushinterval", flushInterval);
pParse.queryAdd("prof_flushtimeinterval", flushTimeInterval);
pParse.queryAdd("prof_flushprint", bFlushPrint);
}


Expand Down
12 changes: 6 additions & 6 deletions Src/Base/AMReX_DistributionMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ DistributionMapping::Initialize ()

ParmParse pp("DistributionMapping");

pp.query("v" , verbose);
pp.query("verbose", verbose);
pp.query("efficiency", max_efficiency);
pp.query("sfc_threshold", sfc_threshold);
pp.query("node_size", node_size);
pp.query("verbose_mapper", flag_verbose_mapper);
pp.queryAdd("v" , verbose);
pp.queryAdd("verbose", verbose);
pp.queryAdd("efficiency", max_efficiency);
pp.queryAdd("sfc_threshold", sfc_threshold);
pp.queryAdd("node_size", node_size);
pp.queryAdd("verbose_mapper", flag_verbose_mapper);

std::string theStrategy;

Expand Down
6 changes: 3 additions & 3 deletions Src/Base/AMReX_FArrayBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ FArrayBox::Initialize ()
? std::numeric_limits<Real>::quiet_NaN()
: std::numeric_limits<Real>::max();

pp.query("initval", initval);
pp.query("do_initval", do_initval);
pp.query("init_snan", init_snan);
pp.queryAdd("initval", initval);
pp.queryAdd("do_initval", do_initval);
pp.queryAdd("init_snan", init_snan);

amrex::ExecOnFinalize(FArrayBox::Finalize);
}
Expand Down
2 changes: 1 addition & 1 deletion Src/Base/AMReX_FabArrayBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ FabArrayBase::Initialize ()
for (int i=0; i<AMREX_SPACEDIM; i++) FabArrayBase::comm_tile_size[i] = tilesize[i];
}

pp.query("maxcomp", FabArrayBase::MaxComp);
pp.queryAdd("maxcomp", FabArrayBase::MaxComp);

if (MaxComp < 1) {
MaxComp = 1;
Expand Down
Loading