runtime_impl<SchedulingPolicy, NotificationPolicy>::runtime_impl( util::runtime_configuration const& rtcfg, runtime_mode locality_mode, std::size_t num_threads, init_scheduler_type const& init, threads::policies::init_affinity_data const& init_affinity) : runtime(rtcfg, init_affinity), mode_(locality_mode), result_(0), num_threads_(num_threads), main_pool_(1, boost::bind(&runtime_impl::init_tss, This(), "main-thread", ::_1, ::_2, false), boost::bind(&runtime_impl::deinit_tss, This()), "main_pool"), io_pool_(rtcfg.get_thread_pool_size("io_pool"), boost::bind(&runtime_impl::init_tss, This(), "io-thread", ::_1, ::_2, true), boost::bind(&runtime_impl::deinit_tss, This()), "io_pool"), timer_pool_(rtcfg.get_thread_pool_size("timer_pool"), boost::bind(&runtime_impl::init_tss, This(), "timer-thread", ::_1, ::_2, true), boost::bind(&runtime_impl::deinit_tss, This()), "timer_pool"), parcel_port_(parcelset::parcelport::create_bootstrap(ini_, boost::bind(&runtime_impl::init_tss, This(), "parcel-thread", ::_1, ::_2, true), boost::bind(&runtime_impl::deinit_tss, This()))), scheduler_(init), notifier_( boost::bind(&runtime_impl::init_tss, This(), "worker-thread", ::_1, ::_2, false), boost::bind(&runtime_impl::deinit_tss, This()), boost::bind(&runtime_impl::report_error, This(), _1, _2)), thread_manager_(new hpx::threads::threadmanager_impl< SchedulingPolicy, NotificationPolicy>( timer_pool_, scheduler_, notifier_, num_threads)), agas_client_(*parcel_port_, ini_, mode_), parcel_handler_(agas_client_, thread_manager_.get(), new parcelset::policies::global_parcelhandler_queue), init_logging_(ini_, mode_ == runtime_mode_console, agas_client_), applier_(parcel_handler_, *thread_manager_, boost::uint64_t(runtime_support_.get()), boost::uint64_t(memory_.get())), action_manager_(applier_) { components::server::get_error_dispatcher().register_error_sink( &runtime_impl::default_errorsink, default_error_sink_); // in AGAS v2, the runtime pointer (accessible through get_runtime // and get_runtime_ptr) is already initialized at this point. applier_.init_tss(); #if defined(HPX_HAVE_SECURITY) // once all has been initialized, finalize security data for bootstrap this->init_security(); #endif // now, launch AGAS and register all nodes, launch all other components agas_client_.initialize(*parcel_port_); parcel_handler_.initialize(parcel_port_); #if defined(HPX_HAVE_SECURITY) // enable parcel capability checking applier_.enable_verify_capabilities(); #endif // copy over all startup functions registered so far BOOST_FOREACH(HPX_STD_FUNCTION<void()> const& f, global_pre_startup_functions) { add_pre_startup_function(f); }
runtime_impl<SchedulingPolicy, NotificationPolicy>::runtime_impl( util::runtime_configuration const& rtcfg, runtime_mode locality_mode, init_scheduler_type const& init) : runtime(agas_client_, rtcfg), mode_(locality_mode), result_(0), main_pool_(1, boost::bind(&runtime_impl::init_tss, This(), "main-thread", ::_1), boost::bind(&runtime_impl::deinit_tss, This()), "main_pool"), io_pool_(rtcfg.get_thread_pool_size("io_pool"), boost::bind(&runtime_impl::init_tss, This(), "io-thread", ::_1), boost::bind(&runtime_impl::deinit_tss, This()), "io_pool"), parcel_pool_(rtcfg.get_thread_pool_size("parcel_pool"), boost::bind(&runtime_impl::init_tss, This(), "parcel-thread", ::_1), boost::bind(&runtime_impl::deinit_tss, This()), "parcel_pool"), timer_pool_(rtcfg.get_thread_pool_size("timer_pool"), boost::bind(&runtime_impl::init_tss, This(), "timer-thread", ::_1), boost::bind(&runtime_impl::deinit_tss, This()), "timer_pool"), parcel_port_(parcel_pool_, ini_.get_parcelport_address(), ini_.get_max_connections(), ini_.get_max_connections_per_loc()), scheduler_(init), notifier_(boost::bind(&runtime_impl::init_tss, This(), "worker-thread", ::_1), boost::bind(&runtime_impl::deinit_tss, This()), boost::bind(&runtime_impl::report_error, This(), _1, _2)), thread_manager_(new hpx::threads::threadmanager_impl< SchedulingPolicy, NotificationPolicy>(timer_pool_, scheduler_, notifier_)), agas_client_(parcel_port_, ini_, mode_), parcel_handler_(agas_client_, parcel_port_, thread_manager_.get(), new parcelset::policies::global_parcelhandler_queue), init_logging_(ini_, mode_ == runtime_mode_console, agas_client_), applier_(parcel_handler_, *thread_manager_, boost::uint64_t(&runtime_support_), boost::uint64_t(&memory_)), action_manager_(applier_), runtime_support_(ini_, parcel_handler_.get_locality(), agas_client_, applier_) { components::server::get_error_dispatcher().register_error_sink( &runtime_impl::default_errorsink, default_error_sink_); // copy over all startup functions registered so far BOOST_FOREACH(HPX_STD_FUNCTION<void()> const& f, global_pre_startup_functions) { add_pre_startup_function(f); }