Interface Documentation
Version: invalid
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
flecsi::run::context Struct Reference

#include <context.hh>

Inheritance diagram for flecsi::run::context:
Inheritance graph
[legend]

Classes

struct  index_subspace_info_t
 

Public Types

using field_info_store_t = data::fields
 

Public Member Functions

 context (const context &)=delete
 
contextoperator= (const context &)=delete
 
 context (context &&)=delete
 
contextoperator= (context &&)=delete
 
bool initialized ()
 
boost::program_options::positional_options_description & positional_description ()
 
std::map< std::string, std::string > & positional_help ()
 
boost::program_options::options_description & hidden_options ()
 
std::map< std::string, std::pair< bool, std::function< bool(boost::any const &)> > > & option_checks ()
 
std::vector< char * > & argv ()
 
std::string const & program ()
 
auto & descriptions_map ()
 
std::vector< std::string > const & unrecognized_options ()
 
int initialize_generic (int argc, char **argv, bool dependent)
 
void finalize_generic ()
 
int initialize (int argc, char **argv, bool dependent)
 
void finalize ()
 
int start (const std::function< int(int, char **)> action &)
 
std::size_t process () const
 
std::size_t processes () const
 
std::size_t threads_per_process () const
 
std::size_t threads () const
 
std::size_t color () const
 
std::size_t colors () const
 
int & exit_status ()
 
void register_init (void callback())
 
bool topology_fields_registered (size_t type_key, size_t instance_key)
 
template<class Topo , std::size_t Index>
void add_field_info (const data::field_info_t &field_info)
 
template<class Topo , std::size_t Index = topo::default_space<Topo>>
field_info_store_t const & get_field_info_store () const
 
void add_index_subspace (size_t index_subspace, size_t capacity)
 
void add_index_subspace (const index_subspace_info_t &info)
 
std::map< size_t, index_subspace_info_t > & index_subspace_info ()
 
size_t const & tasks_executed () const
 
size_t & tasks_executed ()
 

Static Public Member Functions

static context_tinstance ()
 
static std::size_t task_depth ()
 

Protected Member Functions

void start ()
 
void clear ()
 

Protected Attributes

std::string program_
 
std::vector< char * > argv_
 
std::string backend_
 
std::string flog_tags_
 
int flog_verbose_
 
int64_t flog_output_process_
 
bool initialize_dependent_ = true
 
std::map< std::string, boost::program_options::options_description > descriptions_map_
 
boost::program_options::positional_options_description positional_desc_
 
boost::program_options::options_description hidden_options_
 
std::map< std::string, std::string > positional_help_
 
std::map< std::string, std::pair< bool, std::function< bool(boost::any const &)> > > option_checks_
 
std::vector< std::string > unrecognized_options_
 
bool initialized_ = false
 
size_t process_ = std::numeric_limits<size_t>::max()
 
size_t processes_ = std::numeric_limits<size_t>::max()
 
size_t threads_per_process_ = std::numeric_limits<size_t>::max()
 
size_t threads_ = std::numeric_limits<size_t>::max()
 
int exit_status_ = 0
 
std::unordered_map< size_t, void * > function_registry_
 
std::set< std::pair< size_t, size_t > > registered_topology_fields_
 
std::unordered_map< size_t, std::vector< field_info_store_t > > topology_field_info_map_
 
std::map< size_t, index_subspace_info_tindex_subspace_map_
 
size_t tasks_executed_ = 0
 

Detailed Description

The context type provides a high-level execution context interface that is implemented by a specific backend.

Member Function Documentation

◆ add_field_info()

template<class Topo , std::size_t Index>
void flecsi::run::context::add_field_info ( const data::field_info_t field_info)
inline

Register field information.

Template Parameters
Topotopology type
Indextopology-relative index space
Parameters
field_infoField information.

◆ add_index_subspace() [1/2]

void flecsi::run::context::add_index_subspace ( size_t  index_subspace,
size_t  capacity 
)
inline

FIXME: Do we need to make this general for other topology types? This is currently only for unstructured mesh topologies.

Add an index subspace to the specified index space with the specified
capcity.

@param index_space The parent index space.
@param capacity    The maximum size of the subspace in indices.

◆ add_index_subspace() [2/2]

void flecsi::run::context::add_index_subspace ( const index_subspace_info_t info)
inline

FIXME: Do we need to make this general for other topology types? This is currently only for unstructured mesh topologies.

Add an index subspace struct instance.

@param info An initialized instance of index_subspace_info_t.

◆ color()

std::size_t flecsi::run::context::color ( ) const

Get the color of this process.

◆ colors()

std::size_t flecsi::run::context::colors ( ) const

Get the number of colors.

◆ exit_status()

int& flecsi::run::context::exit_status ( )
inline

Return the exit status of the FleCSI runtime.

◆ finalize()

void flecsi::run::context::finalize ( )

Perform FleCSI runtime finalization. If FleCSI was initialized with the dependent flag set to true, FleCSI will also finalize any runtimes on which it depends.

◆ get_field_info_store()

template<class Topo , std::size_t Index = topo::default_space<Topo>>
field_info_store_t const& flecsi::run::context::get_field_info_store ( ) const
inline

Return the stored field info for the given topology type and layout. Const version.

Template Parameters
Topotopology type
Indextopology-relative index space

◆ index_subspace_info()

std::map<size_t, index_subspace_info_t>& flecsi::run::context::index_subspace_info ( )
inline

FIXME: Do we need to make this general for other topology types? This is currently only for unstructured mesh topologies.

Return the map of index subspaces.

◆ process()

std::size_t flecsi::run::context::process ( ) const

Return the current process id.

◆ processes()

std::size_t flecsi::run::context::processes ( ) const

Return the number of processes.

◆ start()

int flecsi::run::context::start ( const std::function< int(int, char **)> action &  )

Start the FleCSI runtime.

Parameters
actionThe top-level action FleCSI should execute.
Returns
An integer with 0 being success, and any other value being failure.

◆ task_depth()

static std::size_t flecsi::run::context::task_depth ( )
static

Return the current task depth within the execution hierarchy. The top-level task has depth 0. This interface is primarily intended for FleCSI developers to use in enforcing runtime constraints.

◆ tasks_executed() [1/2]

size_t const& flecsi::run::context::tasks_executed ( ) const
inline

Return the count of executed tasks. Const version.

◆ tasks_executed() [2/2]

size_t& flecsi::run::context::tasks_executed ( )
inline

Return the count of executed tasks.

◆ threads()

std::size_t flecsi::run::context::threads ( ) const

Return the number of execution instances with which the runtime was invoked. In this context a thread is defined as an instance of execution, and does not imply any other properties. This interface can be used to determine the full subscription of the execution instances of the running process that invokded the FleCSI runtime.

◆ threads_per_process()

std::size_t flecsi::run::context::threads_per_process ( ) const

Return the number of threads per process.

◆ topology_fields_registered()

bool flecsi::run::context::topology_fields_registered ( size_t  type_key,
size_t  instance_key 
)
inline

Return a boolean indicating whether or not the given instance of a data topology has had its internal fields registered with the data model.

Parameters
topology_type_identifierTopology type identifier.
instance_identifierInstance identifier.

The documentation for this struct was generated from the following files: