xbt_cfgelm_string, NULL, 1, 1, NULL,
NULL);
xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/or", "1:0:0:0:0");
-
+ double default_iprobe_time = 1e-4;
+ xbt_cfg_register(&_sg_cfg_set, "smpi/iprobe",
+ "Minimum time to inject inside a call to MPI_Iprobe",
+ xbt_cfgelm_double, &default_iprobe_time, 1, 1, NULL,
+ NULL);
default_value = xbt_strdup("default");
xbt_cfg_register(&_sg_cfg_set, "smpi/allgather",
"Which collective to use for allgather",
while(flag==0){
smpi_mpi_iprobe(source, tag, comm, &flag, status);
XBT_DEBUG("Busy Waiting on probing : %d", flag);
- if(!flag) {
- simcall_process_sleep(0.0001);
- }
}
}
MPI_Request request =build_request(NULL, 0, MPI_CHAR, source, smpi_comm_rank(comm), tag,
comm, NON_PERSISTENT | RECV);
+ //to avoid deadlock, we have to sleep some time here, or the timer won't advance and we will only do iprobe simcalls
+ double sleeptime= sg_cfg_get_double("smpi/iprobe");
+ //multiplier to the sleeptime, to increase speed of execution, each failed iprobe will increase it
+ static int nsleeps = 1;
+
+ simcall_process_sleep(sleeptime);
+
// behave like a receive, but don't do it
smx_rdv_t mailbox;
status->MPI_ERROR = MPI_SUCCESS;
status->count = req->real_size;
}
+ nsleeps=1;//reset the number of sleeps we will do next time
+ }
+ else {
+ *flag = 0;
+ nsleeps++;
}
- else *flag = 0;
smpi_mpi_request_free(&request);
return;