Revision 534e126a src/Tests/tman_test.c

View differences:

src/Tests/tman_test.c
129 129
    } else
130 130
      topoParseData(NULL, 0);
131 131
    if (++cnt % 1 == 0) {
132
    	const uint8_t *mdata;
133
    	const struct nodeID **neighbours;
134
    	int n, i, msize;
135
    	mdata = topoGetMetadata(&msize);
136
    	neighbours = topoGetNeighbourhood(&n);
137
    	fprintf(stderr, "\tMy metadata = %d\nIteration # %d -- Cache size now is : %d -- I have %d neighbours:\n",my_metadata,cnt,now,n);
138
    	for (i = 0; i < n; i++) {
139
    		const int *d;
140
    		d = (const int*)((mdata+i*msize));
141
    		fprintf(stderr, "\t%d: %s -- %d\n", i, node_addr(neighbours[i]), *d);
142
    	}
132
        const uint8_t *mdata;
133
        const struct nodeID **neighbours;
134
        char addr[256];
135
        int n, i, msize;
136
        mdata = topoGetMetadata(&msize);
137
        neighbours = topoGetNeighbourhood(&n);
138
        fprintf(stderr, "\tMy metadata = %d\nIteration # %d -- Cache size now is : %d -- I have %d neighbours:\n",my_metadata,cnt,now,n);
139
        for (i = 0; i < n; i++) {
140
                const int *d;
141
                d = (const int*)((mdata+i*msize));
142
                node_addr(neighbours[i], addr, 256);
143
                fprintf(stderr, "\t%d: %s -- %d\n", i, addr, *d);
144
        }
143 145
    }
144 146
    if (cnt % 20 == 0) {
145
    	change_metadata(s);
147
        change_metadata(s);
146 148
    }
147 149
//    if (cnt % 13 == 0) {
148
//    	more = ((double)rand() / (double)RAND_MAX)*10;
149
//    	now = topoGrowNeighbourhood(more);
150
//    	printf("Growing : +%d -- Cache size now is : %d\n", more,now);
150
//      more = ((double)rand() / (double)RAND_MAX)*10;
151
//      now = topoGrowNeighbourhood(more);
152
//      printf("Growing : +%d -- Cache size now is : %d\n", more,now);
151 153
//    }
152 154
//    if (cnt % 10 == 0) {
153
//    	less = ((double)rand() / (double)RAND_MAX)*10;
154
//    	now = topoShrinkNeighbourhood(less);
155
//    	printf("Shrinking : -%d -- Cache size now is : %d\n", less,now);
155
//      less = ((double)rand() / (double)RAND_MAX)*10;
156
//      now = topoShrinkNeighbourhood(less);
157
//      printf("Shrinking : -%d -- Cache size now is : %d\n", less,now);
156 158
//    }
157 159
  }
158 160

  

Also available in: Unified diff