- /* Retrive the hostnames constituting our playground today */
- for (i = 1; i < argc; i++) {
- slaves[i - 1] = MSG_get_host_by_name(argv[i]);
- xbt_assert(slaves[i - 1] != NULL, "Cannot use inexistent host %s", argv[i]);
- }
+ /* Retrieve the PMs that will launch worker processes. */
+ for (i = 1; i < argc; i++)
+ pms[i - 1] = MSG_get_host_by_name(argv[i]);
+
+
+ /* Launch VMs and worker processes. One VM per PM, and one worker process per VM. */
+
+ XBT_INFO("Launch %d VMs", workers_count);
+ for (i=0; i< workers_count; i++) {
+ char *vm_name = bprintf("VM%02d", i);
+ char *pr_name = bprintf("WRK%02d", i);
+ char *mbox = bprintf("MBOX:WRK%02d", i);
+
+ char **wrk_argv = xbt_new(char*, 3);
+ wrk_argv[0] = pr_name;
+ wrk_argv[1] = mbox;
+ wrk_argv[2] = NULL;
+
+ XBT_INFO("create %s", vm_name);
+ msg_vm_t vm = MSG_vm_create_core(pms[i], vm_name);
+
+ s_ws_params_t params;
+ memset(¶ms, 0, sizeof(params));
+ params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
+ MSG_host_set_params(vm, ¶ms);