libpressio 0.93.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
pressio_distributed_manager Class Reference

#include <distributed_manager.h>

Inheritance diagram for pressio_distributed_manager:
Inheritance graph
[legend]
Collaboration diagram for pressio_distributed_manager:
Collaboration graph
[legend]

Public Member Functions

 pressio_distributed_manager (unsigned int max_ranks_per_worker=1, unsigned int max_masters=1)
 
template<class TaskRandomIt , class MasterFn , class WorkerFn >
int work_queue (TaskRandomIt begin, TaskRandomIt end, WorkerFn &&workerfn, MasterFn &&masterfn)
 
template<class T >
int send (T const &t, int dest, int tag=0)
 
template<class T >
int recv (T &t, int source, int tag=0, MPI_Status *s=nullptr)
 
template<class T >
int bcast (T &t, int bcast_root)
 
template<class T >
int bcast (T &t)
 
int comm_size () const
 
int comm_rank () const
 
struct pressio_options get_documentation () const override
 
struct pressio_options get_options () const override
 
virtual int set_options (struct pressio_options const &options) override
 
const char * prefix () const override
 
- Public Member Functions inherited from pressio_configurable
virtual const char * prefix () const =0
 
std::string const & get_name () const
 
virtual void set_name (std::string const &new_name)
 
virtual void set_name_impl (std::string const &new_name)
 
virtual struct pressio_options get_configuration () const
 
virtual struct pressio_options get_documentation () const
 
virtual int check_options (struct pressio_options const &)
 
virtual struct pressio_options get_options () const
 
virtual int set_options (struct pressio_options const &options)
 
int cast_options (pressio_options const &early_config, pressio_options const &config)
 
- Public Member Functions inherited from pressio_errorable
const char * error_msg () const
 
int error_code () const
 

Static Public Attributes

static size_t unlimited
 

Additional Inherited Members

- Protected Member Functions inherited from pressio_configurable
template<class StringType >
void set (pressio_options &options, StringType const &key, pressio_option const &value) const
 
template<class StringType >
void set_type (pressio_options &options, StringType const &key, pressio_option_type type) const
 
template<class StringType , class PointerType >
enum pressio_options_key_status get (pressio_options const &options, StringType &&key, PointerType value) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta (pressio_options &options, StringType &&key, std::string const &current_id, Wrapper const &current_value, Args &&... args) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_docs (pressio_options &options, StringType &&key, std::string const &docstring, Wrapper const &current_value, Args &&... args) const
 
template<class StringType , class Wrapper , class Registry , class... Args>
void set_meta_configuration (pressio_options &options, StringType &&key, Registry const &registry, Wrapper const &current_value) const
 
template<class StringType , class Wrapper , class Registry , class... Args>
void set_meta_many_configuration (pressio_options &options, StringType &&key, Registry const &registry, std::vector< Wrapper > const &current_values) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_many_docs (pressio_options &options, StringType &&key, std::string const &docstring, std::vector< Wrapper > const &current_values, Args &&... args) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_many (pressio_options &options, StringType &&key, std::vector< std::string > const &current_ids, std::vector< Wrapper > const &current_values, Args &&... args) const
 
template<class StringType , class Registry , class Wrapper >
pressio_options_key_status get_meta (pressio_options const &options, StringType &&key, Registry const &registry, std::string &current_id, Wrapper &current_value)
 
template<class StringType , class Registry , class Wrapper >
pressio_options_key_status get_meta_many (pressio_options const &options, StringType &&key, Registry const &registry, std::vector< std::string > &current_ids, std::vector< Wrapper > &current_values)
 
template<class T >
void set_names_many (std::string const &name, std::vector< T > &plugins, std::vector< std::string > const &names) const
 
std::string get_metrics_key_name () const
 
- Protected Member Functions inherited from pressio_errorable
int set_error (int code, std::string const &msg)
 
void clear_error ()
 
- Static Protected Member Functions inherited from pressio_configurable
static pressio_thread_safety get_threadsafe (pressio_configurable const &c)
 
- Protected Attributes inherited from pressio_configurable
std::string name
 

Detailed Description

helper class for interacting with libdistributed

Constructor & Destructor Documentation

◆ pressio_distributed_manager()

pressio_distributed_manager::pressio_distributed_manager ( unsigned int  max_ranks_per_worker = 1,
unsigned int  max_masters = 1 
)
inline

constructs a distributed_manager

Parameters
[in]max_ranks_per_workerthe maximum numbers of workers to use
[in]max_mastersthe maximum number master processes to use

Member Function Documentation

◆ bcast() [1/2]

template<class T >
int pressio_distributed_manager::bcast ( T &  t)
inline

helper function for recv

Parameters
[in,out]tthe value to bcast
Returns
an error code

◆ bcast() [2/2]

template<class T >
int pressio_distributed_manager::bcast ( T &  t,
int  bcast_root 
)
inline

helper function for recv

Parameters
[in,out]tthe value to bcast
[in]bcast_rootthe destination
Returns
an error code

◆ comm_rank()

int pressio_distributed_manager::comm_rank ( ) const
inline
Returns
the rank of the managed communicator

◆ comm_size()

int pressio_distributed_manager::comm_size ( ) const
inline
Returns
the size of the managed communicator

◆ get_documentation()

struct pressio_options pressio_distributed_manager::get_documentation ( ) const
inlineoverridevirtual

get the documentation strings for a compressor

See also
pressio_compressor_get_documentation for the semantics this function should obey

Reimplemented from pressio_configurable.

◆ get_options()

struct pressio_options pressio_distributed_manager::get_options ( ) const
inlineoverridevirtual

provides options for the manager for the user to configure

Returns
the options

Reimplemented from pressio_configurable.

◆ prefix()

const char * pressio_distributed_manager::prefix ( ) const
inlineoverridevirtual

the prefix "distributed" used in introspection

Implements pressio_configurable.

◆ recv()

template<class T >
int pressio_distributed_manager::recv ( T &  t,
int  source,
int  tag = 0,
MPI_Status *  s = nullptr 
)
inline

helper function for recv

Parameters
[out]tthe value to recv
[in]sourcethe source
[in]tagthe tag to use
[out]sthe optional status value to use
Returns
an error code

◆ send()

template<class T >
int pressio_distributed_manager::send ( T const &  t,
int  dest,
int  tag = 0 
)
inline

helper function for send

Parameters
[in]tthe value to send
[in]destthe destination
[in]tagthe tag to use
Returns
an error code

◆ set_options()

virtual int pressio_distributed_manager::set_options ( struct pressio_options const &  options)
inlineoverridevirtual

sets options for the manager for the user to configure

Returns
an error code

Reimplemented from pressio_configurable.

◆ work_queue()

template<class TaskRandomIt , class MasterFn , class WorkerFn >
int pressio_distributed_manager::work_queue ( TaskRandomIt  begin,
TaskRandomIt  end,
WorkerFn &&  workerfn,
MasterFn &&  masterfn 
)
inline

create a work_queue from the provided configuration

Parameters
[in]beginthe first task in the queue
[in]endthe last task in the queue
[in]workerfnthe function worker tasks should execute
[in]masterfnthe function master tasks should execute

Member Data Documentation

◆ unlimited

size_t pressio_distributed_manager::unlimited
static

a variable used to indicate there is no bound applied


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