Skip to content

Commit

Permalink
Do subset write through H5Tpack + H5Tconvert
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed Jan 31, 2024
1 parent 9979a64 commit b67a1b0
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 227 deletions.
28 changes: 6 additions & 22 deletions src/rest_vol.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,22 +451,6 @@ typedef enum {
H5T_SUBSET_CAP /* Must be the last value */
} RV_subset_t;

/* Information about members of a compound type for subsetting */
typedef struct RV_compound_info_t {
RV_subset_t subset_info; /* Subset relationship between src and dst */

int nmembers; /* Number of offset/length pairs in the subset */
int nalloc; /* Number of offset/length pairs allocated */
size_t full_type_size; /* Size of compound type with all fields */

size_t *src_offsets; /* Offsets of fields within source datatype */
size_t *lengths; /* Lengths of members (in both datatypes) */

size_t subset_buf_size;
void *subset_buf;
void *subset_ptr; /* Pointer for writing into the subset buffer */
} RV_compound_info_t;

/*
* A struct which is used to return a link's name or the size of
* a link's name when calling H5Lget_name_by_idx.
Expand Down Expand Up @@ -600,6 +584,10 @@ typedef struct dataset_write_info {
char *base64_encoded_values;
curl_off_t write_len;
upload_info uinfo;

/* If writing using compound subsetting, this is a packed version of the
* compound type containing only the selected members */
hid_t dense_cmpd_subset_dtype_id;
} dataset_write_info;

typedef struct dataset_read_info {
Expand Down Expand Up @@ -631,9 +619,6 @@ typedef struct dataset_transfer_info {
void *tconv_buf;
void *bkg_buf;

/* Fields for writing to subsets of compound types */
RV_compound_info_t compound_info;

transfer_type_t transfer_type;

union {
Expand Down Expand Up @@ -795,11 +780,10 @@ herr_t RV_convert_datatype_to_JSON(hid_t type_id, char **type_body, size_t *type
herr_t RV_JSON_escape_string(const char *in, char *out, size_t *out_size);

/* Determine if a read from file to mem dtype is a compound subset read */
herr_t RV_get_compound_subset_info(hid_t src_type_id, hid_t dst_type_id, RV_subset_t *subset_info);
herr_t RV_get_cmpd_subset_type(hid_t src_type_id, hid_t dst_type_id, RV_subset_t *subset_info);

/* Helper to get information about members in dst that are included in src compound */
herr_t RV_get_compound_subset_members(hid_t src_type_id, hid_t dst_type_id,
RV_compound_info_t *compound_info);
herr_t RV_get_cmpd_subset_nmembers(hid_t src_type_id, hid_t dst_type_id, size_t *num_cmpd_members);

#define SERVER_VERSION_MATCHES_OR_EXCEEDS(version, major_needed, minor_needed, patch_needed) \
(version.major > major_needed) || (version.major == major_needed && version.minor > minor_needed) || \
Expand Down
Loading

0 comments on commit b67a1b0

Please sign in to comment.