next up previous
Next: Exchange of coupling and Up: Neighbourhood search and determination Previous: Neighbourhood search and determination


prism_enddef

prism_enddef (ierror)


Table 5.19: prism_enddef arguments
\begin{table}\begin{tabularx}{16cm}[t]{\vert l\vert l\vert l\vert X\vert}
\hlin...
...\texttt{Integer}&
returned error code\\
\hline
\end{tabularx}\end{table}




Following prism_init, prism_enddef is the second collective call and has to be called once by each application process when all components within the application have completed their definition phase. (The rest of this section can be skipped by users not interested in the PSMILe internal functioning.)

To perform the exchange of coupling fields during the run, it is required to establish communication only between those pairs of processes that actually have to exchange data based on the user defined coupling configuration in the SMIOCs XML files (see section 6.5).

For each coupling exchange involving a regridding between the source and the target grids, the neighbourhood search is performed. It identifies, for each grid point of each target process, the source grid points and corresponding source process that will be used to calculate the target grid point value. For a coupling exchange involving only repartitioning, each target grid point corresponds exactly to only one source grid point; in this case the `neighbourhood search' process identifies, for each grid point of each target process, on which source process the matching source grid point is located.

In order to save memory and CPU time in the neighbourhood search and the establishment of the communication patterns, prism_enddef works in a parallel way on the local grid domain covered by each application process as much as possible. The search algorithm is split into three parts.

In an initial step, each process calculates a bounding box covering its local geographical volume domain previously defined by prism_set_corners (see section 5.3.2). The bouding boxes of all processes are sent to and collected by all processes. Each source process calculates the intersection of its bounding box with each other process bounding box, thereby identifying the potential interpolation partners and corresponding bounding box intersection. (For fields located on non-geographical fields, see 5.3.1, the intersection calculation is based on the local domain description in the global index space, see 5.3.4.) For each bounding box intersection, the source process creates a sequence of simplified grids and corresponding bounding boxes, each one coarsened by a factor of 2 with respect to the previous one, until falling back onto the bounding box covering the whole intersection (similar to a Multigrid Algorithm). Starting on the coarsest level the search algorithm determines, at each multigrid level, the source bounding box for each target grid point in the intersection. When the bounding box at the finer level is identified, the neighbours of the target grid point, i.e. the source points participating in its calculation (regridding case) or the matching source grid point (repartitioning only case), are identified. The source locations that are identified at this stage can be considered as a frist guess. The source locations are located close to the final source location.

In a second step, the exact source locations are determined and provide the initial location to identify further required neighbour points in a third step which is depending on the interpolation scheme chosen by the user.

For each intersection of source and target grid processes, the `Ensemble of grid Points participating in the Interpolation Operation (EPIO)' (or in the repartitioning) on the source side (EPIOS) and on the target side (EPIOT) are identified. The results of this search are transfered to the target process. For the coupling exchange involving regridding, the EPIOS and EPIOT definition and all related grid information are also transferred to the Transformer (see section 4.2).

As the results of the neighbourhood search are known in the source PSMILe, only the usefull grid points will be effectively sent later on during the coupling exchanges, minimising the amount of data to be transferred.


next up previous
Next: Exchange of coupling and Up: Neighbourhood search and determination Previous: Neighbourhood search and determination
Laure Coquart 2011-12-01