| 718 | } |
| 719 | |
| 720 | int start(hpx::runtime& rt, |
| 721 | hpx::function<int(hpx::program_options::variables_map& vm)> const& |
| 722 | f, |
| 723 | hpx::program_options::variables_map& vm, runtime_mode mode, |
| 724 | startup_function_type startup, shutdown_function_type shutdown) |
| 725 | { |
| 726 | LPROGRESS_; |
| 727 | |
| 728 | add_startup_functions( |
| 729 | rt, vm, mode, HPX_MOVE(startup), HPX_MOVE(shutdown)); |
| 730 | |
| 731 | if (!f.empty()) |
| 732 | { |
| 733 | // Run this runtime instance using the given function f. |
| 734 | return rt.start(hpx::bind_front(f, vm)); |
| 735 | } |
| 736 | |
| 737 | // Run this runtime instance without a hpx_main |
| 738 | return rt.start(); |
| 739 | } |
| 740 | |
| 741 | int run_or_start(bool blocking, std::unique_ptr<hpx::runtime> rt, |
| 742 | util::command_line_handling& cfg, startup_function_type startup, |