Updating test_intercomm2 to read and check the data with more combinations of start/count.
@@ -83,14 +83,20 @@ int check_file(int iosysid, int format, char *filename, int my_rank)
/* Try to read the data. */
PIO_Offset start[NDIM] = {0}, count[NDIM] = {DIM_LEN};
int data_in[DIM_LEN];
+ /* Check with various combinations of start/count */
+ for (int start_index = 0; start_index < DIM_LEN; start_index++)
+ {
+ start[0] = start_index;
+ count[0] = DIM_LEN - start_index;
if ((ret = PIOc_get_vars_tc(ncid, 0, start, count, NULL, NC_INT, data_in)))
ERR(ret);
- for (int i = 0; i < DIM_LEN; i++)
+ for (int i = 0; i < count[0]; i++)
{
- printf("%d test_intercomm2 read data_in[%d] = %d\n", my_rank, i, data_in[i]);
- if (data_in[i] != i)
+ printf("%d test_intercomm2 read data_in[%d] = %d, start_index = %d\n", my_rank, i, data_in[i], start_index);
+ if (data_in[i] != (i + start_index))
ERR(ERR_AWFUL);
}
+ }
/* Find the number of dimensions, variables, and global attributes.*/
if ((ret = PIOc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)))
