Knowledge Center         Contents    Previous  Next    
Platform Computing Corp.

lsb_postjobmsg()

Sends messages and data posted to a job.

DESCRIPTION

Use lsb_postjobmsg() to post a message and data to a job, open a TCP connection, and transfer attached message and data from the mbatchd. Use lsb_readjobmsg() to display messages and copy data files posted by lsb_postjobmsg().

While you can post multiple messages and attached data files to a job, you must call lsb_postjobmsg() for each message and attached data file you want to post. By default, lsb_postjobmsg() posts a message to position 0 of the message index (msgId) (see PARAMETERS) of the specified job. To post additional messages to a job, call lsb_postjobmsg() and increment the message index .

lsb_readjobmsg() reads posted job messages by their position in the message index.

If a data file is attached to a message and the flag EXT_ATTA_POST is set, use the JOB_ATTA_DIR parameter in lsb.params(5) to specify the directory where attachment data fies are saved. The directory must have at least 1MB of free space. The mbatchd checks for available space in the job attachment directory before transferring the file.

Use the MAX_JOB_ATTA_SIZE parameter in lsb.params(5) to set a maximum size for job message attachments.

Users can only send messages and data from their own jobs. Root and LSF administrators can also send messages of jobs submtted by other users, but they cannot attach data files to jobs owned by other users.

You can post messages and data to a job until it is cleaned from the system. You cannot send messages and data to finished or exited jobs.

SYNOPSIS

#include <lsf/lsbatch.h>
#include <time.h> 
int lsb_readjobmsg(struct jobExternalMsgReq *jobExternalMsg, 
                   char *filename) 
struct jobExternalMsgReq {
    int options;
    LS_LONG_INT jobId;
    int msgIdx;
    char *desc;
    int userId;
    long dataSize;
    time_t postTime;
    int dataStatus;
}; 

PARAMETERS

filename

Name of attached data file. If no file is attached, use NULL.

jobExternalMsg

This structure contains the information required to define an external message of a job.

options

Specifies if the message has an attachment to be posted.

<lsf/lsbatch.h> defines the following flags constructed from bits. These flags correspond to the options.

EXT_MSG_POST

Post an external job message. Don't attach a data file.

EXT_ATTA_POST

Post an external job message. Attach a data file.

When the message is read by lsb_readjobmsg(), if a data file is not attached, the error message "The attached data of the message is not available" is displayed, and the external job message is displayed.

jobId

The system generated job Id of the job.

msgIdx

The message index. A job can have more than one message. Use msgIdx in an array to index messages. The default is position 0.

desc

The text of the message.

userId

The userId of the author of the message.

dataSize

The size of the data file. If no data file is attached, the size is 0.

postTime

The time the author posted the message.

dataStatus

The status of the attached data file.

RETURN VALUES

integer:value

The successful function returns a socket number.

integer:0

The EXT_ATTA_POST bit of options is not set or there is no attached data.

integer:-1

The function failed.

ERRORS

If the function fails, lserrno is set to indicate the error.

SEE ALSO

Related APIs

lsb_readjobmsg() - Reads messages and data posted to a job

Equivalent line command

bpost

Files

lsb.params

JOB_ATTA_DIR

LSB_SHAREDIR/info/


Platform Computing Inc.
www.platform.com
Knowledge Center         Contents    Previous  Next