From ca371a4fa83941c2a8e7f4d114e8b6e63994dd0f Mon Sep 17 00:00:00 2001 From: chun9l <97897047+chun9l@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:31:58 +0100 Subject: [PATCH 1/3] Add early draft for shmem docs --- docs/source/shared_memory.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/source/shared_memory.rst diff --git a/docs/source/shared_memory.rst b/docs/source/shared_memory.rst new file mode 100644 index 0000000..bb1349c --- /dev/null +++ b/docs/source/shared_memory.rst @@ -0,0 +1,22 @@ +.. _shared-memory: +============================================= +Client-Server Communication via Shared Memory +============================================= + +UM-Bridge uses HTTP to communicate between a UQ client and a model server +by default. However, this is not the most performant option (in HPC) as it +carries around 1 millisecond of overhead per request. We provide a quicker +method that uses shared memory (RAM) to transfer data. + +Currently, only the C++ and Python implementations are supported; instructions +are documented in the respective sections below. When enabled, UM-Bridge will +first perform a data exchange test, and will fallback to HTTP if this fails. + + +Enabling Shared Memory Communication in C++ +=========================================== + + + +Enabling Shared Memory Communication in Python +============================================== \ No newline at end of file From 1411e02ca158a70d052900d81a18c148a35908bb Mon Sep 17 00:00:00 2001 From: chun9l <97897047+chun9l@users.noreply.github.com> Date: Thu, 23 Jul 2026 17:39:32 +0100 Subject: [PATCH 2/3] add more text on shmem --- docs/source/shared_memory.rst | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/docs/source/shared_memory.rst b/docs/source/shared_memory.rst index bb1349c..3cf3c4d 100644 --- a/docs/source/shared_memory.rst +++ b/docs/source/shared_memory.rst @@ -3,20 +3,17 @@ Client-Server Communication via Shared Memory ============================================= -UM-Bridge uses HTTP to communicate between a UQ client and a model server +UM-Bridge uses HTTP to communicate between an UQ client and a model server by default. However, this is not the most performant option (in HPC) as it carries around 1 millisecond of overhead per request. We provide a quicker -method that uses shared memory (RAM) to transfer data. +alternative that uses shared memory (RAM) to transfer data. This approach +works by using allocated memory buffers in RAM as the transfer medium for +UM-Bridge inputs and outputs. To prevent data races in a parallel setting, +each memory buffer is tagged with the ID of the thread making the request +in the client, and this ID is also shared (through a JSON entry) so that +the model can access the correct buffer. -Currently, only the C++ and Python implementations are supported; instructions -are documented in the respective sections below. When enabled, UM-Bridge will -first perform a data exchange test, and will fallback to HTTP if this fails. - - -Enabling Shared Memory Communication in C++ -=========================================== - - - -Enabling Shared Memory Communication in Python -============================================== \ No newline at end of file +Currently, only the C++ and Python implementations are supported, and this +feature is enabled automatically. The code will first perform a test +transfer using shared memory when the client connects to the server; it +reverts back to HTTP if this test fails. From ebb605828a9c2580fcb8f6eb7e374e4218d7b0ca Mon Sep 17 00:00:00 2001 From: chun9l <97897047+chun9l@users.noreply.github.com> Date: Fri, 24 Jul 2026 16:25:26 +0100 Subject: [PATCH 3/3] update docs with shmem --- docs/generate_documentation.sh | 3 +++ docs/source/shared_memory.rst | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/generate_documentation.sh b/docs/generate_documentation.sh index 361a498..d373331 100755 --- a/docs/generate_documentation.sh +++ b/docs/generate_documentation.sh @@ -131,6 +131,9 @@ for f in $(find ../../umbridge/ -name 'README.md'); do $NAME EOF done + +# Extra docs. Added manually +echo " ../shared_memory" >> docs_output/source/umbridge/index.rst echo " ../mpi_container" >> docs_output/source/umbridge/index.rst echo " ../math_description" >> docs_output/source/umbridge/index.rst diff --git a/docs/source/shared_memory.rst b/docs/source/shared_memory.rst index 3cf3c4d..1cc9a2e 100644 --- a/docs/source/shared_memory.rst +++ b/docs/source/shared_memory.rst @@ -1,4 +1,5 @@ .. _shared-memory: + ============================================= Client-Server Communication via Shared Memory ============================================= @@ -10,10 +11,10 @@ alternative that uses shared memory (RAM) to transfer data. This approach works by using allocated memory buffers in RAM as the transfer medium for UM-Bridge inputs and outputs. To prevent data races in a parallel setting, each memory buffer is tagged with the ID of the thread making the request -in the client, and this ID is also shared (through a JSON entry) so that +in the parallel client, and this ID is shared through a JSON entry so that the model can access the correct buffer. Currently, only the C++ and Python implementations are supported, and this -feature is enabled automatically. The code will first perform a test -transfer using shared memory when the client connects to the server; it -reverts back to HTTP if this test fails. +feature is enabled automatically when available. The code will first +perform a test transfer using shared memory when the client first connects +to the server; it reverts back to HTTP if this test fails.