HPX - High Performance ParalleX

PrevUpHomeNext

Function init

hpx::init — Main entry point for launching the HPX runtime system.

Synopsis

// In header: <hpx/hpx_init.hpp>


int init(int argc, char ** argv, std::vector< std::string > const & cfg, 
         hpx::runtime_mode mode = hpx::runtime_mode_default);

Description

This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).

In console mode it will execute the user supplied function hpx_main, in worker mode it will execute an empty hpx_main.

[Note] Note

The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in argc/argv.

Parameters:

argc

[in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).

argv

[in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).

cfg

A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance 'hpx.component.enabled=1')

mode

[in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.

Returns:

The function returns the value, which has been returned from hpx_main (or 0 when executed in worker mode).


PrevUpHomeNext