- if (task->kind == SD_TASK_COMP_PAR_AMDAHL) {
- XBT_VERB("Build communication matrix for task '%s'", input->name);
- xbt_free(input->flops_amount);
- xbt_free(input->bytes_amount);
- input->flops_amount = xbt_new0(double, input->allocation->size());
- input->bytes_amount = xbt_new0(double, input->allocation->size() * input->allocation->size());
-
- for (int i=0; i<src_nb; i++) {
- double src_start = i*input->amount/src_nb;
- double src_end = src_start + input->amount/src_nb;
- for (int j=0; j<dst_nb; j++) {
- double dst_start = j*input->amount/dst_nb;
- double dst_end = dst_start + input->amount/dst_nb;
- XBT_VERB("(%s->%s): (%.2f, %.2f)-> (%.2f, %.2f)", sg_host_get_name(input->allocation->at(i)),
- sg_host_get_name(input->allocation->at(src_nb+j)), src_start, src_end, dst_start, dst_end);
- if ((src_end <= dst_start) || (dst_end <= src_start)) {
- input->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
- } else {
- input->bytes_amount[i*(src_nb+dst_nb)+src_nb+j] = MIN(src_end, dst_end) - MAX(src_start, dst_start);
- }
- XBT_VERB("==> %.2f", input->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]);
- }
- }
- }