diff --git a/Applications/Utils/FileConverter/PVD2XDMF.cpp b/Applications/Utils/FileConverter/PVD2XDMF.cpp index f581c5cbac6c9694895116bf094cd10d5d917df4..2f99ff70acc2ea13006b5bd9fd3615de7a117935 100644 --- a/Applications/Utils/FileConverter/PVD2XDMF.cpp +++ b/Applications/Utils/FileConverter/PVD2XDMF.cpp @@ -190,7 +190,8 @@ int main(int argc, char* argv[]) mesh_xdmf_hdf_writer = std::make_unique<MeshLib::IO::XdmfHdfWriter>( std::vector{std::cref(*main_mesh)}, output_file_path, 0 /*timestep*/, time, variable_output_names, - true /*output_file.compression*/, 1 /*output_file.n_files*/); + true /*output_file.compression*/, 1 /*output_file.n_files*/, + 1048576 /*chunk_size_bytes*/); } for (std::size_t timestep = 1; timestep < timeseries.size(); ++timestep) diff --git a/Documentation/ProjectFile/prj/time_loop/output/hdf/i_hdf.md b/Documentation/ProjectFile/prj/time_loop/output/hdf/i_hdf.md index 2043711a7a77bcb4ca95a5845138c5bfb9b6761d..a7ba20e050d1eef345e39650d24661e405750dab 100644 --- a/Documentation/ProjectFile/prj/time_loop/output/hdf/i_hdf.md +++ b/Documentation/ProjectFile/prj/time_loop/output/hdf/i_hdf.md @@ -1,2 +1,2 @@ Group of parameters when XDMF/HDF writer is used. -Type of output in time_loop must be XDMF +Type of output must be XDMF diff --git a/Documentation/ProjectFile/prj/time_loop/output/hdf/t_chunk_size_bytes.md b/Documentation/ProjectFile/prj/time_loop/output/hdf/t_chunk_size_bytes.md new file mode 100644 index 0000000000000000000000000000000000000000..c15129e7db1e053faa9025d4aa2d601ac3e6f2a1 --- /dev/null +++ b/Documentation/ProjectFile/prj/time_loop/output/hdf/t_chunk_size_bytes.md @@ -0,0 +1 @@ +\copydoc ProcessLib::OutputXDMFHDF5Format::chunk_size_bytes diff --git a/MeshLib/IO/XDMF/HdfData.cpp b/MeshLib/IO/XDMF/HdfData.cpp index 333d7b71b8e3970c3242cc742c3d50949817c237..d14d334b06da6ac190afd67c58ba2e19bf347874 100644 --- a/MeshLib/IO/XDMF/HdfData.cpp +++ b/MeshLib/IO/XDMF/HdfData.cpp @@ -45,21 +45,34 @@ static hid_t meshPropertyType2HdfType(MeshPropertyDataType const ogs_data_type) HdfData::HdfData(void const* data_start, std::size_t const size_partitioned_dim, std::size_t const size_tuple, std::string const& name, MeshPropertyDataType const mesh_property_data_type, - unsigned int const n_files) + unsigned int const n_files, + unsigned int const chunk_size_bytes) : data_start(data_start), name(name) { + data_type = meshPropertyType2HdfType(mesh_property_data_type); + auto const& partition_info = getPartitionInfo(size_partitioned_dim, n_files); auto const& offset_partitioned_dim = partition_info.local_offset; offsets = {offset_partitioned_dim, 0}; - std::size_t unified_length = partition_info.local_length; + std::size_t const unified_length = partition_info.local_length; + int const type_size = H5Tget_size(data_type); + std::size_t const space = + (chunk_size_bytes > 0) + ? std::min(std::size_t(std::lround(float(chunk_size_bytes) / + (size_tuple * type_size) + + 0.5)), + partition_info.global_length) + : partition_info.longest_local_length; - chunk_space = - (size_tuple > 1) - ? std::vector<Hdf5DimType>{partition_info.longest_local_length, - size_tuple} - : std::vector<Hdf5DimType>{partition_info.longest_local_length}; + if (chunk_size_bytes > 0 && space == partition_info.global_length) + { + INFO("HDF5: Using a single chunk for dataset {:s} .", name); + } + + chunk_space = (size_tuple > 1) ? std::vector<Hdf5DimType>{space, size_tuple} + : std::vector<Hdf5DimType>{space}; data_space = (size_tuple > 1) ? std::vector<Hdf5DimType>{unified_length, size_tuple} @@ -69,8 +82,6 @@ HdfData::HdfData(void const* data_start, std::size_t const size_partitioned_dim, ? std::vector<Hdf5DimType>{partition_info.global_length, size_tuple} : std::vector<Hdf5DimType>{partition_info.global_length}; - data_type = meshPropertyType2HdfType(mesh_property_data_type); - DBUG( "HDF: dataset name: {:s}, offset: {:d}, data_space: {:d}, chunk_space " "{:d}, file_space: {:d}, tuples: {:d}", diff --git a/MeshLib/IO/XDMF/HdfData.h b/MeshLib/IO/XDMF/HdfData.h index 6be7b77c2cbe2ce3a826aa208c547bd4ab455275..dee2d9c0d486b628519bbf58308ea27cef46262c 100644 --- a/MeshLib/IO/XDMF/HdfData.h +++ b/MeshLib/IO/XDMF/HdfData.h @@ -27,7 +27,8 @@ struct HdfData final { HdfData(void const* data_start, std::size_t size_partitioned_dim, std::size_t size_tuple, std::string const& name, - MeshPropertyDataType mesh_property_data_type, unsigned int n_files); + MeshPropertyDataType mesh_property_data_type, unsigned int n_files, + unsigned int chunk_size_bytes); void const* data_start; std::vector<Hdf5DimType> data_space; std::vector<Hdf5DimType> offsets; diff --git a/MeshLib/IO/XDMF/XdmfHdfWriter.cpp b/MeshLib/IO/XDMF/XdmfHdfWriter.cpp index e88fcd5114c1b9bf86e587ee90e7de2fa7474fe8..6509e0d5d0a7aac1d198077bed3ee36bd5186c9a 100644 --- a/MeshLib/IO/XDMF/XdmfHdfWriter.cpp +++ b/MeshLib/IO/XDMF/XdmfHdfWriter.cpp @@ -67,7 +67,8 @@ XdmfHdfWriter::XdmfHdfWriter( std::filesystem::path const& filepath, unsigned long long const time_step, double const initial_time, std::set<std::string> const& variable_output_names, - bool const use_compression, unsigned int const n_files) + bool const use_compression, unsigned int const n_files, + unsigned int const chunk_size_bytes) { // ogs meshes to vector of Xdmf/HDF meshes (we keep Xdmf and HDF together // because XDMF depends on HDF) to meta @@ -81,12 +82,12 @@ XdmfHdfWriter::XdmfHdfWriter( // Transform the data to be written into a format conforming with the rules // of xdmf topology and geometry auto const transform_ogs_mesh_data_to_xdmf_conforming_data = - [&n_files](auto const& mesh) + [&n_files, &chunk_size_bytes](auto const& mesh) { auto flattened_geometry_values = transformToXDMFGeometry(mesh); // actually this line is only needed to calculate the offset - XdmfHdfData const& geometry = - transformGeometry(mesh, flattened_geometry_values.data(), n_files); + XdmfHdfData const& geometry = transformGeometry( + mesh, flattened_geometry_values.data(), n_files, chunk_size_bytes); auto const flattened_topology_values = transformToXDMFTopology(mesh, geometry.hdf.offsets[0]); return std::make_unique<TransformedMeshData>( @@ -96,8 +97,8 @@ XdmfHdfWriter::XdmfHdfWriter( // create metadata for transformed data and original ogs mesh data auto const transform_to_meta_data = - [&transform_ogs_mesh_data_to_xdmf_conforming_data, - &n_files](auto const& mesh) + [&transform_ogs_mesh_data_to_xdmf_conforming_data, &n_files, + &chunk_size_bytes](auto const& mesh) { // important: transformed data must survive and be unique, raw pointer // to its memory! @@ -105,10 +106,12 @@ XdmfHdfWriter::XdmfHdfWriter( transform_ogs_mesh_data_to_xdmf_conforming_data(mesh); auto const geometry = transformGeometry( mesh, xdmf_conforming_data->flattened_geometry_values.data(), - n_files); - auto const topology = transformTopology( - xdmf_conforming_data->flattened_topology_values, n_files); - auto const attributes = transformAttributes(mesh, n_files); + n_files, chunk_size_bytes); + auto const topology = + transformTopology(xdmf_conforming_data->flattened_topology_values, + n_files, chunk_size_bytes); + auto const attributes = + transformAttributes(mesh, n_files, chunk_size_bytes); return XdmfHdfMesh{std::move(geometry), std::move(topology), std::move(attributes), mesh.get().getName(), std::move(xdmf_conforming_data)}; diff --git a/MeshLib/IO/XDMF/XdmfHdfWriter.h b/MeshLib/IO/XDMF/XdmfHdfWriter.h index 03a98f2c08ca1b632c7a77a3406bea8da693f3ac..542d69d69e05185ecb146c100941624be6d529d7 100644 --- a/MeshLib/IO/XDMF/XdmfHdfWriter.h +++ b/MeshLib/IO/XDMF/XdmfHdfWriter.h @@ -35,12 +35,15 @@ public: * @param use_compression if true, zlib compression in HDFWriter component * is used * @param n_files number of hdf5 output files + * @param chunk_size_bytes Data will be split into chunks. The parameter + * specifies the size (in bytes) of the largest chunk. */ XdmfHdfWriter( std::vector<std::reference_wrapper<const MeshLib::Mesh>> const& meshes, std::filesystem::path const& filepath, unsigned long long time_step, double initial_time, std::set<std::string> const& variable_output_names, - bool use_compression, unsigned int n_files); + bool use_compression, unsigned int n_files, + unsigned int chunk_size_bytes); /** * \brief Adds data for either lazy (xdmf) or eager (hdf) writing algorithm diff --git a/MeshLib/IO/XDMF/mpi/fileIO.cpp b/MeshLib/IO/XDMF/mpi/fileIO.cpp index b42fbf50ada8a4a1900d5a0f52744f77be9288b2..f3cb4f852b572f1a736cf4019490c448d5d4dcd0 100644 --- a/MeshLib/IO/XDMF/mpi/fileIO.cpp +++ b/MeshLib/IO/XDMF/mpi/fileIO.cpp @@ -44,6 +44,8 @@ hid_t createFile(std::filesystem::path const& filepath, hid_t const plist_id = H5Pcreate(H5P_FILE_ACCESS); H5Pset_fapl_mpio(plist_id, comm, info); + H5Pset_coll_metadata_write(plist_id, true); + std::filesystem::path const partition_filename = partitionFilename(filepath, communicator.color); hid_t file = H5Fcreate(partition_filename.string().c_str(), H5F_ACC_TRUNC, diff --git a/MeshLib/IO/XDMF/transformData.cpp b/MeshLib/IO/XDMF/transformData.cpp index 7e4e6b2a5ff190fe4e007f56266c7ce4a210aa80..4d5abd6c97c8c79e8b43fece9ec4343c92a314b1 100644 --- a/MeshLib/IO/XDMF/transformData.cpp +++ b/MeshLib/IO/XDMF/transformData.cpp @@ -71,7 +71,7 @@ constexpr auto cellTypeOGS2XDMF(MeshLib::CellType const& cell_type) std::optional<XdmfHdfData> transformAttribute( std::pair<std::string, PropertyVectorBase*> const& property_pair, - unsigned int const n_files) + unsigned int const n_files, unsigned int const chunk_size_bytes) { // 3 data that will be captured and written by lambda f below MeshPropertyDataType data_type = MeshPropertyDataType::unknown; @@ -189,8 +189,8 @@ std::optional<XdmfHdfData> transformAttribute( std::string const& name = property_base->getPropertyName(); - HdfData hdf = {data_ptr, num_of_tuples, ui_global_components, - name, data_type, n_files}; + HdfData hdf = {data_ptr, num_of_tuples, ui_global_components, name, + data_type, n_files, chunk_size_bytes}; XdmfData xdmf = {num_of_tuples, ui_global_components, data_type, name, mesh_item_type, 0, @@ -199,8 +199,9 @@ std::optional<XdmfHdfData> transformAttribute( return XdmfHdfData{std::move(hdf), std::move(xdmf)}; } -std::vector<XdmfHdfData> transformAttributes(MeshLib::Mesh const& mesh, - unsigned int const n_files) +std::vector<XdmfHdfData> transformAttributes( + MeshLib::Mesh const& mesh, unsigned int const n_files, + unsigned int const chunk_size_bytes) { MeshLib::Properties const& properties = mesh.getProperties(); @@ -220,7 +221,10 @@ std::vector<XdmfHdfData> transformAttributes(MeshLib::Mesh const& mesh, } if (auto const attribute = transformAttribute( - std::pair(std::string(name), property_base), n_files)) + + std::pair(std::string(name), property_base), n_files, + chunk_size_bytes)) + { attributes.push_back(attribute.value()); } @@ -248,9 +252,9 @@ std::vector<double> transformToXDMFGeometry(MeshLib::Mesh const& mesh) return values; } -XdmfHdfData transformGeometry(MeshLib::Mesh const& mesh, - double const* data_ptr, - unsigned int const n_files) +XdmfHdfData transformGeometry(MeshLib::Mesh const& mesh, double const* data_ptr, + unsigned int const n_files, + unsigned int const chunk_size_bytes) { std::string const name = "geometry"; std::vector<MeshLib::Node*> const& nodes = mesh.getNodes(); @@ -263,7 +267,8 @@ XdmfHdfData transformGeometry(MeshLib::Mesh const& mesh, point_size, name, MeshPropertyDataType::float64, - n_files}; + n_files, + chunk_size_bytes}; XdmfData const xdmf = { partition_dim, point_size, MeshPropertyDataType::float64, name, std::nullopt, 2, @@ -300,12 +305,13 @@ std::vector<int> transformToXDMFTopology(MeshLib::Mesh const& mesh, } XdmfHdfData transformTopology(std::vector<int> const& values, - unsigned int const n_files) + unsigned int const n_files, + unsigned int const chunk_size_bytes) { std::string const name = "topology"; HdfData const hdf = { - values.data(), values.size(), 1, name, MeshPropertyDataType::int32, - n_files}; + values.data(), values.size(), 1, name, MeshPropertyDataType::int32, + n_files, chunk_size_bytes}; XdmfData const xdmf = { values.size(), 1, MeshPropertyDataType::int32, name, std::nullopt, 3, n_files}; diff --git a/MeshLib/IO/XDMF/transformData.h b/MeshLib/IO/XDMF/transformData.h index 13cf818deabf609a7c14fbdb00914f77ecf5c8c9..463e26022761012e6107b7e016cfcd36405b2721 100644 --- a/MeshLib/IO/XDMF/transformData.h +++ b/MeshLib/IO/XDMF/transformData.h @@ -28,29 +28,38 @@ namespace MeshLib::IO * \param mesh OGS mesh can be mesh or partitionedMesh * \param n_files specifies the number of files. If greater than 1 it groups the * data of each process to n_files - * \return vector of meta data + * @param chunk_size_bytes Data will be split into chunks. The parameter + * specifies the size (in bytes) of the largest chunk. + * @return vector of meta data */ std::vector<XdmfHdfData> transformAttributes(MeshLib::Mesh const& mesh, - unsigned int n_files); + unsigned int n_files, + unsigned int chunk_size_bytes); /** * \brief Create meta data for geometry used for hdf5 and xdmf * \param mesh OGS mesh can be mesh or partitionedMesh * \param data_ptr Memory location of geometry values. * \param n_files specifies the number of files. If greater than 1 it groups the * data of each process to n_files + * \param chunk_size_bytes Data will be split into chunks. The parameter + * specifies the size (in bytes) of the largest chunk. * \return Geometry meta data */ XdmfHdfData transformGeometry(MeshLib::Mesh const& mesh, double const* data_ptr, - unsigned int n_files); + unsigned int n_files, + unsigned int chunk_size_bytes); /** * \brief Create meta data for topology used for HDF5 and XDMF * \param values actual topology values to get size and memory location * \param n_files specifies the number of files. If greater than 1 it groups the * data of each process to n_files + * \param chunk_size_bytes Data will be split into chunks. The parameter + * specifies the size (in bytes) of the largest chunk. * \return Topology meta data */ XdmfHdfData transformTopology(std::vector<int> const& values, - unsigned int n_files); + unsigned int n_files, + unsigned int chunk_size_bytes); /** * \brief Copies all node points into a new vector. Contiguous data used for * writing. Conform with XDMF standard in diff --git a/MeshLib/IO/writeMeshToFile.cpp b/MeshLib/IO/writeMeshToFile.cpp index 0fca1a97fefce31ca9ab9b635fce8986b4543903..0016be32eeeed59ca058ca1ea4d5630cf9561049 100644 --- a/MeshLib/IO/writeMeshToFile.cpp +++ b/MeshLib/IO/writeMeshToFile.cpp @@ -51,7 +51,7 @@ int writeMeshToFile(const MeshLib::Mesh& mesh, const std::reference_wrapper<const MeshLib::Mesh> mr = mesh; meshes.push_back(mr); MeshLib::IO::XdmfHdfWriter(std::move(meshes), file_path, 0, 0.0, - variable_output_names, true, 1); + variable_output_names, true, 1, 1048576); return 0; } ERR("writeMeshToFile(): Unknown file extension '{:s}'. Can not write file " diff --git a/ProcessLib/Output/CreateOutput.cpp b/ProcessLib/Output/CreateOutput.cpp index d5bf7d59a9f9dc76bd3ec638dd443dd5bcb9a8fd..90268f8c22ba8bacd7dc84504d20ad13165d5699 100644 --- a/ProcessLib/Output/CreateOutput.cpp +++ b/ProcessLib/Output/CreateOutput.cpp @@ -61,7 +61,8 @@ namespace ProcessLib std::unique_ptr<OutputFormat> createOutputFormat( std::string const& output_directory, OutputType const output_type, std::string prefix, std::string suffix, std::string const& data_mode, - bool const compress_output, unsigned int const number_of_files) + bool const compress_output, unsigned int const number_of_files, + unsigned int const chunk_size_bytes) { switch (output_type) { @@ -72,7 +73,7 @@ std::unique_ptr<OutputFormat> createOutputFormat( case OutputType::xdmf: return std::make_unique<OutputXDMFHDF5Format>( output_directory, std::move(prefix), std::move(suffix), - compress_output, number_of_files); + compress_output, number_of_files, chunk_size_bytes); default: OGS_FATAL( "No supported file type provided. Read '{}' from " @@ -87,7 +88,7 @@ Output createOutput(OutputConfig&& oc, std::string const& output_directory, auto output_format = createOutputFormat( output_directory, oc.output_type, std::move(oc.prefix), std::move(oc.suffix), oc.data_mode, oc.compress_output, - oc.number_of_files); + oc.number_of_files, oc.chunk_size_bytes); OutputDataSpecification output_data_specification{ std::move(oc.output_variables), std::move(oc.fixed_output_times), diff --git a/ProcessLib/Output/CreateOutputConfig.cpp b/ProcessLib/Output/CreateOutputConfig.cpp index 17242d76f44785e0df1d049d7a13ed9a10679746..f120c1e8c8201781e3d372b871bdc797b04f5324 100644 --- a/ProcessLib/Output/CreateOutputConfig.cpp +++ b/ProcessLib/Output/CreateOutputConfig.cpp @@ -130,6 +130,16 @@ OutputConfig createOutputConfig( } return 1; }(); + output_config.chunk_size_bytes = [&hdf]() -> unsigned int + { + if (hdf) + { + //! \ogs_file_param{prj__time_loop__output__hdf__chunk_size_bytes} + return hdf->getConfigParameter<unsigned int>("chunk_size_bytes"); + } + return 1048576; // default chunk size in bytes according to + // https://www.hdfgroup.org/2022/10/improve-hdf5-performance-using-caching/ + }(); output_config.data_mode = //! \ogs_file_param{prj__time_loop__output__data_mode} diff --git a/ProcessLib/Output/OutputConfig.h b/ProcessLib/Output/OutputConfig.h index 6b1953dabb928a8ed03255365115b4993c57e640..e11a0cdb091f59357d111502327bdb5caa302cc1 100644 --- a/ProcessLib/Output/OutputConfig.h +++ b/ProcessLib/Output/OutputConfig.h @@ -38,6 +38,7 @@ struct OutputConfig std::string suffix; bool compress_output; unsigned int number_of_files; + unsigned int chunk_size_bytes; std::string data_mode; /// A list of repeat/step-count pairs. If the list is empty, and no /// fixed_output_times were specified, a default pair 1/1 will be inserted diff --git a/ProcessLib/Output/OutputFormat.cpp b/ProcessLib/Output/OutputFormat.cpp index 7c54cda07f2bcb06b2795336635f7f94cd3bf6c0..7ccac641221eb359479f7e2341d8a9c9bb283401 100644 --- a/ProcessLib/Output/OutputFormat.cpp +++ b/ProcessLib/Output/OutputFormat.cpp @@ -122,7 +122,8 @@ void OutputXDMFHDF5Format::outputMeshXdmf( iteration); std::filesystem::path path(BaseLib::joinPaths(directory, name)); mesh_xdmf_hdf_writer = std::make_unique<MeshLib::IO::XdmfHdfWriter>( - meshes, path, timestep, t, output_variables, compression, n_files); + meshes, path, timestep, t, output_variables, compression, n_files, + chunk_size_bytes); } else { diff --git a/ProcessLib/Output/OutputFormat.h b/ProcessLib/Output/OutputFormat.h index 2111b9424d20235204fd3b3ba3c4980c4758f3ee..f351c6d8e3d95a9e4ca41b4a05c4b972625681ff 100644 --- a/ProcessLib/Output/OutputFormat.h +++ b/ProcessLib/Output/OutputFormat.h @@ -95,10 +95,12 @@ struct OutputXDMFHDF5Format final : public OutputFormat { OutputXDMFHDF5Format(std::string const& directory, std::string prefix, std::string suffix, bool const compression, - unsigned int const n_files) + unsigned int const n_files, + unsigned int const chunk_size_bytes) : OutputFormat(directory, std::move(prefix), std::move(suffix), compression), - n_files(n_files) + n_files(n_files), + chunk_size_bytes(chunk_size_bytes) { } @@ -117,6 +119,8 @@ struct OutputXDMFHDF5Format final : public OutputFormat mutable std::unique_ptr<MeshLib::IO::XdmfHdfWriter> mesh_xdmf_hdf_writer; //! Specifies the number of hdf5 output files. unsigned int n_files; + //! Specifies the chunks size in bytes per hdf5 output file. + unsigned int const chunk_size_bytes; void outputMeshXdmf( std::set<std::string> const& output_variables, diff --git a/Tests/Data/EllipticPETSc/cube_1e3.include b/Tests/Data/EllipticPETSc/cube_1e3.include new file mode 100644 index 0000000000000000000000000000000000000000..e85244dce8b0afd69ad380d82066eeae3f9152da --- /dev/null +++ b/Tests/Data/EllipticPETSc/cube_1e3.include @@ -0,0 +1,96 @@ + +<mesh>cube_1x1x1_hex_1e3.vtu</mesh> +<geometry>cube_1x1x1.gml</geometry> +<processes> + <process> + <name>GW23</name> + <type>STEADY_STATE_DIFFUSION</type> + <integration_order>2</integration_order> + <process_variables> + <process_variable>pressure</process_variable> + </process_variables> + <secondary_variables> + <secondary_variable internal_name="darcy_velocity" output_name="v" /> + </secondary_variables> + </process> +</processes> +<media> + <medium id="0"> + <phases /> + <properties> + <property> + <name>diffusion</name> + <type>Constant</type> + <value>1</value> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> +</media> +<parameters> + <parameter> + <name>p0</name> + <type>Constant</type> + <value>0</value> + </parameter> + <parameter> + <name>p_Dirichlet_left</name> + <type>Constant</type> + <value>1</value> + </parameter> + <parameter> + <name>p_Dirichlet_right</name> + <type>Constant</type> + <value>-1</value> + </parameter> +</parameters> +<process_variables> + <process_variable> + <name>pressure</name> + <components>1</components> + <order>1</order> + <initial_condition>p0</initial_condition> + <boundary_conditions> + <boundary_condition> + <geometrical_set>cube_1x1x1_geometry</geometrical_set> + <geometry>left</geometry> + <type>Dirichlet</type> + <parameter>p_Dirichlet_left</parameter> + </boundary_condition> + <boundary_condition> + <geometrical_set>cube_1x1x1_geometry</geometrical_set> + <geometry>right</geometry> + <type>Dirichlet</type> + <parameter>p_Dirichlet_right</parameter> + </boundary_condition> + </boundary_conditions> + </process_variable> +</process_variables> +<nonlinear_solvers> + <nonlinear_solver> + <name>basic_picard</name> + <type>Picard</type> + <max_iter>10</max_iter> + <linear_solver>general_linear_solver</linear_solver> + </nonlinear_solver> +</nonlinear_solvers> +<linear_solvers> + <linear_solver> + <name>general_linear_solver</name> + <lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis> + <eigen> + <solver_type>CG</solver_type> + <precon_type>DIAGONAL</precon_type> + <max_iteration_step>10000</max_iteration_step> + <error_tolerance>1e-16</error_tolerance> + </eigen> + <petsc> + <prefix>gw</prefix> + <parameters>-gw_ksp_type bcgs -gw_pc_type mg -gw_ksp_rtol 1.e-16 -gw_ksp_max_it 10000</parameters> + </petsc> + </linear_solver> +</linear_solvers> \ No newline at end of file diff --git a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np2.prj b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np2.prj index 4a82534b0a7fd94f6f17adf8a3d1cbda893eeae7..537de1e64197a22b0c465f4ff3f3e035f8387657 100644 --- a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np2.prj +++ b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np2.prj @@ -1,68 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> - <mesh>cube_1x1x1_hex_1e3.vtu</mesh> - <geometry>cube_1x1x1.gml</geometry> - <processes> - <process> - <name>GW23</name> - <type>STEADY_STATE_DIFFUSION</type> - <integration_order>2</integration_order> - <process_variables> - <process_variable>pressure</process_variable> - </process_variables> - <secondary_variables> - <secondary_variable internal_name="darcy_velocity" output_name="v"/> - </secondary_variables> - </process> - </processes> - <media> - <medium id="0"> - <phases/> - <properties> - <property> - <name>diffusion</name> - <type>Constant</type> - <value>1</value> - </property> - <property> - <name>reference_temperature</name> - <type>Constant</type> - <value>293.15</value> - </property> - </properties> - </medium> - </media> <time_loop> - <processes> - <process ref="GW23"> - <nonlinear_solver>basic_picard</nonlinear_solver> - <convergence_criterion> - <type>DeltaX</type> - <norm_type>NORM2</norm_type> - <abstol>1.e-6</abstol> - </convergence_criterion> - <time_discretization> - <type>BackwardEuler</type> - </time_discretization> - <time_stepping> - <type>FixedTimeStepping</type> - <t_initial>0.0</t_initial> - <t_end>1e-1</t_end> - <timesteps> - <!-- Testing precision of the time step value output. --> - <pair> - <repeat>1</repeat> - <!-- 0.1 - 1e-15 --> - <delta_t>.099999999999999</delta_t> - </pair> - <pair> - <repeat>1</repeat> - <delta_t>1e-1</delta_t> - </pair> - </timesteps> - </time_stepping> - </process> - </processes> + <include file="steady_state_diffusion.include"/> <output> <type>XDMF</type> <prefix>cube_1e3_np2</prefix> @@ -79,67 +18,5 @@ </timesteps> </output> </time_loop> - <parameters> - <parameter> - <name>p0</name> - <type>Constant</type> - <value>0</value> - </parameter> - <parameter> - <name>p_Dirichlet_left</name> - <type>Constant</type> - <value>1</value> - </parameter> - <parameter> - <name>p_Dirichlet_right</name> - <type>Constant</type> - <value>-1</value> - </parameter> - </parameters> - <process_variables> - <process_variable> - <name>pressure</name> - <components>1</components> - <order>1</order> - <initial_condition>p0</initial_condition> - <boundary_conditions> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>left</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_left</parameter> - </boundary_condition> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>right</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_right</parameter> - </boundary_condition> - </boundary_conditions> - </process_variable> - </process_variables> - <nonlinear_solvers> - <nonlinear_solver> - <name>basic_picard</name> - <type>Picard</type> - <max_iter>10</max_iter> - <linear_solver>general_linear_solver</linear_solver> - </nonlinear_solver> - </nonlinear_solvers> - <linear_solvers> - <linear_solver> - <name>general_linear_solver</name> - <lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis> - <eigen> - <solver_type>CG</solver_type> - <precon_type>DIAGONAL</precon_type> - <max_iteration_step>10000</max_iteration_step> - <error_tolerance>1e-16</error_tolerance> - </eigen> - <petsc> - <prefix>gw</prefix> - <parameters>-gw_ksp_type bcgs -gw_pc_type mg -gw_ksp_rtol 1.e-16 -gw_ksp_max_it 10000</parameters> - </petsc> - </linear_solver> - </linear_solvers> -</OpenGeoSysProject> + <include file="cube_1e3.include"/> +</OpenGeoSysProject> \ No newline at end of file diff --git a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3.prj b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3.prj index eea6db0a3d6c15afa314da9c5a36c5b1ae76b3f4..768a35f1a42b194ffd4843f9279808498b2def7e 100644 --- a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3.prj +++ b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3.prj @@ -1,62 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> - <mesh>cube_1x1x1_hex_1e3.vtu</mesh> - <geometry>cube_1x1x1.gml</geometry> - <processes> - <process> - <name>GW23</name> - <type>STEADY_STATE_DIFFUSION</type> - <integration_order>2</integration_order> - <process_variables> - <process_variable>pressure</process_variable> - </process_variables> - <secondary_variables> - <secondary_variable internal_name="darcy_velocity" output_name="v"/> - </secondary_variables> - </process> - </processes> - <media> - <medium id="0"> - <phases/> - <properties> - <property> - <name>diffusion</name> - <type>Constant</type> - <value>1</value> - </property> - <property> - <name>reference_temperature</name> - <type>Constant</type> - <value>293.15</value> - </property> - </properties> - </medium> - </media> <time_loop> - <processes> - <process ref="GW23"> - <nonlinear_solver>basic_picard</nonlinear_solver> - <convergence_criterion> - <type>DeltaX</type> - <norm_type>NORM2</norm_type> - <abstol>1.e-6</abstol> - </convergence_criterion> - <time_discretization> - <type>BackwardEuler</type> - </time_discretization> - <time_stepping> - <type>FixedTimeStepping</type> - <t_initial>0.0</t_initial> - <t_end>1e-1</t_end> - <timesteps> - <pair> - <repeat>1</repeat> - <delta_t>1e-1</delta_t> - </pair> - </timesteps> - </time_stepping> - </process> - </processes> + <include file="steady_state_diffusion.include"/> <output> <type>XDMF</type> <prefix>cube_1e3_np3</prefix> @@ -67,70 +12,9 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> <hdf> <number_of_files>1</number_of_files> + <chunk_size_bytes>1048576</chunk_size_bytes> </hdf> </output> </time_loop> - <parameters> - <parameter> - <name>p0</name> - <type>Constant</type> - <value>0</value> - </parameter> - <parameter> - <name>p_Dirichlet_left</name> - <type>Constant</type> - <value>1</value> - </parameter> - <parameter> - <name>p_Dirichlet_right</name> - <type>Constant</type> - <value>-1</value> - </parameter> - </parameters> - <process_variables> - <process_variable> - <name>pressure</name> - <components>1</components> - <order>1</order> - <initial_condition>p0</initial_condition> - <boundary_conditions> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>left</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_left</parameter> - </boundary_condition> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>right</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_right</parameter> - </boundary_condition> - </boundary_conditions> - </process_variable> - </process_variables> - <nonlinear_solvers> - <nonlinear_solver> - <name>basic_picard</name> - <type>Picard</type> - <max_iter>10</max_iter> - <linear_solver>general_linear_solver</linear_solver> - </nonlinear_solver> - </nonlinear_solvers> - <linear_solvers> - <linear_solver> - <name>general_linear_solver</name> - <lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis> - <eigen> - <solver_type>CG</solver_type> - <precon_type>DIAGONAL</precon_type> - <max_iteration_step>10000</max_iteration_step> - <error_tolerance>1e-16</error_tolerance> - </eigen> - <petsc> - <prefix>gw</prefix> - <parameters>-gw_ksp_type bcgs -gw_pc_type mg -gw_ksp_rtol 1.e-16 -gw_ksp_max_it 10000</parameters> - </petsc> - </linear_solver> - </linear_solvers> + <include file="cube_1e3.include"/> </OpenGeoSysProject> diff --git a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_2files.prj b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_2files.prj index 87ec030106216b19566d3a48d806574172f2d129..44484628f9c52e5ba84e04858cafb1e390400549 100644 --- a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_2files.prj +++ b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_2files.prj @@ -1,62 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> - <mesh>cube_1x1x1_hex_1e3.vtu</mesh> - <geometry>cube_1x1x1.gml</geometry> - <processes> - <process> - <name>GW23</name> - <type>STEADY_STATE_DIFFUSION</type> - <integration_order>2</integration_order> - <process_variables> - <process_variable>pressure</process_variable> - </process_variables> - <secondary_variables> - <secondary_variable internal_name="darcy_velocity" output_name="v"/> - </secondary_variables> - </process> - </processes> - <media> - <medium id="0"> - <phases/> - <properties> - <property> - <name>diffusion</name> - <type>Constant</type> - <value>1</value> - </property> - <property> - <name>reference_temperature</name> - <type>Constant</type> - <value>293.15</value> - </property> - </properties> - </medium> - </media> <time_loop> - <processes> - <process ref="GW23"> - <nonlinear_solver>basic_picard</nonlinear_solver> - <convergence_criterion> - <type>DeltaX</type> - <norm_type>NORM2</norm_type> - <abstol>1.e-6</abstol> - </convergence_criterion> - <time_discretization> - <type>BackwardEuler</type> - </time_discretization> - <time_stepping> - <type>FixedTimeStepping</type> - <t_initial>0.0</t_initial> - <t_end>1e-1</t_end> - <timesteps> - <pair> - <repeat>1</repeat> - <delta_t>1e-1</delta_t> - </pair> - </timesteps> - </time_stepping> - </process> - </processes> + <include file="steady_state_diffusion.include"/> <output> <type>XDMF</type> <prefix>cube_1e3_np3</prefix> @@ -67,70 +12,10 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> <hdf> <number_of_files>2</number_of_files> + <chunk_size_bytes>1048576</chunk_size_bytes> </hdf> </output> </time_loop> - <parameters> - <parameter> - <name>p0</name> - <type>Constant</type> - <value>0</value> - </parameter> - <parameter> - <name>p_Dirichlet_left</name> - <type>Constant</type> - <value>1</value> - </parameter> - <parameter> - <name>p_Dirichlet_right</name> - <type>Constant</type> - <value>-1</value> - </parameter> - </parameters> - <process_variables> - <process_variable> - <name>pressure</name> - <components>1</components> - <order>1</order> - <initial_condition>p0</initial_condition> - <boundary_conditions> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>left</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_left</parameter> - </boundary_condition> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>right</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_right</parameter> - </boundary_condition> - </boundary_conditions> - </process_variable> - </process_variables> - <nonlinear_solvers> - <nonlinear_solver> - <name>basic_picard</name> - <type>Picard</type> - <max_iter>10</max_iter> - <linear_solver>general_linear_solver</linear_solver> - </nonlinear_solver> - </nonlinear_solvers> - <linear_solvers> - <linear_solver> - <name>general_linear_solver</name> - <lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis> - <eigen> - <solver_type>CG</solver_type> - <precon_type>DIAGONAL</precon_type> - <max_iteration_step>10000</max_iteration_step> - <error_tolerance>1e-16</error_tolerance> - </eigen> - <petsc> - <prefix>gw</prefix> - <parameters>-gw_ksp_type bcgs -gw_pc_type mg -gw_ksp_rtol 1.e-16 -gw_ksp_max_it 10000</parameters> - </petsc> - </linear_solver> - </linear_solvers> -</OpenGeoSysProject> + + <include file="cube_1e3.include"/> +</OpenGeoSysProject> \ No newline at end of file diff --git a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_3files.prj b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_3files.prj index 470bf91b822936486ec30670edeeb4568b940537..5e7c13203127c8bf0fcb77d86daad3fabdaad3e8 100644 --- a/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_3files.prj +++ b/Tests/Data/EllipticPETSc/cube_1e3_XDMF_np3_3files.prj @@ -1,62 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> - <mesh>cube_1x1x1_hex_1e3.vtu</mesh> - <geometry>cube_1x1x1.gml</geometry> - <processes> - <process> - <name>GW23</name> - <type>STEADY_STATE_DIFFUSION</type> - <integration_order>2</integration_order> - <process_variables> - <process_variable>pressure</process_variable> - </process_variables> - <secondary_variables> - <secondary_variable internal_name="darcy_velocity" output_name="v"/> - </secondary_variables> - </process> - </processes> - <media> - <medium id="0"> - <phases/> - <properties> - <property> - <name>diffusion</name> - <type>Constant</type> - <value>1</value> - </property> - <property> - <name>reference_temperature</name> - <type>Constant</type> - <value>293.15</value> - </property> - </properties> - </medium> - </media> <time_loop> - <processes> - <process ref="GW23"> - <nonlinear_solver>basic_picard</nonlinear_solver> - <convergence_criterion> - <type>DeltaX</type> - <norm_type>NORM2</norm_type> - <abstol>1.e-6</abstol> - </convergence_criterion> - <time_discretization> - <type>BackwardEuler</type> - </time_discretization> - <time_stepping> - <type>FixedTimeStepping</type> - <t_initial>0.0</t_initial> - <t_end>1e-1</t_end> - <timesteps> - <pair> - <repeat>1</repeat> - <delta_t>1e-1</delta_t> - </pair> - </timesteps> - </time_stepping> - </process> - </processes> + <include file="steady_state_diffusion.include"/> <output> <type>XDMF</type> <prefix>cube_1e3_np3</prefix> @@ -67,70 +12,9 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> <hdf> <number_of_files>3</number_of_files> + <chunk_size_bytes>1048576</chunk_size_bytes> </hdf> </output> </time_loop> - <parameters> - <parameter> - <name>p0</name> - <type>Constant</type> - <value>0</value> - </parameter> - <parameter> - <name>p_Dirichlet_left</name> - <type>Constant</type> - <value>1</value> - </parameter> - <parameter> - <name>p_Dirichlet_right</name> - <type>Constant</type> - <value>-1</value> - </parameter> - </parameters> - <process_variables> - <process_variable> - <name>pressure</name> - <components>1</components> - <order>1</order> - <initial_condition>p0</initial_condition> - <boundary_conditions> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>left</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_left</parameter> - </boundary_condition> - <boundary_condition> - <geometrical_set>cube_1x1x1_geometry</geometrical_set> - <geometry>right</geometry> - <type>Dirichlet</type> - <parameter>p_Dirichlet_right</parameter> - </boundary_condition> - </boundary_conditions> - </process_variable> - </process_variables> - <nonlinear_solvers> - <nonlinear_solver> - <name>basic_picard</name> - <type>Picard</type> - <max_iter>10</max_iter> - <linear_solver>general_linear_solver</linear_solver> - </nonlinear_solver> - </nonlinear_solvers> - <linear_solvers> - <linear_solver> - <name>general_linear_solver</name> - <lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis> - <eigen> - <solver_type>CG</solver_type> - <precon_type>DIAGONAL</precon_type> - <max_iteration_step>10000</max_iteration_step> - <error_tolerance>1e-16</error_tolerance> - </eigen> - <petsc> - <prefix>gw</prefix> - <parameters>-gw_ksp_type bcgs -gw_pc_type mg -gw_ksp_rtol 1.e-16 -gw_ksp_max_it 10000</parameters> - </petsc> - </linear_solver> - </linear_solvers> + <include file="cube_1e3.include"/> </OpenGeoSysProject> diff --git a/Tests/Data/EllipticPETSc/steady_state_diffusion.include b/Tests/Data/EllipticPETSc/steady_state_diffusion.include new file mode 100644 index 0000000000000000000000000000000000000000..4227bc402f6ee3cede8c1cd6a2e7fe218b4b9aeb --- /dev/null +++ b/Tests/Data/EllipticPETSc/steady_state_diffusion.include @@ -0,0 +1,24 @@ +<processes> + <process ref="GW23"> + <nonlinear_solver>basic_picard</nonlinear_solver> + <convergence_criterion> + <type>DeltaX</type> + <norm_type>NORM2</norm_type> + <abstol>1.e-6</abstol> + </convergence_criterion> + <time_discretization> + <type>BackwardEuler</type> + </time_discretization> + <time_stepping> + <type>FixedTimeStepping</type> + <t_initial>0.0</t_initial> + <t_end>1e-1</t_end> + <timesteps> + <pair> + <repeat>1</repeat> + <delta_t>1e-1</delta_t> + </pair> + </timesteps> + </time_stepping> + </process> +</processes> \ No newline at end of file diff --git a/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/XDMF/FunctionParameterTest_XDMF.prj b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/XDMF/FunctionParameterTest_XDMF.prj index 7753f7d2465a4dc136e10d026001cf907c427e72..dd6cadc47cffb0f20ee4efc6c464e3ea8aa7b78a 100644 --- a/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/XDMF/FunctionParameterTest_XDMF.prj +++ b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/XDMF/FunctionParameterTest_XDMF.prj @@ -141,6 +141,10 @@ boundary meshes will be written as well --> <each_steps>1</each_steps> </pair> </timesteps> + <hdf> + <chunk_size_bytes>123456</chunk_size_bytes> + <number_of_files>1</number_of_files> + </hdf> <output_iteration_results>false</output_iteration_results> <variables> <variable> pressure </variable>