The Clean-Up Utility in FronTier

The goal of a cleanup utility ("util/cleanup.c") is to terminate a run in a useful manner. Many different problems can occur as, illustrated in the table below, which some form of handling is very useful.

A perfect run error = 0
The developer wants it:
a case arises which should not arise or
for which there is as yet no code.
error = ERROR = -1
A casualty of a computational error:
Floating point exception (for instance division by zero) error = SIGFPE = 8
Bus Error (for instance: function argument mismatch) error = SIGBUS = 10
Segmentation Violation (for instance: undeclared pointer) error = SIGSEGV = 11
................... error = .....
The user kills it (for instance "control C" or "kill") error = SIGQUIT or SIGKILL
Other: machine malfunction or hard kill ("kill -9") NO CLEANUP

In all but the other case, FronTier will call the function clean_up:

EXPORT	void clean_up(int error)
which will:
  1. Print the debug list of FronTier
  2. Do the FronTier printout of the last time-step (very useful for restart).
  3. Print the storage holdings of FronTier's own memory allocator.
The function cleanup gets called in two different ways:

Back to Main Page


Comments?

Authors: Folkert Tangerman
Last revision: April 10, 1997

Copyright 1997 This article may be redistributed to other individuals for noncommercial use, provided that the entire text, all HTML codes, and this copyright notice remains intact and unaltered in any way. This article may not be resold, reprinted, or redistributed in whole or in part for compensation of any kind without prior written permission of the author.