The Parallel Mid-level Library (aka PMLL) is an extension of CGNS/MLL C and Fortran APIs to enable parallel aware file mapping.

Note

Please refer to General Remarks for details and conventions regarding the equivalent Fortran APIs, paying special attention to 64-bit Fortran Portability.

CGNS Parallel API Overview#

This document describes parallel input/output (I/O) in the CGNS library and the associated routines. It utilizes MPI-IO through the HDF5 library to support parallel I/O operations. As a result, the CGNS library must be built with HDF5 to enable the parallel CGNS APIs.

Parallel File Operations#

int cgp_open(const char *filename, int mode, int *fn)#

Open a file for parallel IO.

Similar to cg_open() and calls that routine. The differences is that cgp_open() explicitly sets an internal CGNS flag to indicate parallel access.

Parameters:
  • filename[in] Name of the CGNS file, including path name if necessary. There is no limit on the length of this character variable.

  • mode[in] Mode used for opening the file. The modes currently supported are CG_MODE_READ, CG_MODE_WRITE, and CG_MODE_MODIFY.

  • fn[out] CGNS file index number.

Returns:

Error status.

int cgp_close(int fn)#

Close a CGNS file.

Similar to cg_close() and calls that routine.

Parameters:

fn[in] CGNS file index number.

Returns:

Error status.

Parallel Grid Coordinate Data#

int cgp_coord_write(int fn, int B, int Z, DataType_t type, const char *coordname, int *C)#

Create a coordinate data node by multiple processes in a parallel fashion.

To write the data in parallel, first call cgp_coord_write() to create an empty data node. This call is identical to cg_coord_write() with coord_array set to NULL (no data written). The actual data is then written to the node in parallel using either cgp_coord_write_data() or cgp_coord_general_write_data() where range_min and range_max specify the subset of coordinate data to be written by a given process.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • type[in] Data type of the coordinate array written to the file. Admissible data types for a coordinate array are RealSingle and RealDouble.

  • coordname[in] Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility.

  • C[out] Coordinate Array index number, where 1 ≤ Cncoords.

Returns:

Error status.

int cgp_coord_write_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, const void *coords)#

Write coordinate data in parallel.

Writes the actual data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be written by a given process. It is the responsibility of the application to ensure that the data type for the coordinate data matches that defined in the file; no conversions are done.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • C[in] Coordinate array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • coords[in] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_coord_general_write_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, const void *coords)#

Write shaped array to a subset of grid coordinates in parallel.

The cgp_coord_general_write_data() perform data conversions if datatype is different from mem_datatype. If coords == NULL, meaning this processor writes no data, then only fn, B, Z, and C need be set. In this case, Z and C are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • C[in] Coordinate Array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a coordinate array are RealSingle and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • coords[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_coord_read_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, void *coords)#

Read coordinate data in parallel.

Reads the actual data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be read by a given process. It is the responsibility of the application to ensure that the data type for the coordinate data matches that defined in the file; no conversions are done.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • C[in] Coordinate array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • coords[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_coord_general_read_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *coords)#

Read shaped array to a subset of grid coordinates in parallel.

