From: Arnaud Giersch Date: Thu, 13 Feb 2014 14:25:53 +0000 (+0100) Subject: Use host's RngStream, instead of creating another one. X-Git-Tag: v3_11_beta~37 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9154df0a647fab4593f952d33a726c084d4cc0b5?ds=sidebyside Use host's RngStream, instead of creating another one. It was already done in commit 2b9e15c1a85e32f98027ba1f1ce99bed29490f49 (Fix the parallel execution for the bittorrent example.), but lost by commit d55f9548c659a1e31267748bde0f8bc9846cd1d4 (-Cleaning a bit the code). --- diff --git a/examples/msg/bittorrent/peer.c b/examples/msg/bittorrent/peer.c index 08f8727590..19232336c5 100644 --- a/examples/msg/bittorrent/peer.c +++ b/examples/msg/bittorrent/peer.c @@ -242,7 +242,8 @@ void peer_init(peer_t peer, int id, int seed) peer->current_pieces = xbt_dynar_new(sizeof(int), NULL); - peer->stream = RngStream_CreateStream(""); + peer->stream = + (RngStream)MSG_host_get_property_value(MSG_host_self(), "stream"); peer->comm_received = NULL; peer->round = 0; @@ -266,8 +267,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); } /**