4 PARCEL Data Types
Description Types used to specify precision through template arguments (referred to below as parceltype), and the integer types. All of them are in the global namespace (outside the namespace parcel). These types are given both for the data precision of matrices and vectors (parcel::matrix<T>, parcel::vector<T>) and for the arithmetic precision of solvers (class template arguments). The precision template arguments can be omitted; when omitted, they are parcel_double (parcel::matrix<>, parcel::vector<>, parcel::krylov::pcg<>, etc.; template arguments of solver()).
Synopsis
using parcel_double = parcel::floatingtype<double>;
using parcel_float = parcel::floatingtype<float>;
using parcel_longdouble = parcel::floatingtype<long double>;
using parcel_fp16 = parcel::floatingtype<sycl::half>;
using parcel_doubledouble = parcel::doubledouble;
#define PARCEL_INT int64_t // int32_t with -DPARCEL_INT32
#define PARCEL_LINT int32_t // int64_t with -DPARCEL_LOCAL_INT64| Type name | Contents |
|---|---|
parcel_fp16 |
sycl::half type (half precision) |
parcel_float |
float type (single precision) |
parcel_double |
double type (double precision) |
parcel_longdouble |
long double type |
parcel_doubledouble |
double-double type (equivalent to quadruple precision). Stored as two double arrays, the high and low parts |
PARCEL_INT |
Integer type for row indices, column indices, numbers of rows, numbers of nonzeros, iteration counts, etc. The default is int64_t (MPI_INT64_T in MPI). Building with -DPARCEL_INT32 makes it int32_t (MPI_INT32_T) (-DPARCEL_INT32=0 means 64 bits). -DPARCEL_INT is accepted as a request for 64 bits (its value is ignored). Specifying both -DPARCEL_INT and -DPARCEL_INT32 results in #error. The selected width is available as the macro PARCEL_INT_BITS (64 / 32) |
PARCEL_LINT |
Type of the indices within one rank. Used for the row pointers and localized column indices of the CRS on the device, the indices of the elements sent in the halo exchange, and in the SpMV and preconditioner kernels. The default is int32_t (MPI_INT32_T). Building with -DPARCEL_LOCAL_INT64 (non-zero value) makes it int64_t (MPI_INT64_T). With -DPARCEL_INT32 it is int32_t. Specifying both -DPARCEL_INT32 and -DPARCEL_LOCAL_INT64 results in #error. The selected width is available as the macro PARCEL_LINT_BITS (32 / 64). It does not appear in the API arguments |
Notes With configurations that use parcel_fp16, there is a lower limit on the relative residual that the precision can reach; with a tolerance below it, the iteration stagnates or breaks down with NaN. With FP16, the Cholesky QR family of pcagmres (CAGMRES_Q_IMPLICIT and the moment method) cannot be used. The details of the restrictions are given in “Specifying Precision” in the “Usage” chapter.
The row-pointer and column-index arrays of the CRS passed to set_crsMat() are PARCEL_INT (8 bytes by default). The CRS on the device is held in PARCEL_LINT, so by default its column indices and row pointers take 4 bytes, and for a double-precision matrix 12 bytes per nonzero including the value. With -DPARCEL_LOCAL_INT64 they take 8 bytes (16 bytes per nonzero in double precision), which increases the memory traffic of SpMV (sparse matrix-vector product). With -DPARCEL_INT32 both are 4 bytes (only for problems with at most rows). In the C and Fortran APIs, the numbers of rows and nonzeros, the row pointers and the column indices are 64-bit regardless of PARCEL_INT (parcel_int in C, integer(parcel_int_kind) in Fortran) (“Usage” chapter).
See Also Items Common to All Solvers; “Integer Type” in the “Basic Structure” chapter; “Integer Type” in the “Installation” chapter