int main(int argc, char *argv[]) { msg_error_t res = MSG_OK; sg_energy_plugin_init(); MSG_init(&argc, argv); if (argc != 3) { XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]); XBT_CRITICAL ("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); exit(1); } MSG_create_environment(argv[1]); /* Application deployment */ MSG_function_register("dvfs_test", dvfs); MSG_launch_application(argv[2]); res = MSG_main(); XBT_INFO("Total simulation time: %e", MSG_get_clock()); if (res == MSG_OK) return 0; else return 1; }
int main(int argc, char *argv[]) { msg_error_t res = MSG_OK; sg_energy_plugin_init(); MSG_init(&argc, argv); xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); MSG_create_environment(argv[1]); MSG_process_create("dvfs",dvfs,NULL,MSG_host_by_name("MyHost1")); res = MSG_main(); XBT_INFO("Total simulation time: %.2f; All hosts must have the exact same energy consumption.", MSG_get_clock()); return res != MSG_OK; }
int main(int argc, char *argv[]) { msg_error_t res = MSG_OK; sg_energy_plugin_init(); MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); MSG_create_environment(argv[1]); MSG_function_register("onoff_test", onoff); MSG_launch_application(argv[2]); res = MSG_main(); XBT_INFO("Total simulation time: %.2f", 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; }
JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit(void) { sg_energy_plugin_init(); }