The cgp_coord_general_read_data() perform data conversions if datatype is different from mem_datatype. If coords == NULL, meaning this processor reads no data, then only fn, B, Z, and C need to be set. In this case, Z and C are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • C[in] Coordinate array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a coordinate array are RealSingle and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • coords[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_coord_multi_read_data(int fn, int B, int Z, int *C, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, void *buf[])#

Read multiple sets of coordinate data in parallel.

Reads the actual coordinate data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be read by a given process. The application is responsible for ensuring that the coordinate data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dread_multi to read nsets of coordinate data, whose identifiers are listed in the C array, from the CGNS file into multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the reads into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • C[in] An array composed of coordinate array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_coord_multi_write_data(int fn, int B, int Z, int *C, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, const void *buf[])#

Writes multiple sets of coordinate data in parallel.

Writes the actual coordinate data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be written by a given process. The application is responsible for ensuring that the coordinate data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dwrite_multi to write nsets of coordinate data, whose identifiers are listed in the C array, to the CGNS file from the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the writes into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • C[in] An array composed of coordinate array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[in] Array of coordinate values for the range prescribed.

Returns:

Error status.

Parallel Particle Coordinate Data#

Parallel Particle Coordinates#

int cgp_particle_coord_write(int fn, int B, int P, DataType_t type, const char *coordname, int *C)#

Create a coordinate data node by multiple processes in a parallel fashion.

To write the data in parallel, first call cgp_coord_write to create an empty data node. This call is identical to cg_particle_coord_write with coord_array set to NULL (no data written). The actual data is then written to the node in parallel using either cgp_particle_coord_write_data or cgp_particle_coord_general_write_data where range_min and range_max specify the subset of coordinate data to be written by a given process.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • type[in] Data type of the coordinate array written to the file. Admissible data types for a coordinate array are RealSingle and RealDouble.

  • coordname[in] Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility.

  • C[out] Coordinate Array index number, where 1 ≤ Cncoords.

Returns:

Error status.

int cgp_particle_coord_write_data(int fn, int B, int P, int C, const cgsize_t *rmin, const cgsize_t *rmax, const void *coords)#

Write particle coordinate data in parallel.

Writes the actual data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be written by a given process. It is the responsibility of the application to ensure that the data type for the coordinate data matches that as defined in the file; no conversions are done.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • C[in] Coordinate array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • coords[in] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_particle_coord_general_write_data(int fn, int B, int P, int C, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, const void *coords)#

Write shaped array to a subset of grid coordinates in parallel.

The cgp_particle_coord_general_write_data perform data conversions if datatype is different from mem_datatype. If coords == NULL, meaning this processor writes no data, then only fn, B, P, and C need be set. In this case, P and C are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • C[in] Coordinate Array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a coordinate array are RealSingle and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • coords[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_particle_coord_read_data(int fn, int B, int P, int C, const cgsize_t *rmin, const cgsize_t *rmax, void *coords)#

Read coordinate data in parallel.

Reads the actual data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be read by a given process. It is the responsibility of the application to ensure that the data type for the coordinate data matches that as defined in the file; no conversions are done.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • C[in] Coordinate array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • coords[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_particle_coord_general_read_data(int fn, int B, int P, int C, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *coords)#

Read shaped array to a subset of grid coordinates in parallel.

The cgp_particle_coord_general_read_data perform data conversions if datatype is different from mem_datatype. If coords == NULL, meaning this processor reads no data, then only fn, B, P, and C need be set. In this case, P and C are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • C[in] Coordinate array index number, where 1 ≤ Cncoords.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a coordinate array are RealSingle and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • coords[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_particle_coord_multi_read_data(int fn, int B, int P, int *C, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, void *buf[])#

Read multiple sets of coordinate data in parallel.

Reads the actual particle coordinate data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be read by a given process. The application is responsible for ensuring that the coordinate data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dread_multi to read nsets of coordinate data, whose identifiers are listed in the C array, from the CGNS file into multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the reads into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • C[in] An array composed of coordinate array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[out] Array of coordinate values for the range prescribed.

Returns:

Error status.

int cgp_particle_coord_multi_write_data(int fn, int B, int P, int *C, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, const void *buf[])#

Writes multiple sets of coordinate data in parallel.

Writes the actual particles coordinate data to the node in parallel, where rmin and rmax specify the subset of coordinate data to be written by a given process. The application is responsible for ensuring that the coordinate data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dwrite_multi to write nsets of coordinate data, whose identifiers are listed in the C array, to the CGNS file from the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the writes into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • C[in] An array composed of coordinate array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[in] Array of coordinate values for the range prescribed.

Returns:

Error status.


Parallel Element Connectivity Data#

int cgp_section_write(int fn, int B, int Z, const char *sectionname, ElementType_t type, cgsize_t start, cgsize_t end, int nbndry, int *S)#

Create a section data node.

cgp_section_write() is used to write element connectivity data by multiple processes in a parallel fashion. To write the element data in parallel, first call cgp_section_write() to create an empty data node. This call is identical to cg_section_write() with Elements set to NULL (no data written). The actual element data is then written to the node in parallel using cgp_elements_write_data() where start and end specify the range of the elements to be written by a given process.

Note

Routine only works for constant-sized elements, since it is not possible to compute file offsets for variable-sized elements without knowledge of the entire element connectivity data.

Note

It is the responsibility of the application to ensure that cgsize_t in the application is the same size as defined in the file; no conversions are done.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • sectionname[in] Name of the Elements_t node.

  • type[in] Type of element. See the eligible types for ElementType_t in the Typedefs section.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • nbndry[in] Index of last boundary element in the section. Set to zero if the elements are unsorted.

  • S[out] Element section index, where 1 ≤ Snsections.

Returns:

Error status.

int cgp_poly_section_write(int fn, int B, int Z, const char *sectionname, ElementType_t type, cgsize_t start, cgsize_t end, cgsize_t maxoffset, int nbndry, int *S)#

Create a section data node.

cgp_poly_section_write() is used to write element connectivity data by multiple processes in a parallel fashion. To write the element data in parallel, first call cgp_section_write() to create an empty data node. This call is identical to cg_section_write() with Elements set to NULL (no data written). The actual element data is then written to the node in parallel using cgp_elements_write_data() where start and end specify the range of the elements to be written by a given process.

Note

Routine only works for constant sized elements, since it is not possible to compute file offsets for variable sized elements without knowing the entire element connectivity data.

Note

It is the responsibility of the application to ensure that cgsize_t in the application is the same size as that defined in the file; no conversions are done.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • sectionname[in] Name of the Elements_t node.

  • type[in] Type of element. See the eligible types for ElementType_t in the Typedefs section.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • maxoffset[in] Maximum data size that should be reserved for Element connectivity data.

  • nbndry[in] Index of last boundary element in the section. Set to zero if the elements are unsorted.

  • S[out] Element section index, where 1 ≤ Snsections.

Returns:

Error status.

int cgp_elements_write_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *elements)#

Write element data in parallel.

cgp_elements_write_data() is used to write element connectivity data by multiple processes in a parallel fashion. To write the element data in parallel, first call cgp_section_write() to create an empty data node. This call is identical to cg_section_write() with Elements set to NULL (no data written). The actual element data is then written to the node in parallel using cgp_elements_write_data() where start and end specify the range of the elements to be written by a given process.

Note

Routine only works for constant-sized elements since it is not possible to compute file offsets for variable sized elements without knowledge of the entire element connectivity data.

Note

It is the responsibility of the application to ensure that cgsize_t in the application is the same size as that defined in the file; no conversions are done.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • elements[in] Element connectivity data.

Returns:

Error status.

int cgp_poly_elements_write_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *elements, const cgsize_t *offsets)#

Write element data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • elements[in] Element connectivity data.

  • offsets[in] Element connectivity offsets data.

Returns:

Error status.

int cgp_poly_elements_read_data_offsets(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *offsets)#

Read offsets data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • offsets[out] Element connectivity offsets data.

Returns:

Error status.

int cgp_poly_elements_read_data_elements(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *offsets, cgsize_t *elements)#

Read elements data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • offsets[in] Element connectivity offsets data.

  • elements[out] Element connectivity data.

Returns:

Error status.

int cgp_elements_read_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *elements)#

Read element data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • elements[out] Element connectivity data.

Returns:

Error status.

int cgp_parent_data_write(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *parent_data)#

Write parent info for an element section data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • parent_data[in] Element connectivity data.

Returns:

Error status.

int cgp_parentelements_read_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *parentelements)#

