if (!xbt_dynar_is_empty(parents)) {
unsigned int i;
double data_available = 0.;
- double redist_time = 0;
double last_data_available;
/* compute last_data_available */
SD_task_t parent;
if (SD_task_get_kind(parent) == SD_TASK_COMM_E2E) {
sg_host_t * parent_host= SD_task_get_workstation_list(parent);
/* Estimate the redistribution time from this parent */
+ double redist_time;
if (SD_task_get_amount(parent) <= 1e-6){
redist_time= 0;
} else {
void CommunicationDeterminismChecker::deterministic_comm_pattern(int process, simgrid::mc::PatternCommunication* comm,
int backtracking)
{
- simgrid::mc::PatternCommunicationList& list = initial_communications_pattern[process];
-
if (not backtracking) {
+ simgrid::mc::PatternCommunicationList& list = initial_communications_pattern[process];
e_mc_comm_pattern_difference_t diff = compare_comm_pattern(list.list[list.index_comm].get(), comm);
if (diff != NONE_DIFF) {
if(retval != MPI_ERR_REQUEST) {
int my_proc_id = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Startall"));
- MPI_Request req = MPI_REQUEST_NULL;
if (not TRACE_smpi_view_internals())
for (int i = 0; i < count; i++) {
- req = requests[i];
+ MPI_Request req = requests[i];
if (req->flags() & MPI_REQ_SEND)
TRACE_smpi_send(my_proc_id, my_proc_id, getPid(req->comm(), req->dst()), req->tag(), req->size());
}
if (not TRACE_smpi_view_internals())
for (int i = 0; i < count; i++) {
- req = requests[i];
+ MPI_Request req = requests[i];
if (req->flags() & MPI_REQ_RECV)
TRACE_smpi_recv(getPid(req->comm(), req->src()), my_proc_id, req->tag());
}
0, // count
true // benching (if we have no data, we need at least one)
});
- LocalData& data = insert.first->second;
if (insert.second) {
XBT_DEBUG("XXXXX First time ever on benched nest %s.", loc.c_str());
xbt_assert(threshold > 0 || iters > 0,
"You should provide either a positive amount of iterations to bench, or a positive maximal stderr (or both)");
} else {
+ LocalData& data = insert.first->second;
if (data.iters != iters || data.threshold != threshold) {
XBT_ERROR("Asked to bench block %s with different settings %d, %f is not %d, %f. "
"How did you manage to give two numbers at the same line??",
auto sample = samples.find(loc);
if (sample == samples.end())
xbt_die("Y U NO use SMPI_SAMPLE_* macros? Stop messing directly with smpi_sample_* functions!");
- LocalData& data = sample->second;
if (smpi_process()->sampling()){//end of loop, but still sampling needed
- smpi_process()->set_sampling(0);
- smpi_execute(data.mean*iter_count);
- smpi_bench_begin();
+ LocalData& data = sample->second;
+ smpi_process()->set_sampling(0);
+ smpi_execute(data.mean * iter_count);
+ smpi_bench_begin();
}
}
return 0;
if (action.size() > 5 + comm_size)
datatype2 = simgrid::smpi::Datatype::decode(action[5 + comm_size]);
} else {
- int datatype_index = 0;
int disp_index = 0;
/* The 3 comes from "0 gather <sendcount>", which must always be present.
* The + comm_size is the recvcounts array, which must also be present
*/
if (action.size() > 3 + comm_size + comm_size) { /* datatype + disp are specified */
- datatype_index = 3 + comm_size;
+ int datatype_index = 3 + comm_size;
disp_index = datatype_index + 1;
datatype1 = simgrid::smpi::Datatype::decode(action[datatype_index]);
datatype2 = simgrid::smpi::Datatype::decode(action[datatype_index]);
3 + comm_size + 2) { /* disps specified; datatype is not specified; use the default one */
disp_index = 3 + comm_size;
} else if (action.size() > 3 + comm_size) { /* only datatype, no disp specified */
- datatype_index = 3 + comm_size;
+ int datatype_index = 3 + comm_size;
datatype1 = simgrid::smpi::Datatype::decode(action[datatype_index]);
datatype2 = simgrid::smpi::Datatype::decode(action[datatype_index]);
}
int Group::incl(int n, const int* ranks, MPI_Group* newgroup)
{
- int i=0;
if (n == 0) {
*newgroup = MPI_GROUP_EMPTY;
} else if (n == size_) {
this->ref();
} else {
*newgroup = new Group(n);
- for (i = 0; i < n; i++) {
+ for (int i = 0; i < n; i++) {
s4u::Actor* actor = this->actor(ranks[i]); // ranks[] was passed as a param!
(*newgroup)->set_mapping(actor, i);
}
MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
int flag;
int error = 0;
- int ret=MPI_SUCCESS;
*outflag = 1;
for(int i=0; i<count; i++){
if (requests[i] != MPI_REQUEST_NULL && not(requests[i]->flags_ & MPI_REQ_PREPARED)) {
- ret = test(&requests[i], pstat, &flag);
+ int ret = test(&requests[i], pstat, &flag);
if (flag){
flag=0;
requests[i]=MPI_REQUEST_NULL;
double surf_solve(double max_date)
{
double time_delta = -1.0; /* duration */
- double model_next_action_end = -1.0;
double value = -1.0;
simgrid::kernel::resource::Resource* resource = nullptr;
simgrid::kernel::profile::Event* event = nullptr;
XBT_DEBUG("Run the NS3 network at most %fs", time_delta);
// run until min or next flow
- model_next_action_end = surf_network_model->next_occurring_event(time_delta);
+ double model_next_action_end = surf_network_model->next_occurring_event(time_delta);
XBT_DEBUG("Min for network : %f", model_next_action_end);
if (model_next_action_end >= 0.0)