25 #include <graphlab/scheduler/scheduler_list.hpp>
26 #include <graphlab/engine/iengine.hpp>
27 #include <graphlab/util/stl_util.hpp>
33 std::vector<std::string> ret;
34 #define __APPEND_TO_RET__(r_unused, data_unused, i, elem) \
35 ret.push_back(BOOST_PP_TUPLE_ELEM(3,0,elem));
36 BOOST_PP_SEQ_FOR_EACH_I(__APPEND_TO_RET__, _, __SCHEDULER_LIST__)
37 #undef __APPEND_TO_RET__
44 std::vector<std::string> schednames;
46 for (
size_t i = 0; i < schednames.size(); ++i) {
50 ret = ret + schednames[i];
55 static std::string add_line_breaks(
const std::string &s,
size_t numcols) {
58 while(pos < s.length() - 1) {
60 pos = std::min(pos + numcols, s.length());
65 if (pos < s.length()) {
66 newpos = s.rfind(
" ", pos);
70 if (newpos == std::string::npos || newpos == oldpos) {
74 ret = ret +
trim(s.substr(oldpos, newpos - oldpos)) +
"\n";
82 typedef char dummy_message_type;
85 #define __GENERATE_SCHEDULER_HELP__(r_unused, data_unused, i, elem) \
86 BOOST_PP_EXPR_IF(i, else) if (s == BOOST_PP_TUPLE_ELEM(3,0,elem)) { \
88 out << BOOST_PP_TUPLE_ELEM(3,0,elem) << " scheduler\n"; \
89 out << std::string(50, '-') << std::endl; \
90 out << add_line_breaks(BOOST_PP_TUPLE_ELEM(3,2,elem), 50) << "\n" \
92 BOOST_PP_TUPLE_ELEM(3,1,elem)< dummy_message_type > \
93 ::print_options_help(out); \
102 BOOST_PP_SEQ_FOR_EACH_I(__GENERATE_SCHEDULER_HELP__, _, __SCHEDULER_LIST__)
104 out <<
"Scheduler " << s <<
" not found" <<
"\n";
106 #undef __GENERATE_SCHEDULER_HELP__