SLOG_RDEF_AddRecDef

Add one definition to the SLOG Record Definition table.

Synopsis


int SLOG_RDEF_AddRecDef(       SLOG_STREAM          *slog,
                         const SLOG_intvltype_t      intvltype,
                         const SLOG_bebit_t          bebit_0,
                         const SLOG_bebit_t          bebit_1,
                         const SLOG_N_assocs_t       Nassocs,
                         const SLOG_N_args_t         Nargs )

Modified Input Variables

slog - pointer to the SLOG_STREAM where SLOG Record Definition Table is located.

Unmodified Input Variables

intvltype - label to the interval type.
bebit_0 - the 1st bebit.
bebit_1 - the 2nd bebit.
Nassocs - Number of assocications for this interval record type.
Nargs - Number of MPI call argument for this interval record type.

Modified Output Variables

returned value - integer return status.

Usage Notes on this subroutine

Notes on the Addition of Extra Record Definitions This note is to clarify the usage of SLOG_RDEF_XXX() routines especially while the user wants to add extra record definitions to the logfile when the process of addition of interval records to the logfile has been started, for instance if one needs to add user marker interval records.

Under normal circumstances, the record definition table is created by first opening the section of the logfile for storing the table using SLOG_RDEF_Open(). Then add the record definition using SLOG_RDEF_AddRecDef() and close the table section by SLOG_RDEF_Close().

In the case that the logfile involves interval records whose interval type are NOT known until the process of inserting of the interval records to the logfile has been started, one should open the SLOG_RDEF_Open(). Then add the known record definitions using SLOG_RDEF_AddRecDef(). However, one should NOT call SLOG_RDEF_Close() to close the table section. Instead, SLOG_RDEF_SetExtraNumOfRecDefs() should be called to set the extra number of record definition entries needed( the number can be greater than what one actually needs ). Then when user encounters a new interval record type, SLOG_RDEF_AddExtraRecDef() can then be called to add the new interval record type to the record definition table. This has to be done before adding the interval record to the logfile using SLOG_Irec_ToOutputStream() which does NOT allow interval record of with unknown interval type to the record definition table.


Include file needed

slog_recdefs.h

Notes on SLOG return status code

There are 5 allowed SLOG returned status codes. They include SLOG_SUCCESS, SLOG_FAIL and SLOG_EOF. Their actual values are defined in slog.h

SLOG_SUCCESS is returned when no error is encountered.

SLOG_FAIL is returned when error is encounted.

SLOG_EOF is returned when End of file is encounted.

There are also SLOG_TRUE and SLOG_FALSE which are sued as boolean values, in particular they are used in boolean functions which are usually named as IsXXXXX(), AreXXXXX() and HasXXXXX().

Location:../src/slog_recdefs.c