diff --git a/.gitignore b/.gitignore index 29dde1318ea0..3ac7fd9da1d0 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ *.toc *.snm *.csv +*.csv.* *.dylib *.so *.so.* diff --git a/framework/doc/content/syntax/VectorPostprocessors/index.md b/framework/doc/content/syntax/VectorPostprocessors/index.md index 413cb952685b..08e1900fff42 100644 --- a/framework/doc/content/syntax/VectorPostprocessors/index.md +++ b/framework/doc/content/syntax/VectorPostprocessors/index.md @@ -76,10 +76,10 @@ getScatterVectorPostprocessorValue('the_vpp_parameter_name', 'the_vector_name') `getScatterVectorPostprocessorValue()` returns a `const ScatterVectorPostprocessorValue &`... which is a single scalar value that you don't index into. Each process receives the "correct" value and can just directly use it. -If the data in a VPP is naturally replicated on all processors a VectorPostprocessor should set `_is_broadcast = true` in its `validParams()` like so: +If the data in a VPP is naturally replicated on all processors a VectorPostprocessor should set `_auto_broadcast = false` in its `validParams()` like so: ```c++ -params.set("_is_broadcast") = true; +params.set("_auto_broadcast") = "false"; ``` This tells MOOSE that the data is already replicated and there is no need to broadcast it if another object is asking for it to be broadcast. diff --git a/framework/include/outputs/CSV.h b/framework/include/outputs/CSV.h index c3a168484680..8156b92e3782 100644 --- a/framework/include/outputs/CSV.h +++ b/framework/include/outputs/CSV.h @@ -75,7 +75,9 @@ class CSV : public TableOutput * Generates a filename pattern for Vectorpostprocessors * filebase + VPP name + time step + ".csv" */ - std::string getVectorPostprocessorFileName(const std::string & vpp_name, bool include_time_step); + std::string getVectorPostprocessorFileName(const std::string & vpp_name, + bool include_time_step, + bool is_distributed); private: /// Flag for aligning data in .csv file @@ -106,13 +108,12 @@ class CSV : public TableOutput bool _create_latest_symlink; /// Current list of VPP filenames for creating _LATEST/_FINAL symlinks - // The pair is composed of the complete filename (foo_variable_0001.csv) and the incomplete name - // (foo_variable) to which the _FINAL or _LATEST is to be applied. - std::vector> _latest_vpp_filenames; + // The pair is composed of the complete filename (foo_variable_0001.csv), the incomplete name + // (foo_variable) to which the _FINAL or _LATEST is to be applied, and the "is_distributed" flag + std::vector> _latest_vpp_filenames; /** * Returns the filename without the time/timestep information. */ std::string getVectorPostprocessorFilePrefix(const std::string & vpp_name); }; - diff --git a/framework/include/problems/FEProblemBase.h b/framework/include/problems/FEProblemBase.h index b395e04199d2..58d2e8c3cee7 100644 --- a/framework/include/problems/FEProblemBase.h +++ b/framework/include/problems/FEProblemBase.h @@ -917,7 +917,8 @@ class FEProblemBase : public SubProblem, public Restartable VectorPostprocessorValue & declareVectorPostprocessorVector(const VectorPostprocessorName & name, const std::string & vector_name, bool contains_complete_history, - bool is_broadcast); + bool is_broadcast, + bool is_distributed); /** * Whether or not the specified VectorPostprocessor has declared any vectors diff --git a/framework/include/vectorpostprocessors/VectorPostprocessor.h b/framework/include/vectorpostprocessors/VectorPostprocessor.h index 8bc3609525c8..601d77e53fb8 100644 --- a/framework/include/vectorpostprocessors/VectorPostprocessor.h +++ b/framework/include/vectorpostprocessors/VectorPostprocessor.h @@ -12,6 +12,7 @@ // MOOSE includes #include "MooseTypes.h" #include "OutputInterface.h" +#include "MooseEnum.h" // libMesh #include "libmesh/parallel.h" @@ -56,6 +57,11 @@ class VectorPostprocessor : public OutputInterface */ bool containsCompleteHistory() const { return _contains_complete_history; } + /** + * Return true if the VPP is operating in distributed mode. + */ + bool isDistributed() const { return _is_distributed; } + protected: /** * Register a new vector to fill up. @@ -75,8 +81,11 @@ class VectorPostprocessor : public OutputInterface const bool _contains_complete_history; + const MooseEnum & _parallel_type; + + const bool _is_distributed; + const bool _is_broadcast; std::map _thread_local_vectors; }; - diff --git a/framework/include/vectorpostprocessors/VectorPostprocessorData.h b/framework/include/vectorpostprocessors/VectorPostprocessorData.h index 70e5f028e09d..519a9220f883 100644 --- a/framework/include/vectorpostprocessors/VectorPostprocessorData.h +++ b/framework/include/vectorpostprocessors/VectorPostprocessorData.h @@ -66,7 +66,8 @@ class VectorPostprocessorData : public Restartable, public libMesh::ParallelObje VectorPostprocessorValue & declareVector(const std::string & vpp_name, const std::string & vector_name, bool contains_complete_history, - bool is_broadcast); + bool is_broadcast, + bool is_distributed); /** * Returns a true value if the VectorPostprocessor exists @@ -126,6 +127,11 @@ class VectorPostprocessorData : public Restartable, public libMesh::ParallelObje */ bool containsCompleteHistory(const std::string & name) const; + /** + * Returns a Boolean indicating whether the specified VPP vectors are distributed + */ + bool isDistributed(const std::string & name) const; + /** * Get the map of vectors for a particular VectorPostprocessor * @param vpp_name The name of the VectorPostprocessor @@ -151,6 +157,7 @@ class VectorPostprocessorData : public Restartable, public libMesh::ParallelObje bool get_current = true, bool contains_complete_history = false, bool is_broadcast = false, + bool is_distributed = false, bool needs_broadcast = false, bool needs_scatter = false); /** @@ -177,6 +184,9 @@ class VectorPostprocessorData : public Restartable, public libMesh::ParallelObje /// Boolean indicating whether any old vectors have been requested. bool _needs_old; + + /// Flag if data is distributed + bool _is_distributed; }; /// The VPP data store in a map: VPP Name to vector storage @@ -185,4 +195,3 @@ class VectorPostprocessorData : public Restartable, public libMesh::ParallelObje std::set _requested_items; std::set _supplied_items; }; - diff --git a/framework/src/outputs/CSV.C b/framework/src/outputs/CSV.C index e9e1c4a63293..b1120bf9b950 100644 --- a/framework/src/outputs/CSV.C +++ b/framework/src/outputs/CSV.C @@ -120,7 +120,9 @@ CSV::outputVectorPostprocessors() } std::string -CSV::getVectorPostprocessorFileName(const std::string & vpp_name, bool include_time_step) +CSV::getVectorPostprocessorFileName(const std::string & vpp_name, + bool include_time_step, + bool is_distributed) { std::ostringstream file_name; file_name << _file_base; @@ -132,8 +134,12 @@ CSV::getVectorPostprocessorFileName(const std::string & vpp_name, bool include_t if (include_time_step) file_name << '_' << std::setw(_padding) << std::setprecision(0) << std::setfill('0') << std::right << timeStep(); + file_name << ".csv"; + if (is_distributed) + file_name << "." << processor_id(); + return file_name.str(); } @@ -154,7 +160,7 @@ CSV::output(const ExecFlagType & type) const auto & vpp_data = _problem_ptr->getVectorPostprocessorData(); // Output each VectorPostprocessor's data to a file - if (_write_vector_table && processor_id() == 0) + if (_write_vector_table) { // The VPP table will not write the same data twice, so to get the symlinks correct @@ -172,28 +178,46 @@ CSV::output(const ExecFlagType & type) it.second.sortColumns(); auto include_time_suffix = !vpp_data.containsCompleteHistory(vpp_name); - std::string fname = getVectorPostprocessorFileName(vpp_name, include_time_suffix); - std::string fprefix = getVectorPostprocessorFilePrefix(vpp_name); - _latest_vpp_filenames.emplace_back(fname, fprefix); - it.second.printCSV(fname, 1, _align); + auto is_distributed = vpp_data.isDistributed(vpp_name); - if (_create_latest_symlink) + if (is_distributed || processor_id() == 0) { - std::string out_latest = fprefix + "_LATEST.csv"; - MooseUtils::createSymlink(fname, out_latest); - } + std::string fname = + getVectorPostprocessorFileName(vpp_name, include_time_suffix, is_distributed); + std::string fprefix = getVectorPostprocessorFilePrefix(vpp_name); + + _latest_vpp_filenames.emplace_back(fname, fprefix, is_distributed); + + it.second.printCSV(fname, 1, _align); - if (_time_data) - _vector_postprocessor_time_tables[vpp_name].printCSV(fprefix + "_time.csv"); + if (_create_latest_symlink) + { + std::ostringstream out_latest; + out_latest << fprefix << "_LATEST.csv"; + if (is_distributed) + out_latest << "." << processor_id(); + MooseUtils::createSymlink(fname, out_latest.str()); + } + + if (_time_data) + _vector_postprocessor_time_tables[vpp_name].printCSV(fprefix + "_time.csv"); + } } } - if (type == EXEC_FINAL && _create_final_symlink && processor_id() == 0) + if (type == EXEC_FINAL && _create_final_symlink) { - for (const auto & name_pair : _latest_vpp_filenames) + for (const auto & name_tuple : _latest_vpp_filenames) { - std::string out_final = name_pair.second + "_FINAL.csv"; - MooseUtils::createSymlink(name_pair.first, out_final); + std::ostringstream out_final; + out_final << std::get<1>(name_tuple) << "_FINAL.csv"; + if (std::get<2>(name_tuple)) + { + out_final << "." << processor_id(); + MooseUtils::createSymlink(std::get<0>(name_tuple), out_final.str()); + } + else if (processor_id() == 0) + MooseUtils::createSymlink(std::get<0>(name_tuple), out_final.str()); } } diff --git a/framework/src/problems/FEProblemBase.C b/framework/src/problems/FEProblemBase.C index 7474d0a6df33..2b2051cff8fa 100644 --- a/framework/src/problems/FEProblemBase.C +++ b/framework/src/problems/FEProblemBase.C @@ -3337,9 +3337,11 @@ VectorPostprocessorValue & FEProblemBase::declareVectorPostprocessorVector(const VectorPostprocessorName & name, const std::string & vector_name, bool contains_complete_history, - bool is_broadcast) + bool is_broadcast, + bool is_distributed) { - return _vpps_data.declareVector(name, vector_name, contains_complete_history, is_broadcast); + return _vpps_data.declareVector( + name, vector_name, contains_complete_history, is_broadcast, is_distributed); } const std::vector> & diff --git a/framework/src/vectorpostprocessors/CSVReader.C b/framework/src/vectorpostprocessors/CSVReader.C index 293be0bc94b3..794dff34a340 100644 --- a/framework/src/vectorpostprocessors/CSVReader.C +++ b/framework/src/vectorpostprocessors/CSVReader.C @@ -45,7 +45,7 @@ CSVReader::validParams() // The value from this VPP is naturally already on every processor // TODO: Make this not the case! See #11415 - params.set("_is_broadcast") = true; + params.set("_auto_broadcast") = false; return params; } diff --git a/framework/src/vectorpostprocessors/ElementVariablesDifferenceMax.C b/framework/src/vectorpostprocessors/ElementVariablesDifferenceMax.C index a6ebb5d94737..ccb63fa06d33 100644 --- a/framework/src/vectorpostprocessors/ElementVariablesDifferenceMax.C +++ b/framework/src/vectorpostprocessors/ElementVariablesDifferenceMax.C @@ -35,7 +35,7 @@ ElementVariablesDifferenceMax::validParams() // The value from this VPP is naturally already on every processor // TODO: Make this not the case! See #11415 - params.set("_is_broadcast") = true; + params.set("_auto_broadcast") = false; return params; } diff --git a/framework/src/vectorpostprocessors/SamplerBase.C b/framework/src/vectorpostprocessors/SamplerBase.C index 5cb6344c8fda..d36b9b8c614a 100644 --- a/framework/src/vectorpostprocessors/SamplerBase.C +++ b/framework/src/vectorpostprocessors/SamplerBase.C @@ -30,7 +30,7 @@ SamplerBase::validParams() // The value from this VPP is naturally already on every processor // TODO: Make this not the case! See #11415 - params.set("_is_broadcast") = true; + params.set("_auto_broadcast") = false; return params; } diff --git a/framework/src/vectorpostprocessors/VectorOfPostprocessors.C b/framework/src/vectorpostprocessors/VectorOfPostprocessors.C index 4abd8048fec6..c9634b3d55a2 100644 --- a/framework/src/vectorpostprocessors/VectorOfPostprocessors.C +++ b/framework/src/vectorpostprocessors/VectorOfPostprocessors.C @@ -26,7 +26,7 @@ VectorOfPostprocessors::validParams() // The value from this VPP is naturally already on every processor // TODO: Make this not the case! See #11415 - params.set("_is_broadcast") = true; + params.set("_auto_broadcast") = false; return params; } diff --git a/framework/src/vectorpostprocessors/VectorPostprocessor.C b/framework/src/vectorpostprocessors/VectorPostprocessor.C index 285bf19407d4..712988b0385b 100644 --- a/framework/src/vectorpostprocessors/VectorPostprocessor.C +++ b/framework/src/vectorpostprocessors/VectorPostprocessor.C @@ -30,8 +30,21 @@ VectorPostprocessor::validParams() "only a single file is output and updated with each invocation"); // VPPs can set this to true if their resulting vectors are naturally replicated in parallel - // setting this to true will keep MOOSE from unnecesarily broadcasting those vectors - params.addPrivateParam("_is_broadcast", false); + // setting this to false will keep MOOSE from unnecessarily broadcasting those vectors + params.addPrivateParam("_auto_broadcast", true); + + // VPPs can operate in "distributed" mode, which disables automatic the automatic broadcasting + // and results in an individual file per processor if CSV output is enabled + MooseEnum parallel_type("DISTRIBUTED REPLICATED", "REPLICATED"); + params.addParam( + "parallel_type", + parallel_type, + "Set how the data is represented within the VectorPostprocessor (VPP); 'distributed' " + "indicates that data within the VPP is distributed and no auto communication is required, " + "this setting will result in parallel output within the CSV output; 'replicated' indicates " + "that the data within the VPP is correct on processor 0, the data will automatically be " + "broadcast to all processors unless the '_auto_broadcast' param is set to false within the " + "validParams function."); params.addParamNamesToGroup("outputs", "Advanced"); params.registerBase("VectorPostprocessor"); @@ -44,7 +57,9 @@ VectorPostprocessor::VectorPostprocessor(const InputParameters & parameters) _vpp_fe_problem(parameters.getCheckedPointerParam("_fe_problem_base")), _vpp_tid(parameters.isParamValid("_tid") ? parameters.get("_tid") : 0), _contains_complete_history(parameters.get("contains_complete_history")), - _is_broadcast(parameters.get("_is_broadcast")) + _parallel_type(parameters.get("parallel_type")), + _is_distributed(_parallel_type == "DISTRIBUTED"), + _is_broadcast(_is_distributed || !parameters.get("_auto_broadcast")) { } @@ -61,5 +76,5 @@ VectorPostprocessor::declareVector(const std::string & vector_name) return _thread_local_vectors.emplace(vector_name, VectorPostprocessorValue()).first->second; else return _vpp_fe_problem->declareVectorPostprocessorVector( - _vpp_name, vector_name, _contains_complete_history, _is_broadcast); + _vpp_name, vector_name, _contains_complete_history, _is_broadcast, _is_distributed); } diff --git a/framework/src/vectorpostprocessors/VectorPostprocessorData.C b/framework/src/vectorpostprocessors/VectorPostprocessorData.C index 0e601c2c03b9..34251337978b 100644 --- a/framework/src/vectorpostprocessors/VectorPostprocessorData.C +++ b/framework/src/vectorpostprocessors/VectorPostprocessorData.C @@ -30,6 +30,15 @@ VectorPostprocessorData::containsCompleteHistory(const std::string & name) const return it->second._contains_complete_history; } +bool +VectorPostprocessorData::isDistributed(const std::string & name) const +{ + auto it = _vpp_data.find(name); + mooseAssert(it != _vpp_data.end(), std::string("VectorPostprocessor ") + name + " not found!"); + + return it->second._is_distributed; +} + bool VectorPostprocessorData::hasVectorPostprocessor(const std::string & name) { @@ -50,6 +59,7 @@ VectorPostprocessorData::getVectorPostprocessorValue(const VectorPostprocessorNa /* get_current */ true, /* contains_complete_history */ false, /* is_broadcast */ false, + /* is_distributed */ false, /* needs_broadcast */ needs_broadcast, /* needs_scatter */ false); return *vec_struct.current; @@ -69,6 +79,7 @@ VectorPostprocessorData::getVectorPostprocessorValueOld(const VectorPostprocesso /* get_current */ false, /* contains_complete_history */ false, /* is_broadcast */ false, + /* is_distributed */ false, /* needs_broadcast */ needs_broadcast, /* needs_scatter */ false); return *vec_struct.old; @@ -88,6 +99,7 @@ VectorPostprocessorData::getScatterVectorPostprocessorValue( /* get_current */ true, /* contains_complete_history */ false, /* is_broadcast */ false, + /* is_distributed */ false, /* needs_broadcast */ false, /* needs_scatter */ true); @@ -108,6 +120,7 @@ VectorPostprocessorData::getScatterVectorPostprocessorValueOld( /* get_current */ false, /* contains_complete_history */ false, /* is_broadcast */ false, + /* is_distributed */ false, /* needs_broadcast */ false, /* needs_scatter */ true); @@ -118,12 +131,13 @@ VectorPostprocessorValue & VectorPostprocessorData::declareVector(const std::string & vpp_name, const std::string & vector_name, bool contains_complete_history, - bool is_broadcast) + bool is_broadcast, + bool is_distributed) { _supplied_items.emplace(vpp_name + "::" + vector_name); auto & vec_struct = getVectorPostprocessorHelper( - vpp_name, vector_name, true, contains_complete_history, is_broadcast); + vpp_name, vector_name, true, contains_complete_history, is_broadcast, is_distributed); return *vec_struct.current; } @@ -134,6 +148,7 @@ VectorPostprocessorData::getVectorPostprocessorHelper(const VectorPostprocessorN bool get_current, bool contains_complete_history, bool is_broadcast, + bool is_distributed, bool needs_broadcast, bool needs_scatter) { @@ -150,6 +165,9 @@ VectorPostprocessorData::getVectorPostprocessorHelper(const VectorPostprocessorN // Note: This parameter is constant and applies to _all_ declared vectors. vec_storage._is_broadcast |= is_broadcast; + // If the VPP is declaring a vector, see if it will be output in parallel. + vec_storage._is_distributed = is_distributed; + // Keep track of whether an old vector is needed for copying back later. if (!get_current) vec_storage._needs_old = true; diff --git a/modules/stochastic_tools/src/vectorpostprocessors/SamplerData.C b/modules/stochastic_tools/src/vectorpostprocessors/SamplerData.C index 05646904795a..8078855190d4 100644 --- a/modules/stochastic_tools/src/vectorpostprocessors/SamplerData.C +++ b/modules/stochastic_tools/src/vectorpostprocessors/SamplerData.C @@ -27,10 +27,6 @@ SamplerData::validParams() params.addRequiredParam("sampler", "The sample from which to extract distribution data."); - // The execute method computes the complete vectors on all processes, so broadcasting the data - // is not required. - // params.set("_is_broadcast") = false; - // Control for MooseEnum method("get_global_samples get_local_samples get_next_local_row", "get_next_local_row"); params.addParam( diff --git a/modules/stochastic_tools/src/vectorpostprocessors/StochasticResults.C b/modules/stochastic_tools/src/vectorpostprocessors/StochasticResults.C index 3866e61928b7..698688348a9f 100644 --- a/modules/stochastic_tools/src/vectorpostprocessors/StochasticResults.C +++ b/modules/stochastic_tools/src/vectorpostprocessors/StochasticResults.C @@ -47,7 +47,7 @@ StochasticResults::validParams() "for output. This is mainly for testing since the data from that rank will override the data " "on the root process."); - params.set("_is_broadcast") = false; + params.set("_auto_broadcast") = false; return params; } diff --git a/test/include/vectorpostprocessors/TestDistributedVectorPostprocessor.h b/test/include/vectorpostprocessors/TestDistributedVectorPostprocessor.h new file mode 100644 index 000000000000..04a531b70325 --- /dev/null +++ b/test/include/vectorpostprocessors/TestDistributedVectorPostprocessor.h @@ -0,0 +1,29 @@ +//* This file is part of the MOOSE framework +//* https://www.mooseframework.org +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#pragma once + +#include "GeneralUserObject.h" + +/** + * Test class to make certain that CSV data is broadcast correctly. + */ +class TestDistributedVectorPostprocessor : public GeneralVectorPostprocessor +{ +public: + static InputParameters validParams(); + + TestDistributedVectorPostprocessor(const InputParameters & parameters); + virtual void execute() override; + virtual void initialize() override {} + virtual void finalize() override; + +protected: + VectorPostprocessorValue & _data; +}; diff --git a/test/src/vectorpostprocessors/TestDistributedVectorPostprocessor.C b/test/src/vectorpostprocessors/TestDistributedVectorPostprocessor.C new file mode 100644 index 000000000000..3f47058c401a --- /dev/null +++ b/test/src/vectorpostprocessors/TestDistributedVectorPostprocessor.C @@ -0,0 +1,42 @@ +//* This file is part of the MOOSE framework +//* https://www.mooseframework.org +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#include "TestDistributedVectorPostprocessor.h" + +registerMooseObject("MooseTestApp", TestDistributedVectorPostprocessor); + +InputParameters +TestDistributedVectorPostprocessor::validParams() +{ + InputParameters params = GeneralVectorPostprocessor::validParams(); + return params; +} + +TestDistributedVectorPostprocessor::TestDistributedVectorPostprocessor( + const InputParameters & parameters) + : GeneralVectorPostprocessor(parameters), _data(declareVector("data")) +{ +} + +void +TestDistributedVectorPostprocessor::execute() +{ + const std::size_t size = 10; + const dof_id_type rank = processor_id(); + _data.resize(size); + for (std::size_t i = 0; i < size; i++) + _data[i] = size * size * (rank + 1) + i; // 100, 101, ..., 200, 201, ... +} + +void +TestDistributedVectorPostprocessor::finalize() +{ + if (!isDistributed()) + _communicator.gather(0, _data); +} diff --git a/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv new file mode 100644 index 000000000000..8fc1b034c374 --- /dev/null +++ b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv @@ -0,0 +1,31 @@ +data +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 diff --git a/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.0 b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.0 new file mode 100644 index 000000000000..33a53f238e7e --- /dev/null +++ b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.0 @@ -0,0 +1,11 @@ +data +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 diff --git a/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.1 b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.1 new file mode 100644 index 000000000000..d9674c61d116 --- /dev/null +++ b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.1 @@ -0,0 +1,11 @@ +data +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 diff --git a/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.2 b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.2 new file mode 100644 index 000000000000..4b78197cf7e2 --- /dev/null +++ b/test/tests/vectorpostprocessors/distributed/gold/input_out_test_0001.csv.2 @@ -0,0 +1,11 @@ +data +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 diff --git a/test/tests/vectorpostprocessors/distributed/input.i b/test/tests/vectorpostprocessors/distributed/input.i new file mode 100644 index 000000000000..a77eb4f2d22d --- /dev/null +++ b/test/tests/vectorpostprocessors/distributed/input.i @@ -0,0 +1,24 @@ +[Mesh] + type = GeneratedMesh + dim = 1 +[] + +[Problem] + solve = false +[] + +[Executioner] + type = Steady +[] + +[VectorPostprocessors/test] + type = TestDistributedVectorPostprocessor + parallel_type = replicated +[] + +[Outputs] + [out] + type = CSV + execute_on = TIMESTEP_END + [] +[] diff --git a/test/tests/vectorpostprocessors/distributed/tests b/test/tests/vectorpostprocessors/distributed/tests new file mode 100644 index 000000000000..0dbaa3100406 --- /dev/null +++ b/test/tests/vectorpostprocessors/distributed/tests @@ -0,0 +1,45 @@ +[Tests] + design = 'VectorPostprocessors/index.md' + issues = '#14480' + + [parallel_type] + requirement = "The system shall support writing a vector of data" + + [replicated] + type = CSVDiff + input = input.i + csvdiff = input_out_test_0001.csv + cli_args = 'VectorPostprocessors/test/parallel_type=replicated' + min_parallel = 3 + max_parallel = 3 + + detail = "that is completely stored on a single processor or" + [] + + [distributed] + type = CSVDiff + input = input.i + csvdiff = 'input_out_test_0001.csv.0 input_out_test_0001.csv.1 input_out_test_0001.csv.2' + min_parallel = 3 + max_parallel = 3 + cli_args = 'VectorPostprocessors/test/parallel_type=distributed' + prereq = parallel_type/replicated + + detail = "distributed across many and" + [] + + [distributed_symlinks] + type = CheckFiles + input = input.i + check_files = 'input_out_test_0002.csv.0 input_out_test_0002.csv.1 input_out_test_0002.csv.2 ' + 'input_out_test_LATEST.csv.0 input_out_test_LATEST.csv.1 input_out_test_LATEST.csv.2 ' + 'input_out_test_FINAL.csv.0 input_out_test_FINAL.csv.1 input_out_test_FINAL.csv.2' + min_parallel = 3 + max_parallel = 3 + cli_args = 'VectorPostprocessors/test/parallel_type=distributed Outputs/out/execute_on=FINAL Outputs/out/create_latest_symlink=true Outputs/out/create_final_symlink=true' + prereq = parallel_type/distributed + + detail = "allows for the creation of symbolic links to the the most recent and final files on each processor." + [] + [] +[]