Read parent elements data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • parentelements[out] Element connectivity data.

Returns:

Error status.

int cgp_parentelements_write_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *parentelements)#

Write parent elements data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Element section index, where 1 ≤ Snsections.

  • start[in] Index of first element in the section.

  • end[in] Index of last element in the section.

  • parentelements[in] Element connectivity data.

Returns:

Error status.

Parallel Flow Solution Data#

Note

The application is responsible for ensuring that the data type for the solution data matches that defined in the file; no conversions are done.

int cgp_field_write(int fn, int B, int Z, int S, DataType_t DataType, const char *fieldname, int *F)#

Create a solution field data node in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • DataType[in] Data type of the solution array written to the file. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble.

  • fieldname[in] Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

Returns:

Error status.

int cgp_field_write_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, const void *data)#

Write field data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • data[in] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_field_general_write_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, const void *data)#

Write shaped array to a subset of flow solution field in parallel.

If data == NULL, meaning this processor reads no data, then only fn,B, Z, S, and F need be set. In this case, Z, S, and F are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • data[in] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_field_read_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, void *data)#

Read field data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • data[in] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_field_general_read_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *data)#

Read subset of flow solution field to a shaped array in parallel.

If data == NULL, meaning this processor reads no data, then only fn, B, Z, S, and F need be set. In this case, Z, S, and F are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • data[out] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_field_multi_write_data(int fn, int B, int Z, int S, int *F, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, const void *buf[])#

Writes multiple sets of field data in parallel.

