Skip to content

Commit f9d6041

Browse files
committed
rebase master branch
* Note chunking/compression feature is only supported when using the MPI-IO driver. Hint nc_pncio must be set to "disable".
1 parent be25547 commit f9d6041

9 files changed

Lines changed: 50 additions & 15 deletions

File tree

examples/C/chunk_2D.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ compress(MPI_Comm comm, char *filename, int cmode)
233233
MPI_Info_set(info, "nc_chunking", "enable");
234234
MPI_Info_set(info, "nc_chunk_default_filter", "zlib");
235235

236+
/* chunking is supported only when MPI-IO driver is used */
237+
MPI_Info_set(info, "nc_pncio", "disable");
238+
236239
cmode |= NC_CLOBBER;
237240
err = ncmpi_create(comm, filename, cmode, info, &ncid);
238241
PNC_ERR("ncmpi_create")
@@ -327,6 +330,9 @@ decompress(MPI_Comm comm, char *filename)
327330
MPI_Info_create(&info);
328331
MPI_Info_set(info, "nc_chunking", "enable");
329332

333+
/* chunking is supported only when MPI-IO driver is used */
334+
MPI_Info_set(info, "nc_pncio", "disable");
335+
330336
err = ncmpi_open(comm, filename, NC_NOWRITE, info, &ncid);
331337
PNC_ERR("ncmpi_open")
332338

@@ -455,6 +461,9 @@ partition_time(MPI_Comm comm, char *filename)
455461
MPI_Info_create(&info);
456462
MPI_Info_set(info, "nc_chunking", "enable");
457463

464+
/* chunking is supported only when MPI-IO driver is used */
465+
MPI_Info_set(info, "nc_pncio", "disable");
466+
458467
err = ncmpi_open(comm, filename, NC_NOWRITE, info, &ncid);
459468
PNC_ERR("ncmpi_open")
460469

examples/C/chunk_compress.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ pnetcdf_io(MPI_Comm comm, char *filename, int cmode)
128128
MPI_Info_set(info, "nc_chunking", "enable");
129129
MPI_Info_set(info, "nc_chunk_default_filter", "zlib");
130130

131+
/* chunking is supported only when MPI-IO driver is used */
132+
MPI_Info_set(info, "nc_pncio", "disable");
133+
131134
/* create a new file for writing ----------------------------------------*/
132135
cmode |= NC_CLOBBER;
133136
err = ncmpi_create(comm, filename, cmode, info, &ncid); ERR

examples/C/chunk_compress_FLDS.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ pnetcdf_io(MPI_Comm comm,
8282
MPI_Info_set(info, "nc_chunking", "enable");
8383
MPI_Info_set(info, "nc_chunk_default_filter", "zlib");
8484

85+
/* chunking is supported only when MPI-IO driver is used */
86+
MPI_Info_set(info, "nc_pncio", "disable");
87+
8588
/* open the input file file */
8689
err = ncmpi_open(comm, in_path, NC_NOWRITE, info, &ncid); ERR
8790
err = ncmpi_inq_dimid(ncid, "time", &dimid[0]); ERR

examples/C/chunk_io.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ compress(MPI_Comm comm, char *filename, int cmode)
147147
MPI_Info_set(info, "nc_chunking", "enable");
148148
MPI_Info_set(info, "nc_chunk_default_filter", "zlib");
149149

150+
/* chunking is supported only when MPI-IO driver is used */
151+
MPI_Info_set(info, "nc_pncio", "disable");
152+
150153
/* the global array is (NTIMES * nprocs) x (NY * nprocs) x NX */
151154

152155
/* set chunking (1st dimension should always be 1 for record variable) */
@@ -221,6 +224,9 @@ decompress(MPI_Comm comm, char *filename)
221224
MPI_Info_create(&info);
222225
MPI_Info_set(info, "nc_chunking", "enable");
223226

227+
/* chunking is supported only when MPI-IO driver is used */
228+
MPI_Info_set(info, "nc_pncio", "disable");
229+
224230
/* the global array is (NTIMES * nprocs) x (NY * nprocs) * NX */
225231

226232
/* open the file for reading ----------------------------------------*/

src/drivers/ncchunkio/Makefile.am

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ AM_CPPFLAGS = -I${top_srcdir}/src/include
1212
AM_CPPFLAGS += -I${top_builddir}/src/include
1313
AM_CPPFLAGS += -I${top_srcdir}/src/drivers/include
1414
AM_CPPFLAGS += -I${top_builddir}/src/drivers/include
15+
AM_CPPFLAGS += -I${top_srcdir}/src/drivers/ncmpio
16+
AM_CPPFLAGS += -I${top_srcdir}/src/drivers/pncio
1517

1618
if PNETCDF_DEBUG
1719
AM_CPPFLAGS += -DPNETCDF_DEBUG
1820
endif
1921

20-
if PNETCDF_PROFILING
21-
AM_CPPFLAGS += -DPNETCDF_PROFILING
22-
endif
23-
2422
noinst_LTLIBRARIES = libncchkio.la
2523

2624
M4FLAGS += -I${top_srcdir}/m4

src/drivers/ncchunkio/ncchkio_driver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ struct NC_chk {
182182
};
183183

184184
extern int ncchkio_create (
185-
MPI_Comm comm, const char *path, int cmode, int ncid, MPI_Info info, void **ncdp);
185+
MPI_Comm comm, const char *path, int cmode, int ncid, int env_mode, MPI_Info info, PNCIO_node_ids node_ids, void **ncdp);
186186

