Using and Administering

ll_control Subroutine

Purpose

This subroutine allows an application program to perform most of the functions that are currently available through the standalone commands: llctl, llfavorjob, llfavoruser, llhold, and llprio.

Library

LoadLeveler API library libllapi.a

Syntax

#include "llapi.h"
 
int ll_control(int control_version, enum LL_control_op control_op, 
char **host_list,char **user_list, char **job_list, char **class_list,
int priority);

Parameters

int control_version
An integer indicating the version of ll_control being used. This argument should be set to LL_CONTROL_VERSION.

enum LL_control_op
The control operation to be performed. The enum LL_control_op is defined in llapi.h as:
enum LL_control_op {
LL_CONTROL_RECYCLE, LL_CONTROL_RECONFIG, LL_CONTROL_START, LL_CONTROL_STOP,
LL_CONTROL_DRAIN, LL_CONTROL_DRAIN_STARTD, LL_CONTROL_DRAIN_SCHEDD, 
LL_CONTROL_PURGE_SCHEDD, LL_CONTROL_FLUSH, LL_CONTROL_SUSPEND,
LL_CONTROL_RESUME, LL_CONTROL_RESUME_STARTD, LL_CONTROL_RESUME_SCHEDD,
LL_CONTROL_FAVOR_JOB, LL_CONTROL_UNFAVOR_JOB, LL_CONTROL_FAVOR_USER,
LL_CONTROL_UNFAVOR_USER, LL_CONTROL_HOLD_USER, LL_CONTROL_HOLD_SYSTEM,
LL_CONTROL_HOLD_RELEASE, LL_CONTROL_PRIO_ABS, LL_CONTROL_PRIO_ADJ }; 
 

char **host_list
A NULL terminated array of host names.

char **user_list
A NULL terminated array of user names.

char **job_list
A NULL terminated array of job names. The job name that an element of job_list points to is a character string with one of the following formats: "host.jobid.stepid," "jobid.stepid," "jobid". host is the name of the machine to which the job was submitted (the default is the local machine), jobid is the job ID assigned to the job by LoadLeveler, and stepid is the job step ID assigned to a job step by LoadLeveler (the default is to include all the steps of a job).

char **class_list
A NULL terminated array of class names.

int priority
An integer representing the new absolute value of user priority or adjustment to the current user priority of job steps.

Description

The ll_control subroutine performs operations that are essentially equivalent to those performed by the standalone commands: llctl, llfavorjob, llfavoruser, llhold, and llprio. Because of this similarity, descriptions of the ll_control operations are grouped according to the standalone command they resemble.

llctl type of operations

These are the ll_control operations which mirror operations performed by the llctl command. This summary includes a brief description of each of the allowed llctl types of operations. For more information on the llctl command, see llctl - Control LoadLeveler Daemons.

LL_CONTROL_START:
Starts the LoadLeveler daemons on the specified machines. The calling program must have rsh privileges to start LoadLeveler daemons on remote machines.

LL_CONTROL_STOP:
Stops the LoadLeveler daemons on the specified machines.

LL_CONTROL_RECYCLE:
Stops, and then restarts, all of the LoadLeveler daemons on the specified machines.

LL_CONTROL_RECONFIG:
Forces all of the LoadLeveler daemons on the specified machines to reread the configuration files.

LL_CONTROL_DRAIN:
When this operation is selected, the following happens: (1) No LoadLeveler jobs can start running on the specified machines, and (2) No LoadLeveler jobs can be submitted to the specified machines.

LL_CONTROL_DRAIN_SCHEDD:
No LoadLeveler jobs can be submitted to the specified machines.

LL_CONTROL_DRAIN_STARTD:
Keeps LoadLeveler jobs from starting on the specified machines. If a class_list is specified, then the classes specified will be drained (made unavailable). The literal string "allclasses" can be used as an abbreviation for all of the classes.

LL_CONTROL_FLUSH:
Terminates running jobs on the specified machines and send them back to the negotiator to await redispatch (if restart=yes).

LL_CONTROL_PURGE_SCHEDD:
Purges the specified schedd host's job queue; a host_list consisting of one host name must be specified.

LL_CONTROL_SUSPEND:
Suspends all jobs on the specified machines. This operation is not supported for parallel jobs.

LL_CONTROL_RESUME:
Resumes job submission to, and job execution on, the specified machines.

LL_CONTROL_RESUME_STARTD:
Resumes job execution on the specified machines; if a class_list is specified, then execution of jobs associated with these classes is resumed.

LL_CONTROL_RESUME_SCHEDD:
Resumes job submission to the specified machines.

