A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better estimate of window for adaptive algorithm
[simgrid.git]
/
src
/
simix
/
smx_host.c
diff --git
a/src/simix/smx_host.c
b/src/simix/smx_host.c
index
40f3c73
..
534e331
100644
(file)
--- a/
src/simix/smx_host.c
+++ b/
src/simix/smx_host.c
@@
-33,7
+33,7
@@
smx_host_t SIMIX_host_create(const char *name,
/* Update global variables */
xbt_lib_set(host_lib,name,SIMIX_HOST_LEVEL,smx_host);
/* Update global variables */
xbt_lib_set(host_lib,name,SIMIX_HOST_LEVEL,smx_host);
-
+
return xbt_lib_get_elm_or_null(host_lib, name);
}
return xbt_lib_get_elm_or_null(host_lib, name);
}
@@
-53,36
+53,41
@@
void SIMIX_host_on(smx_host_t h)
xbt_assert((host != NULL), "Invalid parameters");
if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) {
xbt_assert((host != NULL), "Invalid parameters");
if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) {
- surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON);
+ surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON);
+
unsigned int cpt;
smx_process_arg_t arg;
xbt_dynar_foreach(host->boot_processes,cpt,arg) {
smx_process_t process;
unsigned int cpt;
smx_process_arg_t arg;
xbt_dynar_foreach(host->boot_processes,cpt,arg) {
smx_process_t process;
+ char** argv = xbt_new(char*, arg->argc);
+ for (int i=0; i<arg->argc; i++)
+ argv[i] = xbt_strdup(arg->argv[i]);
+
XBT_DEBUG("Booting Process %s(%s) right now", arg->argv[0], arg->hostname);
if (simix_global->create_process_function) {
simix_global->create_process_function(&process,
XBT_DEBUG("Booting Process %s(%s) right now", arg->argv[0], arg->hostname);
if (simix_global->create_process_function) {
simix_global->create_process_function(&process,
- arg
->arg
v[0],
+ argv[0],
arg->code,
NULL,
arg->hostname,
arg->kill_time,
arg->argc,
arg->code,
NULL,
arg->hostname,
arg->kill_time,
arg->argc,
- arg
->arg
v,
+ argv,
arg->properties,
arg->properties,
- arg->auto_restart
);
- }
- else {
+ arg->auto_restart
,
+ NULL);
+
}
else {
simcall_process_create(&process,
simcall_process_create(&process,
-
arg->argv[0],
-
arg->code,
-
NULL,
-
arg->hostname,
-
arg->kill_time,
-
arg->argc,
-
arg->
argv,
-
arg->properties,
-
arg->auto_restart);
+ arg->argv[0],
+ arg->code,
+ NULL,
+ arg->hostname,
+ arg->kill_time,
+ arg->argc,
+ argv,
+ arg->properties,
+ arg->auto_restart);
}
}
}
}
}
}
@@
-102,7
+107,7
@@
void SIMIX_host_off(smx_host_t h, smx_process_t issuer)
smx_host_priv_t host = SIMIX_host_priv(h);
xbt_assert((host != NULL), "Invalid parameters");
smx_host_priv_t host = SIMIX_host_priv(h);
xbt_assert((host != NULL), "Invalid parameters");
-
+
if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_ON) {
surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_OFF);
if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_ON) {
surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_OFF);
@@
-115,6
+120,14
@@
void SIMIX_host_off(smx_host_t h, smx_process_t issuer)
}
}
}
}
}
}
+ /*xbt_dynar_t vms = surf_workstation_get_vms(h);
+ unsigned int cpt;
+ smx_host_t vm;
+ xbt_dynar_foreach(vms, cpt, vm) {
+ SIMIX_vm_shutdown(vm, issuer);
+ SIMIX_vm_destroy(vm);
+ }
+ xbt_dynar_free(&vms);*/
}
/**
}
/**
@@
-147,7
+160,7
@@
void SIMIX_host_destroy(void *h)
xbt_swag_free(host->process_list);
/* Clean host structure */
xbt_swag_free(host->process_list);
/* Clean host structure */
- free(host);
+ free(host);
return;
}
return;
}
@@
-391,7
+404,8
@@
void SIMIX_host_restart_processes(smx_host_t host)
arg->argc,
arg->argv,
arg->properties,
arg->argc,
arg->argv,
arg->properties,
- arg->auto_restart);
+ arg->auto_restart,
+ NULL);
} else {
simcall_process_create(&process,
arg->argv[0],
} else {
simcall_process_create(&process,
arg->argv[0],
@@
-462,7
+476,7
@@
smx_action_t SIMIX_host_execute(const char *name,
}
}
}
}
- XBT_DEBUG("Create execute action %p
", action
);
+ XBT_DEBUG("Create execute action %p
: %s", action, action->name
);
return action;
}
return action;
}