187187
extern int ncchkio_open (
188-
MPI_Comm comm, const char *path, int omode, int ncid, MPI_Info info, void **ncdp);
188+
MPI_Comm comm, const char *path, int omode, int ncid, int env_mode, MPI_Info info, PNCIO_node_ids node_ids, void **ncdp);
189189

190190
extern int ncchkio_close (void *ncdp);
191191

src/drivers/ncchunkio/ncchkio_file.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@
4848
#include "../ncmpio/ncmpio_NC.h"
4949
#include "ncchkio_internal.h"
5050

51-
int ncchkio_create (
52-
MPI_Comm comm, const char *path, int cmode, int ncid, MPI_Info info, void **ncpp) /* OUT */
51+
int ncchkio_create(MPI_Comm comm,
52+
const char *path,
53+
int cmode,
54+
int ncid,
55+
int env_mode,
56+
MPI_Info info,
57+
PNCIO_node_ids node_ids, /* node IDs of all processes */
58+
void **ncpp) /* OUT */
5359
{
5460
int err=NC_NOERR;
5561
int one = 1;
@@ -61,11 +67,11 @@ int ncchkio_create (
6167
t0 = MPI_Wtime ();
6268
#endif
6369

64-
/* TODO: use comde to determine the true driver */
70+
/* TODO: use cmode to determine the true driver */
6571
driver = ncmpio_inq_driver ();
6672
if (driver == NULL) return NC_ENOTNC;
6773

68-
err = driver->create (comm, path, cmode | NC_64BIT_DATA, ncid, info, &ncp);
74+
err = driver->create(comm, path, cmode | NC_64BIT_DATA, ncid, env_mode, info, node_ids, &ncp);
6975
if (err != NC_NOERR) return err;
7076

7177
/* Create a NC_chk object and save its driver pointer */
@@ -107,8 +113,15 @@ int ncchkio_create (
107113
return NC_NOERR;
108114
}
109115

110-
int ncchkio_open (
111-
MPI_Comm comm, const char *path, int omode, int ncid, MPI_Info info, void **ncpp) {
116+
int ncchkio_open(MPI_Comm comm,
117+
const char *path,
118+
int omode,
119+
int ncid,
120+
int env_mode,
121+
MPI_Info info,
122+
PNCIO_node_ids node_ids, /* node IDs of all processes */
123+
void **ncpp) /* OUT */
124+
{
112125
int err=NC_NOERR;
113126
int one = 0;
114127
void *ncp = NULL;
@@ -120,14 +133,14 @@ int ncchkio_open (
120133
t0 = MPI_Wtime ();
121134
#endif
122135

123-
/* TODO: use comde to determine the true driver */
136+
/* TODO: use omode to determine the true driver */
124137
driver = ncmpio_inq_driver ();
125138
if (driver == NULL) {
126139
DEBUG_ASSIGN_ERROR (err, NC_ENOTNC)
127140
goto errout;
128141
}
129142

130-
err = driver->open (comm, path, omode, ncid, info, &ncp);
143+
err = driver->open(comm, path, omode, ncid, env_mode, info, node_ids, &ncp);
131144
if (err != NC_NOERR) goto errout;
132145

133146
/* Create a NC_chk object and save its driver pointer */

src/drivers/ncchunkio/ncchkio_var.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#include <stdlib.h>
5454
#include <string.h>
5555

56-
#include "../ncmpio/ncmpio_NC.h"
56+
#include "ncmpio_NC.h"
5757
#include "ncchkio_internal.h"
5858

5959
int ncchkio_def_var (

test/testcases/tst_chunk_nonblocking.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ int main(int argc, char **argv)
5555
MPI_Info_create(&info);
5656
MPI_Info_set(info, "nc_chunking", "enable");
5757

58+
/* chunking is supported only when MPI-IO driver is used */
59+
MPI_Info_set(info, "nc_pncio", "disable");
60+
5861
err = ncmpi_create(MPI_COMM_WORLD, filename, NC_CLOBBER, info, &ncid);
5962
CHECK_ERR
6063
MPI_Info_free(&info);

0 commit comments

Comments
 (0)