int main(int argc, char* argv[]) { MPI_par mp; setup_mpi(mp, argc, argv); if (argc != 2) { cerr << "\n\tUsage: ./abc_mpi abc_config_file.json\n\n"; return 100; } const gsl_rng* RNG = gsl_rng_alloc (gsl_rng_taus2); gsl_rng_set(RNG, time (NULL) * getpid()); // seed the rng using sys time and the process id AbcSmc* abc = new AbcSmc(mp); abc->set_simulator(simulator); abc->parse_config(string(argv[1])); abc->run(RNG); MPI_Finalize(); return 0; }
int main(int argc, char* argv[]) { if (not (argc == 3 or argc == 5 or argc == 6) ) { usage(); exit(100); } bool process_db = false; bool simulate_db = false; int buffer_size = -1; for (int i=2; i < argc; i++ ) { if ( strcmp(argv[i], "--process") == 0 ) { process_db = true; } else if ( strcmp(argv[i], "--simulate") == 0 ) { simulate_db = true; buffer_size = buffer_size == -1 ? 1 : buffer_size; } else if ( strcmp(argv[i], "-n" ) == 0 ) { buffer_size = atoi(argv[++i]); } else { usage(); exit(101); } } AbcSmc* abc = new AbcSmc(); abc->parse_config(string(argv[1])); if (process_db) { gsl_rng_set(RNG, time(NULL) * getpid()); // seed the rng using sys time and the process id abc->process_database(RNG); } if (simulate_db) { time(&GLOBAL_START_TIME); abc->set_simulator(simulator); abc->simulate_next_particles(buffer_size); } return 0; }
int main(int argc, char* argv[]) { MPI_par mp; setup_mpi(mp, argc, argv); if (argc != 2) { cerr << "\n\tUsage: ./abc_mpi abc_config_file.json\n\n"; return 100; } // const gsl_rng* RNG = gsl_rng_alloc (gsl_rng_taus2); gsl_rng_set(RNG, time (NULL) * getpid()); // seed the rng using sys time and the process id AbcSmc* abc = new AbcSmc(mp); abc->set_simulator(simulator); abc->parse_config(string(argv[1])); time(&GLOBAL_START_TIME); abc->run(RNG); //caseFile << "vaccine retro catchup target year inf1 inf2 inf3 inf4 sym1 sym2 sym3 sym4" << endl; MPI_Finalize(); return 0; }