11 #include <sys/socket.h> 12 #include <arpa/inet.h> 14 #include <sys/timeb.h> 34 catch (
const std::exception& ex)
36 std::cout << ex.what() << std::endl;
41 std::cout <<
"unknown exception" << std::endl;
67 int main(
int argc,
char* argv[])
69 bool should_use_onethread =
false;
71 driver_config.
add(
make_option(
"onethread", should_use_onethread).help(
"Disable parse thread"));
76 std::vector<std::unique_ptr<options_boost_po>> arguments;
77 std::vector<vw*> alls;
78 if (argc == 3 && !strcmp(argv[1],
"--args"))
80 std::fstream arg_file(argv[2]);
84 while (std::getline(arg_file, line))
86 std::stringstream sstr;
87 sstr << line <<
" -f model." << (line_count++);
88 sstr <<
" --no_stdin";
90 std::cout << sstr.str() << std::endl;
91 std::string str = sstr.str();
92 const char* new_args = str.c_str();
98 ptr->add_and_parse(driver_config);
99 alls.push_back(
setup(*ptr));
100 arguments.push_back(std::move(ptr));
106 ptr->add_and_parse(driver_config);
107 alls.push_back(
setup(*ptr));
108 arguments.push_back(std::move(ptr));
116 if (should_use_onethread)
118 if (alls.size() == 1)
121 THROW(
"--onethread doesn't make sense with multiple learners");
126 if (alls.size() == 1)
137 std::rethrow_exception(v->p->exc_ptr);
149 catch (std::exception& e)
155 std::cerr <<
"vw: " << e.what() << std::endl;
static constexpr int col_current_features
vw * setup(options_i &options)
void generic_driver(ready_examples_queue &examples, context_type &context)
static constexpr int col_current_label
static constexpr int col_avg_loss
static constexpr int col_since_last
const char * Filename() const
char ** get_argv_from_string(std::string s, int &argc)
void finish(vw &all, bool delete_all)
const char * what() const noexcept override
static constexpr int col_example_weight
void start_parser(vw &all)
virtual bool was_supplied(const std::string &key)=0
static constexpr int col_example_counter
vw * initialize(options_i &options, io_buf *model, bool skipModelLoad, trace_message_t trace_listener, void *trace_context)
int main(int argc, char *argv[])
void generic_driver_onethread(vw &all)
option_group_definition & add(T &&op)
typed_option< T > make_option(std::string name, T &location)
static constexpr int col_current_predict