Skip to content

Commit 630fe89

Browse files
committed
check hint nc_header_collective
1 parent 1cbbe94 commit 630fe89

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/testcases/tst_info.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ int main(int argc, char** argv) {
110110
MPI_Info_create(&info);
111111
MPI_Info_set(info, "nc_header_align_size", "1"); /* size in bytes */
112112
MPI_Info_set(info, "nc_var_align_size", "197"); /* size in bytes */
113+
MPI_Info_set(info, "nc_header_collective", "true");
113114

114115
/* create another new file using a non-NULL MPI info --------------------*/
115116
err = ncmpi_create(MPI_COMM_WORLD, filename, NC_CLOBBER, info, &ncid2); CHECK_ERR
@@ -191,6 +192,19 @@ int main(int argc, char** argv) {
191192
}
192193
}
193194

195+
MPI_Info_get_valuelen(info_used, "nc_header_collective", &len, &flag);
196+
if (flag) {
197+
MPI_Info_get(info_used, "nc_header_collective", len+1, value, &flag);
198+
if (strcasecmp("true", value)) {
199+
printf("Error: nc_header_collective expect \"true\" but got \"%s\"\n",
200+
value);
201+
nerrs++;
202+
}
203+
} else {
204+
printf("Error: hint \"nc_header_collective\" is missing\n");
205+
nerrs++;
206+
}
207+
194208
MPI_Info_get_valuelen(info_used, "pnetcdf_subfiling", &len, &flag);
195209
if (flag) {
196210
MPI_Info_get(info_used, "pnetcdf_subfiling", len+1, value, &flag);

0 commit comments

Comments
 (0)