1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 int
 saf_use_written_subset_relation(SAF_ParMode pmode,      /* the parallel mode. */
                                 SAF_Rel *rel,           /* The handle for the relation to be updated. */
                                 SAF_Rel *oldrel,        /* The handle for the relation pointing to the data to be re-used. */
                                 hid_t A_buf_type,       /* The type of data that would be written for the A buffer (see
                                                          * saf_write_subset_relation()) if this call was actually doing any
                                                          * writing. */
                                 hid_t B_buf_type,       /* The type of data that would be written for the B buffer (see
                                                          * saf_write_subset_relation()) if this call was actually doing any
                                                          * writing. */
                                 SAF_Db *file            /* The file the data would be written to if this call was actually
                                                          * doing any writing. */
 )
 {
     SAF_ENTER(saf_use_written_subset_relation, SAF_PRECONDITION_ERROR);
     int         retval;

     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_REL(rel), SAF_LOW_CHK_COST, SAF_PRECONDITION_ERROR,
                 _saf_errmsg("REL must be a valid relation handle"));
     SAF_REQUIRE(SS_REL(oldrel), SAF_LOW_CHK_COST, SAF_PRECONDITION_ERROR,
                 _saf_errmsg("OLDREL must be a valid relation handle"));

     /* Confirm relevant parts of relation records are identical */
     SAF_REQUIRE(SAF_EQUIV(SS_REL_P(rel,sup_cat),SS_REL_P(oldrel,sup_cat)), SAF_NO_CHK_COST, SAF_PRECONDITION_ERROR,
                 _saf_errmsg("OLDREL must be same as REL to re-use data written to it"));
     SAF_REQUIRE(SS_REL(rel)->kind==SS_REL(oldrel)->kind, SAF_NO_CHK_COST, SAF_PRECONDITION_ERROR,
                 _saf_errmsg("OLDREL must be same as REL to re-use data written to it"));

     /* Make the actual call to write/update the relation data */
     retval = _saf_write_subset_relation(pmode, rel, oldrel, A_buf_type, NULL, B_buf_type, NULL, file);
     SAF_LEAVE(retval);
 }