File-based coordination backend implementation. More...
#include <file_backend.hpp>
Public Member Functions | |
| FileBackend (Context ctx) | |
| Construct a file backend. More... | |
| void | put (std::string const &key, std::string const &value) override |
| Store a key-value pair (rank 0 only). More... | |
| std::string | get (std::string const &key, Duration timeout) override |
| Retrieve a value, blocking until available or timeout occurs. More... | |
| void | barrier () override |
| Perform a barrier synchronization. More... | |
| void | sync () override |
| Ensure all previous put() operations are globally visible. More... | |
Public Member Functions inherited from rapidsmpf::bootstrap::detail::Backend | |
| Backend (Backend const &)=delete | |
| Backend & | operator= (Backend const &)=delete |
| Backend (Backend &&)=delete | |
| Backend & | operator= (Backend &&)=delete |
File-based coordination backend implementation.
This class implements coordination using a shared directory on the filesystem. It creates lock files and data files to coordinate between ranks.
Directory structure:
Definition at line 33 of file file_backend.hpp.
|
explicit |
Construct a file backend.
| ctx | Bootstrap context containing rank and coordination directory. |
|
overridevirtual |
Perform a barrier synchronization.
All ranks must call this before any rank proceeds.
Implements rapidsmpf::bootstrap::detail::Backend.
|
overridevirtual |
Retrieve a value, blocking until available or timeout occurs.
Any rank (including rank 0) can call this method to retrieve values that were published by rank 0 via put() and synchronized with sync().
| key | Key name. |
| timeout | Timeout duration. |
| std::runtime_error | if key not found within timeout. |
Implements rapidsmpf::bootstrap::detail::Backend.
|
overridevirtual |
Store a key-value pair (rank 0 only).
Only rank 0 should call this method. The key-value pair is committed immediately and made visible to all ranks (including rank 0) after a collective sync(). Non-root ranks should only use get() to retrieve values published by rank 0.
| key | Key name. |
| value | Value to store. |
| std::runtime_error | if called by non-zero rank. |
Implements rapidsmpf::bootstrap::detail::Backend.
|
overridevirtual |
Ensure all previous put() operations are globally visible.
Implements rapidsmpf::bootstrap::detail::Backend.