Skip to content

Commit

Permalink
Fix the HL H5TB fill-info HDFGroup#5332
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Feb 24, 2025
1 parent d35d1ec commit 85a31db
Show file tree
Hide file tree
Showing 35 changed files with 3,279 additions and 498 deletions.
8 changes: 4 additions & 4 deletions HDF5Examples/C/HL/h5ex_table_01.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ main(void)
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand Down
10 changes: 5 additions & 5 deletions HDF5Examples/C/HL/h5ex_table_02.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ main(void)
Particle dst_buf[NRECORDS + NRECORDS_ADD];

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

/* Calculate the size and the offsets of our struct members in memory */
size_t dst_size = sizeof(Particle);
Expand All @@ -66,7 +66,7 @@ main(void)
int i;

/* Append particles */
Particle particle_in[NRECORDS_ADD] = {{"eight", 80, 80, 8.0F, 80.0}, {"nine", 90, 90, 9.0F, 90.0}};
Particle particle_in[NRECORDS_ADD] = {{"eight", 80, 81, 8.2F, 80.3}, {"nine", 90, 91, 9.2F, 90.3}};

/* Initialize the field field_type */
string_type = H5Tcopy(H5T_C_S1);
Expand Down
6 changes: 3 additions & 3 deletions HDF5Examples/C/HL/h5ex_table_03.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ main(void)
size_t dst_offset[NFIELDS] = {HOFFSET(Particle, name), HOFFSET(Particle, lati), HOFFSET(Particle, longi),
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};

Particle p = {"zero", 0, 0, 0.0F, 0.0};
Particle p = {"zero", 0, 1, 0.2F, 0.3};
size_t dst_sizes[NFIELDS] = {sizeof(p.name), sizeof(p.lati), sizeof(p.longi), sizeof(p.pressure),
sizeof(p.temperature)};

/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
/* Fill value particle */
Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
Particle fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}};
hid_t field_type[NFIELDS];
hid_t string_type;
hid_t file_id;
Expand All @@ -63,7 +63,7 @@ main(void)
int i;

/* Define 2 new particles to write */
Particle particle_in[NRECORDS_WRITE] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0}};
Particle particle_in[NRECORDS_WRITE] = {{"zero", 0, 1, 0.2F, 0.3}, {"one", 10, 11, 1.2F, 10.3}};

/* Initialize the field field_type */
string_type = H5Tcopy(H5T_C_S1);
Expand Down
8 changes: 4 additions & 4 deletions HDF5Examples/C/HL/h5ex_table_04.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ main(void)
hid_t string_type;
hid_t file_id;
hsize_t chunk_size = 10;
Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
Particle fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}}; /* Fill value particle */
hsize_t start; /* Record to start reading/writing */
hsize_t nrecords; /* Number of records to read/write */
int compress = 0;
Expand All @@ -74,9 +74,9 @@ main(void)
float pressure_in[NRECORDS_ADD] = /* Define new values for the field "Pressure" */
{0.0F, 1.0F, 2.0F};
Position position_in[NRECORDS_ADD] = {/* Define new values for "Latitude,Longitude" */
{0, 0},
{10, 10},
{20, 20}};
{0, 1},
{10, 11},
{20, 21}};
NamePressure namepre_in[NRECORDS_ADD] = /* Define new values for "Name,Pressure" */
{
{"zero", 0.0F},
Expand Down
4 changes: 2 additions & 2 deletions HDF5Examples/C/HL/h5ex_table_05.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ main(void)
hid_t string_type;
hid_t file_id;
hsize_t chunk_size = 10;
Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
Particle fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}}; /* Fill value particle */
int compress = 0;
hsize_t nfields;
hsize_t start; /* Record to start reading/writing */
Expand All @@ -77,7 +77,7 @@ main(void)
int field_index_pos[2] = {1, 2};

/* Define new values for the fields "Latitude,Longitude" */
Position position_in[NRECORDS_ADD] = {{0, 0}, {10, 10}, {20, 20}};
Position position_in[NRECORDS_ADD] = {{0, 1}, {10, 11}, {20, 21}};

size_t field_sizes_pos[2] = {sizeof(position_in[0].longi), sizeof(position_in[0].lati)};

Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/C/HL/h5ex_table_06.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ main(void)
hid_t string_type;
hid_t file_id;
hsize_t chunk_size = 10;
Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
Particle fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}}; /* Fill value particle */
int compress = 0;
hsize_t nfields_out;
hsize_t nrecords_out;
Expand Down
10 changes: 5 additions & 5 deletions HDF5Examples/C/HL/h5ex_table_07.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ main(void)
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

