cl_multirun - execute a command on multiple input files


Synopsis:

usage: cl_multirun [options] prog input1 input2 ...
     -s file             read program set from file
     -q                  quiet operation (no stdout)
     -t                  test only, print commands but don't execute
     -v                  verbose output
     -V                  really verbose output


Description:
The cl_multirun command is used to run a Unix command or program on multiple input files, using multiple machines, in a semi-intelligent way. Note that each machine will run exactly the same command, but each will be given a different input file.

cl_multirun is a Perl script that simply automates the process of rsh-ing to the remote machines and executing the command there.

Note that the command to be run should expect exactly one input argument which will be the input file name for that run. Likewise, do not expect to have stdin connected at any time -- all input for the program, including filenames for data, filenames for output, input settings, program parameters, etc., should be read from the file specified in ARGV[1]. In C, for example, you should have something like:

	int main( int argc, char** argv ) {
		char* datafile = "default.txt";
		FILE* fp;

		if( argc > 1 ) {
			datafile = ARGV[1];
		} else {
			/* ERROR!! or use "default.txt"? */
		}

		fp = fopen( datafile, "r" );

		/* etc... */
	}
For Fortran (at least Absoft Fortran), try something like:
	program main
		integer argc
		character datafile*256

		argc = iargc()
		if( argc > 1 ) then
			call getarg( 1, datafile )
		else
			call my_exit_routine
		endif

		/* datafile now has the filename */
	end

The cl_multirun script will then call the specified program for each of the input files listed on the command line and/or in the file specified by -s. For example:

	% cl_multirun -m foo,bar myprog input1 input2 input3
will actually run myprog three times, essentially:
	% myprog input1
	% myprog input2
	% myprog input3
however, it will run these 3 instances on the machines foo and bar. The third input file will be run on whichever machine completes first.


Options:
The -s option reads a text file and adds its contents to the input file set. The file should have one filename per line.


RCSID $Id: cl_multirun.html,v 1.2 2002/03/12 14:11:18 jpormann Exp $