Platform LSF batch applications

Before accessing any of the LSF batch services, an application must initialize LSBLIB. An application does this by calling lsb_init().

lsb_init() function

lsb_init() has the following parameter:

char *appName

On success, lsb_init() returns 0. On failure, it returns -1 and sets lsberrno to indicate the error.

The parameter appName is the name of the application. Use appName to log detailed messages about the transactions inside LSLIB for debugging purpose. If LSB_CMD_LOG_MASK is defined as LOG_DEBUG1, the messages will be logged.

Messages are logged in LSF_LOGDIR/appname. If appname is NULL, the log file is LSF_LOGDIR/bcmd.

Example

Here is an example of code showing the usage of this function:

/* Include <lsf/lsbatch.h> when using this function */
if (lsb_init(argv[0]) < 0) {
        lsb_perror("simbsub: lsb_init() failed");
        exit(-1);
}
lsb_perror()

The function lsb_perror(char *usrMsg) prints a batch LSF error message on stderr. The user message usrMsg is printed, followed by a colon (:) and the batch error message corresponding to lsberrno.