MParallel: batch processor with multi-threading support

0
238

MParallel is a free command line program for Microsoft Windows devices that enables you to run multiple tasks you specify in parallel.

It is probably best to start with a few examples to showcase how powerful MParallel actually is. At a basic level, you could run multiple commands that you can execute from the command line in parallel.

Think of five ping commands to different destinations for example that can run in parallel.

From there, you may explore advanced options like finding all jpg images in a directory and converting them to png format using ImageMagick, or doing the same for video files.

MParallel

mparallel

The program ships as a portable program. Simply download the latest archive for your operating system — there is a 32-bit and 64-bit version, and the source code — and extract the archive when the download completes.

Once done, you may want to run the command mparallel.exe –help to display the list of supported options.

You will notice that there are quite a few that it supports. Generally speaking, it is necessary to begin the command with the program’s parameters before you add the programs that you want executed.

The command MParallel.exe –count=3 ping.exe -n 16 fsf.org : ping.exe -n 16 gnu.org : ping.exe -n 16 w3c.org begins with –count=3 which tells MParallel that there will be three commands that you want run in parallel.

This is a basic example, and there is a lot more that you can do. For instance, instead of specifying commands directly, you could tell the program to look for them in a text file instead. This can be useful if you want lots of commands to be executed, or better editing and management options for those commands.

You’d achieve that by using –input=commands.txt, and adding each command to a line in the text file.

A slightly more complicated command is the following one: dir /b *.jpg | MParallel.exe –shell –stdin —pattern=”copy {{0}} {{0:N}}.png”

This uses the dir command to find all .jpg images, to run MParallel and rename the files to .png. Not something that you want to do, but it showcases several new options such as running shell commands, and using pattern.

The package ships with two example command files that you may look at for additional examples. The first uses MParallel in conjunction with ImageMagick to convert jpg images to png files, the other FFmpeg to convert avi files to mp4 files.

Closing Words

MParallel is a mighty program that may take some getting used to time but if you worked with the command line or batch files before, you should feel at home right away. Probably the biggest advantage of it is that it lets you run commands in parallel which should speed up execution significantly on modern systems.

Now You: Do you use the command line at all?