- interval = (nr_vals + output_nranges - 1) / output_nranges;
-
- output_sums = malloc(output_nranges * sizeof(struct output_sum));
- for (i = 0; i < output_nranges; i++) {
- output_sums[i].output = 0.0;
- output_sums[i].nranges = 1;
- }
-
- total_vals = i = j = cur_vals = 0;
-
- for (k = 0; k < nnodes; k++) {
- struct output_sum *os = &output_sums[j];
- struct node *node = &nodes[k];
-
- if (i >= interval) {
- os->output = (double) (cur_vals + 1) / (double) nranges;
- os->output *= 100.0;
- j++;
- cur_vals = node->hits;
- interval += (nr_vals + output_nranges - 1) / output_nranges;
- } else {
- cur_vals += node->hits;
- os->nranges += node->hits;
+ if (output_csv) {
+ printf("rank, count\n");
+ for (k = 0; k < nnodes; k++)
+ printf("%lu, %lu\n", k, nodes[k].hits);
+ } else {
+ interval = (nr_vals + output_nranges - 1) / output_nranges;
+
+ output_sums = malloc(output_nranges * sizeof(struct output_sum));
+ for (i = 0; i < output_nranges; i++) {
+ output_sums[i].output = 0.0;
+ output_sums[i].nranges = 1;