Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the parallel execution for the bittorrent example.
[simgrid.git] / examples / msg / bittorrent / peer.c
index 026be29..2a9db33 100644 (file)
@@ -239,7 +239,7 @@ void peer_init(peer_t peer, int id, int seed)
   peer->current_pieces = xbt_dynar_new(sizeof(int), NULL);
   peer->current_piece = -1;
 
-  peer->stream = RngStream_CreateStream("");
+  peer->stream = MSG_host_get_data(MSG_host_self());
   peer->comm_received = NULL;
 
   peer->round = 0;
@@ -265,8 +265,6 @@ void peer_free(peer_t peer)
   xbt_free(peer->pieces_count);
   xbt_free(peer->bitfield);
   xbt_free(peer->bitfield_blocks);
-
-  RngStream_DeleteStream(&peer->stream);
 }
 
 /**