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");
xbt_cfg_register(&_sg_cfg_set, "smpi/os",
- "Small messages timings (MPI_Isend/Send minimum time for small messages)",
+ "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,
} s_smpi_factor_t;
xbt_dynar_t smpi_os_values = NULL;
xbt_dynar_t smpi_or_values = NULL;
-
+xbt_dynar_t smpi_ois_values = NULL;
// Methods used to parse and store the values for timing injections in smpi
// These are taken from surf/network.c and generalized to have more factors
return current;
}
+static double smpi_ois(double size)
+{
+ if (!smpi_ois_values)
+ smpi_ois_values =
+ parse_factor(sg_cfg_get_string("smpi/ois"));
+
+ unsigned int iter = 0;
+ s_smpi_factor_t fact;
+ double current=0.0;
+ xbt_dynar_foreach(smpi_ois_values, iter, fact) {
+ if (size <= fact.factor) {
+ XBT_DEBUG("ois : %lf <= %ld return %f", size, fact.factor, current);
+ return current;
+ }else{
+ current=fact.values[0]+fact.values[1]*size;
+ }
+ }
+ XBT_DEBUG("ois : %lf > %ld return %f", size, fact.factor, current);
+
+ return current;
+}
+
static double smpi_or(double size)
{
if (!smpi_or_values)
// we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
request->real_size=request->size;
smpi_datatype_use(request->old_type);
- double sleeptime = smpi_os(request->size);
+
+ //if we are giving back the control to the user without waiting for completion, we have to inject timings
+ double sleeptime =0.0;
+ if(request->detached && !(request->flags & ISEND))
+ sleeptime = smpi_os(request->size);
+ else
+ sleeptime = smpi_ois(request->size);
+
if(sleeptime!=0.0){
simcall_process_sleep(sleeptime);
XBT_DEBUG("sending size of %zu : sleep %lf ", request->size, smpi_os(request->size));