Knowledge Center         Contents    Previous  Next    
Platform Computing Corp.

lsb_puteventrec()

Puts information of an eventRec structure pointed to by logPtr into a log file.

DESCRIPTION

lsb_puteventrec() puts information of an eventRec structure pointed to by logPtr into a log file. log_fp is a pointer pointing to the log file name that could be either event a log file or job log file.

See lsb_geteventrec() for detailed information about parameters.

SYNOPSIS

#include <lsf/lsbatch.h> 
int lsb_puteventrec(FILE *log_fp, struct eventRec *logPtr) 
 
struct eventRec { 
    char version[MAX_VERSION_LEN]; 
    int type; 
    time_t eventTime; 
    union eventLog eventLog; 
}; 
union  eventLog { 
    struct jobNewLog jobNewLog; 
    struct jobStartLog jobStartLog; 
    struct jobStatusLog jobStatusLog; 
    struct sbdJobStatusLog sbdJobStatusLog; 
    struct jobSwitchLog jobSwitchLog; 
    struct jobMoveLog jobMoveLog; 
    struct queueCtrlLog queueCtrlLog; 
    struct newDebugLog  newDebugLog; 
    struct hostCtrlLog hostCtrlLog; 
    struct mbdStartLog mbdStartLog; 
    struct mbdDieLog mbdDieLog; 
    struct unfulfillLog unfulfillLog; 
    struct jobFinishLog jobFinishLog; 
    struct loadIndexLog loadIndexLog; 
    struct migLog migLog; 
    struct calendarLog calendarLog; 
    struct jobForwardLog jobForwardLog; 
    struct jobAcceptLog jobAcceptLog; 
    struct statusAckLog statusAckLog; 
    struct signalLog signalLog; 
    struct jobExecuteLog jobExecuteLog; 
    struct jobMsgLog jobMsgLog; 
    struct jobMsgAckLog jobMsgAckLog; 
    struct jobRequeueLog jobRequeueLog; 
    struct chkpntLog chkpntLog; 
    struct sigactLog sigactLog; 
    struct jobOccupyReqLog jobOccupyReqLog; 
    struct jobVacatedLog jobVacatedLog; 
    struct jobExceptionLog jobExceptionLog; 
    struct jobCleanLog jobCleanLog; 
    struct Log jgrpNewLog; 
    struct jgrpCtrlLog jgrpCtrlLog; 
    struct jobForceRequestLog jobForceRequestLog; 
    struct logSwitchLog logSwitchLog; 
    struct jobModLog jobModLog; 
    struct jgrpStatusLog jgrpStatusLog; 
    struct jobAttrSetLog jobAttrSetLog;  
      struct jobExternalMsgLog jobExternalMsgLog; 
    struct jobChunkLog jobChunkLog; 
    struct sbdUnreportedStatusLog sbdUnreportedStatusLog; 
    struct rsvFinishLog rsvFinishLog; 
    struct cpuProfileLog cpuProfileLog; 
    struct dataLoggingLog dataLoggingLog; 
    struct jobRunRusageLog   jobRunRusageLog; 
    struct eventEOSLog       eventEOSLog; 
    struct slaLog            slaLog; 
    struct perfmonLog        perfmonLog; 
}; 
struct xFile { 
    char *subFn; 
    char *execFn; 
    int options; 
}; 
struct jobAttrSetLog {   /* Structure for log_jobattrset() and other calls */ 
    int       jobId; 
    int       idx; 
    int       uid; 
    int       port; 
    char      *hostname; 
}; 
struct logSwitchLog { /* Records of logged events */ 
    int lastJobId; 
}; 
struct dataLoggingLog {         /* Records of job cpu data logged event */ 
    time_t loggingTime; 
}; 
struct jgrpNewLog { 
    int    userId; 
    time_t submitTime; 
    char   userName[MAX_LSB_NAME_LEN]; 
    char   *depCond; 
    char   *timeEvent; 
    char   *groupSpec; 
    char   *destSpec; 
    int    delOptions; 
    int    delOptions2; 
    int    fromPlatform; 
    char   *sla; 
    int  maxJLimit; 
}; 
struct jgrpCtrlLog { 
    int    userId; 
    char   userName[MAX_LSB_NAME_LEN]; 
    char   *groupSpec; 
    int    options; 
    int    ctrlOp; 
}; 
struct jgrpStatusLog { 
    char   *groupSpec; 
    int    status; 
    int    oldStatus; 
}; 
struct jobNewLog {        /* logged in lsb.events when a job is submitted */ 
    int     jobId; 
    int     userId; 
    char    userName[MAX_LSB_NAME_LEN]; 
    int     options; 
    int     options2; 
    int     numProcessors; 
    time_t  submitTime; 
    time_t  beginTime; 
    time_t  termTime; 
    int     sigValue; 
    int     chkpntPeriod; 
    int     restartPid; 
    int     rLimits[LSF_RLIM_NLIMITS]; 
    char    hostSpec[MAXHOSTNAMELEN]; 
    float   hostFactor; 
    int     umask; 
    char    queue[MAX_LSB_NAME_LEN]; 
    char    *resReq; 
    char    fromHost[MAXHOSTNAMELEN]; 
    char    *cwd; 
    char    *chkpntDir; 
    char    *inFile; 
    char    *outFile; 
    char    *errFile; 
    char    *inFileSpool; 
    char    *commandSpool; 
    char    *jobSpoolDir;  
    char    *subHomeDir; 
    char    *jobFile; 
    int     numAskedHosts; 
    char    **askedHosts; 
    char    *dependCond; 
    char    *timeEvent; 
    char    *jobName; 
    char    *command; 
    int     nxf; 
    struct xFile *xf; 
    char    *preExecCmd; 
    char    *mailUser; 
    char    *projectName; 
    int     niosPort; 
    int     maxNumProcessors; 
    char    *schedHostType; 
    char    *loginShell; 
    char    *userGroup; 
    char    *exceptList; 
    int     idx; 
    int     userPriority; 
    char    *rsvId; 
    char    *jobGroup;  
    char    *extsched; 
    int     warningTimePeriod; 
    char    *warningAction; 
    char    *sla; 
    int     SLArunLimit; 
    char    *licenseProject; 
    int     options3; 
    char    *app; 
    char    *postExecCmd; 
    int     runtimeEstimation; 
    char    *requeueEValues; 
    int     initChkpntPeriod; 
    int     migThreshold; 
}; 
struct jobModLog { 
    char    *jobIdStr; 
    int     options; 
    int     options2; 
    int     delOptions; 
    int     delOptions2; 
    int     userId; 
    char    *userName; 
    int     submitTime; 
    int     umask; 
    int     numProcessors; 
    int     beginTime; 
    int     termTime; 
         int     sigValue; 
    int     restartPid; 
    char    *jobName; 
    char    *queue; 
    int     numAskedHosts; 
    char    **askedHosts; 
    char    *resReq; 
    int     rLimits[LSF_RLIM_NLIMITS]; 
    char    *hostSpec; 
    char    *dependCond; 
    char    *timeEvent; 
    char    *subHomeDir; 
    char    *inFile; 
    char    *outFile; 
    char    *errFile; 
    char    *command; 
    char    *inFileSpool; 
    char    *commandSpool; 
    int     chkpntPeriod; 
    char    *chkpntDir; 
    int     nxf; 
    struct  xFile *xf; 
    char    *jobFile; 
    char    *fromHost; 
    char    *cwd; 
    char    *preExecCmd; 
    char    *mailUser; 
    char    *projectName; 
    int     niosPort; 
    int     maxNumProcessors; 
    char    *loginShell; 
    char    *schedHostType; 
    char    *userGroup; 
    char    *exceptList; 
    int     userPriority; 
    char    *rsvId; 
    char    *extsched; 
    int     warningTimePeriod; 
    char    *warningAction; 
    char    *jobGroup; 
    char    *sla; 
    char    *licenseProject; 
    int     options3; 
    int     delOptions3; 
    char    *app; 
    char    *apsString; 
    char   *postExecCmd; 
    int      runtimeEstimation; 
}; 
struct jobStartLog { 
    LS_LONG_INT jobId; 
    int jStatus; 
    int jobPid; 
    int jobPGid; 
    float hostFactor; 
    int numExHosts; 
    char **execHosts; 
     char   *queuePreCmd;  
    char   *queuePostCmd;  
          int    jFlags; 
    char   *userGroup;  
    int    idx;  
    char   *additionalInfo;  
    int    duration4PreemptBackfill; 
};  
struct jobStartAcceptLog {  /* logged in lsb.events when a job start request is accepted 
*/ 
    int    jobId; 
    int    jobPid; 
    int    jobPGid; 
    int    idx; 
}; 
struct jobExecuteLog {   /* logged in lsb.events when a job is executed */ 
    int    jobId; 
    int    execUid; 
    char   *execHome; 
    char   *execCwd; 
    int    jobPGid; 
    char   *execUsername; 
    int    jobPid; 
    int    idx; 
    char   *additionalInfo; 
    int    SLAscaledRunLimit; 
    int    position; 
    char   *execRusage; 
   int    duration4PreemptBackfill; 
}; 
struct jobStatusLog { 
    int    jobId; 
    int    jStatus; 
    int    reasons; 
    int    subreasons; 
    float cpuTime; 
    time_t endTime; 
    int    ru; 
    struct lsfRusage lsfRusage; 
    int    jFlags; 
    int    exitStatus; 
    int    idx; 
    int    exitInfo; 
}; 
struct sbdJobStatusLog {     /* logged when a job's status is changed */ 
    int    jobId; 
    int    jStatus; 
    int    reasons; 
    int    subreasons; 
    int    actPid; 
    int    actValue; 
    time_t actPeriod; 
    int    actFlags; 
    int    actStatus; 
    int    actReasons; 
    int    actSubReasons; 
    int    idx; 
    int    sigValue; 
    int    exitInfo; 
}; 
struct sbdUnreportedStatusLog {   /* job status that we could send to MBD */ 
    int    jobId; 
    int    actPid; 
    int    jobPid; 
    int    jobPGid; 
    int    newStatus; 
    int    reason; 
    int    subreasons; 
    struct lsfRusage lsfRusage; 
    int    execUid; 
    int    exitStatus; 
    char   *execCwd; 
    char   *execHome; 
    char   *execUsername; 
    int    msgId; 
    struct jRusage runRusage; 
    int    sigValue; 
    int    actStatus; 
    int    seq; 
    int    idx; 
    int    exitInfo; 
}; 
struct jobSwitchLog {     /* logged when a job is switched to another queue */  
    int    userId;  
    int    jobId;  
    char   queue[MAX_LSB_NAME_LEN];  
    int    idx;  
    char   userName[MAX_LSB_NAME_LEN];  
};  
struct jobMoveLog {       /* logged when a job is moved to another position */  
    int    userId;  
    int    jobId;  
    int    position;  
    int    base;  
    int    idx;  
    char   userName[MAX_LSB_NAME_LEN];  
};  
struct chkpntLog { 
    int jobId; 
    time_t period; 
    int pid; 
    int ok; 
    int flags; 
    int    idx; 
}; 
struct jobRequeueLog { 
    int   jobId; 
    int   idx; 
}; 
struct jobCleanLog { 
    int   jobId; 
    int   idx; 
}; 
struct jobExceptionLog { 
    int jobId; 
    int    exceptMask; 
    int    actMask; 
    time_t timeEvent; 
    int    exceptInfo; 
    int    idx; 
}; 
struct sigactLog { 
    int      jobId; 
    time_t   period; 
    int      pid; 
    int      jStatus; 
    int      reasons; 
    int      flags; 
    char     *signalSymbol; 
    int      actStatus; 
    int      idx; 
}; 
struct migLog { 
    int    jobId; 
    int    numAskedHosts; 
    char   **askedHosts; 
    int    userId; 
    int    idx; 
    char   userName[MAX_LSB_NAME_LEN]; 
}; 
struct signalLog { 
    int    userId; 
    int    jobId; 
    char   *signalSymbol; 
    int    runCount; 
    int    idx; 
    char   userName[MAX_LSB_NAME_LEN]; 
}; 
struct queueCtrlLog { /* logged when bqc command is invoked */ 
    int opCode; 
    char queue[MAX_LSB_NAME_LEN]; 
    int  userId; 
    char userName[MAX_LSB_NAME_LEN]; 
    char message[MAXLINELEN]; 
}; 
struct newDebugLog { 
    int opCode; 
    int level; 
    int logclass; 
    int turnOff; 
    char logFileName[MAXLSFNAMELEN]; 
    int userId; 
 };  
