C H A P T E R  6

Killing or Sending Signals to Programs With mpkill


What You Can Do

To Perform This Task

Use This Option

How to kill a running program

mpkill

How to remove all traces of a job

-C

How to display a list of signals

-l -d

How to send a signal to a job

-signal


Return Values

The mpkill command returns these values:


procedure icon  How to Kill a Running Program

To kill a running program, use the mpkill command and the program's job ID:

% mpkill jid

The mpkill command stops all the processes associated with the Job ID.

The job ID now begins with the name of the resource manager (cre, lsf, pbs, or sge). For example: lsf.1289. To obtain a program's job ID, use the mpps command, described in How to Display Information About Individual Jobs (-J).


procedure icon  How to Remove All Traces of a Job

If you have killed a job but it continues to appear in the output of the mpps command (described in Chapter 7), log in as root to the master node and invoke the mpkill command with the -C option and the jid.

% mpkill -C jid

The -C option purges the job from the CRE database, including unpublishing names associated with the job.



Note - Processes spawned in the ClusterTools Runtime Environment are not killed by the mpkill or kill commands so long as they have (spawned) child processes running. To remove the parent process, you must first remove all of its child processes.




procedure icon  How to Display a List of Supported Signals
(-l -d)

To simply list the supported signals, use the -l option.

% mpkill -l

To display a list with brief descriptions, use the -d option.

% mpkill -d


procedure icon  How to Send a Signal to a Job

To send a signal to a job, use this syntax:

% mpkill -signal jid

For example:

% mpkill -CONT sge.59

The example above sends a SIGCONT signal to the processes of the program whose job ID is sge.59.

Issuing mpkill without specifying a signal sends a SIGTERM to the job.Command Reference (mpkill)

TABLE 6-1 Options for mpkill

Command

Description

none

Stop all processes associated with a particular job

-C

Remove all traces of a job, including unpublished names, from the CRE database

-l

Display a list of supported signals

-d

Display a descriptive list of supported signals

-signal

Send a signal to a job