Get datatype and size for a field

saf_get_count_and_type_for_field is a function defined in field.c.

Synopsis:

int saf_get_count_and_type_for_field(SAF_ParMode pmode, SAF_Field *field, SAF_FieldTarget *target, size_t *Pcount, hid_t *Ptype)

Formal Arguments:

  • pmode: The parallel mode.
  • field: The field handle.
  • target: Optional field targeting information.
  • Pcount: [OUT] The number of items that would be placed in the buffer by a call to the saf_read_field function. The caller may pass a value of NULL for this parameter if this value is not desired.
  • Ptype: [OUT] The type of the items that would be placed in the buffer by a call to the saf_read_field function. The caller may pass a value of NULL for this parameter if this value is not desired. The returned HDF5 datatype can be closed by the caller when no longer needed.

Description: This function is used to retrieve the number and type of items that would be retrieved by a call to the saf_read_field function. This function may be used by the caller to determine the size of the buffer needed when pre-allocation is desired or to determine how to traverse the buffer returned by the saf_read_field function.

Preconditions:

  • pmode must be valid. (low-cost)
  • field must be a valid field handle. (low-cost)
  • If targeting of storage decomposition is used, the read must be a SAF__ALL mode read or the. (low-cost)

Return Value: The constant SAF__SUCCESS is returned when this function is successful. Otherwise this function either returns an error number or throws an exception, depending on the value of the library’s error handling property.

Issues: Fields stored on a decomposition must have same datatype. It may be possible to relax this a bit. Also what if the field has been decomposed into blocks? say triangles and quads, field remapping may be possible but makes no sense as the DOFs would be all mixed-up some for triangles, some for quads.

See Also: