Processing Your Program


Thread-Safety

Optimization Library subroutines are not reentrant. Multiple simultaneous calls to an application with Optimization Library modules imbedded from different threads of a single process are not protected against (by the library), and doing so may cause unpredictable results.


Compiling, Linking, and Executing your Application with the Optimization Library

After downloading, extracting, and installing the Optimization Library, you can find sample programs in C and FORTRAN in the SAMPC and SAMPF subdirectories, respectively, of the SAMPLES directory. Also included are sample scripts (or .BAT files) which will show how to compile, link, and run your C or FORTRAN application. Remember these are samples only, and you may have to modify the samples to specify different directories or locations for your compiler and linker, as well as any other modules referenced in your application. You should contact your system administrator or support staff if you do not know the locations of these other products.


Associating File Names with  FORTRAN Unit Numbers

Before running your program, you may associate I/O files with the unit numbers used in your program. Unit numbers must be integers between 1 and 99. Once a file is associated with a unit number, the unit number is used in the program to refer to the file.

To perform this connection, you may use the ln (link) command. For example, to connect the file lpdata.mpsfile to unit 98, enter the following:

   ln lpdata.mpsfile fort.98
You may also connect units and files by using the XL FORTRAN OPEN statement in your program. An example of the syntax for this statement may be found in the User's Guide for IBM AIX XL FORTRAN Compiler/6000.

Since unit 5 is the standard input unit, and unit 6 is the standard output unit, files need not be connected to these units as shown above. Redirection may be used instead when the executable file is run. Other input files may be connected to a unit in advance or may be connected dynamically by using EKKFOPN, which mimics the FORTRAN OPEN statement, in your program. If output files are not associated with a unit number in advance, or by calling EKKFOPN, then the output written to that unit will be placed in a file named fort.nn, where nn is the output unit number referred to in the write statement.

To run the executable program exrow, for example, you would enter the following:

   exrow
or, to redirect the standard output on unit 6 to a file named exrow.output, you would enter:
   exrow > exrow.output

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