Skip to content

Commit 6e4b075

Browse files
committed
Pardi: correct user-feedback completion percentage
cisze was not taken into account
1 parent a9aba3f commit 6e4b075

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pardi.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ let main () =
221221
Log.info "computing input file #chunks...";
222222
let total_items = nb_chunks demux input_fn in
223223
Log.info "%d" total_items;
224+
let nb_chunks = Utls.ceil ((float total_items) /. (float csize)) in
224225
(* Parany has a csize of one, because read_some takes care of the number
225226
of chunks per job *)
226227
let work_dir = Utls.get_command_output !Flags.debug "mktemp -d -t pardi_XXXX" in
@@ -231,7 +232,7 @@ let main () =
231232
~demux:(read_some work_dir input_ext
232233
(Buffer.create 1024) (ref 0) csize in_chan demux)
233234
~work:(process_some output_ext cmd)
234-
~mux:(gather_some total_items start_t (ref 0) mux);
235+
~mux:(gather_some nb_chunks start_t (ref 0) mux);
235236
if not !Flags.debug then
236237
Utls.run_command !Flags.debug (sprintf "rm -rf %s" work_dir);
237238
close_in in_chan

0 commit comments

Comments
 (0)