Writes the actual field data from the node in parallel, where rmin and rmax specify the subset of field data to be written by a given process. The application is responsible for ensuring that the field data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dwrite_multi to write nsets of field data, whose identifiers are listed in the F array, to the CGNS file from the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the writes into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] An array composed of solution array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[in] Buffers with data to be written to the CGNS file.

Returns:

Error status.

int cgp_field_multi_read_data(int fn, int B, int Z, int S, int *F, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, void *buf[])#

Reads multiple sets of field data in parallel.

Reads the actual field data from the node in parallel, where rmin and rmax specify the subset of field data to be read by a given process. The application is responsible for ensuring that the field data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dread_multi to read nsets of field data, whose identifiers are listed in the F array, from the CGNS file into the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the reads into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • Z[in] Zone index number, where 1 ≤ Znzones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] An array composed of solution array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[out] Buffers to receive data read from the CGNS file.

Returns:

Error status.

Parallel Particle Solution Data#

int cgp_particle_field_write(int fn, int B, int P, int S, DataType_t DataType, const char *fieldname, int *F)#

Create a particle solution field data node in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • DataType[in] Data type of the solution array written to the file. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble.

  • fieldname[in] Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

Returns:

Error status.

int cgp_particle_field_write_data(int fn, int B, int P, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, const void *data)#

Write field data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • data[in] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_particle_field_general_write_data(int fn, int B, int P, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, const void *data)#

Write shaped array to a subset of particle solution field in parallel.

If data == NULL, meaning this processor reads no data, then only fn,B, P, S, and F need be set. In this case, P, S, and F are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • data[in] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_particle_field_read_data(int fn, int B, int P, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, void *data)#

Read particle field data in parallel.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • data[in] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_particle_field_general_read_data(int fn, int B, int P, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *data)#

Read subset of particle solution field to a shaped array in parallel.

If data == NULL, meaning this processor reads no data, then only fn, B, P, S, and F need be set. In this case, P, S, and F are “representative” and can point to any valid zone.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] Solution array index number, where 1 ≤ F ≤ nfields.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] Data type of an array in memory. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • data[out] Array of solution values for the range prescribed.

Returns:

Error status.

int cgp_particle_field_multi_write_data(int fn, int B, int P, int S, int *F, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, const void *buf[])#

Writes multiple sets of particle solution field data in parallel.

Writes the actual field data from the node in parallel, where rmin and rmax specify the subset of field data to be written by a given process. The application is responsible for ensuring that the field data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dwrite_multi to write nsets of field data, whose identifiers are listed in the F array, to the CGNS file from the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the writes into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] An array composed of solution array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[in] Buffers with data to be written to the CGNS file.

Returns:

Error status.

int cgp_particle_field_multi_read_data(int fn, int B, int P, int S, int *F, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, void *buf[])#

Reads multiple sets of particle solution field data in parallel.

Reads the actual field data from the node in parallel, where rmin and rmax specify the subset of field data to be read by a given process. The application is responsible for ensuring that the field data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dread_multi to read nsets of field data, whose identifiers are listed in the F array, from the CGNS file into the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the reads into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • B[in] Base index number, where 1 ≤ Bnbases.

  • P[in] Particle Zone index number, where 1 ≤ Pn_particle_zones.

  • S[in] Flow solution index number, where 1 ≤ S ≤ nsols.

  • F[in] An array composed of solution array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[out] Buffers to receive data read from the CGNS file.

Returns:

Error status.


Parallel Array Data#

int cgp_array_write(const char *ArrayName, DataType_t DataType, int DataDimension, const cgsize_t *DimensionVector, int *A)#

Create an array data node.

Parameters:
  • ArrayName[in] Name of the DataArray_t node.

  • DataType[in] Type of data held in the DataArray_t node. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character.

  • DataDimension[in] Number of dimensions of array in file.

  • DimensionVector[in] Dimensions of array in file.

  • A[in] Data array index, where 1 ≤ Anarrays.

Returns:

Error status.

int cgp_array_write_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, const void *data)#

Write array data in parallel.

Parameters:
  • A[in] Data array index, where 1 ≤ Anarrays.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • data[in] The data array.

Returns:

Error status.

int cgp_array_general_write_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, const void *data)#

Write shaped array to a subset of data array in parallel.

If data == NULL, meaning this processor reads no data, then only A need be set. In this case, A is “representative” and can point to any valid array being written by another processor

Parameters:
  • A[in] Data array index, where 1 ≤ Anarrays.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] The type of data held in memory. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • data[out] The data array.

Returns:

Error status.

int cgp_array_read_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, void *data)#

