Using and Administering

Report Generation Subroutine

LoadLeveler provides the GetHistory subroutine to generate accounting reports.

Purpose

GetHistory processes local or global LoadLeveler history files.

Library

LoadLeveler API library libllapi.a

Syntax

#include "llapi.h"
 
int GetHistory(char *filename, int (*func) (LL_job *), int version);

Parameters

filename
Specifies the name of the history file.

(*func) (LL_job *)
Specifies the user-supplied function you want to call to process each history record. The function must return an integer and must accept as input a pointer to the LL_job structure. The LL_job structure is defined in the llapi.h file.

version
Specifies the version of the history record you want to create. LL_JOB_VERSION in the llapi.h file creates an LL_job history record.

Description

GetHistory opens the history file you specify, reads one LL_job accounting record, and calls a user-supplied routine, passing to the routine the address of an LL_job structure. GetHistory processes all history records one at a time and then closes the file. Any user can call this subroutine.

The user-supplied function must include the following files:

#include <sys/resource.h>
#include <sys/types.h>
#include <sys/time.h>

The ll_event_usage structure is part of the LL_job structure and contains the following LoadLeveler defined data:

int event
Specifies the event identifier. This is an integer whose value is one of the following:
1
Represents a LoadLeveler-generated event.
2
Represents an installation-generated event.

char *name
Specifies a character string identifying the event. This can be one of the following:

Return Values

GetHistory returns a zero when successful.

Error Values

GetHistory returns -1 to indicate that the version is not supported or that an error occurred opening the history file.

Examples

Makefiles and examples which use this API are located in the samples/llphist subdirectory of the release directory. The examples include the executable llpjob, which invokes GetHistory to print every record in the history file. In order to compile llpjob, the sample Makefile must update the RELEASE_DIR field to represent the current LoadLeveler release directory. The syntax for llpjob is:

  llpjob history_file

Where history_file is a local or global history file.


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