[Go to TAO Home Page]

## Documentation for SIDL Interface Tools for TAO

Directory: src/sidl
Contents: SIDL interface tools for TAO

### Subdirectories:

- sidlfiles - Contains all the SIDL (Scientific Interface Definition Language) files that are used.
- xml - Will contain all the xml repositories corresponding to the SIDL files. Since these are Babel-generated, they are not included in the distribution. To create the xml repositories run 'make xml' from src/sidl
- clients - Contains all the client stubs of the SIDL files (in C, C++, and F77). Upon cloning from the bitkeeper repository, these directories are empty (except for makefile templates) because the files are all generated by Babel. cd to the clients directory and type 'make stubs' to generate these files, and 'make libs' to make the client libraries. All of the client libraries will be placed in the clients/libs directory. There are no (or at least shouldn't be) any clients for the components since the server libraries are dynamically loaded using SIDL.Loader. Only the abstract SIDL interfaces for the components need client stubs.
- servers - Contains the implementation of classes.
- interface - Defines the TaoSIDLApplication class, which descends from TaoApplication (see $TAO_DIR/include/taoappobject.c) and is an adaptor for the SIDL class TAOAPI_Application.
- examples - Contains the example drivers. Run 'make' for the Rosenbrock examples (with drivers in C, C++, and F77; models implemented in C, C++, and F77)
- components - Contains the various components.

### Dependencies:

In addition to standard TAO dependencies (PETSc, MPI), a distribution of Babel is required to use the SIDL interface. (Version 1.6 of TAO uses version 0.8.8 of Babel; other versions may or may not be compatible.)

To use the examples that employ the CCA reference framework, Ccaffeine version 0.4.3 should be used. Instructions for dowload can be found at cca-forum.org.

### Building:

1. In the bmake/packages/${PETSC_ARCH} file, specify the location of the Babel distribution, the Babel sh script, and the location of ccafe information if you wish to use Ccaffeine components.
2. To build the Ccaffeine components, set the location of the cca-spec-classic, cca-spec-babel, and ccafe directories in the bmake/packages.${PETSC_ARCH} file.
3. Compile TAO according to standard installation instructions. If PETSc is already installed, then you should only have to set the TAO_DIR environment variable and run 'make'.

### Writing your own model implementation:

This can be done by writing your own SIDL file that declares a class implementing all of the methods in the Optimize.OptimizationModel interface (declared in the file Optimize.sidl; see Rosenbrock.sidl for an example. Run Babel on your SIDL file to create C++ client files for TAO to access, client files for whatever language your driver will employ, and server files for your implementation. (If the driver is also in C++, then it can use the same library that TAO uses.) For example, to build your model in F77 and use F77 in your driver program, use:

      %babel -cC++ -o{C++ client directory} -R$TAO_DIR/src/sidl/repositories/Optimize {your SIDL file}
      %babel -cF77 -o{F77 client directory} -R$TAO_DIR/src/sidl/repositories/Optimize {your SIDL file}
      %babel -sF77 -o{F77 server directory} -R$TAO_DIR/src/sidl/repositories/Optimize {your SIDL file}

The -R flag indicates the location TAO places the xml parsing of the Optimize.OptimizeModel interface.

Now you need to edit the files in the server directory with the '_Impl' endings -- you should not need to edit any other files -- to perform the desired implementations.

For examples, see Rosenbrock_RosenbrockModel_Impl.cc and Rosenbrock_RosenbrockModel_Impl.hh for a C++ implementation, or Rosenbrock_RosenbrockModel_Impl.f for a F77 implementation.

For references on implementing SIDL functions and accessing SIDL arrays, see the Babel documentation.

Next, the various client and server files must be compiled, and ideally built into shared libraries. Again, see the Babel documentation and RosenbrockModel examples.

Finally, you must compile your driver (see example drivers in C++, C, and F77) and link with the necessary client and server libraries, the TAO and PETSc libraries, and the Babel runtime library. (see example makefile).

### Using Components

We have included five components that can be used the Ccaffeine (SIDL-enabled version) framework to run a sample program: Review the SIDL and source files for more information on the components:

- Solver.sidl -- defines Solver.OptimizationSolver interface.
- Optimize.sidl -- defines Optimize.OptimizationSolver interface.
- TaoSolver.Component is a concrete implementation of the interface Solver.OptimizationSolver.
- Minsurf.Component is an implementation of the Optimize.OptimizationModel interface (evaluateObectiveFunction, evaluteGradient, evaluateHessian, etc.).
- TaoDriver.Component implements [gov.]cca.GoPort and connects with a Solver.OptimizationSolver interface.
- PetscFactory implements the LinearAlgebra interface (see LAFactory.sidl).
- GAFactory is another implementation of the LinearAlgebra interface using Global Arrays.
- CCAFERC -- ccaffeine script for running TaoSolver, Minsurf, PetscFactory, and TaoDriver.
- After compiling, the Minsurf example can be run with the command:

      (ccaffeine_install_dir)/bin/ccafe-single --ccafe-rc $TAO_DIR/src/sidl/CCAFERC

If you have any questions at all, please feel free to email us at tao-comments@mcs.anl.gov.

[Go to TAO Home Page]