how to print progress of a long running parallel() loop?
mw
mingwu at gmail.com
Mon Dec 7 08:16:50 UTC 2020
https://dlang.org/phobos/std_parallelism.html#.parallel
auto logs = new double[1_000_000];
foreach (i, ref elem; parallel(logs))
{
elem = log(i + 1.0);
}
In Python, using joblib, I can use `verbose` level like this:
r = Parallel(n_jobs=2, verbose=10)(delayed(sleep)(.2) for _ in
range(10))
to print out the progress.
How to do this in D's parallel loop?
thanks.
More information about the Digitalmars-d-learn
mailing list