diff --git a/source/conf.py b/source/conf.py index 1906369..add81d6 100644 --- a/source/conf.py +++ b/source/conf.py @@ -47,8 +47,12 @@ "sphinx_design", "sphinx_togglebutton", "sphinx_tabs.tabs", + "sphinxcontrib.mermaid" ] +mermaid_height = "50%" +mermaid_width = "100%" + templates_path = ['_templates'] exclude_patterns = [] diff --git a/source/content/primerParallelism/implementationApproaches.md b/source/content/primerParallelism/implementationApproaches.md index 95274b3..6bbcd5f 100644 --- a/source/content/primerParallelism/implementationApproaches.md +++ b/source/content/primerParallelism/implementationApproaches.md @@ -15,6 +15,12 @@ ⚠️ Python GIL limitation *Tightly coupled tasks* +```{mermaid} +graph LR + T1[T1] -.shared.-> M[Mem] + T2[T2] -.shared.-> M +``` + :::: ::::{grid-item-card} ⚙️ Multi-Processing @@ -26,24 +32,17 @@ ⚠️ Higher memory use *Embarrassingly parallel* + +```{mermaid} +graph LR + P1[P1] -->|IPC| P2[P2] +``` :::: ::::: ### Communication Trade-off -```{mermaid} -graph LR - subgraph "Multi-Threading" - T1[Thread 1] -.shared.-> M[Memory] - T2[Thread 2] -.shared.-> M - end - - subgraph "Multi-Processing" - P1[Process 1] -->|IPC| P2[Process 2] - end -``` - ```{tip} **Litmus test**: "Do the same thing to 1000 inputs independently" → Multi-processing ```