int k, myid;
char my_mbox[MAILBOX_NAME_SIZE];
node_job_t myjob, jobs[GRID_NUM_NODES];
- xbt_matrix_t A, B, C = NULL, sA, sB, sC;
+ xbt_matrix_t A, B, C, sA, sB, sC;
result_t result;
xbt_assert(argc != 1, "Wrong number of arguments for this node");
broadcast_jobs(jobs + 1);
}else{
+ A = B = C = NULL; /* Avoid warning at compilation */
myjob = wait_job(myid);
}
//xbt_matrix_dump(C, "C:res", 0, xbt_matrix_dump_display_double);
+ xbt_matrix_free(A);
+ xbt_matrix_free(B);
+ xbt_matrix_free(C);
+
/* The rest: return the result to node 0 */
}else{
msg_task_t task;
result->sC =
xbt_matrix_new_sub(sC, NODE_MATRIX_SIZE, NODE_MATRIX_SIZE, 0, 0, NULL);
task = MSG_task_create("result",100,100,result);
- MSG_task_dsend(task, "0", (void_f_pvoid_t) MSG_task_destroy);
+ MSG_task_send(task, "0");
}
/* Clean up and finish*/
+ xbt_matrix_free(sC);
xbt_matrix_free(myjob->A);
xbt_matrix_free(myjob->B);
xbt_free(myjob);
}
MSG_comm_waitall(comms, GRID_NUM_NODES-1, -1);
+ for (node = 1; node < GRID_NUM_NODES; node++)
+ MSG_comm_destroy(comms[node - 1]);
}
static node_job_t wait_job(int selfid)
}
MSG_comm_waitall(comms, GRID_NUM_NODES - 1, -1);
+ for (node = 1; node < GRID_NUM_NODES; node++)
+ MSG_comm_destroy(comms[node - 1]);
/* Reconstruct the result matrix */
for (node = 1; node < GRID_NUM_NODES; node++){