A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5d5b1f3
)
Add the function autorestart in simix_global
author
navarro
<navarro@caraja.(none)>
Thu, 28 Jun 2012 12:28:40 +0000
(14:28 +0200)
committer
navarro
<navarro@caraja.(none)>
Thu, 28 Jun 2012 12:28:40 +0000
(14:28 +0200)
include/simgrid/simix.h
patch
|
blob
|
history
src/simix/smx_global.c
patch
|
blob
|
history
src/simix/smx_host.c
patch
|
blob
|
history
src/simix/smx_host_private.h
patch
|
blob
|
history
src/simix/smx_private.h
patch
|
blob
|
history
src/surf/surf.c
patch
|
blob
|
history
src/surf/surf_private.h
patch
|
blob
|
history
diff --git
a/include/simgrid/simix.h
b/include/simgrid/simix.h
index
d61c833
..
960f5bd
100644
(file)
--- a/
include/simgrid/simix.h
+++ b/
include/simgrid/simix.h
@@
-110,6
+110,8
@@
typedef struct s_smx_context_factory *smx_context_factory_t;
/* Process creation/destruction callbacks */
typedef void (*void_pfn_smxprocess_t) (smx_process_t);
/* Process creation/destruction callbacks */
typedef void (*void_pfn_smxprocess_t) (smx_process_t);
+/* for function autorestart */
+typedef void (*void_pfn_smxhost_t) (smx_host_t);
/* The following function pointer types describe the interface that any context
factory should implement */
/* The following function pointer types describe the interface that any context
factory should implement */
diff --git
a/src/simix/smx_global.c
b/src/simix/smx_global.c
index
abde774
..
bc03b95
100644
(file)
--- a/
src/simix/smx_global.c
+++ b/
src/simix/smx_global.c
@@
-78,6
+78,7
@@
void SIMIX_global_init(int *argc, char **argv)
simix_global->action_mallocator = xbt_mallocator_new(65536,
SIMIX_action_mallocator_new_f, SIMIX_action_mallocator_free_f,
SIMIX_action_mallocator_reset_f);
simix_global->action_mallocator = xbt_mallocator_new(65536,
SIMIX_action_mallocator_new_f, SIMIX_action_mallocator_free_f,
SIMIX_action_mallocator_reset_f);
+ simix_global->autorestart = SIMIX_host_restart_processes;
surf_init(argc, argv); /* Initialize SURF structures */
SIMIX_context_mod_init();
surf_init(argc, argv); /* Initialize SURF structures */
SIMIX_context_mod_init();
diff --git
a/src/simix/smx_host.c
b/src/simix/smx_host.c
index
cc4273b
..
1d41473
100644
(file)
--- a/
src/simix/smx_host.c
+++ b/
src/simix/smx_host.c
@@
-13,8
+13,6
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix,
"Logging specific to SIMIX (hosts)");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix,
"Logging specific to SIMIX (hosts)");
-xbt_dict_t watched_hosts_lib;
-
static void SIMIX_execution_finish(smx_action_t action);
/**
static void SIMIX_execution_finish(smx_action_t action);
/**
@@
-275,6
+273,14
@@
void SIMIX_host_restart_processes(smx_host_t host)
xbt_dynar_reset(host->auto_restart_processes);
}
xbt_dynar_reset(host->auto_restart_processes);
}
+void SIMIX_host_autorestart(smx_host_t host)
+{
+ if(simix_global->autorestart)
+ simix_global->autorestart(host);
+ else
+ xbt_die("No function for simix_global->autorestart");
+}
+
void SIMIX_host_set_data(smx_host_t host, void *data)
{
xbt_assert((host != NULL), "Invalid parameters");
void SIMIX_host_set_data(smx_host_t host, void *data)
{
xbt_assert((host != NULL), "Invalid parameters");
diff --git
a/src/simix/smx_host_private.h
b/src/simix/smx_host_private.h
index
0b32448
..
59b9b97
100644
(file)
--- a/
src/simix/smx_host_private.h
+++ b/
src/simix/smx_host_private.h
@@
-34,6
+34,7
@@
void SIMIX_host_add_auto_restart_process(smx_host_t host,
xbt_dict_t properties,
int auto_restart);
void SIMIX_host_restart_processes(smx_host_t host);
xbt_dict_t properties,
int auto_restart);
void SIMIX_host_restart_processes(smx_host_t host);
+void SIMIX_host_autorestart(smx_host_t host);
xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
double SIMIX_host_get_speed(smx_host_t host);
double SIMIX_host_get_available_speed(smx_host_t host);
xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
double SIMIX_host_get_speed(smx_host_t host);
double SIMIX_host_get_available_speed(smx_host_t host);
diff --git
a/src/simix/smx_private.h
b/src/simix/smx_private.h
index
4d25f01
..
5bd6499
100644
(file)
--- a/
src/simix/smx_private.h
+++ b/
src/simix/smx_private.h
@@
-40,11
+40,14
@@
typedef struct s_smx_global {
void_pfn_smxprocess_t kill_process_function;
void_pfn_smxprocess_t cleanup_process_function;
xbt_mallocator_t action_mallocator;
void_pfn_smxprocess_t kill_process_function;
void_pfn_smxprocess_t cleanup_process_function;
xbt_mallocator_t action_mallocator;
+ void_pfn_smxhost_t autorestart;
} s_smx_global_t, *smx_global_t;
extern smx_global_t simix_global;
extern unsigned long simix_process_maxpid;
} s_smx_global_t, *smx_global_t;
extern smx_global_t simix_global;
extern unsigned long simix_process_maxpid;
+extern xbt_dict_t watched_hosts_lib;
+
/******************************** Exceptions *********************************/
#define SMX_EXCEPTION(issuer, c, v, m) \
/******************************** Exceptions *********************************/
#define SMX_EXCEPTION(issuer, c, v, m) \
diff --git
a/src/surf/surf.c
b/src/surf/surf.c
index
d2d0f2e
..
515c6c4
100644
(file)
--- a/
src/surf/surf.c
+++ b/
src/surf/surf.c
@@
-709,11
+709,9
@@
void surf_watched_hosts(void)
xbt_dict_foreach(watched_hosts_lib,cursor,key,host)
{
if(SIMIX_host_get_state(host) == SURF_RESOURCE_ON){
xbt_dict_foreach(watched_hosts_lib,cursor,key,host)
{
if(SIMIX_host_get_state(host) == SURF_RESOURCE_ON){
- XBT_DEBUG("See SURF_RESOURCE_ON on host: %s",SIMIX_host_get_name(host));
- // TODO need to restart all processes on host->auto_restart_processes
- XBT_INFO("Should call SIMIX restart host here for '%s'",SIMIX_host_get_name(host));
- // TODO be sure having remove the wake up host
- //xbt_dict_remove(watched_hosts_lib,key);
+ XBT_INFO("Restart processes on host: %s",SIMIX_host_get_name(host));
+ SIMIX_host_autorestart(host);
+ xbt_dict_remove(watched_hosts_lib,key);
}
else
XBT_DEBUG("See SURF_RESOURCE_OFF on host: %s",key);
}
else
XBT_DEBUG("See SURF_RESOURCE_OFF on host: %s",key);
diff --git
a/src/surf/surf_private.h
b/src/surf/surf_private.h
index
6e87529
..
3f24d74
100644
(file)
--- a/
src/surf/surf_private.h
+++ b/
src/surf/surf_private.h
@@
-30,7
+30,7
@@
extern double sg_gtnets_jitter;
extern int sg_gtnets_jitter_seed;
#endif
extern int sg_gtnets_jitter_seed;
#endif
-
extern
xbt_dict_t watched_hosts_lib;
+xbt_dict_t watched_hosts_lib;
extern const char *surf_action_state_names[6];
extern const char *surf_action_state_names[6];