Public Member Functions | List of all members
rapidsmpf::bootstrap::detail::FileBackend Class Reference

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...
 

Detailed Description

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:

<coord_dir>/
├── rank_<N>_alive # Created by each rank to signal presence
├── kv/
│ ├── <key1> # Key-value pairs
│ └── <key2>
└── barriers/
└── barrier_<N> # Barrier synchronization

Definition at line 32 of file file_backend.hpp.

Constructor & Destructor Documentation

◆ FileBackend()

rapidsmpf::bootstrap::detail::FileBackend::FileBackend ( Context  ctx)
explicit

Construct a file backend.

Parameters
ctxBootstrap context containing rank and coordination directory.

Member Function Documentation

◆ barrier()

void rapidsmpf::bootstrap::detail::FileBackend::barrier ( )

Perform a barrier synchronization.

All ranks must call this before any rank proceeds.

◆ broadcast()

void rapidsmpf::bootstrap::detail::FileBackend::broadcast ( void *  data,
std::size_t  size,
Rank  root 
)

Broadcast data from root to all ranks.

Parameters
dataData buffer.
sizeSize in bytes.
rootRoot rank.

◆ get()

std::string rapidsmpf::bootstrap::detail::FileBackend::get ( std::string const &  key,
Duration  timeout 
)

Retrieve a value, blocking until available or timeout occurs.

Parameters
keyKey name.
timeoutTimeout duration.
Returns
Value associated with key.

◆ put()

void rapidsmpf::bootstrap::detail::FileBackend::put ( std::string const &  key,
std::string const &  value 
)

Store a key-value pair.

Parameters
keyKey name.
valueValue to store.

The documentation for this class was generated from the following file: