int main(int argc, char **argv){ MSG_init(&argc, argv); MSG_config("model-check/property","promela"); MSG_create_environment("snapshot_comparison_platform.xml"); MSG_function_register("test", test); MSG_launch_application("deploy_snapshot_comparison.xml"); MSG_main(); return 0; }
int main(int argc, char *argv[]) { MSG_init(&argc, argv); MSG_config("model-check/property","promela_bugged2_liveness"); MC_automaton_new_propositional_symbol("cs", &predCS); MSG_create_environment("../msg_platform.xml"); MSG_function_register("coordinator", coordinator); MSG_function_register("client", client); MSG_launch_application("deploy_bugged2_liveness.xml"); MSG_main(); return 0; }
/** Test function */ msg_error_t test_all(const char *platform_file) { msg_error_t res = MSG_OK; xbt_dynar_t all_hosts; msg_host_t first_host; MSG_config("host/model", "ptask_L07"); MSG_create_environment(platform_file); all_hosts = MSG_hosts_as_dynar(); first_host = xbt_dynar_getfirst_as(all_hosts,msg_host_t); MSG_process_create("test", test, NULL, first_host); res = MSG_main(); xbt_dynar_free(&all_hosts); XBT_INFO("Simulation time %g", MSG_get_clock()); return res; }
msg_error_t test_all(const char *platform_file, const char *application_file) { msg_error_t res = MSG_OK; MSG_config("workstation/model", "ptask_L07"); /* Simulation setting */ MSG_create_environment(platform_file); /* Application deployment */ MSG_function_register("execute", execute); MSG_function_register("redistribute", redistribute); MSG_launch_application(application_file); res = MSG_main(); XBT_INFO("Simulation time %g", MSG_get_clock()); return res; }
int main(int argc, char *argv[]) { MSG_init(&argc, argv); MSG_config("host/model", "ptask_L07"); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../examples/platforms/two_hosts.xml\n", argv[0], argv[0]); MSG_create_environment(argv[1]); MSG_process_create("sequential", seq_task, NULL, MSG_get_host_by_name("Tremblay")); MSG_process_create("parallel", par_task, NULL, MSG_get_host_by_name("Tremblay")); // Create a process to test in progress task MSG_process_create("get_progress", get_progress, NULL, MSG_get_host_by_name("Tremblay")); msg_error_t res = MSG_main(); XBT_INFO("Simulation time %g", MSG_get_clock()); return res != MSG_OK; }
int main(int argc, char *argv[]) { MSG_init(&argc, argv); MSG_config("host/model", "ptask_L07"); xbt_assert(argc <= 3, "1Usage: %s <platform file> [--energy]", argv[0]); xbt_assert(argc >= 2, "2Usage: %s <platform file> [--energy]", argv[0]); if(argc == 3 && argv[2][2] == 'e') sg_energy_plugin_init(); MSG_create_environment(argv[1]); /* Pick a process, no matter which, from the platform file */ xbt_dynar_t all_hosts = MSG_hosts_as_dynar(); msg_host_t first_host = xbt_dynar_getfirst_as(all_hosts,msg_host_t); xbt_dynar_free(&all_hosts); MSG_process_create("test", runner, NULL, first_host); msg_error_t res = MSG_main(); XBT_INFO("Simulation done."); return res != MSG_OK; }