Revision 9c84b6d3 som/Tests/tman_test.c
som/Tests/tman_test.c | ||
---|---|---|
111 | 111 |
|
112 | 112 |
static void loop(struct nodeID *s) |
113 | 113 |
{ |
114 |
int done = 0; |
|
114 |
int done = 0; int more,less,now;
|
|
115 | 115 |
#define BUFFSIZE 1524 |
116 | 116 |
static uint8_t buff[BUFFSIZE]; |
117 | 117 |
int cnt = 0; |
... | ... | |
137 | 137 |
int n, i,*d, msize,si; |
138 | 138 |
mdata = topoGetMetadata(&msize); |
139 | 139 |
neighbours = topoGetNeighbourhood(&n); |
140 |
printf("\tMy metadata = %d\nIteration # %d -- I have %d neighbours:\n",my_metadata,cnt,n);
|
|
140 |
fprintf(stderr, "\tMy metadata = %d\nIteration # %d -- Cache size now is : %d -- I have %d neighbours:\n",my_metadata,cnt,now,n);
|
|
141 | 141 |
for (i = 0; i < n; i++) { |
142 | 142 |
neigh = nodeid_undump(mdata+i*msize,&si); |
143 | 143 |
d = (int*)((mdata+i*msize)+si); |
144 |
printf("\t%d: %s -- %d\n", i, node_addr(neighbours[i]), //node_addr(neigh),
|
|
144 |
fprintf(stderr, "\t%d: %s -- %d\n", i, node_addr(neighbours[i]), //node_addr(neigh),
|
|
145 | 145 |
*d); |
146 | 146 |
nodeid_free(neigh); |
147 | 147 |
} |
148 | 148 |
} |
149 |
// if (cnt % 30 == 0) {
|
|
150 |
// int more = 20;//((double)rand() / (double)RAND_MAX)*10;
|
|
151 |
// int now = topoGrowNeighbourhood(more);
|
|
152 |
// printf("Growing : +%d -- Cache size now is : %d\n", more,now);
|
|
153 |
// }
|
|
154 |
// if (cnt % 10 == 0) {
|
|
155 |
// int less = ((double)rand() / (double)RAND_MAX)*10;
|
|
156 |
// int now = topoShrinkNeighbourhood(less);
|
|
157 |
// printf("Shrinking : -%d -- Cache size now is : %d\n", less,now);
|
|
158 |
// }
|
|
149 |
if (cnt % 13 == 0) {
|
|
150 |
more = ((double)rand() / (double)RAND_MAX)*10;
|
|
151 |
now = topoGrowNeighbourhood(more);
|
|
152 |
printf("Growing : +%d -- Cache size now is : %d\n", more,now); |
|
153 |
} |
|
154 |
if (cnt % 10 == 0) { |
|
155 |
less = ((double)rand() / (double)RAND_MAX)*10;
|
|
156 |
now = topoShrinkNeighbourhood(less);
|
|
157 |
printf("Shrinking : -%d -- Cache size now is : %d\n", less,now); |
|
158 |
} |
|
159 | 159 |
} |
160 | 160 |
|
161 | 161 |
} |
Also available in: Unified diff