diff options
author | Thomas White <taw@physics.org> | 2019-06-19 10:55:43 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-06-21 15:36:53 +0200 |
commit | 24be95399829dc0f6d46189caf6e4a015fe27c3c (patch) | |
tree | 6607f084b0cc3e2e1a23ee935f1851b89f81eca1 /src | |
parent | e5f68f15f477ff0747bc1a3672964400ab576040 (diff) |
partialator: Progress bar for logs/grid scans
Diffstat (limited to 'src')
-rw-r--r-- | src/partialator.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/partialator.c b/src/partialator.c index a973113b..4ea1e5e6 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -833,6 +833,7 @@ struct log_qargs int n_crystals; RefList *full; int scaleflags; + int n_done; }; @@ -877,9 +878,12 @@ static void write_logs(void *vp, int cookie) } -static void done_log(void *qargs, void *vp) +static void done_log(void *vqargs, void *vp) { struct log_args *task = vp; + struct log_qargs *qargs = vqargs; + qargs->n_done++; + progress_bar(qargs->n_done, qargs->n_crystals/20, "Writing logs/grid scans"); free(task); } @@ -894,13 +898,12 @@ static void write_logs_parallel(Crystal **crystals, int n_crystals, qargs.next = 0; qargs.full = full; qargs.crystals = crystals; + qargs.n_done = 0; qargs.n_crystals = n_crystals; qargs.scaleflags = scaleflags; - STATUS("Writing logs...\n"); run_threads(n_threads, write_logs, get_log_task, done_log, &qargs, n_crystals/20, 0, 0, 0); - STATUS("Done.\n"); } |