next up previous
Next: prism_put Up: OASIS4 Model Interface library, Previous: prism_enddef


Exchange of coupling and I/O fields

The PSMILe exchanges are based on the principle of ``end-point'' data exchange. When producing data, no assumptions are made in the source component code concerning which other component will consume these data or whether they will be written to a file, and at which frequency. Likewise, when asking for data, a target component does not know which other component produces them or whether they are read in from a file. The target or the source (another component or a file) for each field is defined by the user in the SMIOC XML file (see section 6.5) and the coupling exchanges and/or the I/O actions take place according to the user external specifications. The switch between the coupled mode and the forced mode is therefore totally transparent for the component. Furthermore, source data can be directed to more than one target (other components and/or disk files).

The sending and receiving PSMILe calls prism_put and prism_get can be placed anywhere in the source and target code and possibly at different locations for the different coupling fields. These routines can be called by the model at each timestep. The actual date at which the call is performed and the date bounds for which it is valid are given as arguments; the sending/receiving is actually performed only if the date bounds include a time at which it should be activated, given the field coupling (or I/O) period indicated by the user in the SMIOC; a change in the coupling or I/O period is therefore also totally transparent for the component itself. The PSMILe can also take into account a timelag between the sending prism_put and the corresponding prism_get defined by the user in the SMIOC (see item 6. of section 6.5.4).

Local transformations can be performed in the source component PSMILe below the prism_put and/or in the target component PSMILe below the prism_get like time accumulation, time averaging, algebraic operations, statistics, scattering, gathering (see item 7. of section 6.5.4 and item 5. of section 6.5.5).

When the action is activated, each process sends or receives only its local partition of the data, corresponding to its local grid defined previously. The coupling exchange, including data repartitioning if needed, occurs either directly between the components, or via additional Transformer processes if regridding needed (see section 4.2).

If the user specifies that the source of a prism_get or the target of a prism_put is a disk file, the PSMILe exploits the GFDL mpp_io package [Balaji (2001)] for its file I/O. The supported file format is NetCDF according to the CF convention [Eaton et al. (2003)]. The mpp_io package is driven by a PSMILe internal layer which interfaces with various sources of information. For instance, the definition of grids and masks as well as the form of the data of a field is provided through the PSMILe API. On the other hand the information with regard to the CF standard name and unit are provided by the SMIOC XML file through the Driver.

The mpp_io package can operate in three general I/O modes:

-
Distributed I/O

Each process works on a individual file containing the I/O field on the domain onto which that process works. Domain partitioning information is written into the resulting files such they can be merged into one file during a post processing step.

-
Pseudo parallel I/O

The whole field is read from or written to one file. The domain partitioning information is exploited such that the data are collected - stitched together - during the write operation or distributed to the parallel processes of a component during the read operation. This domain stitching or distribution is automatically done by the PSMILe on the component model master process and happens transparently for the parallel component itself.

-
Parallel I/O

A fully parallel I/O using the parallel NetCDF [Li et al. (2003)] library and MPI-IO is available. This allows parallel IO of distributed data into a single NetCDF file which is controlled by MPI-IO instead of collecting the data on the master process first. To have this feature available the PSMILe has to be linked against the parallel NetCDF library. The PSMILe library has to be generated with -D__PARNETCDF. Note that this type of IO is not yet supported for applications having more than 1 component.

The PSMILe I/O layer also copes with the fact that the input data may be spread accross a number of different files11, and that NetCDF file format has certain restrictions with respect to size of a file. Therefore, on output chunking of a series of time stamps across multiple files will be provided depending on a threshold value of the file size.



Footnotes

... files11
The system calls 'scandir' and 'alphasort' are used to implement this feature (see routine /oasis4/lib/psmile_oa4/src/psmile_io_scandir.c). In case of problems with these system calls, one may try to compile with the -D__MYALPHASORT. If there are still problems, one has to comment the calls to psmile_io_scandir_no_of_files and psmile_io_scandir in psmile_open_file_byid.F90, but then that PSMILe functionality will not be provided anymore.


Subsections
next up previous
Next: prism_put Up: OASIS4 Model Interface library, Previous: prism_enddef
Laure Coquart 2011-12-01