const char *field_names[NFIELDS] = /* Define field information */
{"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand All @@ -56,7 +56,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
Particle fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}};
hsize_t start; /* Record to start reading */
hsize_t nrecords; /* Number of records to insert/delete */
hsize_t nfields_out;
Expand Down
10 changes: 5 additions & 5 deletions HDF5Examples/C/HL/h5ex_table_08.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ main(void)
Particle dst_buf[NRECORDS + NRECORDS_INS];

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

/* Calculate the size and the offsets of our struct members in memory */
size_t dst_size = sizeof(Particle);
Expand All @@ -54,7 +54,7 @@ main(void)
sizeof(p_data[0].pressure), sizeof(p_data[0].temperature)};

/* Define an array of Particles to insert */
Particle p_data_insert[NRECORDS_INS] = {{"new", 30, 30, 3.0F, 30.0}, {"new", 40, 40, 4.0F, 40.0}};
Particle p_data_insert[NRECORDS_INS] = {{"new", 80, 81, 8.2F, 83.0}, {"new", 90, 91, 9.2F, 93.0}};

/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand Down
10 changes: 5 additions & 5 deletions HDF5Examples/C/HL/h5ex_table_09.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ main(void)
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand All @@ -61,7 +61,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
Particle fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}}; /* Fill value particle */
hsize_t start1; /* Record to start reading from 1st table */
hsize_t nrecords; /* Number of records to insert */
hsize_t start2; /* Record to start writing in 2nd table */
Expand Down
8 changes: 4 additions & 4 deletions HDF5Examples/C/HL/h5ex_table_10.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ main(void)
} Particle;

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

Particle dst_buf[2 * NRECORDS];
/* Calculate the size and the offsets of our struct members in memory */
Expand Down
10 changes: 5 additions & 5 deletions HDF5Examples/C/HL/h5ex_table_11.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ main(void)
} Particle1;

/* Define an array of Particles */
Particle1 p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle1 p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

/* Calculate the size and the offsets of our struct members in memory */
size_t dst_size1 = sizeof(Particle1);
Expand All @@ -56,7 +56,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
Particle1 fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
Particle1 fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}};
int fill_data_new[1] = {-100};
hsize_t position;
hsize_t nfields_out;
Expand Down
10 changes: 5 additions & 5 deletions HDF5Examples/C/HL/h5ex_table_12.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ main(void)
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
{"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
{"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
{"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle p_data[NRECORDS] = {{"zero", 0, 1, 0.2F, 3.0}, {"one", 10, 11, 1.2F, 13.0},
{"two", 20, 21, 2.2F, 23.0}, {"three", 30, 31, 3.2F, 33.0},
{"four", 40, 41, 4.2F, 43.0}, {"five", 50, 51, 5.2F, 53.0},
{"six", 60, 61, 6.2F, 63.0}, {"seven", 70, 71, 7.2F, 73.0}};

/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand All @@ -56,7 +56,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
Particle fill_data[1] = {{"no data", -1, -2, -99.0F, -98.0}};
hsize_t nfields_out;
hsize_t nrecords_out;

Expand Down
48 changes: 24 additions & 24 deletions HDF5Examples/C/HL/tfiles/h5ex_table_01.ddl
Original file line number Diff line number Diff line change
Expand Up @@ -18,58 +18,58 @@ GROUP "/" {
(0): {
"zero",
0,
0,
0,
0
1,
0.2,
3
},
(1): {
"one",
10,
10,
1,
10
11,
1.2,
13
},
(2): {
"two",
20,
20,
2,
20
21,
2.2,
23
},
(3): {
"three",
30,
30,
3,
30
31,
3.2,
33
},
(4): {
"four",
40,
40,
4,
40
41,
4.2,
43
},
(5): {
"five",
50,
50,
5,
50
51,
5.2,
53
},
(6): {
"six",
60,
60,
6,
60
61,
6.2,
63
},
(7): {
"seven",
70,
70,
7,
70
71,
7.2,
73
}
}
ATTRIBUTE "CLASS" {
Expand Down
16 changes: 8 additions & 8 deletions HDF5Examples/C/HL/tfiles/h5ex_table_01.tst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
zero 0 0 0.000000 0.000000
one 10 10 1.000000 10.000000
two 20 20 2.000000 20.000000
three 30 30 3.000000 30.000000
four 40 40 4.000000 40.000000
five 50 50 5.000000 50.000000
six 60 60 6.000000 60.000000
seven 70 70 7.000000 70.000000
zero 0 1 0.200000 3.000000
one 10 11 1.200000 13.000000
two 20 21 2.200000 23.000000
three 30 31 3.200000 33.000000
four 40 41 4.200000 43.000000
five 50 51 5.200000 53.000000
six 60 61 6.200000 63.000000
seven 70 71 7.200000 73.000000
Loading

0 comments on commit 85a31db

Please sign in to comment.