Clean some cruft in the comments.
/** \brief Initializes the CPU model with the model Cas01
* \ingroup SURF_models
*
+ * By default, this model uses the lazy optimization mechanism that
+ * relies on partial invalidation in LMM and a heap for lazy action update.
+ * You can change this behavior by setting the cpu/optim configuration
+ * variable to a different value.
+ *
* This function is called by surf_workstation_model_init_CLM03
* so you shouldn't have to call it by yourself.
*
*/
XBT_PUBLIC(void) surf_cpu_model_init_Cas01(void);
-/** \brief Initializes the CPU model with trace integration
- * \ingroup SURF_models
- *
- */
-XBT_PUBLIC(void) surf_cpu_model_init_ti(void);
-
-/** \brief Initializes the CPU model with the model Cas01 Improved. This model uses a heap to order the events, decreasing the time complexity to get the minimum next event.
+/** \brief Initializes the CPU model with trace integration [Deprecated]
* \ingroup SURF_models
*
- * This function is called by surf_workstation_model_init_CLM03
- * so you shouldn't have to call it by yourself.
- *
+ * You shouldn't have to call it by yourself.
* \see surf_workstation_model_init_CLM03()
*/
-XBT_PUBLIC(void) surf_cpu_model_init_Cas01_im(void);
+XBT_PUBLIC(void) surf_cpu_model_init_ti(void);
/** \brief This function call the share resources function needed
*
*
*/
XBT_PUBLIC(void) generic_update_actions_state(double now, double delta);
+
+/** \brief The list of all available optimization modes (both for cpu and networks).
+ * \ingroup SURF_models
+ * These optimization modes can be set using --cfg=cpu/optim:... and --cfg=network/optim:...
+ */
+XBT_PUBLIC_DATA(s_surf_model_description_t) surf_optimization_mode_description[];
+
/** \brief The list of all available cpu model models
* \ingroup SURF_models
*/
/** \brief Initializes the platform with a compound workstation model
* \ingroup SURF_models
- * \param filename XML platform file name
*
* This function should be called after a cpu_model and a
* network_model have been set up.
*/
XBT_PUBLIC(void) surf_workstation_model_init_compound(void);
+/** \brief Initializes the platform with the current best network and cpu models at hand
+ * \ingroup SURF_models
+ *
+ * This platform model seperates the workstation model and the network model.
+ * The workstation model will be initialized with the model compound, the network
+ * model with the model LV08 (with cross traffic support) and the CPU model with
+ * the model Cas01.
+ * Such model is subject to modification with warning in the ChangeLog so monitor it!
+ *
+ */
+XBT_PUBLIC(void) surf_workstation_model_init_current_default(void);
+
/** \brief Initializes the platform with the workstation model CLM03
* \ingroup SURF_models
- * \param filename XML platform file name
*
* This platform model seperates the workstation model and the network model.
* The workstation model will be initialized with the model CLM03, the network
* In future releases, some other network models will be implemented and will be
* combined with the workstation model CLM03.
*
- * \see surf_workstation_model_init_KCCFLN05()
*/
XBT_PUBLIC(void) surf_workstation_model_init_CLM03(void);
/** \brief Initializes the platform with the model KCCFLN05
* \ingroup SURF_models
- * \param filename XML platform file name
- *
- * With this model, the workstations and the network are handled
- * together. The network model is roughly the same as in CM02 but
- * interference between computations and communications can be taken
- * into account. This platform model is the default one for MSG and
- * SimDag.
- *
- */
-XBT_PUBLIC(void) surf_workstation_model_init_KCCFLN05(void);
-
-/** \brief Initializes the platform with the model KCCFLN05
- * \ingroup SURF_models
- * \param filename XML platform file name
*
* With this model, only parallel tasks can be used. Resource sharing
* is done by identifying bottlenecks and giving an equal share of
* This function has to be called to initialize the common
* structures. Then you will have to create the environment by
* calling
- * e.g. surf_workstation_model_init_CLM03() or
- * surf_workstation_model_init_KCCFLN05().
+ * e.g. surf_workstation_model_init_CLM03()
*
- * \see surf_workstation_model_init_CLM03(),
- * surf_workstation_model_init_KCCFLN05(), surf_workstation_model_init_compound(), surf_exit()
+ * \see surf_workstation_model_init_CLM03(), surf_workstation_model_init_compound(), surf_exit()
*/
XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structures */
/* \url{http://grail.sdsc.edu/papers/simgrid_ccgrid01.ps.gz}." */
/* } */
-void surf_cpu_model_init_Cas01_im()
+void surf_cpu_model_init_Cas01()
{
- if( strcmp(xbt_cfg_get_string(_surf_cfg_set, "cpu/model"),"Cas01"))
- cpu_update_mechanism = UM_LAZY;
- else
+ char *optim = xbt_cfg_get_string(_surf_cfg_set, "cpu/optim");
+ char *model = xbt_cfg_get_string(_surf_cfg_set, "cpu/model");
+
+ if(!strcmp(model,"Cas01_fullupdate")) {
+ XBT_WARN("[*Deprecated*. Use --cfg=cpu/model:Cas01 with option --cfg=cpu/optim:Full instead.]");
+ } else if(!strcmp(model,"CpuTI")) {
+ XBT_WARN("[*Deprecated*. Use --cfg=cpu/model:Cas01 with option --cfg=cpu/optim:TI instead.]");
+ }
+
+ if(!strcmp(optim,"Full")) {
cpu_update_mechanism = UM_FULL;
+ } else if (strcmp(optim,"Lazy")) {
+ cpu_update_mechanism = UM_LAZY;
+ } else if (strcmp(optim,"TI")) {
+ surf_cpu_model_init_ti();
+ return;
+ } else {
+ xbt_die("Unsupported optimization (%s) for this model",optim);
+ }
if (surf_cpu_model)
return;
"Simplistic network model where all communication take a constant time (one second)",
surf_network_model_init_Constant},
{"CM02",
- "Realistic network model with lmm_solve and no correction factors",
+ "Legacy network model with lmm_solve (slow-start and bottleneck sharing with small bandwidth poorly modeled).",
surf_network_model_init_CM02},
{"LV08",
- "Realistic network model with lmm_solve, adequate correction factors (latency*=10.4, bandwidth*=.92, S=8775) and partial invalidation optimization",
+ "Realistic network model (slow-start modeled by multiplying latency by 10.4, bandwidth by .92 and bottleneck sharing uses a payload of S=8775 for evaluating RTT). Uses partial invalidation optimization of lmm system and a heap for action management by default (option --cfg=network/optim:Lazy)",
im_surf_network_model_init_LegrandVelho},
{"LV08_fullupdate",
- "Realistic network model wit lmm_solve, adequate correction factors (latency*=10.4, bandwidth*=.92, S=8775) but no further optimization. Should produce the same results as LV08, only slower.",
+ "Realistic network model (see LV08) [Deprecated. Use LV08 with option --cfg=network/optim:Full. The Full option updates all actions at every step, which may be useful for debug.]",
im_surf_network_model_init_LegrandVelho},
{"SMPI",
- "Realistic network model with lmm_solve and correction factors on three intervals (< 1KiB, < 64 KiB, >= 64 KiB)",
+ "Realistic network model with lmm_solve specifically tailored for HPC setting (accurate modeling of slow start with correction factors on three intervals (< 1KiB, < 64 KiB, >= 64 KiB))",
surf_network_model_init_SMPI},
#ifdef HAVE_GTNETS
{"GTNets",
surf_network_model_init_NS3},
#endif
{"Reno",
- "Model using lagrange_solve instead of lmm_solve (experts only)",
+ "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info)",
surf_network_model_init_Reno},
{"Reno2",
- "Model using lagrange_solve instead of lmm_solve (experts only)",
+ "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info)",
surf_network_model_init_Reno2},
{"Vegas",
- "Model using lagrange_solve instead of lmm_solve (experts only)",
+ "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info)",
surf_network_model_init_Vegas},
{NULL, NULL, NULL} /* this array must be NULL terminated */
};
s_surf_model_description_t surf_cpu_model_description[] = {
- {"Cas01_fullupdate", "CPU classical model time=size/power",
- surf_cpu_model_init_Cas01_im},
+ {"Cas01_fullupdate", "CPU classical model time=size/power (Cas01). [Deprecated. Use Cas01 with option --cfg=cpu/optim:Full. The Full option updates all actions at every step, which may be useful for debug.]",
+ surf_cpu_model_init_Cas01},
{"Cas01",
- "Variation of Cas01_fullupdate with partial invalidation optimization of lmm system. Should produce the same values, only faster",
- surf_cpu_model_init_Cas01_im},
+ "CPU classical model time=size/power. Default version uses partial invalidation optimization of lmm system and a heap for action management (default option is --cfg=cpu/optim:Lazy)",
+ surf_cpu_model_init_Cas01},
{"CpuTI",
- "Variation of Cas01 with also trace integration. Should produce the same values, only faster if you use availability traces",
+ "CPU classical model time=size/power (Cas01). [Deprecated. Use Cas01 with option --cfg=cpu/optim:TI. The TI optimization is highly optimized when using traces]",
surf_cpu_model_init_ti},
{NULL, NULL, NULL} /* this array must be NULL terminated */
};
s_surf_model_description_t surf_workstation_model_description[] = {
+ {"current_default",
+ "Curent default workstation model (may change with versions of SimGrid). Currently Cas01 and LV08 (with full duplex support) as CPU and Network",
+ surf_workstation_model_init_current_default},
{"CLM03",
- "Default workstation model, using LV08 and CM02 as network and CPU",
+ "Default workstation model, using Cas01 and CM02 as CPU and Network",
surf_workstation_model_init_CLM03},
{"compound",
"Workstation model allowing you to use other network and CPU models",
{NULL, NULL, NULL} /* this array must be NULL terminated */
};
+s_surf_model_description_t surf_optimization_mode_description[] = {
+ {"Lazy",
+ "Lazy action management (partial invalidation in lmm + heap in action remaining).",
+ NULL},
+ {"TI",
+ "Trace integration. Highly optimized mode for the Cas01 model when using availability traces.",
+ NULL},
+ {"Full",
+ "Full update of remaining and variables. Slow but may be useful when debugging.",
+ NULL},
+ {NULL, NULL, NULL} /* this array must be NULL terminated */
+};
+
/** Displays the long description of all registered models, and quit */
void model_help(const char *category, s_surf_model_description_t * table)
{
find_model_description(surf_cpu_model_description, val);
}
+/* callback of the cpu/model variable */
+static void _surf_cfg_cb__optimization_mode(const char *name, int pos)
+{
+ char *val;
+
+ xbt_assert(_surf_init_status < 2,
+ "Cannot change the model after the initialization");
+
+ val = xbt_cfg_get_string(_surf_cfg_set, name);
+
+ if (!strcmp(val, "help")) {
+ model_help("optimization", surf_optimization_mode_description);
+ exit(0);
+ }
+
+ /* New Module missing */
+ find_model_description(surf_optimization_mode_description, val);
+}
+
/* callback of the workstation_model variable */
static void _surf_cfg_cb__network_model(const char *name, int pos)
{
"cpu/model", description, xbt_cfgelm_string,
&default_value, 1, 1, &_surf_cfg_cb__cpu_model, NULL);
+ sprintf(description,
+ "The optimization modes to use for the CPU. Possible values: ");
+ p = description;
+ while (*(++p) != '\0');
+ for (i = 0; surf_optimization_mode_description[i].name; i++)
+ p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
+ surf_optimization_mode_description[i].name);
+ sprintf(p,
+ ".\n (use 'help' as a value to see the long description of each optimization mode)");
+ default_value = xbt_strdup("Lazy");
+ xbt_cfg_register(&_surf_cfg_set,
+ "cpu/optim", description, xbt_cfgelm_string,
+ &default_value, 1, 1, &_surf_cfg_cb__optimization_mode, NULL);
+
sprintf(description,
"The model to use for the network. Possible values: ");
p = description;
&default_value, 1, 1, &_surf_cfg_cb__network_model,
NULL);
+ sprintf(description,
+ "The optimization modes to use for the network. Possible values: ");
+ p = description;
+ while (*(++p) != '\0');
+ for (i = 0; surf_optimization_mode_description[i].name; i++)
+ p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
+ surf_optimization_mode_description[i].name);
+ sprintf(p,
+ ".\n (use 'help' as a value to see the long description of each optimization mode)");
+ default_value = xbt_strdup("Lazy");
+ xbt_cfg_register(&_surf_cfg_set,
+ "network/optim", description, xbt_cfgelm_string,
+ &default_value, 1, 1, &_surf_cfg_cb__optimization_mode, NULL);
+
sprintf(description,
"The model to use for the workstation. Possible values: ");
p = description;
}
+void surf_workstation_model_init_current_default(void)
+{
+ surf_workstation_model_init_internal();
+ surf_cpu_model_init_Cas01();
+ im_surf_network_model_init_LegrandVelho();
+
+ xbt_dynar_push(model_list, &surf_workstation_model);
+ sg_platf_postparse_add_cb(create_workstations);
+}
+
/********************************************************************/
/* The model used in MSG and presented at CCGrid03 */
/********************************************************************/
void surf_workstation_model_init_CLM03(void)
{
surf_workstation_model_init_internal();
- surf_cpu_model_init_Cas01_im();
- im_surf_network_model_init_LegrandVelho();
+ surf_cpu_model_init_Cas01();
+ surf_network_model_init_CM02();
xbt_dynar_push(model_list, &surf_workstation_model);
sg_platf_postparse_add_cb(create_workstations);