Totalview® for HPC Reference Guide : PART I Using the CLI : Chapter 2 CLI Commands : drun
drun
Starts or restarts processes
Format 
drun [ cmd_arguments ] [ in_operation infile ] [ out_operations outfile ] [ error_operations errfile ]
Arguments 
cmd_arguments
The argument list passed to the process.
in_operation
Names the file from which the CLI reads input.
< infile
Reads from infile instead of stdin. infile indicates a file from which the launched process reads information.
out_operations
Names the file to which the CLI writes output. In the following, outfile indicates the file into which the launched processes writes information.
> outfile
Sends output to outfile instead of stdout.
>& outfile
Sends output and error messages to outfile instead of stdout and stderr.
>>& outfile
Appends output and error messages to outfile.
>> outfile
Appends output to outfile.
error_operations
Names the file to which the CLI writes error output. In the following, errfile indicates the file into which the launched processes writes error information.
2> errfile
Sends error messages to errfile instead of stderr.
2>> errfile
Appends error messages to errfile.
Description 
The drun command launches each process in the current focus and starts it running. The CLI passes the command arguments to the processes. You can also indicate I/O redirection for input and output information. Later in the session, you can use the drerun command to restart the program.
The arguments to this command are similar to the arguments used in the Bourne shell.
In addition, the CLI uses the following variables to hold the default argument list for each process:
ARGS_DEFAULT
The CLI sets this variable if you use the -a command-line option when you started the CLI or TotalView. (This option passes command-line arguments that TotalView uses when it invokes a process.) This variable holds the default arguments that TotalView passes to a process when the process has no default arguments of its own.
ARGS(dpid)
An array variable that contains the command-line arguments. The index dpid is the process ID. This variable holds a process’s default arguments. It is always set by the drun command, and it also contains any arguments you used when executing a drerun command.
If more than one process is launched with a single drun command, each receives the same command-line arguments.
In addition to setting these variables by using the -a command-line option or specifying cmd_arguments when you use this or the drerun command, you can modify these variables directly with the dset and dunset commands.
You can only use this command to tell TotalView to execute initial processes, because TotalView cannot directly run processes that your program spawns. When you enter this command, the initial process must have terminated; if it was not terminated, you are told to kill it and retry. (You could, use the drerun command instead because the drerun commands first kills the process.)
The first time you use the drun command, TotalView copies arguments to program variables. It also sets up any requested I/O redirection. If you re-enter this command for processes that TotalView previously started—or use it when you use the dattach command to attach to a process—the CLI reinitializes your program.
Issues When Using Starter Programs
Starter programs such as poe or aprun and the CLI can interfere with one another because each believes that it owns stdin. Because the starter program is trying to manage stdin on behalf of your processes, it continually reads from stdin, acquiring all characters that it sees. This means that the CLI never sees these characters. If your target process does not use stdin, you can use the -stdinmode noneoption. Unfortunately, this option is incompatible with poe -cmdfileoption that is used when specifying -pgmmodel mpmd.
If you encounter these problems, try redirecting stdin within the CLI; for example:
drun < in.txt
Command alias 
Alias
Definition
Description
r
drun
Starts or restarts processes
Examples 
drun
Begins executing processes represented in the current focus.
f {p2 p3} drun
Begins execution of processes 2 and 3.
f 4.2 r
Begins execution of process 4. This is the same as f 4 drun.
dfocus a drun
Restarts execution of all processes known to the CLI. If they were not previously killed, you are told to use the dkill command and then try again.
drun < in.txt
Restarts execution of all processes in the current focus, setting them up to get standard input from in.txt file.
Related Topics
Starting Processes and Threads
Command Arguments in the “Using the Command Line Interface (CLI)” chapter
Process > Startup Parameters
drerunCommand
dgoCommand