XMDF  2.2
4.15.4. Writing scalar time steps

Three new functions will be created for writing scalar time steps. The function used in serial, xfWriteScalarTimestep, is used for either creating a dataset or appending to an already existing dataset. In parallel the function is called xfWriteScalarTimestepPar. xfWriteScalarTimestepPar will call xfWriteScalarTimestepParMinMax after determining the time step min and max using the function MPI_reduce. Each processor writes its corresponding scalar values to a dataset and their indices to a global id array. Thus the dataset can be reorganized to its proper format when read. This is to speed up writing and to avoid overlapping chunks when writing

The functions are listed below:

C
xfWriteScalarTimestepPar(xid a_Id, double a_Time, int a_NumTotal,
int a_NumValues, const double *a_Values,
const int *a_WhichVals, int a_Stride);
xfWriteScalarTimestepParMinMax(xid a_Id, double a_Time, int a_NumTotal,
int a_NumProc, const double *a_Values,
const int *a_WhichVals, int a_Stride,
double a_Min, double a_Max);
a_Id xid of the group containing the dataset
a_Time time of the current time step
a_NumTotal total number of values in the dataset
a_NumValues number of values to be written by this processor
a_Values values to be written to the dataset
a_WhichVals indices corresponding to the location of the values in the dataset
a_Stride number of values (or bytes) to be skipped in the dataset after each value
FORTRAN
SUBROUTINE XF_WRITE_SCALAR_TIMESTEP_PAR (a_Id, a_Time, a_NumTotal,
a_NumProc, a_Values,
a_WhichVals, a_Stride,
error)
INTEGER(HID_T), INTENT(IN) :: a_Id
REAL*8, INTENT(IN) :: a_Time
INTEGER(HSIZE_T), INTENT(IN) :: a_NumTotal
INTEGER(HSIZE_T), INTENT(IN) :: a_NumProc
REAL*8, DIMENSION(*), INTENT(IN) :: a_Values
INTEGER, DIMENSION(*), INTENT(IN) :: a_WhichVals
INTEGER, INTENT(IN) :: a_Stride
INTEGER, INTENT(OUT) :: error
SUBROUTINE XF_WRITE_SCALAR_TS_MIN_MAX_PAR(a_Id, a_Time, a_NumTotal,
a_NumProc,
a_Values, a_WhichVals,
a_Minimum, a_Maximum,
error)
INTEGER(HID_T), INTENT(IN) :: a_Id
REAL*8, INTENT(IN) :: a_Time
INTEGER(HSIZE_T), INTENT(IN) :: a_NumTotal
INTEGER(HSIZE_T), INTENT(IN) :: a_NumProc
REAL*8, DIMENSION(*), INTENT(IN) :: a_Values
INTEGER, DIMENSION(*), INTENT(IN) :: a_WhichVals
REAL*8, INTENT(IN) :: a_Minimum, a_Maximum
INTEGER, INTENT(OUT) :: error