xbt_dict_cursor_t cursor;
connection_t connection;
xbt_dict_foreach(peer->peers, cursor, key, connection) {
- int interested = 0;
if (connection->am_interested != 0) {
+ int interested = 0;
//Check if the peer still has a piece we want.
for (int i = 0; i < FILE_PIECES; i++) {
if (peer_has_not_piece(peer, i) && connection_has_piece(connection,i)) {
TRACE_mark("msmark", "start_send_tasks");
for (int i = 0; i < number_of_tasks; i++) {
- msg_task_t task = NULL;
- task = MSG_task_create("task", task_comp_size, task_comm_size, NULL);
+ msg_task_t task = MSG_task_create("task", task_comp_size, task_comm_size, NULL);
//setting the variable "task_creation" to value i
TRACE_host_variable_set(MSG_host_get_name(MSG_host_self()), "task_creation", i);
int err, size, rank;
int recv_buff;
MPI_Status status;
- int CS_used = 0;
xbt_dynar_t requests = xbt_dynar_new(sizeof(int), NULL);
/* Initialize MPI */
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if(rank == 0){ /* Coordinator */
+ int CS_used = 0;
while(1){
MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
if(status.MPI_TAG == REQUEST_TAG){
int main(int argc, char **argv)
{
- int recv_buff, err, size, rank, i;
+ int recv_buff, err, size, rank;
MPI_Status status;
/* Initialize MPI */
if (rank == 0) {
//printf("MPI_ISend / MPI_IRecv Test \n");
- for(i=0; i < size - 1; i++){
+ for (int i = 0; i < size - 1; i++) {
MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
//printf("Message received from %d\n", recv_buff);
}