Skip to content

Commit

Permalink
Add test. REfs idaholab#24264
Browse files Browse the repository at this point in the history
  • Loading branch information
aprilnovak authored and milljm committed May 10, 2023
1 parent 3877041 commit d3218e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion framework/include/multiapps/MultiApp.h
Expand Up @@ -477,7 +477,7 @@ class MultiApp : public MooseObject,
std::vector<FileName> _input_files;

/// Whether to create the first app on rank 0 while all other MPI ranks are idle
const bool & _force_safe_app_init;
const bool & _quiet_app_init;

/// Number of positions for each input file
std::vector<unsigned int> _npositions_inputfile;
Expand Down
8 changes: 4 additions & 4 deletions framework/src/multiapps/MultiApp.C
Expand Up @@ -121,7 +121,7 @@ MultiApp::validParams()
"Minimum number of processors to give to each App in this "
"MultiApp. Useful for larger, distributed mesh solves.");
params.addParam<bool>(
"force_safe_app_init",
"quiet_app_init",
false,
"Advanced parameter that will create the first "
"sub-application on rank 0, then MPI_Barrier before creating the next N-1 apps (on all "
Expand Down Expand Up @@ -224,7 +224,7 @@ MultiApp::validParams()

params.addParamNamesToGroup("positions positions_file run_in_position output_in_position",
"Positions / transformations of the MultiApp frame of reference");
params.addParamNamesToGroup("min_procs_per_app max_procs_per_app force_safe_app_init",
params.addParamNamesToGroup("min_procs_per_app max_procs_per_app quiet_app_init",
"Parallelism");
params.addParamNamesToGroup("reset_time reset_apps", "Reset MultiApp");
params.addParamNamesToGroup("move_time move_apps move_positions", "Timed move of MultiApps");
Expand All @@ -247,7 +247,7 @@ MultiApp::MultiApp(const InputParameters & parameters)
: _fe_problem.getMooseApp().type()),
_use_positions(getParam<bool>("use_positions")),
_input_files(getParam<std::vector<FileName>>("input_files")),
_force_safe_app_init(getParam<bool>("force_safe_app_init")),
_quiet_app_init(getParam<bool>("quiet_app_init")),
_total_num_apps(0),
_my_num_apps(0),
_first_local_app(0),
Expand Down Expand Up @@ -369,7 +369,7 @@ MultiApp::createApps()

bool rank_did_quiet_init = false;
unsigned int local_app;
if (_force_safe_app_init)
if (_quiet_app_init)
{
if (hasLocalApp(0))
{
Expand Down
11 changes: 10 additions & 1 deletion test/tests/multiapps/centroid_multiapp/tests
@@ -1,5 +1,5 @@
[Tests]
issues = '#10483'
issues = '#10483 #24264'
design = 'CentroidMultiApp.md'

[./test]
Expand All @@ -9,4 +9,13 @@

requirement = "The system shall include the ability to execute a sub-application at the centroid of every element within the finite element mesh."
[../]
[test_quiet]
type = Exodiff
input = centroid_multiapp.i
cli_args = 'MultiApps/sub/quiet_app_init=true'
min_parallel = 2
exodiff = 'centroid_multiapp_out.e centroid_multiapp_out_sub1.e centroid_multiapp_out_sub3.e centroid_multiapp_out_sub5.e centroid_multiapp_out_sub7.e centroid_multiapp_out_sub0.e centroid_multiapp_out_sub2.e centroid_multiapp_out_sub4.e centroid_multiapp_out_sub6.e centroid_multiapp_out_sub8.e'

requirement = "The system shall optionally allow the first sub-app to fully initialize before launching the remaining N-1 apps in parallel."
[]
[]

0 comments on commit d3218e0

Please sign in to comment.