Sun MPI 4.0 User's Guide: With CRE

Specifying a Different Argument Vector

By default, mprun passes the vector of a program's command-line arguments to the program in the standard way. For example, if you issue the command

% mprun a.out arg1 arg2

mprun passes an array in which the name of the program, a.out, is the first element (argv[0]), and arg1 and arg2 are the second and third elements.

In cluster-level programming, it is sometimes useful to specify an argv[0] that is not the name of the program. You can use the -A option to do this. The argument to -A is the name of the program to be executed. You can then follow this with an argument of your choice in the arg0 position. For example, if you want to pass newarg as the argv[0] to the program a.out, along with arg1 and arg2, you could issue the command

% mprun -A a.out newarg arg1 arg2