theory.
PPSS. (Parallel Processing Shell Script) - a shell- script for parallel processing of files or other data. It is designed to take full advantage of multicore processors. The script determines the number of available processors and runs for each of them a separate thread. Optional use of Hyper-Threading. You can manually change the number of parallel processes, if you want (key -p N, where N - number of processes).
PPSS. will accept items from the list as an argument to this command. Elements can be a file from a specific directory, and a string in a text file (one per line ).
The script will be useful when the processing is divided into separate tasks that can execute in parallel. For example, encoding WAV-files to mp3, download multiple files, batch processing of images, etc. Dr..
practice.
A few words about how to manage this ... Startup Options:.
-c [command]. The command to execute. Example:-c 'lame'.
-d [directory]. Directory with files to process.
-f [input file]. A file containing a string processing.
-l [logfile]. The name and path to the log file.
-p [no of parallel processes]. The number of concurrent processes.
-j (enable hyperthreading). Enable / disable hyperthreading.
for.
lame. Thus, the raw data: 14 wav-files the total size of 770 Mb and a laptop Dell Inspiron 1525 with Core 2 Duo T7250 on board. Without ppss the command:.
for f in *. wav; do lame-V2 '$ f'; done.
It took. 234 seconds. Take two, this time with parallel processing:.
/ ppss. sh-c 'lame-V2'-l logfile-j.
Drum roll. The result:. 161 seconds. , Which is almost half as fast when compared to the first experience. It turns out that even at home during the winter frosts undeniable benefit of the script:-).
No comments:
Post a Comment