int
saf_is_self_stored_field(SAF_ParMode pmode, /* The parallel mode. */
SAF_Field *field, /* The handle of the field which is to be examined. */
hbool_t *result /* [OUT] Optional pointer to memory which is to receive the result of the test:
* true if the field is self stored or false if it is stored on a
* decomposition. */
)
{
SAF_ENTER(saf_is_self_stored_field, SAF_PRECONDITION_ERROR);
SAF_REQUIRE(_saf_valid_pmode(pmode), SAF_LOW_CHK_COST, SAF_PRECONDITION_ERROR,
_saf_errmsg("PMODE must be valid"));
if (!_saf_is_participating_proc(pmode)) SAF_RETURN(-1);
SAF_REQUIRE(SS_FIELD(field), SAF_LOW_CHK_COST, SAF_PRECONDITION_ERROR,
_saf_errmsg("FIELD must be a valid field handle"));
/* When a field is stored on "self" then we store actual field coefficient values. When a field is not stored on "self"
* then DOFs are stored on the subsets specified by the decomposition. In this case the field values of this "parent"
* field are the handles to the "actual" fields found on each of the subsets. */
if (_saf_is_self_decomp(SS_FIELD_P(field,storage_decomp_cat))) {
if (result) *result = TRUE;
} else {
if (result) *result = FALSE;
}
SAF_LEAVE(SAF_SUCCESS);
}