Read array data in parallel.

Parameters:
  • A[in] Data array index, where 1 ≤ Anarrays.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • data[in] The data array.

Returns:

Error status.

int cgp_array_general_read_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, DataType_t m_type, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *data)#

Read subset of data array to a shaped array in parallel.

If data == NULL, meaning this processor reads no data, then only A need be set. In this case, A is “representative” and can point to any valid array being written by another processor.

Parameters:
  • A[in] Data array index, where 1 ≤ Anarrays.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • m_type[in] The type of data held in memory. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character.

  • m_numdim[in] Number of dimensions of array in memory.

  • m_arg_dimvals[in] Dimensions of array in memory.

  • m_rmin[in] Lower range index in memory (eg., imin, jmin, kmin).

  • m_rmax[in] Upper range index in memory (eg., imax, jmax, kmax).

  • data[out] The data array.

Returns:

Error status.

int cgp_array_multi_write_data(int fn, int *A, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, const void *buf[])#

Writes multiple sets of array data in parallel.

Writes the actual array data to the node in parallel, where rmin and rmax specify the subset of array data to be written by a given process. The application is responsible for ensuring that the array data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dwrite_multi to write nsets of array data, whose identifiers are listed in the F array, to the CGNS file from the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the writes into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • A[in] An array of data array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[in] Buffers with data to be written to the CGNS file.

Returns:

Error status.

int cgp_array_multi_read_data(int fn, int *A, const cgsize_t *rmin, const cgsize_t *rmax, int nsets, void *buf[])#

Reads multiple sets of array data in parallel.

Reads the actual array data from the node in parallel, where rmin and rmax specify the subset of array data to be read by a given process. The application is responsible for ensuring that the array data type matches what is defined in the file; no conversions are made.

Uses HDF5’s multidataset API H5Dread_multi to read nsets of array data, whose identifiers are listed in the F array, from the CGNS file into the multiple application memory buffers listed in the buf array. All array parameters have length nsets. The HDF5 library will combine the writes into larger I/O requests, which usually results in better parallel I/O performance.

Parameters:
  • fn[in] CGNS file index number.

  • A[in] An array of data array index numbers.

  • rmin[in] Lower range index in file (eg., imin, jmin, kmin).

  • rmax[in] Upper range index in file (eg., imax, jmax, kmax).

  • nsets[in] The number of data sets stored in the data buffer.

  • buf[out] Buffers to receive data read from the CGNS file.

Returns:

Error status.

Parallel Miscellaneous Routines#

int cgp_mpi_comm(MPI_Comm comm)#

Set the MPI communicator.

Sets the MPI communicator for parallel operations by the CGNS library. The default value is MPI_COMM_WORLD.

Parameters:

comm[in] The MPI communicator to be used by the CGNS library.

Returns:

Error status.

int cgp_mpi_info(MPI_Info info)#

Set the MPI info object.

Passes the MPI info object for parallel operations to the CGNS library. Notes for Fortran: the data type for info is an INTEGER.

Parameters:

info[in] The MPI info object to be used by the CGNS library.

Returns:

Error status.

int cgp_pio_mode(PIOmode_t mode)#

Set the parallel IO mode.

Sets the mode for parallel data reads and writes. The default value is CGP_COLLECTIVE, which allows any number of processes to access the data. When set to CGP_COLLECTIVE, all processes must access the data.

Parameters:

mode[in] Parallel input/output mode.

Returns:

Error status.

void cgp_error_exit(void)#

Exit with error message.

Is similar to cg_error_exit() in that the process will exit with an error message. However, it will also print the process rank and call MPI_Abort with an exit code of 1.

int cgp_ptlist_write_data(int file_number, cgsize_t rmin, cgsize_t rmax, const cgsize_t *points)#

Write index array to PointList in parallel.

Functions in Accessing a Node must be used to point to a PointSet for writing.

Parameters:
  • file_number[in] CGNS file index number.

  • rmin[in] Lower range index in file

  • rmax[in] Upper range index in file

  • points[in] Array of points

Returns:

Error status.

int cgp_ptlist_read_data(int file_number, cgsize_t rmin, cgsize_t rmax, cgsize_t *points)#

Read index array to PointList in parallel.

Functions in Accessing a Node must be used to point to a PointSet for reading.

Parameters:
  • file_number[in] CGNS file index number.

  • rmin[in] Lower range index in file

  • rmax[in] Upper range index in file

  • points[in] Array of points

Returns:

Error status.