This appendix lists all the LSF API functions for your reference. Many of the functions listed below are not documented in this guide, but are described in detail in the on-line man pages. See lslib(3)
and lsblib(3)
for details of these functions.
These are the function calls provided by the LSF base system API. The function calls are listed by service categories.
struct lsInfo *ls_info(void)
Get cluster-wide configuration information.
char *ls_getclustername(void)
Get the name of the local cluster.
char *ls_getmastername(void)
Get the name of the master host.
float *ls_getmodelfactor(char *modelname)
Get the CPU factor of the given host model.
char *ls_gethosttype(char *hostname)
Get the host type of the given host.
char *ls_gethostmodel(char *hostname)
Get the host model of the given host.
float *ls_gethostfactor(char *hostname)
Get the CPU factor of the given host.
struct hostInfo *ls_gethostinfo(char *resreq, int *numhosts,
char **hostlist, int listsize, int options)
Get host related configuration information.
int ls_readconfenv(struct config_param *paramList,
Get the variables defined in
char *confPath)lsf.conf
.
struct hostLoad *ls_load(char *resreq, int *numhosts,
int options, char *fromhost)
Get load information of qualified hosts, simple version.
struct hostLoad *ls_loadinfo(char *resreq, int *numhosts,
int options, char *fromhost, char **hostlist,
int listsize, char ***indxnamelist)
Get load information of qualified hosts, generic version.
struct hostLoad *ls_loadofhosts(char *resreq, int *numhosts,
int options, char *fromhost, char **hostlist,
int listsize)
Get load information of the qualified hosts from the given list of hosts.
struct hostLoad *ls_loadoftype(char *resreq, int *numhosts,
int options, char *fromhost, char *hosttype)
Get load information about hosts of the given host type.
char **ls_placereq(char *resreq, int *numhosts, int options,
char *fromhost)
Get the best qualified hosts.
char **ls_placeofhosts(char *resreq, int *numhosts,
int options, char *fromhost, char **hostlist,
int listsize)
Get the best qualified hosts from the given list of hosts.
char **ls_placeoftype(char *resreq, int *numhosts, int options,
char *fromhost, char *hosttype)
Get the best qualified hosts with the given host type.
int ls_loadadj(char *resreq, struct placeInfo *hostlist,
int listsize)
Adjust the load of the given host(s).
char *ls_resreq(char *task)
Get resource requirements of task in the remote task list.
int ls_eligible(char *task, char *resreqstr, char mode)
Get resource requirements oftask
in the task list indicated bymode
.
int ls_insertrtask(char *task)
Inserttask
into the remotetask
list.
int ls_insertltask(char *task)
Inserttask
into the local task list.
int ls_deletertask(char *task)
Removetask
from the remote task list.
int ls_deleteltask(char *task)
Removetask
from the local task list.
int ls_listrtask(char ***taskList, int sortflag)
Get all tasks in the remote task list.
int ls_listltask (char ***taskList, int sortflag)
Get all tasks in the local task list.
These functions are subject to the authentication protocols described in `Authentication' on page 17.
int ls_initrex(int numPorts, int options)
Initialize for remote execution or file operation.
int ls_connect(char *hostname)
Establish a connection with a remote RES.
int ls_rexecv(char *host, char **argv, int options)
Remoteexecv(2).
Executeargv
onhost
with the local environment.
int ls_rexecve(char *host, char **argv, int options,
Remote
char **envp)execve(2)
. Executeargv
onhost
with the given environment.
int ls_rtask(char *host, char **argv, int options)
Startargv
on host with local environment.
int ls_rtaske(char *host, char **argv, int options,
Start
char **envp)argv
onhost
with the given environment.
int ls_rwait(LS_WAIT_T *status, int options, struct rusage *ru)
Remotewait(2)
.
int ls_rwaittid(int tid, LS_WAIT_T *status, int options,
Remote
struct rusage *ru)waitpid
(2
).
int ls_rkill(int tid, int sig)
Remotekill(2)
.
int ls_rsetenv(char *host, char **envp)
Reset the environment for remote tasks onhost
..
int ls_chdir(char *host, char *clntdir)
Set the working directory for remote tasks onhost
..
int ls_stoprex(void)
Inform the NIOS to suspend itself and restore local tty settings.
These functions are subject to the authentication protocols described in `Authentication' on page 17.
int ls_ropen (char *host, char *fn, int flags, int mode)
Remoteopen(2)
onhost
.
int ls_rclose(int rfd)
Remoteclose(2
) onhost
.
int ls_rwrite(int rfd, char *buf, int len)
Remotewrite(2)
onhost
.
int ls_rread(int rfd, char *buf, int len)
Remoteread(2)
onhost
.
off_t ls_rlseek(int rfd, off_t offset, int whence)
Remote lseek(2)
onhost
.
int ls_rfstat(int rfd, struct stat *buf)
Remotefstat(2)
onhost
.
int ls_rstat(char *host, char *fn, struct stat *buf)
Remotestat(2)
onhost
.
int ls_getmnthost(char *file)
Returns the host name of the file server forfile
.
char *ls_rgetmnthost(char *host, char *file)
Return the host name of the file server forfile
onhost
.
int ls_rfcontrol(int command, int arg)
Control the behavior of remote file operations.
int ls_lockhost(time_t duration)
Set LIM status of the local host to "locked" forduration
seconds. The application must be a setuid to root program to use this function.
int ls_unlockhost(void)
Cancel a previous lock operation. The application must be a setuid to root program to use this function.
int ls_limcontrol(char *hostname, int opCode)
Perform a LIM administration operation as specified byopCode
. The application must be a setuid to root program to use this function.
int ls_rescontrol(char *host, int opCode, int options)
Perform a RES administrative operation as specified byopCode
. The use of this function is subject to authentication protocols described in `Authentication' on page 17.
void ls_perror(char *usrMsg)
PrintusrMsg
followed by the LSLIB error message associated withlserrno
.
char *ls_sysmsg(void)
Return the LSLIB error message associated withlserrno
.
void ls_errlog(FILE *fp, const char *fmt, ...)
Logging an LSLIB error message with time stamp.
int ls_fdbusy(int fd)
Test if a file descriptorfd
is in use or reserved by LSF.
These are function calls provided by the LSF Batch system API. The functions are listed by service categories.
lsb_init(char *appName)
Initialize an LSF Batch application.
struct groupInfoEnt *lsb_hostgrpinfo(char **groups,
int *numGroups, int options)
Get membership of the LSF Batch host groups.
struct groupInfoEnt *lsb_usergrpinfo(char **groups,
int *numGroups, int options)
Get membership of the LSF Batch user groups.
struct parameterInfo *lsb_parameterinfo(char **names,
int *numUsers, int options)
Get the LSF Batch cluster parameters.
struct hostInfoEnt *lsb_hostinfo(char **hosts, int *numHosts)
Get information about the LSF Batch server hosts or host groups.
struct userInfoEnt *lsb_userinfo(char **users, int *numUsers)
Get system information about the LSF Batch users and user groups.
struct hostPartInfoEnt *lsb_hostpartinfo(char **hostParts,
int *numHostParts)
Get information about the LSF Batch host partitions.
.struct queueInfoEnt *lsb_queueinfo(char **queues,
int *numQueues, char *host, char *userName, int options)
Get information about the LSF Batch queues.
These functions are subject to the authentication protocols described in `Authentication' on page 17.
int lsb_submit(struct submit *jobSubReq,
struct submitReply *jobSubReply)
Submit a job to the LSF Batch system.
int lsb_modify(struct submit *jobSubReq,
struct submitReply *jobSubReply, int jobId)
Change the attributes of an already submitted job.
int lsb_signaljob(int jobId, int sigValue)
Send jobjobId
signalsigValue
.
int lsb_chkpntjob (int jobId, time_t period, int options)
Checkpoint the jobjobId
.
int lsb_deletejob (int jobId, int times, int options)
Delete a calendar-driven job.
int lsb_mig(struct submig *mig, int *badHostIdx)
Migrate a job from one host to another.
int lsb_movejob(int jobId, int *position, int opCode)
Change the position of a pending job within its queue.
int lsb_switchjob(int jobId, char *queue)
Switch a jobjobId
to queuequeue
.
int lsb_openjobinfo(int jobId, char *jobName, char *user,
Open a job information stream for the matching job(s) with
char *queue, char *host, int options)mbatchd
.
struct jobInfoEnt *lsb_readjobinfo(int *more)
Read a job record from the opened job information stream.
void lsb_closejobinfo(void)
Close a job information stream.
char *lsb_suspreason(int reasons, int subreasons,
struct loadIndexLog *ld)
Convert suspending reason codes into text.
char *lsb_pendreason(int reasons, int subreasons,
struct loadIndexLog *ld)
Convert pending reason codes into text.
char *lsb_peekjob(int jobId)
Get the name of the job's buffered output file. This function is subject to the authentication protocols described in `Authentication' on page 17.
struct eventRec *lsb_geteventrec(FILE *log_fp, int *lineNum)
Read an event record from the opened log file.
These functions are subject to the authentication protocols described in `Authentication' on page 17.
int lsb_reconfig(void)
Reconfigure the LSF Batch system using the current configuration files.
int lsb_hostcontrol(char *host, int opCode)
Open, closehost
for batch jobs, or restart, shut downsbatchd
onhost
.
int lsb_queuecontrol(char *queue, int opCode)
Change the status of an LSF Batch queue.
These functions can be used only if the LSF JobScheduler component is enabled.
int lsb_calendarop(int opCode, int numNames, char **names,
char *desc, char *timeEvents, int options, char **badStr)
Add, modify, or delete a calendar.
struct calendarInfoEnt *lsb_calendarinfo(char **calendars,
int *numCalendars, char *user)
Get calendar information.
void lsb_perror(char *usrMsg)
Print the LSBLIB error message associated withlsberrno
together withusrMsg
.
char *lsb_sysmsg (void)
Return the LSBLIB error message associated withlsberrno
.