by adwn · 5y ago · 0 comments
No, it doesn't. Only for those processes, where you can trivially split the input and concatenate the outputs. Try using GNU parallel to sort a list of numbers, or to compute their prefix sum – it's not possible, and those are even simpler use cases than most of what you'll encounter in practice.
No, you weren't. You said: "[...] GNU parallel [...] works for any non-parallel process" (emphasis mine)
> Those problems are so common that someone literally wrote GNU parallel to solve them.
As part of my job I'm writing multi-threaded, parallel programs all the time, and in those years only a single problem would have been feasible to parallelize with GNU parallel; but since I was using Rust, it was trivial to do the parallelization right there in my code without having to resort an outer script/binary that calls GNU parallel on my program.
`parsort` is part of GNU Parallel.
Yet it clearly is possible, so your blanket statement is clearly wrong.
`parsort` a simple wrapper, and this really goes for many uses of GNU Parallel: You need to prepare your data for the parallel step and post-process the output.
Maybe you originally meant to say: "Only for those processes, where you can preprocess the input and post-process the outputs."
GNU parallel is great if you have, e.g., a bunch of files, each of which needs to be processed individually, like running awk or sed over it. Then you can just plop parallel in front and get a speedup for free. That's not what parsort does.