next up previous
Next: COMPILING AND LINKING
Up: MISCELLANEOUS FACILITIES
Previous: Message System Routines

Tuning the NDF_ System   

The routine NDF_TUNE is provided to allow various features of the NDF_ system to be configured for individual needs if the default behaviour is not appropriate. This process is referred to as tuning the system, and is performed as follows:

      CALL NDF_TUNE( 0, 'WARN', STATUS )

Here, a new value of zero is specified for the tuning parameter called `WARN'. The current setting of a tuning parameter may be determined using the related routine NDF_GTUNE which returns the parameter's value via its VALUE argument, as follows:

      INTEGER VALUE

      ...

      CALL NDF_GTUNE( 'WARN', VALUE, STATUS )

By using these two routines in pairs it is possible to determine the original setting of a tuning parameter, modify it locally, and then return it to its original value if necessary.

Each tuning parameter controls one aspect of the NDF_ system's behaviour according to the value which has been set for it. The tuning parameters currently available are as follows:

DOCVT:

Controls whether to convert foreign format data files to and from native NDF format for access (using the facilities described in SSN/20). If DOCVT is set to 1 (the default), and the other necessary steps described in SSN/20 have been taken, then such conversions will be performed whenever they are necessary to gain access to data stored in a foreign format. If DOCVT is set to 0, no such conversions will be attempted and all data will be accessed in native NDF format only. The value of DOCVT may be changed at any time. It is the value current when a dataset is acquired by the NDF_ library (or a placeholder for a new dataset is created) which is significant.

KEEP:

Controls whether to retain a native format NDF copy of any foreign format data files which are accessed by the NDF_ library (and automatically converted using the facilities described in SSN/20). If KEEP is set to 0 (the default), then the results of converting foreign format data files will be stored in scratch filespace and deleted when no longer required. If KEEP is set to 1, the results of the conversion will instead be stored in permanent NDF data files in the default directory (such files will have the same name as the foreign file from which they are derived and a file type of `.sdf'). Setting KEEP to 1 may be useful if the same datasets are to be re-used, as it avoids having to convert them on each occasion.

The value of KEEP may be changed at any time. It is the value current when a foreign format file is first accessed by the NDF_ library which is significant.

SHCVT:

Controls whether diagnostic information is displayed to show the actions being taken to convert to and from foreign data formats (using the facilities described in SSN/20). If SHCVT is set to 1, then this information is displayed to assist in debugging external format conversion software whenever a foreign format file is accessed. If SHCVT is set to 0 (the default), this information does not appear and format conversion proceeds silently unless an error occurs.

TRACE:

Controls the reporting of additional error messages which may occasionally be useful for diagnosing internal problems within the NDF_ library. If TRACE is set to 1, then any error occurring within the NDF_ system will be accompanied by error messages indicating which internal routines have exited prematurely as a result. If TRACE is set to 0 (the default), this internal diagnostic information will not appear and only standard error messages will be produced.

WARN:

Controls the issuing of warning messages when certain non-fatal errors in the structure of NDF data objects are detected. If WARN is set to 1 (the default), then a warning message is issued. If WARN is set to 0, then no message is issued. In both cases normal execution continues and no STATUS value is set.

The value of tuning parameters may also be set by the user of NDF_ applications independently of the application itself. This is accomplished by defining an environment variable whose name is constructed by prefixing `NDF_' to the name of the tuning parameter to be set. Thus, the shell command:

   % setenv NDF_TRACE 1

would set the `TRACE' tuning parameter to 1 by default for all subsequent NDF_ applications (i.e. over-riding the default described above). The application may, however, still modify the value itself.

Note that all tuning parameters set in this way must be given valid integer values. If the associated environment variable does not translate to a valid value, the default will remain unchanged.



next up previous
Next: COMPILING AND LINKING
Up: MISCELLANEOUS FACILITIES
Previous: Message System Routines


Starlink User Note 33
R.F. Warren-Smith
11th January 2000
E-mail:rfws@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils