In this exercise, you will work with pre-built components from the integrator example to compose several CCA-based applications and execute them. The integrator application is a simple example, designed to illustrate the basics of creating, building, and running component-based applications without scientific complexities a more realistic application would also present. The purpose of this application is to numerically integrate a one-dimensional function. Several different integrators and functions are available, in the form of components. A ``driver'' component controls the calculation, and for the Monte Carlo integrator, a random number generator is also required. The specific components available are shown in Table 2.1.
|Drivers||Identical functionality, illustrating components in different languages.|
|Integrators||Various integration algorithms|
|functions.CosFunction||cos(x) ; integrates to sin(1) 0.841|
|functions.CubeFunction||x3 ; integrates to 0.25|
|functions.LinearFunction||x ; integrates to 0.5|
|functions.PiFunction||; integrates to|
|functions.QuinticFunction||x5 -4x4 ; integrates to - - 0.633|
|functions.SquareFunction||x2 ; integrates to|
|Random Number Generators|
|randomgens.RandNumGenerator||Required for Monte Carlo integration|
The Ccaffeine framework provide three different ways for users to interact with it in order to assemble and run CCA applications. You can type commands in yourself at the framework's prompt, execute a script containing those same commands, or use a graphical user interface.2.1The graphical approach is the easiest for most people to get a feel for how components work, so we will start with that (Section 2.1) and later discuss how actions in the GUI map onto instructions in a script (see Section 2.2).
In practice, most users set the GUI interface aside after they become more comfortable with the CCA environment in favor of the scripting approach. That's especially true once they've developed a bunch of components and want to run simulations with them in batch jobs, where GUIs tend not to be so convenient. Of course it is entirely up to you which approach you use in the long run.