next up previous contents
Next: Debugging tools Up: Compiling and Running Parallel Previous: Running The Programs:   Contents

Process diagnostics:

Since the parallel programs you write will spawn processes, it would be interesting to know how these processes are perfoming in the environment. IRIX ( and other UNIX versions) provide certain tools which can help us to perform process diagnostics.

Note that everything in the IRIX is a process. It is really a process which is showing you the hydra prompt and waiting for next input from the user. Also some processes are under user control others are not. This is to prevent malicious use of processes.

  1. ps command

    If you type ps at the hydra command prompt and type enter you get a list of processes which belong to you and are currently alive.

    If you type ps -ef at the prompt you get a complete listing of all the processes currently alive in the system which will not all belong to you. Some are system processes while others are those initiated by other users.

    To isolate processes while using ps -ef which belong to you use the following format ps -ef grep your_userid

    e.g ps -u user_id

    This will sometimes have the same effect as the usual ps command.

    In the output of the above commands we specifically get information about the process id which is of importance to us. Try to identify the pids of the processes by refering the corresponding command cols. Refer to the man pages for an explanation of other details shown.

  2. kill command

    The kill command can be used to terminate processes you identified using ps, because of a variety of reasons, primarily because they are erroneous, requiring debugging.

    To use kill first obtain the process ids using ps by matching the PID column with the COMMAND column. Assuming that you have a PID of a process which you want to kill, type in the following command and press enter

    kill -9 PID

    The -9 option stands for sure kill. Others are discussed in the man pages.

    To kill processes which have spawned by a program perform the following steps

    a) Run the main program in background process mode. For example prog &

    b) Use ps to identify the process PIDs.

    c) Use the kill command to kill the processes identified.

  3. top command

    The top command displays information about the top cpu processes alive at anytime. To use top, type top at the hydra prompt and press enter. Type q to quit. Top displays the top 30 processes and ranks them according to raw cpu percentage usage.

    Read the man pages to get more details on ps, kill and top.


next up previous contents
Next: Debugging tools Up: Compiling and Running Parallel Previous: Running The Programs:   Contents
Sushil Prasad 2004-09-16