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 new file mode 100644 index 0000000..1cc9a2e --- /dev/null +++ b/docs/source/shared_memory.rst @@ -0,0 +1,20 @@ +.. _shared-memory: + +============================================= +Client-Server Communication via Shared Memory +============================================= + +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 +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 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 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.