aboutsummaryrefslogtreecommitdiff
path: root/src/ats/perf_ats_mlp.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-04-17 10:36:04 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-04-17 10:36:04 +0000
commit716899950996602e7bc249b2a752032272b5ec00 (patch)
tree9d988f103dcc5a4db5402e131595f3f9ad87351f /src/ats/perf_ats_mlp.c
parentdb854346c14f08d5cb53912c352af94b022ae572 (diff)
downloadgnunet-716899950996602e7bc249b2a752032272b5ec00.tar.gz
gnunet-716899950996602e7bc249b2a752032272b5ec00.zip
- changes
Diffstat (limited to 'src/ats/perf_ats_mlp.c')
-rw-r--r--src/ats/perf_ats_mlp.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/ats/perf_ats_mlp.c b/src/ats/perf_ats_mlp.c
index 115fbf01a..f536419a7 100644
--- a/src/ats/perf_ats_mlp.c
+++ b/src/ats/perf_ats_mlp.c
@@ -88,7 +88,7 @@ check (void *cls, char *const *args, const char *cfgfile,
88 if (addresses == 0) 88 if (addresses == 0)
89 addresses = DEF_ADDRESSES_PER_PEER; 89 addresses = DEF_ADDRESSES_PER_PEER;
90 90
91 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Setting up %u peers with %u addresses per peer\n", peers, addresses); 91 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up %u peers with %u addresses per peer\n", peers, addresses);
92 92
93 struct PeerContext p[peers]; 93 struct PeerContext p[peers];
94 struct ATS_Address a[addresses * peers]; 94 struct ATS_Address a[addresses * peers];
@@ -99,12 +99,12 @@ check (void *cls, char *const *args, const char *cfgfile,
99 mlp->auto_solve = GNUNET_NO; 99 mlp->auto_solve = GNUNET_NO;
100 for (c=0; c < peers; c++) 100 for (c=0; c < peers; c++)
101 { 101 {
102 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Setting up peer %u\n", c); 102 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up peer %u\n", c);
103 GNUNET_CRYPTO_hash_create_random(GNUNET_CRYPTO_QUALITY_WEAK, &p[c].id.hashPubKey); 103 GNUNET_CRYPTO_hash_create_random(GNUNET_CRYPTO_QUALITY_WEAK, &p[c].id.hashPubKey);
104 104
105 for (c2=0; c2 < addresses; c2++) 105 for (c2=0; c2 < addresses; c2++)
106 { 106 {
107 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Setting up address %u for peer %u\n", c2, c); 107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up address %u for peer %u\n", c2, c);
108 /* Setting required information */ 108 /* Setting required information */
109 a[ca].mlp_information = NULL; 109 a[ca].mlp_information = NULL;
110 a[ca].prev = NULL; 110 a[ca].prev = NULL;
@@ -123,20 +123,25 @@ check (void *cls, char *const *args, const char *cfgfile,
123 a[ca].ats[1].type = GNUNET_ATS_QUALITY_NET_DISTANCE; 123 a[ca].ats[1].type = GNUNET_ATS_QUALITY_NET_DISTANCE;
124 a[ca].ats[1].value = 2; 124 a[ca].ats[1].value = 2;
125 a[ca].ats_count = 2; 125 a[ca].ats_count = 2;
126 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Setting up address %u\n", ca); 126 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up address %u\n", ca);
127 GNUNET_CONTAINER_multihashmap_put (amap, &a[ca].peer.hashPubKey, &a[ca], GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 127 GNUNET_CONTAINER_multihashmap_put (amap, &a[ca].peer.hashPubKey, &a[ca], GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
128 GAS_mlp_address_update(mlp, amap, &a[ca]); 128 GAS_mlp_address_update(mlp, amap, &a[ca]);
129
130 ca++; 129 ca++;
131 } 130 }
132 } 131 }
133 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Problem contains %u peers and %u adresses\n", mlp->c_p, mlp->addr_in_problem); 132 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Problem contains %u peers and %u adresses\n", mlp->c_p, mlp->addr_in_problem);
134 133
135 /* Solving the problem */ 134 /* Solving the problem */
136 //GAS_mlp_solve_problem(mlp); 135 if (GNUNET_OK == GAS_mlp_solve_problem(mlp))
136 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Problem solved successfully \n");
137 else
138 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Problem solved failed \n");
137 139
138 GAS_mlp_done (mlp); 140 GAS_mlp_done (mlp);
139 141
142 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Execution duration %llu\n", mlp->max_exec_duration);
143
144
140 for (ca=0; ca < (peers * addresses); ca++) 145 for (ca=0; ca < (peers * addresses); ca++)
141 { 146 {
142 GNUNET_free (a[ca].plugin); 147 GNUNET_free (a[ca].plugin);