void print_help (void) { print_revision(); print_revision_snmp(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); print_help_default(); print_help_warn("remaining charge", DEFAULT_CHARGE_WARNING); print_help_crit("remaining charge", DEFAULT_CHARGE_CRITICAL); printf(" -W\n"); printf(" Return warning if remaining runtime exceeds limit. " "Defaults to %s\n", DEFAULT_RUNTIME_WARNING); printf(" -Z\n"); printf(" Return critical if remaining runtime exceeds limit. " "Defaults to %s\n", DEFAULT_RUNTIME_CRITICAL); printf(" -e, --extended-status\n"); printf(" Print extended status.\n"); print_help_snmp(); }
void show_help() { print_version(); print_copyright(); printf( "\n" ); print_usage(); printf( "\n\tLong Version Short Description\n" ); printf( "----------------------------------------------------------------\n" ); printf( "\t--help -h Show this help screen.\n" ); printf( "\t--verbose -v Be verbose when running.\n" ); printf( "\t--showargs -s Show all the arguments passed to ferite.\n" ); printf( "\t--execute -e Execute the script supplied on the command line\n" ); printf( "\t--module-name -m Name of the module to be generated (default: modulename)\n" ); printf( "\t--add-file -a Add an external file to the generated makefile\n" ); printf( "\t--init-name -i Change the name of the default module init function (default: module_init)\n" ); printf( "\t--no-deinit -d Stop builder generating a module_deinit function\n" ); printf( "\t--no-makefile -f Stop builder generating a 'Makfile.am'\n" ); printf( "\t--no-configm4 -nc Stop builder generating a 'config.m4'\n" ); printf( "\t--no-xml -x Stop builder generating a 'modulename.xml'\n" ); printf( "\t--force-makefile -k Force builder to generate a 'Makefile.am'\n" ); printf( "\t--add-dist-file -A Add a file to the distributed files.\n" ); printf( "\t--builder-path -b The value to use for the builder location in the Makefile.am (default: @BUILDER@).\n" ); printf( "\t--source-prefix -p The value to use for the src prefix in the Makefile.am (default: @MODULE_SRC_PREFIX@)\n" ); printf( "\t--closed -c Generate source code to generate .fec file structure without needing the .fec\n" ); printf( "\t--file-prefix -fp Place each file generated in the directory given\n" ); printf( "\t--version Print out the version\n" ); printf( "\t--copyright Print out the copyright\n" ); printf( "\n" ); ferite_show_help(); exit(0); }
void print_help (void) { print_revision(); print_revision_ldns(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); print_help_default(); print_help_host(); print_help_ldns(); printf(" -D, --domain=DOMAIN\n"); printf(" The name of the domain to check.\n"); printf(" -T, --trace-from=DOMAIN\n"); printf(" The name of the domain to trace from. (default: .)\n"); printf(" -k, --trusted-keys=FILE\n"); printf(" File to read trust-anchors from.\n"); printf(" -R, --resolver=HOST\n"); printf(" Host name or IP Address of the resolver to use.\n"); printf("\n"); print_help_ldns_keyfile(); }
void print_help (void) { print_revision(); print_revision_ldns(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); print_help_default(); print_help_host(); printf(" -D, --domain=DOMAIN\n"); printf(" The name of the domain to check.\n"); printf(" --norecursion\n"); printf(" Do not test for disabled recursion.\n"); printf(" --notcp\n"); printf(" Do not test TCP queries.\n"); printf(" --noudp\n"); printf(" Do not test UDP queries.\n"); printf(" --noaxfrn\n"); printf(" Do not test for disabled AXFR.\n"); }
/** * @brief Read in files with arrays and join them into a single file * @param argc * @param argv[] * @return */ int main (int argc, char *argv[]) { AnyOption opt; opt.setFlag ("help", 'h'); /* a flag (takes no argument), supporting long and short form */ opt.setOption ("verbose", 'v'); opt.setOption ("random", 'r'); opt.addUsage ("OA: unittest: Perform some checks on the code"); opt.addUsage ("Usage: unittest [OPTIONS]"); opt.addUsage (""); opt.addUsage (" -v --verbose Print documentation"); opt.addUsage (" -r --random Seed for random number generator"); opt.processCommandArgs (argc, argv); int verbose = opt.getIntValue ('v', 1); int random = opt.getIntValue ('r', 0); if (opt.getFlag ("help") || opt.getFlag ('h')) { opt.printUsage (); exit (0); } if (verbose) { print_copyright (); } if (verbose >= 2) { print_options (std::cout); } oaunittest (verbose, 1, random); return 0; }
int main(int argc, char* argv[]) { utils::debug::scope_log log(DBG_LVL_1("gtox"), { argc, utils::debug::parameter(argv, argc), }); std::set_terminate(terminate_handler); Glib::add_exception_handler(sigc::ptr_fun(&terminate_handler)); Gtk::Main kit(argc, argv); Gst::init(argc, argv); setup_translation( Glib::path_get_dirname( Glib::find_program_in_path(argv[0]))); print_copyright(); bool non_unique = false; if (argc > 1) { non_unique = std::any_of(argv, argv + argc, [](auto x) { return std::string("-non-unique") == x; }); } Glib::RefPtr<gTox> application = gTox::create(non_unique); const int status = application->run(argc, argv); return status; }
void print_help (void) { print_revision(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); print_help_default(); print_help_host(); #ifdef USE_IPV6 print_help_46(); #endif //USE_IPV6 printf(" -p, --packets=[NUM]\n"); printf(" Number of packets to send. (Default to 5)\n"); printf(" -q, --quick\n"); printf(" Return as soon as OK is reached.\n"); printf(" -i, --interval=[SEC]\n"); printf(" Number of secounds to wait between packets. (Default to 1)\n"); printf(" -I, --interfact=[DEV]\n"); printf(" Set the outgoing network device to use.\n"); printf(" -T, --ttl=[NUM]\n"); printf(" Set TTL of packets to given value.\n"); printf(" -w, --warning=<rta>,<pl>%%\n"); printf(" Return warning if check exceeds TRA or Packet loss limit.\n"); printf(" (Default to 90ms and 10%%)\n"); printf(" -c, --critical=<rta>,<pl>%%\n"); printf(" Return critical if check exceeds TRA or Packet loss limit\n"); printf(" (Default to 100ms and 20%%)\n"); }
void print_help (void) { print_revision(); print_revision_snmp(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); printf("\nIf no On/Off-Ports are defines all ports are asumed as should be On.\n"); printf("\nOn/Off-Ports can be named or nubered. ex: --on '1,Outlet 3,4'\n"); print_help_default(); printf(" -o, --on=PORT[,PORTS]\n"); printf(" Ports which should be On.\n"); printf(" -O, --off=PORT[,PORTS]\n"); printf(" Ports which should be Off.\n"); print_help_snmp(); }
int main(int argc, const char ** argv) { print_copyright(); //* CE_Graph initialization will read the command line arguments and the configuration file. */ CE_Graph_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("biassgd-inmemory-factors"); biassgd_lambda = get_option_float("biassgd_lambda", 1e-3); biassgd_gamma = get_option_float("biassgd_gamma", 1e-3); biassgd_step_dec = get_option_float("biassgd_step_dec", 0.9); parse_command_line_args(); parse_implicit_command_line(); /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<EdgeDataType>(training, 0, 0, 3, TRAINING, false); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, !load_factors_from_file); if (validation != ""){ int vshards = convert_matrixmarket<EdgeDataType>(validation, 0, 0, 3, VALIDATION, false); init_validation_rmse_engine<VertexDataType, EdgeDataType>(pvalidation_engine, vshards, &bias_sgd_predict); } /* load initial state from disk (optional) */ if (load_factors_from_file){ load_matrix_market_matrix(training + "_U.mm", 0, D); load_matrix_market_matrix(training + "_V.mm", M, D); vec user_bias = load_matrix_market_vector(training +"_U_bias.mm", false, true); assert(user_bias.size() == M); vec item_bias = load_matrix_market_vector(training +"_V_bias.mm", false, true); assert(item_bias.size() == N); for (uint i=0; i<M+N; i++){ latent_factors_inmem[i].bias = ((i<M)?user_bias[i] : item_bias[i-M]); } vec gm = load_matrix_market_vector(training + "_global_mean.mm", false, true); globalMean = gm[0]; } /* Run */ BIASSGDVerticesInMemProgram program; CE_Graph_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, niters); /* Output latent factor matrices in matrix-market format */ output_biassgd_result(training); test_predictions(&bias_sgd_predict); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }
int main(int argc, const char ** argv) { print_copyright(); /* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("als-inmemory-factors"); lambda = get_option_float("lambda", 0.065); user_sparsity = get_option_float("user_sparsity", 0.9); movie_sparsity = get_option_float("movie_sparsity", 0.9); algorithm = get_option_int("algorithm", SPARSE_USR_FACTOR); parse_command_line_args(); parse_implicit_command_line(); if (user_sparsity < 0.5 || user_sparsity >= 1) logstream(LOG_FATAL)<<"Sparsity level should be [0.5,1). Please run again using --user_sparsity=XX in this range" << std::endl; if (movie_sparsity < 0.5 || movie_sparsity >= 1) logstream(LOG_FATAL)<<"Sparsity level should be [0.5,1). Please run again using --movie_sparsity=XX in this range" << std::endl; if (algorithm != SPARSE_USR_FACTOR && algorithm != SPARSE_BOTH_FACTORS && algorithm != SPARSE_ITM_FACTOR) logstream(LOG_FATAL)<<"Algorithm should be 1 for SPARSE_USR_FACTOR, 2 for SPARSE_ITM_FACTOR and 3 for SPARSE_BOTH_FACTORS" << std::endl; /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<EdgeDataType>(training); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, !load_factors_from_file); if (validation != ""){ int vshards = convert_matrixmarket<EdgeDataType>(validation, 0, 0, 3, VALIDATION); init_validation_rmse_engine<VertexDataType, EdgeDataType>(pvalidation_engine, vshards, &sparse_als_predict); } if (load_factors_from_file){ load_matrix_market_matrix(training + "_U.mm", 0, D); load_matrix_market_matrix(training + "_V.mm", M, D); } /* Run */ ALSVerticesInMemProgram program; graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, niters); /* Output latent factor matrices in matrix-market format */ output_als_result(training); test_predictions(&sparse_als_predict); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }
int main(int argc, const char ** argv) { print_copyright(); /* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("als-inmemory-factors"); lambda = get_option_float("lambda", 0.065); parse_command_line_args(); parse_implicit_command_line(); if (unittest == 1){ if (training == "") training = "test_wals"; niters = 100; } /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket4<edge_data>(training); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, !load_factors_from_file); if (validation != ""){ int vshards = convert_matrixmarket4<EdgeDataType>(validation, false, M==N, VALIDATION, 0); init_validation_rmse_engine<VertexDataType, EdgeDataType>(pvalidation_engine, vshards, &wals_predict, true, false, 0); } if (load_factors_from_file){ load_matrix_market_matrix(training + "_U.mm", 0, D); load_matrix_market_matrix(training + "_V.mm", M, D); } /* Run */ WALSVerticesInMemProgram program; graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, niters); /* Output latent factor matrices in matrix-market format */ output_als_result(training); test_predictions(&wals_predict); if (unittest == 1){ if (dtraining_rmse > 0.03) logstream(LOG_FATAL)<<"Unit test 1 failed. Training RMSE is: " << training_rmse << std::endl; if (dvalidation_rmse > 0.61) logstream(LOG_FATAL)<<"Unit test 1 failed. Validation RMSE is: " << validation_rmse << std::endl; } /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }
int main(int argc, const char ** argv) { print_copyright(); /* CE_Graph initialization will read the command line arguments and the configuration file. */ CE_Graph_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("item-cf2"); /* Basic arguments for application */ min_allowed_intersection = get_option_int("min_allowed_intersection", min_allowed_intersection); distance_metric = get_option_int("distance", JACCARD_WEIGHT); if (distance_metric != JACCARD_WEIGHT) logstream(LOG_FATAL)<<"--distance_metrix=XX should be one of:9= JACCARD_WEIGHT" << std::endl; debug = get_option_int("debug", 0); parse_command_line_args(); //if (distance_metric != JACKARD && distance_metric != AA && distance_metric != RA) // logstream(LOG_FATAL)<<"Wrong distance metric. --distance_metric=XX, where XX should be either 0) JACKARD, 1) AA, 2) RA" << std::endl; mytimer.start(); int nshards = convert_matrixmarket<EdgeDataType>(training, 0, 0, 3, TRAINING, true); assert(M > 0 && N > 0); //initialize data structure which saves a subset of the items (pivots) in memory adjcontainer = new adjlist_container(); /* Run */ ItemDistanceProgram program; CE_Graph_engine<VertexDataType, EdgeDataType> engine(training, nshards, true, m); set_engine_flags(engine); //open output files as the number of operating threads out_files.resize(number_of_omp_threads()); for (uint i=0; i< out_files.size(); i++){ char buf[256]; sprintf(buf, "%s.out%d", training.c_str(), i); out_files[i] = open_file(buf, "w"); } //run the program engine.run(program, niters); /* Report execution metrics */ if (!quiet) metrics_report(m); std::cout<<"Total item pairs compared: " << item_pairs_compared << " total written to file: " << written_pairs << std::endl; for (uint i=0; i< out_files.size(); i++) fclose(out_files[i]); std::cout<<"Created output files with the format: " << training << ".outXX, where XX is the output thread number" << std::endl; return 0; }
int main(int argc, const char ** argv) { print_copyright(); //* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("rbm-inmemory-factors"); /* Basic arguments for RBM algorithm */ rbm_bins = get_option_int("rbm_bins", rbm_bins); rbm_alpha = get_option_float("rbm_alpha", rbm_alpha); rbm_beta = get_option_float("rbm_beta", rbm_beta); rbm_mult_step_dec = get_option_float("rbm_mult_step_dec", rbm_mult_step_dec); rbm_scaling = get_option_float("rbm_scaling", rbm_scaling); parse_command_line_args(); parse_implicit_command_line(); mytimer.start(); /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<float>(training); rbm_init(); if (validation != "") { int vshards = convert_matrixmarket<EdgeDataType>(validation, 0, 0, 3, VALIDATION); init_validation_rmse_engine<VertexDataType, EdgeDataType>(pvalidation_engine, vshards, &rbm_predict); } /* load initial state from disk (optional) */ if (load_factors_from_file) { load_matrix_market_matrix(training + "_U.mm", 0, 3*D); load_matrix_market_matrix(training + "_V.mm", M, rbm_bins*(D+1)); } print_config(); /* Run */ RBMVerticesInMemProgram program; graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, niters); /* Output latent factor matrices in matrix-market format */ output_rbm_result(training); test_predictions(&rbm_predict); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }
int main(int argc, const char ** argv) { print_copyright(); //* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ /* Basic arguments for application. NOTE: File will be automatically 'sharded'. */ beta = get_option_float("beta", 1); debug = get_option_int("debug", 0); parse_command_line_args(); parse_implicit_command_line(); D = 0; //no feature vector is needed binary_relevance_threshold = 0; //treat all edge values as binary /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<EdgeDataType>(training, 0, 0, 3, TRAINING, false); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, !load_factors_from_file); //read initial vector from file std::cout << "Load CTR vector from file" << training << ":vec" << std::endl; load_matrix_market_vector(training + ":vec", Y_POS, false, false); mu_ij = zeros(M+N); sigma_ij = ones(M+N); if (validation != ""){ //read validation data (optional) vshards = convert_matrixmarket<EdgeDataType>(validation, 0, 0, 3, VALIDATION, false); validation_targets = load_matrix_market_vector(validation + ":vec", false, false); Me = validation_targets.size(); } print_config(); /* Run */ AdPredictorVerticesInMemProgram program; metrics m("adpredictor"); graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, niters); /* Output latent factor matrices in matrix-market format */ output_adpredictor_result(training); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }
int main(int argc, const char ** argv) { print_copyright(); /* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("itemsim2rating2"); /* Basic arguments for application */ min_allowed_intersection = get_option_int("min_allowed_intersection", min_allowed_intersection); debug = get_option_int("debug", 0); parse_command_line_args(); std::string similarity = get_option_string("similarity", ""); if (similarity == "") Rcpp::Rcerr<<"Missing similarity input file. Please specify one using the --similarity=filename command line flag" << std::endl; undirected = get_option_int("undirected", 1); Q = get_option_float("Q", Q); K = get_option_int("K"); mytimer.start(); vec unused; int nshards = convert_matrixmarket_and_item_similarity<edge_data>(training, similarity, 3, unused); assert(M > 0 && N > 0); //initialize data structure which saves a subset of the items (pivots) in memory adjcontainer = new adjlist_container(); //array for marking which items are conected to the pivot items via users. relevant_items = new bool[N]; /* Run */ ItemDistanceProgram program; graphchi_engine<VertexDataType, edge_data> engine(training, nshards, true, m); set_engine_flags(engine); out_file = open_file((training + "-rec").c_str(), "w"); //run the program engine.run(program, niters); /* Report execution metrics */ if (!quiet) metrics_report(m); Rcpp::Rcout<<"Total item pairs compared: " << item_pairs_compared << " total written to file: " << written_pairs << std::endl; if (zero_edges) Rcpp::Rcout<<"Found: " << zero_edges<< " user edges with weight zero. Those are ignored." <<std::endl; delete[] relevant_items; fclose(out_file); return 0; }
options::STATUS options::process_command_line(int argc, char *argv[]) { namespace po = boost::program_options; po::options_description desc("Allowed options"); desc.add_options() ("help", "display help message") ("version", "display sfrp version and exit") ("fullversion", "display sfrp and libevent version and exit") ("copyright", "display copyright and exit") ("file,f", po::value<std::string>(), "configuration file"); try{ po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); po::notify(vm); if(vm.count("version")){ std::cout<<SFRP_VERSION<<std::endl; return INFO; } if(vm.count("fullversion")){ std::cout<<"sfrp version: "<<SFRP_VERSION<<"_"<<std::endl; std::cout<<"libevent version: "<<event_get_version()<<std::endl; return INFO; } // // Don't print the copyright when showing the version print_short_copyright(); if(vm.count("help")) { std::cout<<desc<<std::endl; return INFO; } if(vm.count("copyright")){ print_copyright(); return INFO; } if(vm.count("file")) { config_file_ = vm["file"].as<std::string>(); } } catch(po::error e){ std::cout<<e.what()<<std::endl<<std::endl; std::cout<<desc<<std::endl; return ERROR; } return RUN; }
void Xboxdrv::run_daemon(const Options& opts) { if (!opts.quiet) { print_copyright(); } if (opts.usb_debug) { libusb_set_debug(NULL, 3); } USBSubsystem usb_subsystem; if (!opts.detach) { XboxdrvDaemon daemon(usb_subsystem, opts); daemon.run(); } else { pid_t pid = fork(); if (pid < 0) { // fork error raise_exception(std::runtime_error, "failed to fork(): " << strerror(errno)); } else if (pid > 0) { // parent, just exit _exit(EXIT_SUCCESS); } else { // child, run daemon pid_t sid = setsid(); if (sid == static_cast<pid_t>(-1)) { raise_exception(std::runtime_error, "failed to setsid(): " << strerror(errno)); } else { if (chdir("/") != 0) { raise_exception(std::runtime_error, "failed to chdir(\"/\"): " << strerror(errno)); } else { XboxdrvDaemon daemon(usb_subsystem, opts); daemon.run(); } } } } }
void Xboxdrv::run_main(const Options& opts) { if (!opts.quiet) { print_copyright(); } XboxdrvMain xboxdrv_main(opts); xboxdrv_main.run(); }
void Xboxdrv::run_main(const Options& opts) { if (!opts.quiet) { print_copyright(); } USBSubsystem usb_subsystem; XboxdrvMain xboxdrv_main(usb_subsystem, opts); xboxdrv_main.run(); }
int main(int argc, char **argv) { print_copyright(); print_license(); #ifdef SVNRELEASE printf("At svn revision %s.\n\n",SVNREVISION); #endif print_hostname(); if(argc!=5) { printf("Usage: %s zeta l Nf method\n",argv[0]); printf("zeta is the STO exponent to fit\n"); printf("l is angular momentum to use\n"); printf("Nf is number of exponents to use\n"); printf("method is 0 for even-tempered, 1 for well-tempered and 2 for full optimization, or 3 for midpoint quadrature.\n"); return 1; } // Read parameteres double zeta=atof(argv[1]); double am=atoi(argv[2]); int Nf=atoi(argv[3]); int method=atoi(argv[4]); // Do the optimization std::vector<contr_t> contr; if(method>=0 && method<=2) contr=slater_fit(zeta,am,Nf,true,method); else if(method==3) contr=slater_fit_midpoint(zeta,am,Nf); else throw std::runtime_error("Unknown method.\n"); // Print them out printf("\nExponential contraction\nc_i\t\tz_i\t\tlg z_i\n"); for(size_t i=0;i<contr.size();i++) printf("% e\t%e\t% e\n",contr[i].c,contr[i].z,log10(contr[i].z)); // Form basis set ElementBasisSet elbas("El"); FunctionShell sh(am,contr); elbas.add_function(sh); // Save the basis set BasisSetLibrary baslib; baslib.add_element(elbas); baslib.save_gaussian94("slater-contr.gbs"); // also in decontracted form baslib.decontract(); baslib.save_gaussian94("slater-uncontr.gbs"); return 0; }
int main(int argc, const char ** argv) { print_copyright(); //* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("sgd-inmemory-factors"); /* Basic arguments for application. NOTE: File will be automatically 'sharded'. */ sgd_lambda = get_option_float("sgd_lambda", 1e-3); sgd_gamma = get_option_float("sgd_gamma", 1e-3); sgd_step_dec = get_option_float("sgd_step_dec", 0.9); parse_command_line_args(); parse_implicit_command_line(); /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<EdgeDataType>(training, NULL, 0, 0, 3, TRAINING, false); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, !load_factors_from_file); if (validation != ""){ int vshards = convert_matrixmarket<EdgeDataType>(validation, NULL, 0, 0, 3, VALIDATION, false); init_validation_rmse_engine<VertexDataType, EdgeDataType>(pvalidation_engine, vshards, &sgd_predict); } /* load initial state from disk (optional) */ if (load_factors_from_file){ load_matrix_market_matrix(training + "_U.mm", 0, D); load_matrix_market_matrix(training + "_V.mm", M, D); } print_config(); /* Run */ SGDVerticesInMemProgram program; graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, niters); /* Output latent factor matrices in matrix-market format */ output_sgd_result(training); test_predictions(&sgd_predict); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }
void print_version(const char *program_name) { if (strlen(SVN_REV)>0) { printf("\n%s, version %s (part of %s %s)\n", program_name, SVN_REV, TOOL_SUITE_NAME, MAPREADY_VERSION_STRING); } else { printf("\n%s, part of %s %s (unknown build)\n", program_name, TOOL_SUITE_NAME, MAPREADY_VERSION_STRING); } print_copyright(); exit (EXIT_FAILURE); }
// Print our copyright and license notice & exit void print_license(int license_id) { print_copyright(); switch (license_id) { case ASF_BSD_ID: printf(ASF_BSD_LICENSE_STRING"\n"); break; default: printf("License not found.\n"); break; } exit(EXIT_FAILURE); }
void print_help (void) { print_revision(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); print_help_default(); }
int main(int argc, const char ** argv) { print_copyright(); /* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); metrics m("nmf-inmemory-factors"); parse_command_line_args(); parse_implicit_command_line(); niters *= 2; //each NMF iteration is composed of two sub iters /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<float>(training, 0, 0, 3, TRAINING, false); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, !load_factors_from_file); if (validation != ""){ int vshards = convert_matrixmarket<EdgeDataType>(validation, 0, 0, 3, VALIDATION, false); if (vshards != -1) init_validation_rmse_engine<VertexDataType, EdgeDataType>(pvalidation_engine, vshards, &nmf_predict); } if (load_factors_from_file){ load_matrix_market_matrix(training + "_U.mm", 0, D); load_matrix_market_matrix(training + "_V.mm", M, D); } sum_of_item_latent_features = zeros(D); sum_of_user_latent_feautres = zeros(D); /* Run */ NMFVerticesInMemProgram program; graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, niters); /* Output latent factor matrices in matrix-market format */ output_nmf_result(training); test_predictions(&nmf_predict); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }
void print_help() { printf("\nTool name:\n %s\n", TOOL_NAME); usage(); printf("Description:\n%s\n\n", TOOL_DESCRIPTION); if(strlen(TOOL_INPUT)) printf("Input:\n%s\n\n", TOOL_INPUT); if(strlen(TOOL_OUTPUT)) printf("Output:\n%s\n\n", TOOL_OUTPUT); if(strlen(TOOL_OPTIONS)) printf("Options:\n%s\n\n", TOOL_OPTIONS); if(strlen(TOOL_EXAMPLES)) printf("Examples:\n%s\n\n", TOOL_EXAMPLES); if(strlen(TOOL_LIMITATIONS)) printf("Limitations:\n%s\n\n", TOOL_LIMITATIONS); if(strlen(TOOL_SEE_ALSO)) printf("See Also:\n%s\n\n", TOOL_SEE_ALSO); printf("Contact:\n%s\n", ASF_CONTACT_STRING); print_version(TOOL_NAME); print_copyright(); }
void print_help (void) { print_revision(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); print_help_default(); print_help_warn("Memory Usage", "90%"); print_help_crit("Memory Usage", "95%"); }
int main(int argc, char* argv[]) { std::set_terminate(terminate_handler); Glib::add_exception_handler(sigc::ptr_fun(&terminate_handler)); Gtk::Main kit(argc, argv); Gst::init(argc, argv); setup_translation(); print_copyright(); Glib::RefPtr<gTox> application = gTox::create(); const int status = application->run(argc, argv); return status; }
void print_help (void) { print_revision(); print_copyright(); printf("\n"); printf("Check description: %s", progdesc); printf("\n\n"); print_usage(); print_help_default(); printf(" -b, --bond=BOND\n"); printf(" Check bond named BOND.\n"); }
int main(int argc, const char ** argv) { print_copyright(); //* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("sgd-inmemory-factors"); algorithm = get_option_string("algorithm", "global_mean"); if (algorithm == "global_mean") algo = GLOBAL_MEAN; else if (algorithm == "user_mean") algo = USER_MEAN; else if (algorithm == "item_mean") algo = ITEM_MEAN; else logstream(LOG_FATAL)<<"Unsupported algorithm name. Should be --algorithm=XX where XX is one of [global_mean,user_mean,item_mean] for example --algorithm=global_mean" << std::endl; parse_command_line_args(); mytimer.start(); /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<float>(training, NULL, 0, 0, 3, TRAINING, false); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, false); rmse_vec = zeros(number_of_omp_threads()); print_config(); /* Run */ BaselineVerticesInMemProgram program; graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; engine.run(program, 1); if (algo == USER_MEAN || algo == ITEM_MEAN) output_baseline_result(training); test_predictions(&baseline_predict); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }