pexec

The main purpose of the program pexec is to execute the given command or shell script (e.g. parsed by /bin/sh) in parallel on the local host or on remote hosts, while some of the execution parameters, namely the redirected standard input, output or error and environmental variables can be varied. This program is therefore capable to replace the classic shell loop iterators (e.g. for ~ in ~ done in the Bourne shell) by executing the body of the loop in parallel. Thus, the program `pexec` implements shell level data parallelism in a very simple form. The capabilities of the program is extended with additional features, such as allowing to define mutual exclusions, do atomic command executions and implement higher level resource and job control.

The given program or script is executed as many times as how many parameters are specified in the command line or read from a given parameter file. Each parameter is a simple string which can be used either to pass to the program/script as the value of an environmental variable or it can be used in the format of the file names where the standard input, output or error are optionally redirected from or to.

Moreover, more than one shell command script can also be passed to parallel execution, in this case there is no need for parameters or the number of the parameters taken from command line (or read from a parameter file) must be the same as the number of the distinct shell command scripts.

The program is capable to automatically swallow the standard output and error (to /dev/null), or collecting them via pipes and dump to the invoker's standard output or error (with optional line headers or trailers which can be used to distinguish between the output of the distinctive processes).

The execution on remote hosts is done using a remote shell which both builds a tunnel between the invoking and the remote host(s) and do the authentication and ensures the security (if a secure remote shell is used). Hence, there is no need to run standalone daemons on the remote side: the remote shell itself executes the `pexec` program in daemon mode when the standard input and output of the latter is bound to the remote shell to form a (secure and authenticated) tunnel.

In order to avoid unexpected I/O load or to synchronize individual tasks, pexec supports mutual exclusions (mutexes) and atomic command executions. The maximum number of simultaneous tasks can be controlled by a hypervisor daemon: with such a daemon, concurrent pexec instances can be launched without an unexpectedly high load.

Releases

Official releasesDateSizeLinksStatus
1.0-rc32008-Oct-2060.25 KBThis release is not supported and may no longer work.