X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/17a9f17337b1d6743025cf52e7c19a469138d38f..cd641543689ed33eb33ac4f3905f63d3d6a0d541:/src/simgrid/sg_config.c diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index db7de62927..63f1a02f30 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -18,7 +18,9 @@ #include "instr/instr_interface.h" #include "simgrid/simix.h" #include "simgrid/sg_config.h" -#include "mc/mc.h" +#include "smpi/smpi_interface.h" +#include "mc/mc.h" +#include "instr/instr.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf, "About the configuration of simgrid"); @@ -97,7 +99,6 @@ static void sg_config_cmd_line(int *argc, char **argv) } } - /* callback of the workstation/model variable */ static void _sg_cfg_cb__workstation_model(const char *name, int pos) { @@ -225,6 +226,55 @@ static void _sg_cfg_cb__weight_S(const char *name, int pos) sg_weight_S_parameter = xbt_cfg_get_double(_sg_cfg_set, name); } +#ifdef HAVE_SMPI +/* callback of the mpi collectives */ +static void _sg_cfg_cb__coll(const char *category, + s_mpi_coll_description_t * table, + const char *name, int pos) +{ + char *val; + + xbt_assert(_sg_init_status == 1, + "Cannot change the model after the initialization"); + + val = xbt_cfg_get_string(_sg_cfg_set, name); + + if (!strcmp(val, "help")) { + coll_help(category, table); + exit(0); + } + + /* New Module missing */ + find_coll_description(table, val); +} +static void _sg_cfg_cb__coll_allgather(const char *name, int pos){ + _sg_cfg_cb__coll("allgather", mpi_coll_allgather_description, name, pos); +} +static void _sg_cfg_cb__coll_allgatherv(const char *name, int pos){ + _sg_cfg_cb__coll("allgatherv", mpi_coll_allgatherv_description, name, pos); +} +static void _sg_cfg_cb__coll_allreduce(const char *name, int pos) +{ + _sg_cfg_cb__coll("allreduce", mpi_coll_allreduce_description, name, pos); +} +static void _sg_cfg_cb__coll_alltoall(const char *name, int pos) +{ + _sg_cfg_cb__coll("alltoall", mpi_coll_alltoall_description, name, pos); +} +static void _sg_cfg_cb__coll_alltoallv(const char *name, int pos) +{ + _sg_cfg_cb__coll("alltoallv", mpi_coll_alltoallv_description, name, pos); +} +static void _sg_cfg_cb__coll_bcast(const char *name, int pos) +{ + _sg_cfg_cb__coll("bcast", mpi_coll_bcast_description, name, pos); +} +static void _sg_cfg_cb__coll_reduce(const char *name, int pos) +{ + _sg_cfg_cb__coll("reduce", mpi_coll_reduce_description, name, pos); +} +#endif + /* callback of the inclusion path */ static void _sg_cfg_cb__surf_path(const char *name, int pos) { @@ -234,14 +284,16 @@ static void _sg_cfg_cb__surf_path(const char *name, int pos) /* callback to decide if we want to use the model-checking */ #include "xbt_modinter.h" +#ifdef HAVE_MC extern int _sg_do_model_check; /* this variable lives in xbt_main until I find a right location for it */ +#endif static void _sg_cfg_cb_model_check(const char *name, int pos) { +#ifdef HAVE_MC _sg_do_model_check = xbt_cfg_get_int(_sg_cfg_set, name); - -#ifndef HAVE_MC - if (_sg_do_model_check) { +#else + if (xbt_cfg_get_int(_sg_cfg_set, name)) { xbt_die("You tried to activate the model-checking from the command line, but it was not compiled in. Change your settings in cmake, recompile and try again"); } #endif @@ -453,17 +505,16 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register(&_sg_cfg_set, "maxmin/precision", "Numerical precision used when updating simulation models (epsilon in double comparisons)", xbt_cfgelm_double, NULL, 1, 1, _sg_cfg_cb__maxmin_precision, NULL); - xbt_cfg_setdefault_double(_sg_cfg_set, "maxmin/precision", 0.00001); // FIXME use setdefault everywhere here! + xbt_cfg_setdefault_double(_sg_cfg_set, "maxmin/precision", 0.00001); /* The parameters of network models */ - double_default_value = 0.0; xbt_cfg_register(&_sg_cfg_set, "network/sender_gap", "Minimum gap between two overlapping sends", - xbt_cfgelm_double, &double_default_value, 1, 1, + xbt_cfgelm_double, NULL, 1, 1, /* default is set in network.c */ _sg_cfg_cb__sender_gap, NULL); - double_default_value = 1.0; + double_default_value = 1.0; // FIXME use setdefault everywhere here! xbt_cfg_register(&_sg_cfg_set, "network/latency_factor", "Correction factor to apply to the provided latency (default value set by network model)", xbt_cfgelm_double, &double_default_value, 1, 1, @@ -473,10 +524,10 @@ void sg_config_init(int *argc, char **argv) "Correction factor to apply to the provided bandwidth (default value set by network model)", xbt_cfgelm_double, &double_default_value, 1, 1, _sg_cfg_cb__bandwidth_factor, NULL); - double_default_value = 0.0; + xbt_cfg_register(&_sg_cfg_set, "network/weight_S", - "Correction factor to apply to the weight of competing streams(default value set by network model)", - xbt_cfgelm_double, &double_default_value, 1, 1, + "Correction factor to apply to the weight of competing streams (default value set by network model)", + xbt_cfgelm_double, NULL, 1, 1, /* default is set in network.c */ _sg_cfg_cb__weight_S, NULL); /* Inclusion path */ @@ -546,6 +597,13 @@ void sg_config_init(int *argc, char **argv) xbt_cfgelm_int, NULL, 0, 1, _mc_cfg_cb_visited, NULL); xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/visited", 0); + + /* Set file name for dot output of graph state */ + xbt_cfg_register(&_sg_cfg_set, "model-check/dot_output", + "Specify the name of dot file corresponding to graph state", + xbt_cfgelm_string, NULL, 0, 1, + _mc_cfg_cb_dot_output, NULL); + xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/dot_output", ""); #endif /* do verbose-exit */ @@ -636,7 +694,7 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_setdefault_string(_sg_cfg_set, "ns3/TcpModel", "default"); #endif -//SMPI +#ifdef HAVE_SMPI double default_reference_speed = 20000.0; xbt_cfg_register(&_sg_cfg_set, "smpi/running_power", "Power of the host running the simulation (in flop/s). Used to bench the operations.", @@ -661,6 +719,12 @@ void sg_config_init(int *argc, char **argv) xbt_cfgelm_int, &default_small_messages_threshold, 1, 1, NULL, NULL); + int default_send_is_detached_threshold = 65536; + xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres", + "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend", + xbt_cfgelm_int, &default_send_is_detached_threshold, 1, 1, NULL, + NULL); + //For smpi/bw_factor and smpi/lat_factor //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN" //test is if( size >= thresholdN ) return valueN; @@ -677,8 +741,68 @@ void sg_config_init(int *argc, char **argv) xbt_cfgelm_string, NULL, 1, 1, NULL, NULL); xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/lat_factor", "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;1426:1.61075;732:1.9503;257:1.95341;0:2.01467"); -//END SMPI + xbt_cfg_register(&_sg_cfg_set, "smpi/os", + "Small messages timings (MPI_Send minimum time for small messages)", + xbt_cfgelm_string, NULL, 1, 1, NULL, + NULL); + xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/os", "1:0:0:0:0"); + + xbt_cfg_register(&_sg_cfg_set, "smpi/ois", + "Small messages timings (MPI_Isend minimum time for small messages)", + xbt_cfgelm_string, NULL, 1, 1, NULL, + NULL); + xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/ois", "1:0:0:0:0"); + + xbt_cfg_register(&_sg_cfg_set, "smpi/or", + "Small messages timings (MPI_Recv minimum time for small messages)", + xbt_cfgelm_string, NULL, 1, 1, NULL, + NULL); + xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/or", "1:0:0:0:0"); + + default_value = xbt_strdup("default"); + xbt_cfg_register(&_sg_cfg_set, "smpi/allgather", + "Which collective to use for allgather", + xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_allgather, + NULL); + + default_value = xbt_strdup("default"); + xbt_cfg_register(&_sg_cfg_set, "smpi/allgatherv", + "Which collective to use for allgatherv", + xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_allgatherv, + NULL); + + default_value = xbt_strdup("default"); + xbt_cfg_register(&_sg_cfg_set, "smpi/allreduce", + "Which collective to use for allreduce", + xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_allreduce, + NULL); + + default_value = xbt_strdup("ompi"); + xbt_cfg_register(&_sg_cfg_set, "smpi/alltoall", + "Which collective to use for alltoall", + xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_alltoall, + NULL); + + default_value = xbt_strdup("default"); + xbt_cfg_register(&_sg_cfg_set, "smpi/alltoallv", + "Which collective to use for alltoallv", + xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_alltoallv, + NULL); + + default_value = xbt_strdup("default"); + xbt_cfg_register(&_sg_cfg_set, "smpi/bcast", + "Which collective to use for bcast", + xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_bcast, + NULL); + + + default_value = xbt_strdup("default"); + xbt_cfg_register(&_sg_cfg_set, "smpi/reduce", + "Which collective to use for reduce", + xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_reduce, + NULL); +#endif // HAVE_SMPI if (!surf_path) { /* retrieves the current directory of the current process */