aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-05-06 00:23:52 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2016-05-06 00:23:52 +1200
commit7bceb564014a97b780f3ecdefec55f88928e67bc (patch)
treea90e87846cae6360934e60f7746909f4732eb8d3
parent7829acdb73ac143cbe550a7ea84beebdd71f0eda (diff)
downloadfractal-gen-7bceb564014a97b780f3ecdefec55f88928e67bc.tar.xz
Revert "Revert to thread 0 for progress monitoring"
It wasn't a bug after all. This reverts commit 7829acdb73ac143cbe550a7ea84beebdd71f0eda.
-rw-r--r--fractal-gen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fractal-gen.c b/fractal-gen.c
index 5e1e146..612e7ce 100644
--- a/fractal-gen.c
+++ b/fractal-gen.c
@@ -132,10 +132,11 @@ int main(int argc, char **argv)
pthread_create(&sections[i].thread, NULL, generator, &(sections[i]));
}
- s = &(sections[0]);
+ s = &(sections[cores-1]);
while((x = s->idx) < s->datasize)
{
- fprintf(stderr, "Thread 0: %.4f%%\r",
+ fprintf(stderr, "Thread %d: %.4f%%\r",
+ cores-1,
100.f*(double)x/s->datasize);
sleep(1);
}