[Next] [Up] [Back] [Previous] [Contents]

1.25 Errors and Error Recovery

All of the Database Interface Routines pass back an exit status (IEXIT), this variable can be checked to see whether a call was successful or not. A value of 0 indicates a successful call. A value greater than zero indicates an error. When an error does occur, an error message will be output to screen and/or logging file (see DIINI).

The value of the error code indicates the action required to correct the problem. For codes 1 to 99, the routine may be called again with modified parameters, or ignored depending on individual circumstances. For codes 101 to 199 the current dataset must be abandoned. For codes 201 to 299, the current model must be abandoned.

Routine DIERR is provided for cleaning up after an error has occurred. The routine may be used to abandon the current dataset, or the current model. Once DIERR has been called, the user is free to continue inputting data. Detailed information on error messages is given in Appendix three of this document.

The process of error recovery is fairly simple within the Database Interface Routines. It is not

always so simple for the user program to recover intelligently from errors. If, for example, the

user program is drawing its data from one or more sequential files, sorting some information, and possibly using some temporary files of its own, the abandoning of a dataset may involve much more than skipping a number of records on a file before continuing. If the user program is taking advantage of the parallel processing facility, the process of error recovery may become even more difficult.

Clearly the optimum solution to error recovery must include a facility to abandon only that data which is invalid, and continue to process the remaining data intelligently after. A slightly inferior, but quite satisfactory approach is to ensure that all valid datasets prior to an error are successfully, and permanently entered into the FEMVIEW database. When an error does occur, the user program abandons the current dataset, tidies up, and terminates leaving all data entered prior to the error intact.

This second approach to error recovery may be achieved quite simply using the Database Interface Routines. The model header, nodal co-ordinates, and element topology are processed as normal using DIHED, DICOR, and DITOP (see flow chart). Routine DIBLD is then called to create the FEMVIEW display data sets. Subsequent results datasets are then appended to the model, with DIHED being called with OPCODE = 2 for every results dataset. When an error occurs, the user program simply calls DIERR and terminates using DISTP. When using the parallel processing facility, this technique is slightly more involved.

There is a third way of recovering from errors which, although primitive, does allow all valid data to be processed, even after an error. When one of the Database Interface Routines detects a severe error, it sets an internal flag which prevents any other routine from performing its required task (see error 032). Rather than check for errors after each routine call, one can check the error code IEXIT once only per dataset, just before calling DILIM. If an error has occurred then DIERR is called instead of DILIM and the user program simply continues processing. The message generating routine within the Database Interface Routines counts the number of errors that have occurred and will suppress message output beyond 50 errors per dataset.



[Next] [Up] [Back] [Previous] [Contents]