diff --git a/test/SMESH_ParallelCompute.py b/doc/examples/creating_parallel_mesh.py similarity index 100% rename from test/SMESH_ParallelCompute.py rename to doc/examples/creating_parallel_mesh.py diff --git a/doc/examples/tests.set b/doc/examples/tests.set index df39d9dd9..e051ca01c 100644 --- a/doc/examples/tests.set +++ b/doc/examples/tests.set @@ -129,6 +129,7 @@ SET(BAD_TESTS viewing_meshes_ex01.py radial_prism_3d_algo.py create_dual_mesh.py + creating_parallel_mesh.py ) IF(NOT WIN32) LIST(APPEND BAD_TESTS diff --git a/doc/gui/images/diagram_parallel_mesh.png b/doc/gui/images/diagram_parallel_mesh.png new file mode 100644 index 000000000..466b29b97 Binary files /dev/null and b/doc/gui/images/diagram_parallel_mesh.png differ diff --git a/doc/gui/input/about_meshes.rst b/doc/gui/input/about_meshes.rst index 619bd799f..6350eea4b 100644 --- a/doc/gui/input/about_meshes.rst +++ b/doc/gui/input/about_meshes.rst @@ -71,6 +71,8 @@ Quadratic mesh can be obtained in three ways: * Using :ref:`convert_to_from_quadratic_mesh_page` operation. * Using an appropriate option of some meshing algorithms, which generate elements of several dimensions starting from mesh segments. +A work in progress allow you to compute your mesh in parralle :ref:`Parallel Computing` + **Table of Contents** @@ -86,3 +88,4 @@ Quadratic mesh can be obtained in three ways: copy_mesh.rst create_dual_mesh.rst connectivity.rst + parallel_compute.rst diff --git a/doc/gui/input/parallel_compute.rst b/doc/gui/input/parallel_compute.rst new file mode 100644 index 000000000..82d1abfb9 --- /dev/null +++ b/doc/gui/input/parallel_compute.rst @@ -0,0 +1,69 @@ +.. _parallel_compute_page: + +****************** +Parallel Computing +****************** + + +.. warning:: + This functionality is a work in progress. + + It is only available for NETGEN. + + It is only available in TUI. + + +The goal here is to speed up computation by running sub-meshes in parallel +(multi-threading). + +******* +Concept +******* + +.. image:: ../images/diagram_parallel_mesh.png + +In order to parallelise the computation of the mesh we split the geometry into: + + * A 1D+2D compound + * A list of 3D solids + +Then create a sub-mesh for each of those geometry. +And associate Hypothesis to the mesh using a hypothesis on the whole geometry + +We will first compute sequentially the 1D+2D compound with NETGEN_1D2D. + +Then we will compute all the solids in parallel. Having done the 1D+2D first +ensure that all the solids can be computed without any concurrency. + + +****** +How to +****** + +You follow the same principle as the creation of a sequential Mesh. + + +#. First you create the mesh: + .. code-block:: python + + par_mesh = smesh.ParallelMesh(geom, name="par_mesh") + +#. Define the Global Hypothesis that will be split into an hypothesis for the + 1D+2D compound and one for each of the 3D solids: + .. code-block:: python + + NETGEN_3D_Parameters_1 = smesh.CreateHypothesisByAverageLength( 'NETGEN_Parameters', + 'NETGENEngine', 34.641, 0 ) + par_mesh.AddGlobalHypothesis(netgen_parameters) + +#. Set the parameters for the parallelisation: + .. code-block:: python + + par_mesh.SetNbThreads()Compute() + +#. Compute the mesh: + .. code-block:: python + + mesh.Compute() + +**See Also** a sample script of :ref:`tui_create_parallel_mesh`. diff --git a/doc/gui/input/tui_creating_meshes.rst b/doc/gui/input/tui_creating_meshes.rst index 253fbf260..67e14d358 100644 --- a/doc/gui/input/tui_creating_meshes.rst +++ b/doc/gui/input/tui_creating_meshes.rst @@ -117,3 +117,12 @@ Creating Dual Mesh :download:`Download this script <../../examples/create_dual_mesh.py>` +.. _tui_create_parallel_mesh: + +Creating Parallel Mesh +====================== + +.. literalinclude:: ../../examples/creating_parallel_mesh.py + :language: python + +:download:`Download this script <../../examples/creating_parallel_mesh.py>` diff --git a/test/tests.set b/test/tests.set index 0035933fe..b14e7c200 100644 --- a/test/tests.set +++ b/test/tests.set @@ -65,7 +65,6 @@ SET(BAD_TESTS SMESH_create_dual_mesh_adapt.py SMESH_create_dual_mesh_tpipe.py netgen_runner.py - SMESH_ParallelCompute.py ) IF(NOT WIN32) LIST(APPEND BAD_TESTS