XMDF  2.2
4.15.6. Reading scalar time steps

The function used in serial, xfReadScalarValuesTimestep, is used for reading an existing dataset. In parallel, the function xfReadScalarValuesTimestepPar requires an additional parameter a_StartIndex which specifies where in the array to begin reading values. a_Values should be allocated appropriately before this function is called. The function is listed below:

C
int xfReadScalarValuesTimestepPar(xid a_Id, int a_Time, int a_StartIndex, int a_NumValues, float *a_Values, int a_Stride);
a_Id xid of the group containing the dataset
a_Time time index of the current time step
a_StartIndex indices corresponding to the starting location of the values in the dataset to be read
a_NumValues number of values to be read
a_Values values to be read from the dataset
a_Stride number of values (or bytes) to be skipped in the dataset after each value
FORTRAN
SUBROUTINE XF_READ_SCALAR_VALUES_TS_PAR (a_Id, a_Time, StartIndex, a_NumVals,
a_Values, a_Stride, error)
INTEGER(HID_T), INTENT(IN) :: a_Id
INTEGER, INTENT(IN) :: a_Time, a_NumVals, a_StartIndex
REAL*8, DIMENSION(*), INTENT(OUT) :: a_Values
INTEGER, INTENT(IN) :: a_Stride
INTEGER, INTENT(OUT) :: error

The user may or may not know how many values to read or how the data should be partitioned among the processors. For the case where the user does not know the number of values, a function was created to return the number of values to be read and the starting index for a contiguous chunk of data. In this case, the user would call this function before calling xfReadScalarValuesTimestepPar. A dataset group or a mesh group can be passed in as the a_Id.

C
int xfGetOffsetPar(xid a_Id, int a_Time, int *a_NumValues, int *a_StartIndex);
a_Id xid of the group containing the dataset
a_Time time index of the current time step
a_StartIndex indice corresponding to the starting location of the values in the dataset to be read
a_NumValues number of values to be read
FORTRAN
SUBROUTINE XF_GET_OFFSET_PAR (a_Id, a_NumValues, a_StartIndex, error)
INTEGER(HID_T), INTENT(IN) :: a_Id
INTEGER, INTENT(OUT) :: a_NumValues, a_StartIndex
INTEGER, INTENT(OUT) :: error