struct hostCtrlLog { /* logged when dynamic hosts are added to group */  
    int opCode; 
    char host[MAXHOSTNAMELEN]; 
    int  userId; 
    char userName[MAX_LSB_NAME_LEN]; 
    char message[MAXLINELEN]; 
}; 
struct hgCtrlLog {       /* logged when dynamic hosts are added to group */  
    int    opCode;  
    char   host[MAXHOSTNAMELEN];  
    char   grpname[MAXHOSTNAMELEN];  
    int    userId;  
    char   userName[MAX_LSB_NAME_LEN];  
    char   message[MAXLINELEN];  
};  
struct mbdStartLog { 
    char master[MAXHOSTNAMELEN]; 
    char cluster[MAXLSFNAMELEN]; 
    int  numHosts; 
    int  numQueues; 
};  
struct mbdDieLog { 
    char master[MAXHOSTNAMELEN]; 
    int  numRemoveJobs; 
    int  exitCode; 
    char   message[MAXLINELEN]; 
};  
struct unfulfillLog {           /* logged before mbatchd dies */ 
    int  jobId; 
    int  notSwitched; 
    int  sig; 
    int  sig1; 
    int  sig1Flags; 
    time_t chkPeriod; 
    int  notModified; 
    int  idx; 
    int  miscOpts4PendSig; 
};  
struct jobFinishLog {          /* logged in lsb.acct when a job finished */ 
    int    jobId; 
    int    userId; 
    char   userName[MAX_LSB_NAME_LEN]; 
    int    options; 
    int    numProcessors; 
    int    jStatus; 
    time_t submitTime; 
    time_t beginTime; 
    time_t termTime; 
    time_t startTime; 
    time_t endTime; 
    char   queue[MAX_LSB_NAME_LEN]; 
    char   *resReq; 
    char   fromHost[MAXHOSTNAMELEN]; 
    char   *cwd; 
    char   *inFile; 
    char   *outFile; 
    char   *errFile; 
    char   *inFileSpool; 
    char   *commandSpool; 
    char   *jobFile; 
    int    numAskedHosts; 
    char   **askedHosts; 
    float  hostFactor; 
    int    numExHosts; 
    char   **execHosts; 
    float  cpuTime; 
    char   *jobName; 
    char   *command; 
    struct  lsfRusage lsfRusage; 
    char   *dependCond; 
    char   *timeEvent; 
    char   *preExecCmd; 
    char   *mailUser; 
    char   *projectName; 
    int    exitStatus; 
    int    maxNumProcessors; 
    char   *loginShell; 
    int    idx; 
    int    maxRMem; 
    int    maxRSwap; 
    char   *rsvId; 
    char   *sla; 
    int    exceptMask; 
    char   *additionalInfo; 
    int    exitInfo; 
    int    warningTimePeriod; 
    char   *warningAction; 
    char   *chargedSAAP; 
    char   *app; 
    char   *postExecCmd; 
    int    runtimeEstimation; 
    char   *jgroup; 
}; 
struct loadIndexLog { 
    int  nIdx; 
    char **name; 
};  
struct calendarLog { 
    int    options; 
    int    userId; 
    char   *name; 
    char   *desc; 
    char   *calExpr; 
}; 
struct jobForwardLog { 
    int    jobId; 
    char   *cluster; 
    int    numReserHosts; 
    char   **reserHosts; 
    int    idx; 
          int    jobRmtAttr; 
}; 
struct jobAcceptLog { 
    int         jobId; 
    LS_LONG_INT remoteJid; 
    char        *cluster; 
    int         idx; 
    int         jobRmtAttr; 
}; 
struct statusAckLog { 
    int jobId; 
    int statusNum; 
    int    idx; 
}; 
struct jobMsgLog { 
    int   usrId; 
    int   jobId; 
    int   msgId; 
    int   type; 
    char  *src; 
    char  *dest; 
    char  *msg; 
    int   idx; 
}; 
struct jobMsgAckLog { 
    int usrId; 
    int jobId; 
    int msgId; 
    int type; 
    char *src; 
    char *dest; 
    char *msg; 
    int    idx; 
}; 
struct jobOccupyReqLog {      
    int userId; 
    int jobId; 
    int numOccupyRequests; 
    void *occupyReqList; 
    int    idx; 
    char userName[MAX_LSB_NAME_LEN]; 
}; 
struct jobVacatedLog {         
    int userId; 
    int jobId; 
    int    idx; 
    char userName[MAX_LSB_NAME_LEN]; 
}; 
struct jobForceRequestLog { 
    int     userId; 
    int     numExecHosts; 
    char**  execHosts; 
    int     jobId; 
    int     idx; 
    int     options; 
    char    userName[MAX_LSB_NAME_LEN]; 
    char   *queue; 
}; 
struct jobChunkLog { 
    long         membSize; 
    LS_LONG_INT *membJobId; 
    long         numExHosts; 
    char       **execHosts; 
}; 
struct jobExternalMsgLog { 
    int      jobId; 
          int      idx; 
    int      msgIdx; 
    char     *desc; 
    int      userId; 
    long     dataSize; 
    time_t   postTime; 
    int      dataStatus; 
    char     *fileName; 
    char     userName[MAX_LSB_NAME_LEN]; 
}; 
struct rsvRes { 
    char     *resName;  
    int      count; 
    int      usedAmt; 
};  
struct rsvFinishLog {           /* for advanced reservation */ 
    time_t        rsvReqTime; 
    int           options; 
    int         uid; 
    char          *rsvId; 
    char          *name;  
    int           numReses;  
    struct rsvRes *alloc;  
    char          *timeWindow;  
    time_t        duration;  
    char          *creator; 
};  
struct cpuProfileLog { 
    char    servicePartition[MAX_LSB_NAME_LEN]; 
    int     slotsRequired; 
    int     slotsAllocated; 
    int     slotsBorrowed; 
    int     slotsLent; 
}; 
struct jobRunRusageLog {         /* log the running rusage of a job in the lsb.stream  
file */ 
    int              jobid; 
    int              idx; 
    struct jRusage   jrusage; 
}; 
struct slaLog {              /* SLA event */ 
    char   *name;             
    char   *consumer;         
    int    goaltype;          
    int    state;             
    int    optimum;           
    int    counters[NUM_JGRP_COUNTERS];  
};  
struct perfmonLog {              /* performance metrics log in lsb.stream */ 
    int    samplePeriod; 
    int    totalQueries; 
    int    jobQuries; 
    int    queueQuries; 
    int    hostQuries; 
    int    submissionRequest; 
    int    jobSubmitted; 
    int    dispatchedjobs; 
    int    jobcompleted; 
    int    jobMCSend; 
    int    jobMCReceive; 
    time_t startTime; 
}; 
struct eventEOSLog {     /* Event end of stream. */ 
    int   eos; 
      }; 

PARAMETERS

*logPtr

The eventRec structure pointed to by logPtr into a log file.

*log_fp

A pointer pointing to the log file name that could be either event a log file or job log file.

RETURN VALUES

integer:0

The function was successful, and the information of eventRec structure has been put into log file pointed by log_fp

integer:-1

Function failed.

ERRORS

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

SEE ALSO

Related APIs

lsb_geteventrec()

Equivalent line command

none

Files

lsb.events

lsb.acct


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