ParExec
ParExec is a utility to start multiple jobs (.exe or .bat files)
and execute them in parallel. ParExec does not return until all processes
have terminated. The usage screen below will give you a clue of the
features ParExec supports.
ParExec is especially useful to speed up automated task on machines
with more than one CPU. However it is possible to get some improvement
on single CPU machines when at mose one job is CPU bound.
Usage screen:
ParExec Version 1.1 (June 30 2002)
Copyright (C) 2000, 2002 P. Gautschi
ParExec runs multiple commands in parallel and waits until all have completed.
Usage: ParExec [/par:[mm,]nn] [/v[v]] { [/a | /i] [/c | /e] [/mode:m] COMMAND }
Global modifiers:
/par:mm,nn Start the first mm commands immediately. The remaining commands
are executed in a way that no more than nn of them are running
at any time. For nn the special value 'cpu' (lower case, without
quotes) can be used instead of a decimal value to represent the
number of CPUs installed in the computer.
/par:nn short form of /par:0,nn
/v verbose: Writes all commands to STDERR when started.
/vv very verbose: Also writes time stamps for start end end of
each command and the exit code.
Modifiers valid for all commands that follow them:
/i ignore errors (error starting process or exit code > 0)
/a abort (do not execute any new commands) on errors
/l execute the command in the IDLE priority class
/b execute the command in the BELOWNORMAL priority class
/n do not set the priority class
/c execute the command through the command shell
/e execute the specified exe-file directly
/mode:m m=normal: the created process shares the same console window.
m=newwindow: a new window is created for the command.
m=hidden: a hidden window is created for the command.
m=detached: creates a 'detached' process.
COMMAND:
COMMAND can be any valid command for the command shell (cmd.exe on NT/Win2k
or command.com on Win 9x) when used with "/c". It must be quoted when it
contains spaces or I/O redirection. (Be careful with quotation marks inside
a quoted command!)
An exe-file with optional parameters must be specified for COMMAND when used
with "/e".
When the COMMAND starts with @ followed (without a space) by a file name of
a text file (ANSI), the commands are read from that file. (one command per
line)
Defaults:
/par:0,60 /a /c /n /mode:normal
Environment variables:
Use PAREXEC_FORCE_SERIAL=1 to force a serial execution of all commands.
Use PAREXEC_SET_AFFINITY=1 to optimize performance on Windows 2000
Machines with Hyperthreading enabled CPUs.
Notes:
/par:mm,nn is useful when some commands are CPU bound and some are not.
You should place the commands that are not CPU bound first and specify the
number of them as mm. For nn the value 'cpu' should be used, because it
makes no sense to execute more CPU bound processes at a time than there
are CPUs in the machine.
The implementation limits the sum of mm and nn to 60.
|
|