For these llctl type of operations, the user_list, job_list, and priority arguments are not used and should be set to NULL or zero. The class_list argument is meaningful only if the operation is LL_CONTROL_DRAIN_STARTD, or LL_CONTROL_RESUME_STARTD. If class_list is not being used, then it should be set to NULL. If host_list is NULL, then the scope of the operation is all machines in the LoadLeveler cluster. Unlike the standalone llctl command, where the scope of the operation is either global or one host, ll_control operations allow the user to specify a list of hosts (through the host_list argument). To perform these operations, the calling program must have LoadLeveler administrator authority.

llfavorjob type of operations

The llfavorjob type of control operations are: LL_CONTROL_FAVOR_JOB, and LL_CONTROL_UNFAVOR_JOB. For these operations, the user_list, host_list, class_list, and priority arguments are not used and should be set to NULL or zero. LL_CONTROL_FAVOR_JOB is used to set specified job steps to a higher system priority thatn all job steps that are not favored. LL_CONTROL_UNFAVOR_JOB is used to unfavor previously favored job steps, restoring the original priorities. The calling program must have LoadLeveler administrator authority to perform these operations.

llfavoruser type of operations

The llfavoruser type of control operations are: LL_CONTROL_FAVOR_USER, and LL_CONTROL_UNFAVOR_USER. For these operations, the host_list, job_list, class_list, and priority arguments are not used and should be set to NULL or zero. LL_CONTROL_FAVOR_USER sets jobs of one or more users to the highest priority in the system, regardless of the current setting. Jobs already running are not affected. LL_CONTROL_UNFAVOR_USER is used to unfavor previously favored user's jobs, restoring the original priorities. The calling program must have LoadLeveler administrator authority to perform these operations.

llhold type of operations

The llhold type of control operations are: LL_CONTROL_HOLD_USER, LL_CONTROL_HOLD_SYSTEM, and LL_CONTROL_HOLD_RELEASE. For these operations, the class_list and priority arguments are not used, and should be set to NULL or zero. LL_CONTROL_HOLD_USER and LL_CONTROL_HOLD_SYSTEM place jobs in user hold and system hold, respectively. LL_CONTROL_HOLD_RELEASE is used to release jobs from both types of hold. The calling program must have LoadLevler administrator authority to put jobs into system hold, and to release jobs from system hold. If a job is in both user and system holds then the LL_CONTROL_HOLD_RELEASE operation must be performed twice to release the job from both types of hold. If the user is not a LoadLeveler administrator then the llhold types of operations have no effect on jobs that do not belong to him/her.

llprio type of operations

The llprio type of control operations are: LL_CONTROL_PRIO_ABS, and LL_CONTROL_PRIO_ADJ. For these operations, the user_list, host_list, and class_list arguments are not used, and should be set to NULL. llprio type of operations change the user priority of one or more job steps in the LoadLeveler queue. LL_CONTROL_PRIO_ABS specifies a new absolute value of the user priority, and LL_CONTROL_PRIO_ADJ specifies an adjustment to the current user priority. The valid range of LoadLeveler user priorities is 0-100 (inclusive); 0 is the lowest possible priority, and 100 is the highest. The llprio type of operations have no effect on a running job step unless this job step returns to Idle state. If the user is not a LoadLeveler administrator, then an llprio type of operation has no effect on jobs that do not belong to him/her.

Return Values

0
The specified command has been sent to the appropriate LoadLeveler daemon.

-2
The specified command cannot be sent to the central manager.

-3
The specified command cannot be sent to one of the LoadL_master daemons.

-4
ll_control encountered an error while processing the administration or configuration file.

-6
A data transmission failure has occurred.

-7
The calling program does not have LoadLeveler administrator authority.

-19
An incorrect ll_control version has been specified.

-20
A system error has occurred.

-21
The system cannot allocate memory.

-22
An invalid control_op operation has been specified.

-23
The job_list argument contains one or more errors.

-24
The host_list argument contains one or more errors.

-25
The user_list argument contains one or more errors.

-26
Incompatible arguments have been specified for HOLD operation.

-27
Incompatible arguments have been specified for PRIORITY operation.

-28
Incompatible arguments have been specified for FAVORJOB operation.

-29
Incompatible arguments have been specified for FAVORUSER operation.

-30
An error occurred while ll_control tried to start a child process.

-31
An error occurred while ll_control tried to start the LoadL_master daemon.

-32
An error occurred while ll_control tried to execute the llpurgeschedd command.

-33
The class_list argument contains incompatible information.

-34
ll_control cannot create a file in the /tmp directory.

-35
LoadLeveler has encountered miscellaneous incompatible input specifications.

Related Information

Commands: llprio, llhold, llfavoruser,llfavorjob,llctl.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]