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) |
| Store a key-value pair. More... | |
| std::string | get (std::string const &key, Duration timeout) |
| Retrieve a value, blocking until available or timeout occurs. More... | |
| void | barrier () |
| Perform a barrier synchronization. More... | |
| void | broadcast (void *data, std::size_t size, Rank root) |
| Broadcast data from root to all ranks. More... | |
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 32 of file file_backend.hpp.
|
explicit |
Construct a file backend.
| ctx | Bootstrap context containing rank and coordination directory. |
| void rapidsmpf::bootstrap::detail::FileBackend::barrier | ( | ) |
Perform a barrier synchronization.
All ranks must call this before any rank proceeds.
| void rapidsmpf::bootstrap::detail::FileBackend::broadcast | ( | void * | data, |
| std::size_t | size, | ||
| Rank | root | ||
| ) |
Broadcast data from root to all ranks.
| data | Data buffer. |
| size | Size in bytes. |
| root | Root rank. |
| std::string rapidsmpf::bootstrap::detail::FileBackend::get | ( | std::string const & | key, |
| Duration | timeout | ||
| ) |
Retrieve a value, blocking until available or timeout occurs.
| key | Key name. |
| timeout | Timeout duration. |
| void rapidsmpf::bootstrap::detail::FileBackend::put | ( | std::string const & | key, |
| std::string const & | value | ||
| ) |
Store a key-value pair.
| key | Key name. |
| value | Value to store. |