next up previous
Next: The Transformer part Up: OASIS4 Driver/Transformer Previous: OASIS4 Driver/Transformer


The Driver part

The first task of the Driver is to get the process management information defined by the user in the SCC XML file (see section 6.4). The information is first extracted using the libxml C library 3, and then passed from C to Fortran to fill up the Driver structures.

Once the Driver has accessed the SCC XML file information, it will, if the user has chosen the spawn approach, launch the different executables (or applications) that compose the coupled model, following the information given in the SCC file. For the spawn approach, only the Driver should therefore be started and a full MPI2 implementation Gropp et al. (1998) is required as the Driver uses the MPI2 MPI_Comm_Spawn_Multiple functionality. If only MPI1 implementation is available Snir et al. (1998), the Driver and the applications must be all started at once in the run script; this is the so-called not_spawn approach. The advantage of the spawn approach is that each application keeps its own internal communication context (e.g. for internal parallelisation) unchanged as in the standalone mode, whereas in the not_spawn approach, OASIS4 has to recreate an application communicator that must be used by the application for its own internal parallelisation. Of course, the not_spawn is also possible if an MPI2 library is used4.

The Driver then participates in the definition of the different MPI communicators (see section 5.1.3), and transfers the relevant SCC information to the different component PSMILe coupling library (corresponding to their prism_init call, see section 5.1.1).

When the simulation context is set, the Driver accesses the SMIOCs XML files information (see section 6.5), which mainly defines all coupling and I/O exchanges (e.g. source or target components or files, local transformations, etc.). The Driver sorts this component specific information, and defines global identifiers for the components, their grids, their coupling/IO fields, etc. to ensure global consistency between the different processes participating in the coupling. Finally, the Driver sends to each component PSMILe coupling library the information relevant for its coupling or I/O exchanges (e.g. source or components target or files and their global identifier) and information about the transformations required for the different coupling fields. This corresponds to the component PSMILe prism_init_comp call (see section 5.1.2)5. With such information, the applications and components are able to run and perform the coupling exchanges as specified by the user. The Driver/Transformer processes are then used to execute the Transformer routines (see Section 4.2).

When a component reaches the end of its execution, its processes send a signal to the Transformer master process by calling the PRISM_Terminate routine (see Section 5.8.1). Once the Transformer master process has received as many signals as processes active in the coupled run, it sends a termination message to all Transformer processes and ends.



Footnotes

... library3
http://www.xmlsoft.org
... used4
See section 7.2.2 for related use of appropriate CPP keys.
...subsec:prisminitcomp)5
If the component is running stand-alone but linked with the PSMILe library for I/O actions only, there is no need to start the Driver/Transformer; the PSMILe component will automatically read its SMIOC information below the prism_init_comp call. In this case, the component SMIOC is used to configure the I/O of the component from/to files.

next up previous
Next: The Transformer part Up: OASIS4 Driver/Transformer Previous: OASIS4 Driver/Transformer
Laure Coquart 2011-12-01