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 (parent:
93bc022
)
Allow selective update to be independently set for cpu and network model.
author
Navarrop
<Pierre.Navarro@imag.fr>
Mon, 12 Dec 2011 15:09:00 +0000
(16:09 +0100)
committer
Navarrop
<Pierre.Navarro@imag.fr>
Fri, 16 Dec 2011 15:58:02 +0000
(16:58 +0100)
src/include/surf/maxmin.h
patch
|
blob
|
history
src/surf/cpu_cas01.c
patch
|
blob
|
history
src/surf/maxmin.c
patch
|
blob
|
history
src/surf/network_im.c
patch
|
blob
|
history
src/surf/surf_config.c
patch
|
blob
|
history
src/surf/workstation_ptask_L07.c
patch
|
blob
|
history
testsuite/surf/lmm_usage.c
patch
|
blob
|
history
testsuite/surf/maxmin_bench.c
patch
|
blob
|
history
diff --git
a/src/include/surf/maxmin.h
b/src/include/surf/maxmin.h
index
2a7e6dd
..
5ebf9da
100644
(file)
--- a/
src/include/surf/maxmin.h
+++ b/
src/include/surf/maxmin.h
@@
-31,7
+31,7
@@
static XBT_INLINE int double_equals(double value1, double value2)
return (fabs(value1 - value2) < MAXMIN_PRECISION);
}
return (fabs(value1 - value2) < MAXMIN_PRECISION);
}
-XBT_PUBLIC(lmm_system_t) lmm_system_new(
void
);
+XBT_PUBLIC(lmm_system_t) lmm_system_new(
int selective_update
);
XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var);
XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var);
diff --git
a/src/surf/cpu_cas01.c
b/src/surf/cpu_cas01.c
index
dcc738c
..
3e345d2
100644
(file)
--- a/
src/surf/cpu_cas01.c
+++ b/
src/surf/cpu_cas01.c
@@
-10,9
+10,10
@@
surf_model_t surf_cpu_model = NULL;
lmm_system_t cpu_maxmin_system = NULL;
e_UM_t cpu_update_mechanism = UM_UNDEFINED;
surf_model_t surf_cpu_model = NULL;
lmm_system_t cpu_maxmin_system = NULL;
e_UM_t cpu_update_mechanism = UM_UNDEFINED;
+static int selective_update = 0;
+
static xbt_swag_t cpu_modified_cpu = NULL;
static xbt_heap_t cpu_action_heap = NULL;
static xbt_swag_t cpu_modified_cpu = NULL;
static xbt_heap_t cpu_action_heap = NULL;
-extern int sg_maxmin_selective_update;
#undef GENERIC_LMM_ACTION
#undef GENERIC_ACTION
#undef GENERIC_LMM_ACTION
#undef GENERIC_ACTION
@@
-701,8
+702,7
@@
static void surf_cpu_model_init_internal(const char* name)
surf_cpu_model->extension.cpu.add_traces = cpu_add_traces_cpu;
if (!cpu_maxmin_system) {
surf_cpu_model->extension.cpu.add_traces = cpu_add_traces_cpu;
if (!cpu_maxmin_system) {
- sg_maxmin_selective_update = 1;
- cpu_maxmin_system = lmm_system_new();
+ cpu_maxmin_system = lmm_system_new(selective_update);
}
if(cpu_update_mechanism == UM_LAZY){
cpu_action_heap = xbt_heap_new(8, NULL);
}
if(cpu_update_mechanism == UM_LAZY){
cpu_action_heap = xbt_heap_new(8, NULL);
@@
-733,6
+733,7
@@
void surf_cpu_model_init_Cas01()
{
char *optim = xbt_cfg_get_string(_surf_cfg_set, "cpu/optim");
char *model = xbt_cfg_get_string(_surf_cfg_set, "cpu/model");
{
char *optim = xbt_cfg_get_string(_surf_cfg_set, "cpu/optim");
char *model = xbt_cfg_get_string(_surf_cfg_set, "cpu/model");
+ int select = xbt_cfg_get_int(_surf_cfg_set, "cpu/maxmin_selective_update");
if(!strcmp(model,"Cas01_fullupdate")) {
XBT_WARN("[*Deprecated*. Use --cfg=cpu/model:Cas01 with option --cfg=cpu/optim:Full instead.]");
if(!strcmp(model,"Cas01_fullupdate")) {
XBT_WARN("[*Deprecated*. Use --cfg=cpu/model:Cas01 with option --cfg=cpu/optim:Full instead.]");
@@
-742,8
+743,12
@@
void surf_cpu_model_init_Cas01()
if(!strcmp(optim,"Full")) {
cpu_update_mechanism = UM_FULL;
if(!strcmp(optim,"Full")) {
cpu_update_mechanism = UM_FULL;
+ selective_update = select;
} else if (!strcmp(optim,"Lazy")) {
cpu_update_mechanism = UM_LAZY;
} else if (!strcmp(optim,"Lazy")) {
cpu_update_mechanism = UM_LAZY;
+ selective_update = 1;
+ xbt_assert((select==1) || (xbt_cfg_is_default_value(_surf_cfg_set,"cpu/maxmin_selective_update")),
+ "Disabling selective update while using the lazy update mechanism is dumb!");
} else if (!strcmp(optim,"TI")) {
surf_cpu_model_init_ti();
return;
} else if (!strcmp(optim,"TI")) {
surf_cpu_model_init_ti();
return;
diff --git
a/src/surf/maxmin.c
b/src/surf/maxmin.c
index
0a00e66
..
c7f2d8e
100644
(file)
--- a/
src/surf/maxmin.c
+++ b/
src/surf/maxmin.c
@@
-23,12
+23,11
@@
static void lmm_variable_mallocator_free_f(void *var);
static void lmm_update_modified_set(lmm_system_t sys,
lmm_constraint_t cnst);
static void lmm_remove_all_modified_set(lmm_system_t sys);
static void lmm_update_modified_set(lmm_system_t sys,
lmm_constraint_t cnst);
static void lmm_remove_all_modified_set(lmm_system_t sys);
-int sg_maxmin_selective_update = 1;
static int Global_debug_id = 1;
static int Global_const_debug_id = 1;
extern xbt_swag_t keep_track;
static int Global_debug_id = 1;
static int Global_const_debug_id = 1;
extern xbt_swag_t keep_track;
-lmm_system_t lmm_system_new(
void
)
+lmm_system_t lmm_system_new(
int selective_update
)
{
lmm_system_t l = NULL;
s_lmm_variable_t var;
{
lmm_system_t l = NULL;
s_lmm_variable_t var;
@@
-37,7
+36,7
@@
lmm_system_t lmm_system_new(void)
l = xbt_new0(s_lmm_system_t, 1);
l->modified = 0;
l = xbt_new0(s_lmm_system_t, 1);
l->modified = 0;
- l->selective_update_active = s
g_maxmin_s
elective_update;
+ l->selective_update_active = selective_update;
XBT_DEBUG("Setting selective_update_active flag to %d\n",
l->selective_update_active);
XBT_DEBUG("Setting selective_update_active flag to %d\n",
l->selective_update_active);
diff --git
a/src/surf/network_im.c
b/src/surf/network_im.c
index
83e5ad0
..
8b62c88
100644
(file)
--- a/
src/surf/network_im.c
+++ b/
src/surf/network_im.c
@@
-45,7
+45,8
@@
int sg_network_crosstraffic = 0;
xbt_dict_t gap_lookup = NULL;
xbt_dict_t gap_lookup = NULL;
-e_UM_t network_update_mechanism = UM_FULL;
+e_UM_t network_update_mechanism = UM_UNDEFINED;
+static int selective_update = 0;
typedef struct network_link_CM02_im {
s_surf_resource_lmm_t lmm_resource; /* must remain first to be added to a trace */
typedef struct network_link_CM02_im {
s_surf_resource_lmm_t lmm_resource; /* must remain first to be added to a trace */
@@
-1059,7
+1060,6
@@
static void gap_remove(surf_action_network_CM02_im_t action) {
static void im_surf_network_model_init_internal(void)
{
s_surf_action_network_CM02_im_t comm;
static void im_surf_network_model_init_internal(void)
{
s_surf_action_network_CM02_im_t comm;
-
surf_network_model = surf_model_init();
surf_network_model->name = "network";
surf_network_model = surf_model_init();
surf_network_model->name = "network";
@@
-1100,8
+1100,8
@@
static void im_surf_network_model_init_internal(void)
surf_network_model->extension.network.create_resource =
im_net_create_resource;
surf_network_model->extension.network.create_resource =
im_net_create_resource;
-
if (!network_im_maxmin_system)
- network_im_maxmin_system = lmm_system_new();
+ if (!network_im_maxmin_system)
+ network_im_maxmin_system = lmm_system_new(
selective_update
);
routing_model_create(sizeof(link_CM02_im_t),
im_net_create_resource("__loopback__",
routing_model_create(sizeof(link_CM02_im_t),
im_net_create_resource("__loopback__",
@@
-1110,7
+1110,6
@@
static void im_surf_network_model_init_internal(void)
SURF_LINK_FATPIPE, NULL));
if(network_update_mechanism == UM_LAZY){
SURF_LINK_FATPIPE, NULL));
if(network_update_mechanism == UM_LAZY){
- sg_maxmin_selective_update = 1;
im_net_action_heap = xbt_heap_new(8,NULL);
xbt_heap_set_update_callback(im_net_action_heap, im_net_action_update_index_heap);
im_net_modified_set =
im_net_action_heap = xbt_heap_new(8,NULL);
xbt_heap_set_update_callback(im_net_action_heap, im_net_action_update_index_heap);
im_net_modified_set =
@@
-1120,11
+1119,16
@@
static void im_surf_network_model_init_internal(void)
static void set_update_mechanism(void) {
char *optim = xbt_cfg_get_string(_surf_cfg_set, "network/optim");
static void set_update_mechanism(void) {
char *optim = xbt_cfg_get_string(_surf_cfg_set, "network/optim");
+ int select = xbt_cfg_get_int(_surf_cfg_set, "network/maxmin_selective_update");
if(!strcmp(optim,"Full")) {
network_update_mechanism = UM_FULL;
if(!strcmp(optim,"Full")) {
network_update_mechanism = UM_FULL;
+ selective_update = select;
} else if (!strcmp(optim,"Lazy")) {
network_update_mechanism = UM_LAZY;
} else if (!strcmp(optim,"Lazy")) {
network_update_mechanism = UM_LAZY;
+ selective_update = 1;
+ xbt_assert((select==1) || (xbt_cfg_is_default_value(_surf_cfg_set,"network/maxmin_selective_update")),
+ "Disabling selective update while using the lazy update mechanism is dumb!");
} else {
xbt_die("Unsupported optimization (%s) for this model",optim);
}
} else {
xbt_die("Unsupported optimization (%s) for this model",optim);
}
diff --git
a/src/surf/surf_config.c
b/src/surf/surf_config.c
index
02ab8a8
..
65ffb94
100644
(file)
--- a/
src/surf/surf_config.c
+++ b/
src/surf/surf_config.c
@@
-178,12
+178,6
@@
static void _surf_cfg_cb__weight_S(const char *name, int pos)
sg_weight_S_parameter = xbt_cfg_get_double(_surf_cfg_set, name);
}
sg_weight_S_parameter = xbt_cfg_get_double(_surf_cfg_set, name);
}
-static void _surf_cfg_cb__surf_maxmin_selective_update(const char *name,
- int pos)
-{
- sg_maxmin_selective_update = xbt_cfg_get_int(_surf_cfg_set, name);
-}
-
/* callback of the inclusion path */
static void _surf_cfg_cb__surf_path(const char *name, int pos)
{
/* callback of the inclusion path */
static void _surf_cfg_cb__surf_path(const char *name, int pos)
{
@@
-421,10
+415,15
@@
void surf_config_init(int *argc, char **argv)
_surf_cfg_cb__surf_path, NULL);
default_value_int = 0;
_surf_cfg_cb__surf_path, NULL);
default_value_int = 0;
- xbt_cfg_register(&_surf_cfg_set, "maxmin_selective_update",
- "Update the constraint set propagating recursively to others constraints",
+ xbt_cfg_register(&_surf_cfg_set, "
cpu/
maxmin_selective_update",
+ "Update the constraint set propagating recursively to others constraints
(1 by default when optim is set to lazy)
",
xbt_cfgelm_int, &default_value_int, 0, 1,
xbt_cfgelm_int, &default_value_int, 0, 1,
- _surf_cfg_cb__surf_maxmin_selective_update, NULL);
+ NULL, NULL);
+ default_value_int = 0;
+ xbt_cfg_register(&_surf_cfg_set, "network/maxmin_selective_update",
+ "Update the constraint set propagating recursively to others constraints (1 by default when optim is set to lazy)",
+ xbt_cfgelm_int, &default_value_int, 0, 1,
+ NULL, NULL);
/* do model-check */
default_value_int = 0;
/* do model-check */
default_value_int = 0;
diff --git
a/src/surf/workstation_ptask_L07.c
b/src/surf/workstation_ptask_L07.c
index
217e63b
..
952fd8a
100644
(file)
--- a/
src/surf/workstation_ptask_L07.c
+++ b/
src/surf/workstation_ptask_L07.c
@@
-890,7
+890,7
@@
static void ptask_model_init_internal(void)
ptask_add_traces;
if (!ptask_maxmin_system)
ptask_add_traces;
if (!ptask_maxmin_system)
- ptask_maxmin_system = lmm_system_new();
+ ptask_maxmin_system = lmm_system_new(
1
);
routing_model_create(sizeof(link_L07_t),
ptask_link_create_resource("__loopback__",
routing_model_create(sizeof(link_L07_t),
ptask_link_create_resource("__loopback__",
diff --git
a/testsuite/surf/lmm_usage.c
b/testsuite/surf/lmm_usage.c
index
c331b29
..
61b3ad7
100644
(file)
--- a/
testsuite/surf/lmm_usage.c
+++ b/
testsuite/surf/lmm_usage.c
@@
-122,7
+122,7
@@
void test1(method_t method)
lmm_set_default_protocol_function(func_reno_f, func_reno_fpi,
func_reno_fpi);
lmm_set_default_protocol_function(func_reno_f, func_reno_fpi,
func_reno_fpi);
- Sys = lmm_system_new();
+ Sys = lmm_system_new(
1
);
L1 = lmm_constraint_new(Sys, (void *) "L1", a);
L2 = lmm_constraint_new(Sys, (void *) "L2", b);
L3 = lmm_constraint_new(Sys, (void *) "L3", a);
L1 = lmm_constraint_new(Sys, (void *) "L1", a);
L2 = lmm_constraint_new(Sys, (void *) "L2", b);
L3 = lmm_constraint_new(Sys, (void *) "L3", a);
@@
-254,7
+254,7
@@
void test2(method_t method)
lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
func_reno_fpi);
lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
func_reno_fpi);
- Sys = lmm_system_new();
+ Sys = lmm_system_new(
1
);
CPU1 = lmm_constraint_new(Sys, (void *) "CPU1", 200.0);
CPU2 = lmm_constraint_new(Sys, (void *) "CPU2", 100.0);
CPU1 = lmm_constraint_new(Sys, (void *) "CPU1", 200.0);
CPU2 = lmm_constraint_new(Sys, (void *) "CPU2", 100.0);
@@
-403,7
+403,7
@@
void test3(method_t method)
lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
func_reno_fpi);
lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
func_reno_fpi);
- Sys = lmm_system_new();
+ Sys = lmm_system_new(
1
);
diff --git
a/testsuite/surf/maxmin_bench.c
b/testsuite/surf/maxmin_bench.c
index
149f273
..
c599596
100644
(file)
--- a/
testsuite/surf/maxmin_bench.c
+++ b/
testsuite/surf/maxmin_bench.c
@@
-40,7
+40,7
@@
void test(int nb_cnst, int nb_var, int nb_elem)
int *used = xbt_new0(int, nb_cnst);
int i, j, k;
int *used = xbt_new0(int, nb_cnst);
int i, j, k;
- Sys = lmm_system_new();
+ Sys = lmm_system_new(
1
);
for (i = 0; i < nb_cnst; i++) {
cnst[i] = lmm_constraint_new(Sys, NULL, float_random(10.0));
for (i = 0; i < nb_cnst; i++) {
cnst[i] = lmm_constraint_new(Sys, NULL, float_random(10.0));