├── .github └── workflows │ ├── mac_mpich.yml │ ├── mac_openmpi.yml │ ├── ubuntu_mpich.yml │ └── ubuntu_openmpi.yml ├── .gitignore ├── .travis.yml ├── AUTHORS ├── COPYING ├── COPYRIGHT ├── CREDITS ├── ChangeLog ├── DEVELOPER_NOTES.md ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── README.md ├── RELEASE_NOTES ├── benchmarks ├── C │ ├── Makefile.am │ ├── aggregation.c │ ├── netcdf_put_vara.c │ ├── parallel_run.sh │ ├── pnetcdf_put_vara.c │ └── write_block_read_column.c ├── FLASH-IO │ ├── .gitignore │ ├── Makefile.am │ ├── README.md │ ├── block_boundary_data.fh │ ├── checkpoint_ncmpi_parallel.F90 │ ├── common.fh │ ├── configure.ac │ ├── definitions.fh │ ├── flash_benchmark_io.F90 │ ├── flash_release.F90 │ ├── get_mfluid_property.F90 │ ├── m4 │ │ ├── check_fortran.m4 │ │ └── libtool.m4 │ ├── numfluids.fh │ ├── parallel_run.sh │ ├── physicaldata.fh │ ├── plotfile_ncmpi_parallel.F90 │ ├── scripts │ │ └── ltmain.sh │ └── tree.fh ├── Makefile.am ├── README.md └── WRF-IO │ ├── Makefile.am │ ├── parallel_run.sh │ ├── wrf_header.txt │ └── wrf_io.c ├── configure.ac ├── coverity_model.c ├── doc ├── Makefile.am ├── README.ADIOS.md ├── README.CRAY.md ├── README.Fujitsu.md ├── README.IBM.md ├── README.INTEL.md ├── README.K-Computer.md ├── README.LINUX.md ├── README.NetCDF4.md ├── README.SGI.md ├── README.SX.md ├── README.Ubuntu.md ├── README.burst_buffering.md ├── README.consistency.md ├── README.large_files.md ├── README.md ├── blocking_vs_nonblocking.md ├── netcdf4_vs_pnetcdf.md ├── pbs.script ├── pnetcdf-api │ ├── Makefile.am │ ├── c_api.tex │ ├── data_mode_api.tex │ ├── flexible_api.tex │ ├── latex8.sty │ ├── multiple_io.tex │ ├── nonblocking.tex │ ├── pnetcdf-api.bbl │ └── pnetcdf-api.tex ├── porting_notes.txt └── symbol_renaming.txt ├── examples ├── C │ ├── Makefile.am │ ├── block_cyclic.c │ ├── bput_varn_int64.c │ ├── bput_varn_uint.c │ ├── cdl_header.txt │ ├── collective_write.c │ ├── column_wise.c │ ├── create_from_cdl.c │ ├── create_open.c │ ├── fill_mode.c │ ├── flexible_api.c │ ├── flexible_bottom.c │ ├── get_info.c │ ├── get_vara.c │ ├── ghost_cell.c │ ├── global_attributes.c │ ├── hints.c │ ├── i_varn_int64.c │ ├── mpi_subarray.c │ ├── mput.c │ ├── nonblocking_write.c │ ├── nonblocking_write_in_def.c │ ├── parallel_run.sh │ ├── pthread.c │ ├── put_vara.c │ ├── put_varn_float.c │ ├── put_varn_int.c │ ├── req_all.c │ ├── run_c_examples.sh │ ├── time_var.c │ ├── transpose.c │ ├── transpose2D.c │ ├── vard_bottom.c │ ├── vard_int.c │ └── vard_mvars.c ├── CXX │ ├── Makefile.am │ ├── SimpleXyWr.cpp │ ├── block_cyclic.cpp │ ├── collective_write.cpp │ ├── column_wise.cpp │ ├── fill_mode.cpp │ ├── flexible_api.cpp │ ├── get_info.cpp │ ├── get_vara.cpp │ ├── hints.cpp │ ├── nonblocking_write.cpp │ ├── parallel_run.sh │ ├── put_vara.cpp │ ├── put_varn_float.cpp │ ├── put_varn_int.cpp │ ├── run_cxx_examples.sh │ ├── transpose.cpp │ └── vard_int.cpp ├── F77 │ ├── Makefile.am │ ├── block_cyclic.f │ ├── bput_varn_int8.f │ ├── column_wise.f │ ├── fill_mode.f │ ├── flexible_api.f │ ├── get_info.f │ ├── hints.f │ ├── i_varn_real.f │ ├── nonblocking_write.f │ ├── parallel_run.sh │ ├── put_vara.f │ ├── put_varn_int.f │ ├── put_varn_real.f │ ├── run_f77_examples.sh │ ├── time_var.f │ ├── transpose.f │ ├── utils.F90 │ └── vard_int.f ├── F90 │ ├── Makefile.am │ ├── block_cyclic.f90 │ ├── column_wise.f90 │ ├── fill_mode.f90 │ ├── flexible_api.f90 │ ├── get_info.f90 │ ├── hints.f90 │ ├── nonblocking_write.f90 │ ├── parallel_run.sh │ ├── put_var.f90 │ ├── put_varn_int.f90 │ ├── put_varn_real.f90 │ ├── run_f90_examples.sh │ ├── transpose.f90 │ ├── utils.F90 │ └── vard_int.f90 ├── Makefile.am ├── README.md ├── adios │ ├── Makefile.am │ ├── parallel_run.sh │ ├── read_metadata.c │ ├── read_var.c │ └── read_var_nb.c ├── burst_buffer │ ├── Makefile.am │ ├── create_open.c │ ├── flash_benchmark_io.script │ ├── nonblocking.c │ └── parallel_run.sh └── tutorial │ ├── Makefile.am │ ├── parallel_run.sh │ ├── pnetcdf-permute.c │ ├── pnetcdf-read-flexible.c │ ├── pnetcdf-read-from-master.c │ ├── pnetcdf-read-nb.c │ ├── pnetcdf-read-nfiles.c │ ├── pnetcdf-read-standard.c │ ├── pnetcdf-write-buffered.c │ ├── pnetcdf-write-bufferedf.f90 │ ├── pnetcdf-write-bufferedf77.f │ ├── pnetcdf-write-flexible.c │ ├── pnetcdf-write-from-master.c │ ├── pnetcdf-write-nb.c │ ├── pnetcdf-write-nfiles.c │ └── pnetcdf-write-standard.c ├── m4 ├── aclocal_coverage.m4 ├── ax_compare_version.m4 ├── ax_compiler_vendor.m4 ├── check_cc.m4 ├── check_cxx.m4 ├── check_fortran.m4 ├── check_mpi.m4 ├── check_utils.m4 ├── foreach.m4 ├── foreachq.m4 ├── libtool.m4 ├── patch.libtool-2.4.6.m4.txt ├── patch.libtool-2.5.4.m4.txt ├── quote.m4 └── utils.m4 ├── man ├── Makefile.am ├── pnetcdf.m4 └── pnetcdf_f90.m4 ├── scripts ├── config.guess ├── config.sub ├── ltmain.sh ├── patch.ltmain-2.4.6.sh.txt └── patch.ltmain-2.5.4.sh.txt ├── sneak_peek.md ├── src ├── Makefile.am ├── binding │ ├── Makefile.am │ ├── cxx │ │ ├── Makefile.am │ │ ├── ncmpiAtt.cpp │ │ ├── ncmpiAtt.h │ │ ├── ncmpiByte.cpp │ │ ├── ncmpiByte.h │ │ ├── ncmpiChar.cpp │ │ ├── ncmpiChar.h │ │ ├── ncmpiCheck.cpp │ │ ├── ncmpiCheck.h │ │ ├── ncmpiCompoundType.cpp │ │ ├── ncmpiCompoundType.h │ │ ├── ncmpiDim.cpp │ │ ├── ncmpiDim.h │ │ ├── ncmpiDouble.cpp │ │ ├── ncmpiDouble.h │ │ ├── ncmpiEnumType.cpp │ │ ├── ncmpiEnumType.h │ │ ├── ncmpiException.cpp │ │ ├── ncmpiException.h │ │ ├── ncmpiFile.cpp │ │ ├── ncmpiFile.h │ │ ├── ncmpiFloat.cpp │ │ ├── ncmpiFloat.h │ │ ├── ncmpiGroup.cpp │ │ ├── ncmpiGroup.h │ │ ├── ncmpiGroupAtt.cpp │ │ ├── ncmpiGroupAtt.h │ │ ├── ncmpiInt.cpp │ │ ├── ncmpiInt.h │ │ ├── ncmpiInt64.cpp │ │ ├── ncmpiInt64.h │ │ ├── ncmpiOpaqueType.cpp │ │ ├── ncmpiOpaqueType.h │ │ ├── ncmpiShort.cpp │ │ ├── ncmpiShort.h │ │ ├── ncmpiType.cpp │ │ ├── ncmpiType.h │ │ ├── ncmpiUbyte.cpp │ │ ├── ncmpiUbyte.h │ │ ├── ncmpiUint.cpp │ │ ├── ncmpiUint.h │ │ ├── ncmpiUint64.cpp │ │ ├── ncmpiUint64.h │ │ ├── ncmpiUshort.cpp │ │ ├── ncmpiUshort.h │ │ ├── ncmpiVar.cpp │ │ ├── ncmpiVar.h │ │ ├── ncmpiVarAtt.cpp │ │ ├── ncmpiVarAtt.h │ │ ├── ncmpiVlenType.cpp │ │ ├── ncmpiVlenType.h │ │ ├── ncmpi_notyet.cpp │ │ ├── ncmpi_notyet.h │ │ └── pnetcdf.in │ ├── f77 │ │ ├── Makefile.am │ │ ├── README │ │ ├── buildiface │ │ ├── createffiles │ │ ├── defs │ │ ├── inq_libversf.f │ │ ├── mpinetcdf_impl.h │ │ ├── pnetcdf.inc.in │ │ ├── strerrnof.f │ │ └── strerrorf.f │ └── f90 │ │ ├── Makefile.am │ │ ├── api.fh.in │ │ ├── attributes.fh │ │ ├── dims.fh │ │ ├── file.fh │ │ ├── getput_text.m4 │ │ ├── getput_var.m4 │ │ ├── getput_vard.m4 │ │ ├── getput_varn.m4 │ │ ├── nf90_constants.fh │ │ ├── nfmpi_constants.fh.in │ │ ├── overloads.fh │ │ ├── pnetcdf.f90.in │ │ ├── variables.fh │ │ └── visibility.fh ├── dispatchers │ ├── Makefile.am │ ├── attr_getput.m4 │ ├── attribute.c │ ├── cdl_header_parser.c │ ├── dimension.c │ ├── error_codes.c │ ├── file.c │ ├── lib_version.c │ ├── var_getput.m4 │ └── variable.c ├── drivers │ ├── DEVELOPER_README.md │ ├── Makefile.am │ ├── common │ │ ├── Makefile.am │ │ ├── check_name.c │ │ ├── convert_swap.m4 │ │ ├── create_imaptype.c │ │ ├── dtype_decode.c │ │ ├── error_adios2nc.c │ │ ├── error_mpi2nc.c │ │ ├── error_posix2nc.c │ │ ├── hash_map.c │ │ ├── mem_alloc.c │ │ ├── ncx.m4 │ │ ├── pack_unpack.c │ │ ├── utf8proc.c │ │ ├── utf8proc.h │ │ ├── utf8proc_data.h │ │ └── utils.c │ ├── include │ │ ├── Makefile.am │ │ ├── common.h │ │ └── ncx_h.m4 │ ├── nc4io │ │ ├── Makefile.am │ │ ├── nc4io_attr.c │ │ ├── nc4io_dim.c │ │ ├── nc4io_driver.c │ │ ├── nc4io_driver.h │ │ ├── nc4io_file.c │ │ ├── nc4io_get_put.m4 │ │ └── nc4io_var.c │ ├── ncadios │ │ ├── ADIOS_COPYING │ │ ├── Makefile.am │ │ ├── adios_headers │ │ │ ├── core │ │ │ │ ├── adios_bp_v1.h │ │ │ │ ├── adios_internals.h │ │ │ │ ├── adios_timing.h │ │ │ │ ├── adios_transport_hooks.h │ │ │ │ ├── qhashtbl.h │ │ │ │ ├── strutil.h │ │ │ │ ├── transforms │ │ │ │ │ ├── adios_transforms_specparse.h │ │ │ │ │ └── plugindetect │ │ │ │ │ │ └── detect_plugin_types.h │ │ │ │ └── types.h │ │ │ └── transforms │ │ │ │ └── transform_plugins.h │ │ ├── ncadios_attr.c │ │ ├── ncadios_bp2ncd.c │ │ ├── ncadios_convert.m4 │ │ ├── ncadios_dim.c │ │ ├── ncadios_driver.c │ │ ├── ncadios_driver.h │ │ ├── ncadios_file.c │ │ ├── ncadios_internal.c │ │ ├── ncadios_internal.h │ │ ├── ncadios_lists.c │ │ ├── ncadios_misc.c │ │ ├── ncadios_nonblocking.c │ │ ├── ncadios_sync.c │ │ └── ncadios_var.c │ ├── ncbbio │ │ ├── Makefile.am │ │ ├── ncbbio_attr.c │ │ ├── ncbbio_dim.c │ │ ├── ncbbio_driver.c │ │ ├── ncbbio_driver.h │ │ ├── ncbbio_file.c │ │ ├── ncbbio_log.c │ │ ├── ncbbio_log_flush.c │ │ ├── ncbbio_log_put.c │ │ ├── ncbbio_mem.c │ │ ├── ncbbio_misc.c │ │ ├── ncbbio_nonblocking.c │ │ ├── ncbbio_sharedfile.c │ │ ├── ncbbio_util.c │ │ └── ncbbio_var.c │ ├── ncfoo │ │ ├── Makefile.am │ │ ├── ncfoo_attr.c │ │ ├── ncfoo_dim.c │ │ ├── ncfoo_driver.c │ │ ├── ncfoo_driver.h │ │ ├── ncfoo_file.c │ │ └── ncfoo_var.c │ └── ncmpio │ │ ├── Makefile.am │ │ ├── TODO │ │ ├── ncmpio_NC.h │ │ ├── ncmpio_attr.m4 │ │ ├── ncmpio_bput.c │ │ ├── ncmpio_close.c │ │ ├── ncmpio_create.c │ │ ├── ncmpio_dim.c │ │ ├── ncmpio_driver.c │ │ ├── ncmpio_driver.h │ │ ├── ncmpio_enddef.c │ │ ├── ncmpio_file_io.c │ │ ├── ncmpio_file_misc.c │ │ ├── ncmpio_filetype.c │ │ ├── ncmpio_fill.c │ │ ├── ncmpio_getput.m4 │ │ ├── ncmpio_hash_func.c │ │ ├── ncmpio_header_get.c │ │ ├── ncmpio_header_put.c │ │ ├── ncmpio_i_getput.m4 │ │ ├── ncmpio_i_varn.m4 │ │ ├── ncmpio_intra_node.c │ │ ├── ncmpio_open.c │ │ ├── ncmpio_subfile.c │ │ ├── ncmpio_subfile.h │ │ ├── ncmpio_sync.c │ │ ├── ncmpio_util.c │ │ ├── ncmpio_var.c │ │ ├── ncmpio_vard.c │ │ ├── ncmpio_varn.m4 │ │ └── ncmpio_wait.c ├── include │ ├── Makefile.am │ ├── dispatch.h │ ├── nctypes.h │ ├── pnc_debug.h │ └── pnetcdf.h.in ├── libs │ ├── Makefile.am │ ├── strcasecmp.c │ └── strdup.c ├── packaging │ ├── Makefile.am │ └── pnetcdf.pc.in └── utils │ ├── Makefile.am │ ├── README.md │ ├── check_install.in │ ├── hacking │ └── hack_numrecs.c │ ├── ncmpidiff │ ├── Makefile.am │ ├── cdfdiff.1 │ ├── cdfdiff.c │ ├── ncmpidiff.1 │ └── ncmpidiff.c │ ├── ncmpidump │ ├── Makefile.am │ ├── dumplib.c │ ├── dumplib.h │ ├── ncmpidump.1 │ ├── ncmpidump.c │ ├── ncmpidump.h │ ├── test0.cdl │ ├── vardata.c │ └── vardata.h │ ├── ncmpigen │ ├── Makefile.am │ ├── c0.cdl │ ├── escapes.c │ ├── generic.h │ ├── genlib.c │ ├── genlib.h │ ├── getfill.c │ ├── init.c │ ├── load.c │ ├── main.c │ ├── ncmpigen.1 │ ├── ncmpigen.h │ ├── ncmpigen.l │ ├── ncmpigen.y │ ├── ncmpigentab.c │ ├── ncmpigentab.h │ └── ncmpigenyy.c │ ├── ncmpilogdump │ ├── Makefile.am │ └── ncmpilogdump.m4 │ ├── ncoffsets │ ├── Makefile.am │ ├── ncoffsets.1 │ └── ncoffsets.c │ ├── ncvalidator │ ├── Makefile.am │ ├── bad_large_fixed_var.nc2 │ ├── bad_large_rec_2_vars.nc2 │ ├── bad_large_rec_var.nc2 │ ├── bad_magic.nc │ ├── bad_nvars.nc1 │ ├── bad_nvars.nc2 │ ├── bad_nvars.nc5 │ ├── bad_padding_name_dim.nc1 │ ├── bad_padding_name_dim.nc2 │ ├── bad_padding_name_dim.nc5 │ ├── bad_padding_name_gattr.nc1 │ ├── bad_padding_name_gattr.nc2 │ ├── bad_padding_name_gattr.nc5 │ ├── bad_padding_name_var.nc1 │ ├── bad_padding_name_var.nc2 │ ├── bad_padding_name_var.nc5 │ ├── bad_padding_name_vattr.nc1 │ ├── bad_padding_name_vattr.nc2 │ ├── bad_padding_name_vattr.nc5 │ ├── bad_padding_value_gattr.nc1 │ ├── bad_padding_value_gattr.nc2 │ ├── bad_padding_value_gattr.nc5 │ ├── bad_padding_value_vattr.nc1 │ ├── bad_padding_value_vattr.nc2 │ ├── bad_padding_value_vattr.nc5 │ ├── bad_tag_dimension.nc1 │ ├── bad_tag_dimension.nc2 │ ├── bad_tag_dimension.nc5 │ ├── bad_tag_gattr.nc1 │ ├── bad_tag_gattr.nc2 │ ├── bad_tag_gattr.nc5 │ ├── bad_tag_variable.nc1 │ ├── bad_tag_variable.nc2 │ ├── bad_tag_variable.nc5 │ ├── bad_tag_vattr.nc1 │ ├── bad_tag_vattr.nc2 │ ├── bad_tag_vattr.nc5 │ ├── bad_unlimited.nc1 │ ├── bad_unlimited.nc2 │ ├── bad_unlimited.nc5 │ ├── ncvalidator.1 │ ├── ncvalidator.c │ ├── pad_superblock.h5 │ ├── seq_runs.sh │ ├── tst_open.c │ ├── wrap_runs.sh │ └── xfail_runs.sh │ ├── pnetcdf-config.in │ └── pnetcdf_version │ ├── Makefile.am │ ├── pnetcdf_version.1 │ └── pnetcdf_version.c ├── test ├── C │ ├── Makefile.am │ ├── parallel_run.sh │ ├── pres_temp_4D_rd.c │ ├── pres_temp_4D_wr.c │ └── seq_runs.sh ├── CXX │ ├── Makefile.am │ ├── nctst.cpp │ ├── parallel_run.sh │ ├── test_classic.cpp │ └── wrap_runs.sh ├── F90 │ ├── Makefile.am │ ├── f90tst_parallel.f90 │ ├── f90tst_parallel2.f90 │ ├── f90tst_parallel3.f90 │ ├── f90tst_parallel4.f90 │ ├── f90tst_vars.f90 │ ├── f90tst_vars2.f90 │ ├── f90tst_vars3.f90 │ ├── f90tst_vars4.f90 │ ├── parallel_run.sh │ ├── seq_runs.sh │ ├── test_attr_int64.f90 │ ├── test_fill.f90 │ ├── test_intent.f90 │ ├── tst_f90.f90 │ ├── tst_f90_cdf5.f90 │ ├── tst_io.f90 │ ├── tst_types2.f90 │ └── wrap_runs.sh ├── Makefile.am ├── adios │ ├── Makefile.am │ ├── arrays.bp │ ├── arrays_big.bp │ ├── att.c │ ├── attributes.bp │ ├── attributes_big.bp │ ├── header.c │ ├── indep.c │ ├── ivar.c │ ├── ivarm.c │ ├── ivars.c │ ├── open.c │ ├── parallel_run.sh │ ├── var.c │ ├── varm.c │ ├── vars.c │ └── wrap_runs.sh ├── burst_buffer │ ├── Makefile.am │ ├── bb_bsize.c │ ├── bb_hints.c │ ├── bb_many_reqs.c │ ├── bb_nonblocking.c │ ├── highdim.c │ ├── parallel_run.sh │ ├── varn.c │ └── wrap_runs.sh ├── cdf_format │ ├── Makefile.am │ ├── bad_begin.nc5 │ ├── bad_dimid.nc1 │ ├── bad_dimid.nc2 │ ├── bad_dimid.nc5 │ ├── bad_nattrs.nc1 │ ├── bad_nattrs.nc2 │ ├── bad_nattrs.nc5 │ ├── bad_ndims.nc1 │ ├── bad_ndims.nc2 │ ├── bad_ndims.nc5 │ ├── bad_xtype.nc1 │ ├── bad_xtype.nc2 │ ├── bad_xtype.nc5 │ ├── cdf_type.c │ ├── dim_cdf12.c │ ├── parallel_run.sh │ ├── seq_runs.sh │ ├── test_cdf1.nc │ ├── test_cdf2.nc │ ├── test_cdf5.nc │ ├── test_inq_format.c │ ├── test_netcdf4.nc │ ├── tst_corrupt.c │ ├── tst_open_cdf5.c │ ├── wrap_runs.sh │ └── xfail_runs.sh ├── cdl │ ├── Makefile.am │ ├── cdl_header.txt │ ├── parallel_run.sh │ ├── tst_cdl_hdr_parser.c │ └── wrap_runs.sh ├── common │ ├── Makefile.am │ ├── testutils.c │ ├── testutils.h │ └── testutilsf.F90 ├── fandc │ ├── Makefile.am │ ├── README │ ├── csnap.c │ ├── fixedform.f90 │ ├── freeform.f │ ├── pnctest.c │ ├── pnctestf.f │ └── pnf_test.f ├── header │ ├── Makefile.am │ ├── README │ ├── header_consistency.c │ ├── parallel_run.sh │ └── seq_runs.sh ├── jenkins.sh ├── largefile │ ├── Makefile.am │ ├── bigrecords.f │ ├── high_dim_var.c │ ├── large_attr.c │ ├── large_coalesce.c │ ├── large_dims_vars_attrs.c │ ├── large_files.c │ ├── large_header.c │ ├── large_reqs.c │ ├── large_var.c │ ├── parallel_run.sh │ ├── seq_runs.sh │ ├── tst_cdf5_begin.c │ ├── tst_flarge.f90 │ ├── tst_hash_large_ndims.c │ ├── tst_hash_large_ngattrs.c │ ├── tst_hash_large_nvars.c │ └── wrap_runs.sh ├── mcs-environment.soft ├── mpi │ └── threads_open.c ├── nc4 │ ├── Makefile.am │ ├── compressed.c │ ├── interoperability_rd.m4 │ ├── interoperability_wr.m4 │ ├── noclobber.c │ ├── notsupport.c │ ├── parallel_run.sh │ ├── pres_temp_4D.c │ ├── put_get_all_kinds.m4 │ ├── rd_compressed.c │ ├── simple_xy.c │ ├── tst_2_rec_dims.c │ ├── tst_get_put_size.c │ ├── tst_rec_vars.c │ ├── tst_zero_req.c │ └── wrap_runs.sh ├── nc_test │ ├── Makefile.am │ ├── README │ ├── error.c │ ├── error.h │ ├── nc_test.c │ ├── seq_runs.sh │ ├── t_nc.c │ ├── test_get.m4 │ ├── test_iget.m4 │ ├── test_iput.m4 │ ├── test_put.m4 │ ├── test_read.m4 │ ├── test_write.m4 │ ├── tests.h.m4 │ ├── tst_atts.c │ ├── tst_atts3.c │ ├── tst_misc.c │ ├── tst_names.c │ ├── tst_nofill.c │ ├── tst_norm.c │ ├── tst_small.c │ ├── util.c │ └── wrap_runs.sh ├── nf90_test │ ├── Makefile.am │ ├── README │ ├── fortlib.c │ ├── nf90_error.F90 │ ├── nf90_test.F90 │ ├── seq_runs.sh │ ├── test_get.m4 │ ├── test_iget.m4 │ ├── test_iput.m4 │ ├── test_put.m4 │ ├── test_read.F90 │ ├── test_write.F90 │ ├── tests.inc.in │ └── util.F90 ├── nf_test │ ├── Makefile.am │ ├── README │ ├── fortlib.c │ ├── nf_error.F │ ├── nf_test.F │ ├── seq_runs.sh │ ├── test_get.m4 │ ├── test_iget.m4 │ ├── test_iput.m4 │ ├── test_put.m4 │ ├── test_read.F │ ├── test_write.F │ ├── tests.inc.in │ └── util.F ├── nonblocking │ ├── Makefile.am │ ├── README │ ├── bput_varn.m4 │ ├── column_wise.m4 │ ├── flexible_bput.c │ ├── i_varn_indef.c │ ├── i_varn_int64.c │ ├── interleaved.c │ ├── large_num_reqs.c │ ├── mcoll_perf.c │ ├── mcoll_testf.f90 │ ├── mcoll_testf77.f │ ├── parallel_run.sh │ ├── req_all.c │ ├── seq_runs.sh │ ├── test_bput.c │ ├── test_bputf.f90 │ ├── test_bputf77.f │ ├── wait_after_indep.c │ └── wrap_runs.sh ├── subfile │ ├── Makefile.am │ ├── README.md │ ├── parallel_run.sh │ ├── seq_runs.sh │ └── test_subfile.c ├── test_installed │ ├── README.md │ ├── batch.sh.in │ ├── interactive.sh.in │ └── makefile ├── testcases │ ├── Makefile.am │ ├── add_var.c │ ├── alignment_test.c │ ├── attrf.f │ ├── buftype_free.c │ ├── buftype_freef.f │ ├── check_striping.c │ ├── check_type.c │ ├── collective_error.c │ ├── erange_fill.m4 │ ├── error_precedence.m4 │ ├── file_create_open.c │ ├── flexible.c │ ├── flexible2.c │ ├── flexible_api.f │ ├── flexible_large_count.c │ ├── flexible_var.c │ ├── flexible_varm.c │ ├── inq_num_vars.c │ ├── inq_num_varsf.f90 │ ├── inq_recsize.c │ ├── inq_recsizef.f90 │ ├── iput_all_kinds.m4 │ ├── ivarn.c │ ├── large_var_cdf5.c │ ├── last_large_var.c │ ├── mix_collectives.c │ ├── modes.c │ ├── nc_null_args.c │ ├── ncmpi_vars_null_stride.c │ ├── noclobber.c │ ├── nonblocking.c │ ├── null_args.m4 │ ├── one_record.c │ ├── parallel_run.sh │ ├── profile.c │ ├── put_all_kinds.m4 │ ├── put_parameter.f │ ├── record.c │ ├── redef-good.ncdump │ ├── redef1.c │ ├── scalar.c │ ├── seq_runs.sh │ ├── test_erange.c │ ├── test_fillvalue.c │ ├── test_get_varn.c │ ├── test_vard.c │ ├── test_vard_multiple.c │ ├── test_vard_rec.c │ ├── test_vardf.F │ ├── test_vardf90.f90 │ ├── test_varm.c │ ├── tst_def_var_fill.c │ ├── tst_del_attr.c │ ├── tst_dimsizes.c │ ├── tst_free_comm.c │ ├── tst_grow_header.c │ ├── tst_info.c │ ├── tst_max_var_dims.c │ ├── tst_pthread.c │ ├── tst_redefine.c │ ├── tst_symlink.c │ ├── tst_vars_fill.m4 │ ├── tst_version.c │ ├── varn_contig.c │ ├── varn_int.c │ ├── varn_intf.f │ ├── varn_real.f90 │ ├── vectors.c │ └── wrap_runs.sh └── tst_install.sh └── travis-run-tests.sh /AUTHORS: -------------------------------------------------------------------------------- 1 | Authors of PnetCDF 2 | 3 | Wei-keng Liao (Northwestern University) 4 | Kai-Yuan Hou (Northwestern University) 5 | Alok Choudhary (Northwestern University) 6 | Kui Gao (Northwestern University) 7 | Jianwei Li (Northwestern University) 8 | Seung Woo Son (Northwestern University) 9 | 10 | Rob Latham (Argonne National Laboratory) 11 | Rob Ross (Argonne National Laboratory) 12 | Bill Gropp (Argonne National Laboratory) 13 | Rajeev Thakur (Argonne National Laboratory) 14 | 15 | See also file "CREDITS" for additional contributors. 16 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | See file "COPYRIGHT". 2 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | PnetCDF is a joint effort between Northwestern University and Argonne 2 | National Laboratory. We have also been fortunate to receive a great deal of 3 | help from the community. A partial list follows. Thanks everyone! 4 | 5 | - PnetCDF uses a great deal of NetCDF code, so the project would not 6 | have gotten as far as it did as quickly as it did without the efforts of the 7 | Unidata group. 8 | 9 | - Joachim Worringen and Rene Redler 10 | helped us build and run correctly on NEC SX-6 11 | 12 | - John Tannahill contributed a great deal of effort 13 | testing and improving our Fortran bindings 14 | 15 | - Richard Hedges was another early adopter and 16 | offered a lot of configuration tips, particularly for IFC 17 | 18 | - Renier Vogelsang provided valuable assistance with the IRIX 19 | port 20 | 21 | - Greg Sjaardema's CDF-2 patch gave us and serial NetCDF 22 | large file support 23 | 24 | - Jim Edwards provided a great deal of assistance with our 25 | AIX port, and testing the nonblocking APIs. 26 | 27 | - Tyce Mclarty also did a lot of AIX work for us 28 | 29 | - Christopher Subich contributed several configure 30 | fixes, improving our handling of cross-compile environments. 31 | 32 | - Kurt Glaesemann contributed numerous cleanups for 33 | PnetCDF on ia64 with HP-MPI 34 | 35 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/ChangeLog -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Please see PnetCDF project web sites: 2 | https://parallel-netcdf.github.io 3 | http://cucis.ece.northwestern.edu/projects/PnetCDF 4 | -------------------------------------------------------------------------------- /benchmarks/C/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .o .c 10 | 11 | AM_CPPFLAGS = -I$(top_builddir)/src/include 12 | LDADD = $(top_builddir)/src/libs/libpnetcdf.la 13 | LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ 14 | 15 | check_PROGRAMS = aggregation \ 16 | write_block_read_column \ 17 | pnetcdf_put_vara 18 | 19 | # parallel runs only 20 | # TESTS = $(check_PROGRAMS) 21 | 22 | TESTS_ENVIRONMENT = export SED="$(SED)"; 23 | TESTS_ENVIRONMENT += export srcdir="$(srcdir)"; 24 | TESTS_ENVIRONMENT += export TESTOUTDIR="$(FSTYPE_PREFIX)$(TESTOUTDIR)"; 25 | TESTS_ENVIRONMENT += export TESTSEQRUN="$(TESTSEQRUN)"; 26 | TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN)"; 27 | TESTS_ENVIRONMENT += export PNETCDF_DEBUG="$(PNETCDF_DEBUG)"; 28 | TESTS_ENVIRONMENT += export TESTPROGRAMS="$(TESTPROGRAMS)"; 29 | TESTS_ENVIRONMENT += export check_PROGRAMS="$(check_PROGRAMS)"; 30 | TESTS_ENVIRONMENT += export ENABLE_BURST_BUFFER="$(ENABLE_BURST_BUFFER)"; 31 | TESTS_ENVIRONMENT += export ENABLE_NETCDF4="$(ENABLE_NETCDF4)"; 32 | 33 | NC_FILES = $(check_PROGRAMS:%=$(TESTOUTDIR)/%.nc) \ 34 | $(check_PROGRAMS:%=$(TESTOUTDIR)/%.bb.nc) 35 | 36 | CLEANFILES = core core.* *.gcda *.gcno *.gcov gmon.out \ 37 | $(NC_FILES) 38 | 39 | # netcdf_put_vara.c is a NetCDF4 version of pnetcdf_put_vara.c. Both files can 40 | # be used to compare NetCDF4 performance against PnetCDF. 41 | EXTRA_DIST = parallel_run.sh netcdf_put_vara.c 42 | 43 | ptest ptests ptest4: $(check_PROGRAMS) 44 | @echo "===========================================================" 45 | @echo " $(subdir): Parallel testing on 4 MPI processes" 46 | @echo "===========================================================" 47 | @$(TESTS_ENVIRONMENT) \ 48 | $(srcdir)/parallel_run.sh 4 || exit 1 49 | 50 | ptest2 ptest6 ptest8 ptest10: 51 | 52 | # build check targets but not invoke 53 | tests-local: all $(check_PROGRAMS) 54 | 55 | .PHONY: ptest ptests ptest2 ptest4 ptest6 ptest8 ptest10 56 | 57 | -------------------------------------------------------------------------------- /benchmarks/FLASH-IO/.gitignore: -------------------------------------------------------------------------------- 1 | # Autoreconf stage files 2 | /aclocal.m4 3 | /autom4te.cache 4 | /configure 5 | /m4/ltoptions.m4 6 | /m4/ltsugar.m4 7 | /m4/ltversion.m4 8 | /m4/lt~obsolete.m4 9 | /scripts/compile 10 | /scripts/config.guess 11 | /scripts/config.sub 12 | /scripts/install-sh 13 | /scripts/missing 14 | /scripts/test-driver 15 | Makefile.in 16 | 17 | # Configure stage files 18 | /config.log 19 | /config.status 20 | /libtool 21 | Makefile 22 | 23 | # Build stage files 24 | *.o 25 | /flash_benchmark_io 26 | 27 | # Test stage files 28 | *.log 29 | *.nc 30 | -------------------------------------------------------------------------------- /benchmarks/FLASH-IO/common.fh: -------------------------------------------------------------------------------- 1 | !****************************************************************************** 2 | 3 | ! File: common.fh 4 | 5 | ! Purpose: This file is the global common, visible to all modules, 6 | ! containing such things as physical constants, runtime 7 | ! parameters, etc. 8 | 9 | implicit none 10 | 11 | 12 | 13 | #include "physicaldata.fh" 14 | 15 | ! Simulation time and timestep 16 | 17 | double precision time, dt 18 | 19 | ! Simulation step number and beginning step number; my processing 20 | ! element (PE) number, the PE number of the "master" processor, 21 | ! and the total number of PEs 22 | 23 | integer nstep, nbegin, MyPE, MasterPE, NumPEs 24 | 25 | common /floats/ time, dt 26 | 27 | common /intgrs/ nstep, nbegin, MyPE, MasterPE, NumPEs 28 | 29 | ! add the runtime parameters needed explicitly 30 | character(len=128) :: basenm 31 | 32 | common /runtime_char/ basenm 33 | 34 | !============================================================================== 35 | 36 | ! Numerical constants 37 | 38 | include 'definitions.fh' 39 | 40 | !============================================================================== 41 | 42 | ! PARAMESH adaptive mesh refinement (AMR) declarations 43 | 44 | include 'tree.fh' 45 | 46 | !============================================================================== 47 | 48 | ! Message-Passing Interface (MPI) library subroutines & constants 49 | 50 | integer info_used 51 | logical use_nonblocking_io 52 | logical indep_io 53 | 54 | double precision chk_t(3), corner_t(3), nocorner_t(3) 55 | common /timers/ chk_t, corner_t, nocorner_t, info_used, & 56 | use_nonblocking_io, indep_io 57 | 58 | 59 | -------------------------------------------------------------------------------- /benchmarks/FLASH-IO/flash_release.F90: -------------------------------------------------------------------------------- 1 | function flash_release() 2 | 3 | implicit none 4 | 5 | character (len = 40) :: flash_release 6 | 7 | flash_release = 'FLASH I/O benchmark using Pnetcdf' 8 | 9 | return 10 | end 11 | -------------------------------------------------------------------------------- /benchmarks/FLASH-IO/get_mfluid_property.F90: -------------------------------------------------------------------------------- 1 | subroutine get_mfluid_property(property, value) 2 | 3 | ! stub function to fill the need for get_mfluid_property from the 4 | ! FLASH I/O routines that are used in this benchmark. All they need 5 | ! is a routine to return the names of the isotopes, so do that here 6 | 7 | #include "common.fh" 8 | 9 | character (len=*) :: property 10 | character (len=4) :: value(ionmax) 11 | 12 | if (ionmax == 2) then 13 | value(1) = "f1" 14 | value(2) = "f2" 15 | else if (ionmax == 13) then 16 | value(1) = "f1" 17 | value(2) = "f2" 18 | value(3) = "f3" 19 | value(4) = "f4" 20 | value(5) = "f5" 21 | value(6) = "f6" 22 | value(7) = "f7" 23 | value(8) = "f8" 24 | value(9) = "f9" 25 | value(10) = "f10" 26 | value(11) = "f11" 27 | value(12) = "f12" 28 | value(13) = "f13" 29 | endif 30 | 31 | return 32 | end subroutine get_mfluid_property 33 | 34 | 35 | -------------------------------------------------------------------------------- /benchmarks/FLASH-IO/numfluids.fh: -------------------------------------------------------------------------------- 1 | ! Number of fluids to track. 2 | 3 | integer, parameter :: ionmax = IONMAX 4 | -------------------------------------------------------------------------------- /benchmarks/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUBDIRS = C WRF-IO 10 | DIST_SUBDIRS = C FLASH-IO WRF-IO 11 | 12 | if HAS_FORTRAN 13 | if HAVE_MPI_MOD 14 | SUBDIRS += FLASH-IO 15 | endif 16 | endif 17 | 18 | EXTRA_DIST = README.md 19 | 20 | # below is the alternative when AM_EXTRA_RECURSIVE_TARGETS is not defined 21 | # TESTS_DIRS = $(SUBDIRS:%=tests-%) 22 | # tests: $(TESTS_DIRS) 23 | # $(TESTS_DIRS): 24 | # $(MAKE) $(MFLAGS) -C $(@:tests-%=%) tests 25 | 26 | if BUILD_COVERAGE 27 | PTEST_SUBDIRS = 28 | else 29 | PTEST_SUBDIRS = $(SUBDIRS) 30 | endif 31 | 32 | ptest ptests: 33 | @for d in $(PTEST_SUBDIRS) ; do \ 34 | $(MAKE) $(MFLAGS) -C $$d ptest $$* || exit 1 ; \ 35 | done 36 | 37 | # For VPATH build (parallel build), try delete all sub-directories 38 | distclean-local: 39 | @for d in $(DIST_SUBDIRS) ; do \ 40 | if [ -d $$d/.deps ] ; then rmdir $$d/.deps || true ; fi ; \ 41 | done ; \ 42 | if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 43 | for d in $(DIST_SUBDIRS) ; do \ 44 | rmdir $$d || true ; \ 45 | done ; \ 46 | fi 47 | 48 | .PHONY: ptest ptests tests 49 | 50 | -------------------------------------------------------------------------------- /coverity_model.c: -------------------------------------------------------------------------------- 1 | void* NCI_Malloc_fn(size_t size, const int lineno, const char *func, const char *filename) { 2 | __coverity_alloc__(size); 3 | } 4 | 5 | void* NCI_Calloc_fn(size_t nelem, size_t elsize, const int lineno, const char *func, const char *filename) { 6 | __coverity_alloc__(nelem*elsize); 7 | } 8 | 9 | void* NCI_Realloc_fn(void *ptr, size_t size, const int lineno, const char *func, const char *filename) { 10 | __coverity_alloc__(size); 11 | } 12 | 13 | void NCI_Free_fn(void *ptr, const int lineno, const char *func, const char *filename) { 14 | __coverity_free__(ptr); 15 | } 16 | 17 | int MPI_Abort(int comm, int errorcode) { 18 | __coverity_panic__(); 19 | } 20 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUBDIRS = pnetcdf-api 10 | DIST_SUBDIRS = $(SUBDIRS) 11 | 12 | EXTRA_DIST = README.CRAY.md \ 13 | README.Fujitsu.md \ 14 | README.INTEL.md \ 15 | README.IBM.md \ 16 | README.K-Computer.md \ 17 | README.LINUX.md \ 18 | README.SGI.md \ 19 | README.SX.md \ 20 | README.Ubuntu.md \ 21 | README.consistency.md \ 22 | README.large_files.md \ 23 | README.NetCDF4.md \ 24 | README.ADIOS.md \ 25 | README.burst_buffering.md \ 26 | pbs.script 27 | 28 | # For VPATH build (parallel build), try delete all sub-directories 29 | distclean-local: 30 | @if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 31 | for d in $(DIST_SUBDIRS) ; do \ 32 | rmdir $$d || true ; \ 33 | done ; \ 34 | fi 35 | -------------------------------------------------------------------------------- /doc/README.INTEL.md: -------------------------------------------------------------------------------- 1 | ## Build PnetCDF Using The Intel Compilers 2 | 3 | * When using old versions of Intel MPI compilers (4.x), you might encounter the 4 | following error message. 5 | ```console 6 | In file included from /opt/intel/impi/4.1.3/include/mpi.h(1279), 7 | from ../lib/pnetcdf.h(10), 8 | from ../../../trunk/src/libcxx/ncmpiType.h(2), 9 | from ../../../trunk/src/libcxx/ncmpiType.cpp(2): 10 | /opt/intel/impi/4.1.3/include/mpicxx.h(95): error: #error directive: "SEEK_SET is 11 | #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h" 12 | #error "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h" 13 | ^ 14 | ``` 15 | * A solution is to add the following C++ preprocessor flags at the configure 16 | command line, for example. 17 | ```console 18 | ./configure CXXCPPFLAGS="-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX" 19 | ``` 20 | 21 | * Note that this error has been resolved when using newer Intel MPI compiler 22 | (5.x). See the two URLs below for more information. 23 | + https://software.intel.com/en-us/articles/intel-cluster-toolkit-for-linux-error-when-compiling-c-aps-using-intel-mpi-library-compilation-driver-mpiicpc 24 | + https://wiki.mpich.org/mpich/index.php/Frequently_Asked_Questions#Q:_I_get_compile_errors_saying_.22SEEK_SET_is_.23defined_but_must_not_be_for_the_C.2B.2B_binding_of_MPI.22 25 | 26 | * If you encountered the following error when using mpiicc compiler, add 27 | "CPP="mpiicc -E"" to your configure command line should resolve the problem. 28 | ```console 29 | configure: error: in pnetcdf-1.11.0': configure: error: C preprocessor "mpiicc" fails sanity check See config.log' for more details 30 | ``` 31 | + See issue [#43](https://github.com/Parallel-NetCDF/PnetCDF/issues/43). 32 | 33 | Copyright (C) 2017, Northwestern University and Argonne National Laboratory. 34 | See COPYRIGHT notice in top-level directory. 35 | 36 | -------------------------------------------------------------------------------- /doc/README.SGI.md: -------------------------------------------------------------------------------- 1 | ### SGI UV 2000 2 | * Endeavour @ NASA http://www.nas.nasa.gov/hecc/resources/endeavour.html 3 | * There are 2 compilers available on Endeavour: Intel and GNU. Intel compiler 4 | is recommended. 5 | * To use Intel compiler, run command below to load the Intel compiler module. 6 | ```console 7 | module load comp-intel 8 | module load mpi-intel 9 | ``` 10 | 11 | * run configure command: 12 | ```console 13 | ./configure --prefix=/path/to/install \ 14 | MPICC=icc MPICXX=icpc MPIF77=ifort MPIF90=ifort \ 15 | CFLAGS="-O2" FFLAGS="-O2" FCFLAGS="-O2" \ 16 | LIBS=-lmpi LDFLAGS= 17 | ``` 18 | 19 | * Some users have their environment variable LDFLAGS set to "-shared", 20 | which can prevent PnetCDF to build correctly. Please note PnetCDF 21 | currently supports to build a static library only. 22 | 23 | * It is also possible to build PnetCDF with GNU-based MPI compilers on 24 | Endeavour. Here is configure command. 25 | ```console 26 | ./configure --prefix=/path/to/install \ 27 | CFLAGS="-O2" FFLAGS="-O2" FCFLAGS="-O2" \ 28 | LDFLAGS= 29 | ``` 30 | 31 | ### SGI IRIX64 32 | The PnetCDF library should build fine under IRIX. There are just a few 33 | issues not directly related to the library: 34 | 35 | * The IRIX compiler does not like the cnap.c test. gcc compiles the 36 | file without any warnings, even when the tests are configured with 37 | "--enable-strict". Renier Vogelsang reports that the 38 | latest MIPSpro compiler release fixes this issue, so upgrade if 39 | possible. 40 | 41 | Copyright (C) 2017, Northwestern University and Argonne National Laboratory. 42 | See COPYRIGHT notice in top-level directory. 43 | 44 | -------------------------------------------------------------------------------- /doc/README.SX.md: -------------------------------------------------------------------------------- 1 | ## NEC SX 2 | 3 | * Current notes for NEC SX; based on pnetcdf version 1.0.0; 28 July, 2005 4 | 5 | * SX Cross compiler environment is not supported yet (the check for a working 6 | ftruncate is not possible). Configure steps have to be invoked on the SX directly. 7 | Configuring on the target host and then cross-compiling works fine when setting 8 | up necessary aliases on the configure host (cc -> sxcc, etc) or vice versa 9 | on the compile host (sxcc -> cc). 10 | 11 | * With the following environment variables a libpnetcdf.a has been built 12 | successfully 13 | ```console 14 | MPICC=mpic++ 15 | MPIF77=mpif90 16 | FC=f90 17 | CC=c++ 18 | FFLAGS=-dW 19 | ``` 20 | 21 | * Built on NEC SX6 with: 22 | - Operating system SUPER-UX 14.1 23 | - C++/SX compiler rev.061 2004/01/06 24 | - f90/SX compiler rev.285 2003/09/25 25 | 26 | * Note on nf_test 27 | + `-dW` disables promotion of Integer*2. However no interfaces for 28 | `Integer*1` are built. This causes 2 compile time errors in util.F. Lines 29 | 1158 and 1226 have to be turned into valid Fortran syntax. 30 | 31 | * Note on test_dtype 32 | + The executables have to be compiled with `-pvctl loopcnt=186048`. To avoid 33 | run time error in test_array the vectorisation of the loop starting at line 34 | 256 needs to be disabled with `#pragma cdir novector` 35 | 36 | * Rob Latham 37 | * Rene Redler 38 | * Joachim Worringen 39 | 40 | Copyright (C) 2017, Northwestern University and Argonne National Laboratory. 41 | See COPYRIGHT notice in top-level directory. 42 | -------------------------------------------------------------------------------- /doc/README.Ubuntu.md: -------------------------------------------------------------------------------- 1 | ## Build PnetCDF on Ubuntu 2 | 3 | The following waning message may occur during "make". It is safe to ignore. 4 | * See http://gnu-automake.7480.n7.nabble.com/bug-20082-new-warning-from-ar-on-rawhide-systems-td21769.html 5 | ```console 6 | ar: `u' modifier ignored since `D' is the default (see `U') 7 | ``` 8 | 9 | ### The following note applies to 1.9.0 only, when building shared library. 10 | 11 | * Set LDFLAGS to the following at the configure command line, i.e., 12 | ```console 13 | ./configure --prefix=/path/to/install \ 14 | --enable-shared \ 15 | LDFLAGS="-Wl,--allow-shlib-undefined" 16 | ``` 17 | 18 | * Without option "--enable-shared", only the static libraries will be built 19 | and in this case there is no need to set LDFLAGS. 20 | 21 | * Note that without setting the LDFLAGS to the above, you might see error 22 | messages similar to below, when using gfortran based MPI compilers. 23 | ```console 24 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_shape_4' 25 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_os_error' 26 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_runtime_error_at' 27 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_runtime_error' 28 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_internal_unpack' 29 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_compare_string' 30 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_internal_pack' 31 | ../../../src/libs/.libs/libpnetcdf.so: undefined reference to `_gfortran_string_len_trim' 32 | collect2: error: ld returned 1 exit status 33 | ``` 34 | 35 | Copyright (C) 2017, Northwestern University and Argonne National Laboratory. 36 | See COPYRIGHT notice in top-level directory. 37 | 38 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | * [README.ADIOS.md](README.ADIOS.md) - Instructions to enable read capability of BP files. 2 | * [README.burst_buffering.md](README.burst_buffering.md) - Instructions to enable feature of burst buffering. 3 | * [README.consistency.md](README.consistency.md) - Note on parallel I/O data consistency supported by PnetCDF. 4 | * [README.CRAY.md](README.CRAY.md) - Build instructions on Cray computers. 5 | * [README.Fujitsu.md](README.Fujitsu.md) - Build instructions when using the Fujitsu compilers. 6 | * [README.IBM.md](README.IBM.md) - Build instructions when using the IBM XL compilers. 7 | * [README.INTEL.md](README.INTEL.md) - Build instructions when using the Intel compilers. 8 | * [README.K-Computer.md](README.K-Computer.md) - Build instructions on the K computer. 9 | * [README.large_files.md](README.large_files.md) - Note on supports of large files (of size larger than 2 GB). 10 | * [README.LINUX.md](README.LINUX.md) - Build instructions under Linux OS. 11 | * [README.NetCDF4.md](README.NetCDF4.md) - Note on supporting NetCDF4 file access. 12 | * [README.SGI.md](README.SGI.md) - Build instructions on SGI computers. 13 | * [README.SX.md](README.SX.md) - Build instructions on SX computers. 14 | * [README.Ubuntu.md](README.Ubuntu.md) - Build instructions under Ubuntu OS. 15 | * [A Parallel API for Creating and Reading NetCDF Files](https://github.com/Parallel-NetCDF/Parallel-NetCDF.github.io/blob/master/doc/pnetcdf-api.pdf) 16 | is a document describing the PnetCDF APIs. Folder 17 | [pnetcdf-api](./pnetcdf-api) contains the LaTeX source files of this PDF file. 18 | 19 | -------------------------------------------------------------------------------- /doc/pbs.script: -------------------------------------------------------------------------------- 1 | #PBS -q debug 2 | #PBS -l walltime=00:10:00 3 | #PBS -l mppwidth=8 4 | #PBS -N pnetcdf_test 5 | #PBS -j oe 6 | #PBS -V 7 | 8 | cd $PBS_O_WORKDIR 9 | 10 | set OUT_DIR = /output/file/directory 11 | 12 | # test seqential programs 13 | make check TESTMPIRUN="aprun -n NP" TESTOUTDIR=$OUT_DIR TESTSEQRUN="aprun -n 1" 14 | 15 | # test parallel programs 16 | make ptest TESTMPIRUN="aprun -n NP" TESTOUTDIR=$OUT_DIR TESTSEQRUN="aprun -n 1" 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/pnetcdf-api/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .tex .pdf 10 | 11 | AM_DEFAULT_SOURCE_EXT = .tex 12 | 13 | API_GUIDE = 14 | if BUILD_DOCS 15 | if HAS_LATEX 16 | API_GUIDE += pnetcdf-api.pdf 17 | endif 18 | endif 19 | 20 | all: $(API_GUIDE) 21 | 22 | pnetcdf-api.pdf: pnetcdf-api.tex 23 | cd $(srcdir) ; $(LATEX) -output-directory=$(abs_builddir) $< && $(LATEX) -output-directory=$(abs_builddir) $< 24 | $(DVIPDF) pnetcdf-api.dvi $@ 25 | 26 | EXTRA_DIST = c_api.tex \ 27 | data_mode_api.tex \ 28 | flexible_api.tex \ 29 | latex8.sty \ 30 | Makefile.in \ 31 | multiple_io.tex \ 32 | nonblocking.tex \ 33 | pnetcdf-api.bbl \ 34 | pnetcdf-api.tex 35 | 36 | CLEANFILES = *.dvi *.log *.aux *.ps $(API_GUIDE) 37 | 38 | # Turn off parallel builds in this directory. 39 | .NOTPARALLEL: 40 | 41 | -------------------------------------------------------------------------------- /doc/pnetcdf-api/pnetcdf-api.bbl: -------------------------------------------------------------------------------- 1 | \begin{thebibliography}{1} 2 | 3 | \bibitem{thakur:romio} 4 | Rajeev Thakur, William Gropp, and Ewing Lusk. 5 | \newblock Data sieving and collective {I/O} in {ROMIO}. 6 | \newblock In {\em Proceedings of the Seventh Symposium on the Frontiers of 7 | Massively Parallel Computation}, pages 182--189. IEEE Computer Society Press, 8 | February 1999. 9 | 10 | \end{thebibliography} 11 | -------------------------------------------------------------------------------- /doc/porting_notes.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | 7 | ---------------------------------------------- 8 | Notes in this file are for PnetCDF developers 9 | ---------------------------------------------- 10 | 11 | 12 | These are some rough notes for porting code from the serial netcdf api to 13 | the pnetcdf API. Pnetcdf is very similar but there are some changes that 14 | have to be made: 15 | 16 | 17 | . the nc_* functions are called ncmpi_* 18 | 19 | . the nf_* functions are called nfmpi_* 20 | 21 | . ncmpi_open takes a communicator and an info structure, in addition to the 22 | parameters in the serial nc_open() 23 | 24 | For example: 25 | status = nc_open(path, NC_NOWRITE, &ncid); 26 | becomes 27 | status = ncmpi_open(MPI_COMM_WORLD, path, NC_NOWRITE, 28 | MPI_INFO_NULL, &ncid); 29 | 30 | . if you make any independent calls ( those not ending in _all), you must put 31 | yourself into independent data mode with ncmpi_begin_indep_data(ncid) and 32 | ncmpi_end_indep_data(ncid) 33 | 34 | . FILL_DOUBLE and FILL_FLOAT are called NC_FILL_DOUBLE and NC_FILL_FLOAT 35 | respectively. We do not define these NetCDF-2.x era constants in pnetcdf. 36 | 37 | . #include . If you want, define a communicator. MPI_COMM_WORLD 38 | should work ok for most things. 39 | 40 | . somewhere near main, call MPI_Init(): pnetcdf won't do that for you. 41 | 42 | . pnetcdf does not implement nc_advise 43 | 44 | . pnetcdf does not support all types that serial netcdf supports. see 45 | src/lib/TODO for more specifics 46 | 47 | . If for some reason your code uses 'ptrdiff_t' types, consider using 48 | MPI_Offset types 49 | 50 | . likewise, in many places where serial netcdf takes size_t types, we instead 51 | take MPI_Offset types 52 | 53 | . Fortran users should use '#include ' and '#include "pnetcdf.inc"', 54 | instead of using the Fortran INCLUDE directive. 55 | 56 | . Fortran 90 users can use 'use mpi' and 'use pnetcdf'. 57 | 58 | . Fortran dimension sizes should be declared as type 59 | INTEGER(KIND=MPI_OFFSET_KIND) 60 | 61 | -------------------------------------------------------------------------------- /doc/symbol_renaming.txt: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | ---------------------------------------------- 4 | Notes in this file are for PnetCDF developers (obsolete) 5 | ---------------------------------------------- 6 | 7 | # 8 | # We want apps to be able to link with both serial NetCDF and PnetCDF, 9 | # so we had to alter some symbols in the library. The following list is a 10 | # start at documenting the changes. I found such a list helpful when merging 11 | # netcdf-3.5 patches to PnetCDF. 12 | # 13 | 14 | serial parallel 15 | ----------------------------------------- 16 | ncx_len_NC ncmpii_hdr_len_NC 17 | ncx_put_NC ncmpii_hdr_put_NC 18 | nc_get_NC ncmpii_hdr_get_NC 19 | ncx_get_size_t ncmpix_get_size_t 20 | new_NC ncmpii_new_NC 21 | v1h_get_NC_attarray hdr_len_NC_attarray 22 | ncx_len_NC_var hdr_len_NC_var 23 | ncx_len_NC_vararray hdr_len_NC_vararray 24 | check_v1hs hdr_check_buffer 25 | struct v1hs struct bufferinfo 26 | NC_* ncmpii_NC_* 27 | nc__ 28 | ncx_* ncmpix_* 29 | 30 | -------------------------------------------------------------------------------- /examples/C/cdl_header.txt: -------------------------------------------------------------------------------- 1 | netcdf cdl_header { 2 | // file format: CDF-5 (big variables) 3 | dimensions: 4 | Y = 4 ; 5 | time = UNLIMITED ; // (1 currently) 6 | X = 10 ; 7 | chars = 101 ; 8 | variables: 9 | int var_int(Y, X) ; 10 | var_int:FieldType = 104 ; 11 | var_int:MemoryOrder = "XY " ; 12 | float scalar_var ; 13 | scalar_var:units = "K" ; 14 | double time(time) ; 15 | time:long_name = "time" ; 16 | time:units = "days since 0001-01-01 00:00:00" ; 17 | time:calendar = "noleap" ; 18 | time:bounds = "time_bnds" ; 19 | char date_written(time, chars) ; 20 | 21 | // global attributes: 22 | :TITLE = " OUTPUT FROM A CLIMATE MODEL Va.b.c " ; 23 | :EMPTY_STR = "" ; 24 | :SOME_INT = 0 ; 25 | :SOME_FLOAT = 1.f, 2.f ; 26 | } 27 | -------------------------------------------------------------------------------- /examples/CXX/run_cxx_examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2022, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | NPROCS=4 11 | if test "x$1" != x ; then 12 | NPROCS=$1 13 | fi 14 | OUTDIR=TESTOUTDIR 15 | MPIRUN="TESTMPIRUN" 16 | MPIRUN=`echo ${MPIRUN} | SED_CMD -e "s/NP/${NPROCS}/g"` 17 | run_BURST_BUFFER=ENABLE_BURST_BUFFER 18 | run_NETCDF4=ENABLE_NETCDF4 19 | 20 | for i in check_PROGRAMS ; do 21 | if test $i = get_vara ; then 22 | # get_vara reads the file 'put_vara.nc' created by put_vara 23 | ${MPIRUN} ./$i -q ${OUTDIR}/put_vara.nc 24 | else 25 | ${MPIRUN} ./$i -q ${OUTDIR}/$i.nc 26 | fi 27 | if test $? = 0 ; then 28 | echo "PASS: CXX parallel run on ${NPROCS} processes --------------- $i" 29 | fi 30 | 31 | if test "x${run_BURST_BUFFER}" = x1 ; then 32 | # echo "test burst buffering feature" 33 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${OUTDIR};nc_burst_buf_overwrite=enable" 34 | if test $i = get_vara ; then 35 | ${MPIRUN} ./$i -q ${OUTDIR}/put_vara.bb.nc 36 | else 37 | ${MPIRUN} ./$i -q ${OUTDIR}/$i.bb.nc 38 | fi 39 | if test $? = 0 ; then 40 | echo "PASS: CXX parallel run on ${NPROCS} processes --------------- $i" 41 | fi 42 | unset PNETCDF_HINTS 43 | fi 44 | 45 | if test "x${run_NETCDF4}" = x1 ; then 46 | # echo "test netCDF-4 feature" 47 | ${MPIRUN} ./$i ${OUTDIR}/$i.nc4 4 48 | fi 49 | # delete output file 50 | if test $i = get_vara ; then 51 | rm -f ${OUTDIR}/put_vara.nc 52 | rm -f ${OUTDIR}/put_vara.bb.nc 53 | elif test $i != put_vara ; then 54 | rm -f ${OUTDIR}/$i.nc 55 | rm -f ${OUTDIR}/$i.bb.nc 56 | fi 57 | done 58 | 59 | -------------------------------------------------------------------------------- /examples/F77/run_f77_examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2022, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | NPROCS=4 11 | if test "x$1" != x ; then 12 | NPROCS=$1 13 | fi 14 | OUTDIR=TESTOUTDIR 15 | MPIRUN="TESTMPIRUN" 16 | MPIRUN=`echo ${MPIRUN} | SED_CMD -e "s/NP/${NPROCS}/g"` 17 | run_BURST_BUFFER=ENABLE_BURST_BUFFER 18 | run_NETCDF4=ENABLE_NETCDF4 19 | 20 | for i in check_PROGRAMS ; do 21 | if test $i = get_vara ; then 22 | # get_vara reads the file 'put_vara.nc' created by put_vara 23 | ${MPIRUN} ./$i -q ${OUTDIR}/put_vara.nc 24 | else 25 | ${MPIRUN} ./$i -q ${OUTDIR}/$i.nc 26 | fi 27 | if test $? = 0 ; then 28 | echo "PASS: F77 parallel run on ${NPROCS} processes --------------- $i" 29 | fi 30 | 31 | if test "x${run_BURST_BUFFER}" = x1 ; then 32 | # echo "test burst buffering feature" 33 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${OUTDIR};nc_burst_buf_overwrite=enable" 34 | if test $i = get_vara ; then 35 | ${MPIRUN} ./$i -q ${OUTDIR}/put_vara.bb.nc 36 | else 37 | ${MPIRUN} ./$i -q ${OUTDIR}/$i.bb.nc 38 | fi 39 | if test $? = 0 ; then 40 | echo "PASS: F77 parallel run on ${NPROCS} processes --------------- $i" 41 | fi 42 | unset PNETCDF_HINTS 43 | fi 44 | 45 | if test "x${run_NETCDF4}" = x1 ; then 46 | # echo "test netCDF-4 feature" 47 | ${MPIRUN} ./$i ${OUTDIR}/$i.nc4 4 48 | fi 49 | # delete output file 50 | rm -f ${OUTDIR}/$i.nc 51 | rm -f ${OUTDIR}/$i.bb.nc 52 | done 53 | 54 | -------------------------------------------------------------------------------- /examples/F90/run_f90_examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2022, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | NPROCS=4 11 | if test "x$1" != x ; then 12 | NPROCS=$1 13 | fi 14 | OUTDIR=TESTOUTDIR 15 | MPIRUN="TESTMPIRUN" 16 | MPIRUN=`echo ${MPIRUN} | SED_CMD -e "s/NP/${NPROCS}/g"` 17 | run_BURST_BUFFER=ENABLE_BURST_BUFFER 18 | run_NETCDF4=ENABLE_NETCDF4 19 | 20 | for i in check_PROGRAMS ; do 21 | if test $i = get_vara ; then 22 | # get_vara reads the file 'put_vara.nc' created by put_vara 23 | ${MPIRUN} ./$i -q ${OUTDIR}/put_vara.nc 24 | else 25 | ${MPIRUN} ./$i -q ${OUTDIR}/$i.nc 26 | fi 27 | if test $? = 0 ; then 28 | echo "PASS: F90 parallel run on ${NPROCS} processes --------------- $i" 29 | fi 30 | 31 | if test "x${run_BURST_BUFFER}" = x1 ; then 32 | # echo "test burst buffering feature" 33 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${OUTDIR};nc_burst_buf_overwrite=enable" 34 | if test $i = get_vara ; then 35 | ${MPIRUN} ./$i -q ${OUTDIR}/put_vara.bb.nc 36 | else 37 | ${MPIRUN} ./$i -q ${OUTDIR}/$i.bb.nc 38 | fi 39 | if test $? = 0 ; then 40 | echo "PASS: F90 parallel run on ${NPROCS} processes --------------- $i" 41 | fi 42 | unset PNETCDF_HINTS 43 | fi 44 | 45 | if test "x${run_NETCDF4}" = x1 ; then 46 | # echo "test netCDF-4 feature" 47 | ${MPIRUN} ./$i ${OUTDIR}/$i.nc4 4 48 | fi 49 | # delete output file 50 | rm -f ${OUTDIR}/$i.nc 51 | rm -f ${OUTDIR}/$i.bb.nc 52 | done 53 | 54 | -------------------------------------------------------------------------------- /examples/F90/utils.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! Copyright (C) 2015, Northwestern University and Argonne National Laboratory 3 | ! See COPYRIGHT notice in top-level directory. 4 | ! 5 | ! This is part of the PnetCDF package. 6 | ! 7 | ! $Id$ 8 | 9 | ! This function gets the executable name and output file name from the 10 | ! command line. 11 | integer function get_args(max_argc, cmd, filename, verbose, len) 12 | #ifdef NAGFOR 13 | USE F90_UNIX_ENV, only : iargc, getarg 14 | implicit none 15 | #else 16 | implicit none 17 | integer iargc 18 | #endif 19 | integer max_argc, len 20 | character(len=*) cmd, filename 21 | logical verbose 22 | 23 | ! local variables 24 | integer argc 25 | character(len=16) quiet_mode, str 26 | 27 | get_args = 1 28 | call getarg(0, cmd) 29 | argc = IARGC() 30 | 31 | ! command-line arguments are optional 32 | if (argc .EQ. 0) return 33 | 34 | if (argc .GT. max_argc) then 35 | if (max_argc .EQ. 3) & 36 | print*,'Usage: ',trim(cmd),' [-q] [filename] [len]' 37 | if (max_argc .EQ. 2) & 38 | print*,'Usage: ',trim(cmd),' [-q] [filename]' 39 | get_args = 0 40 | return 41 | endif 42 | call getarg(1, quiet_mode) 43 | if (quiet_mode(1:2) .EQ. '-q') then 44 | verbose = .FALSE. 45 | if (argc .GE. 2) call getarg(2, filename) 46 | if (argc .EQ. 3) then 47 | call getarg(3, str) 48 | read (str,'(I10)') len 49 | endif 50 | else 51 | if (argc .GE. 1) call getarg(1, filename) 52 | if (argc .EQ. 2) then 53 | call getarg(2, str) 54 | read (str,'(I10)') len 55 | endif 56 | endif 57 | end function get_args 58 | -------------------------------------------------------------------------------- /examples/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUBDIRS = C 10 | DIST_SUBDIRS = C tutorial CXX F77 F90 burst_buffer adios 11 | 12 | if HAS_MPICXX 13 | SUBDIRS += CXX 14 | endif 15 | 16 | if HAS_FORTRAN 17 | SUBDIRS += F77 18 | if HAVE_MPI_MOD 19 | SUBDIRS += F90 20 | endif 21 | endif 22 | 23 | # There are FORTRAN programs in tutorial replying on F77/utils.o 24 | # Thus, keep folder tutorial after F77, allowing F77 build first. 25 | SUBDIRS += tutorial 26 | 27 | if ENABLE_BURST_BUFFER 28 | SUBDIRS += burst_buffer 29 | endif 30 | 31 | if ENABLE_ADIOS 32 | SUBDIRS += adios 33 | endif 34 | 35 | EXTRA_DIST = README.md 36 | 37 | # below is the alternative when AM_EXTRA_RECURSIVE_TARGETS is not defined 38 | # TESTS_DIRS = $(SUBDIRS:%=tests-%) 39 | # tests: $(TESTS_DIRS) 40 | # $(TESTS_DIRS): 41 | # $(MAKE) $(MFLAGS) -C $(@:tests-%=%) tests 42 | 43 | if BUILD_COVERAGE 44 | PTEST_SUBDIRS = 45 | else 46 | PTEST_SUBDIRS = $(SUBDIRS) 47 | endif 48 | 49 | ptest: 50 | @for d in $(PTEST_SUBDIRS) ; do \ 51 | $(MAKE) $(MFLAGS) -C $$d ptest $$* || exit 1 ; \ 52 | done 53 | 54 | ptests: 55 | @for d in $(PTEST_SUBDIRS) ; do \ 56 | $(MAKE) $(MFLAGS) -C $$d ptests $$* || exit 1 ; \ 57 | done 58 | 59 | # For VPATH build (parallel build), try delete all sub-directories 60 | distclean-local: 61 | @for d in $(DIST_SUBDIRS) ; do \ 62 | if [ -d $$d/.deps ] ; then rmdir $$d/.deps || true ; fi ; \ 63 | done ; \ 64 | if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 65 | for d in $(DIST_SUBDIRS) ; do \ 66 | rmdir $$d || true ; \ 67 | done ; \ 68 | fi 69 | 70 | .PHONY: ptest ptests 71 | 72 | -------------------------------------------------------------------------------- /examples/adios/parallel_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2019, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"` 14 | # echo "MPIRUN = ${MPIRUN}" 15 | # echo "check_PROGRAMS=${check_PROGRAMS}" 16 | 17 | let NTHREADS=$1*6-1 18 | 19 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 20 | if test ${PNETCDF_DEBUG} = 1 ; then 21 | safe_modes="0 1" 22 | else 23 | safe_modes="0" 24 | fi 25 | 26 | # prevent user environment setting of PNETCDF_HINTS to interfere 27 | unset PNETCDF_HINTS 28 | 29 | for i in ${check_PROGRAMS} ; do 30 | for j in ${safe_modes} ; do 31 | for intra_aggr in 0 1 ; do 32 | if test "$j" = 1 ; then # test only in safe mode 33 | export PNETCDF_HINTS="romio_no_indep_rw=true" 34 | else 35 | export PNETCDF_HINTS= 36 | fi 37 | if test "$intra_aggr" = 1 ; then 38 | export PNETCDF_HINTS="${PNETCDF_HINTS};nc_num_aggrs_per_node=2" 39 | fi 40 | export PNETCDF_SAFE_MODE=$j 41 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 42 | if test "$i" = read_metadata ; then 43 | ${MPIRUN} ./$i -q ${top_srcdir}/test/adios/attributes.bp 44 | else 45 | ${MPIRUN} ./$i -q ${top_srcdir}/test/adios/arrays.bp 46 | fi 47 | if test $? = 0 ; then 48 | echo "PASS: C parallel run on $1 processes --------------- $i" 49 | fi 50 | done 51 | done 52 | done 53 | 54 | -------------------------------------------------------------------------------- /examples/burst_buffer/flash_benchmark_io.script: -------------------------------------------------------------------------------- 1 | # Here we provide a job script example to run the built in FLASH benchmark on Cori at NERSC 2 | 3 | # The first step is to request burst buffer access from the scheduler 4 | # Add #DW jobdw argument to request burst buffer space. 5 | # We request a private mode burst buffer access with capacity of 1289 GiB from the sm_pool 6 | 7 | # The second step is to set up the hint for burst buffer driver. We use following hints: 8 | # Enable the burst buffer driver 9 | # nc_burst_buf=enable; 10 | # burst buffer will recycle the space after job execution. We don't need to delete the log files. 11 | # nc_burst_buf_del_on_close=disable; 12 | # We are using private mode, BB_JOB_PRIVATE will be set to the path of burst buffer 13 | # nc_burst_buf_dirname=${BB_JOB_PRIVATE} 14 | # We can set the optional nc_burst_buf_flush_buffer_size hint to limit the memory space PnetCDF can use on flushing the log. 15 | # There is no need to do so since the built in FLASH benchmark by default only generate around 75 MiB of data per process 16 | 17 | # The burst buffer driver is designed to be as transparent as possible. 18 | # In most cases, we can run the job as usual after previous 2 steps. 19 | # We don't need to modify FLASH benchmark in this case. 20 | 21 | ================================================================================================================== 22 | 23 | #!/bin/bash 24 | #SBATCH -p debug 25 | #SBATCH -N 1 26 | #SBATCH -C haswell 27 | #SBATCH -t 00:01:00 28 | #SBATCH -o burst buffer_FLASH_example.txt 29 | #SBATCH -L scratch 30 | #DW jobdw capacity=1289GiB access_mode=private type=scratch pool=sm_pool 31 | 32 | NNodes=${SLURM_NNODES} 33 | NProc=NNodes*32 34 | 35 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_del_on_close=disable;nc_burst_buf_dirname=${BB_JOB_PRIVATE}" 36 | 37 | srun -n ${NProc} ./flash_benchmark_io ${SCRATCH}/flash_ 38 | 39 | -------------------------------------------------------------------------------- /examples/burst_buffer/parallel_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2018, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | # remove file system type prefix if there is any 14 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 15 | 16 | MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"` 17 | # echo "MPIRUN = ${MPIRUN}" 18 | # echo "check_PROGRAMS=${check_PROGRAMS}" 19 | 20 | # let NTHREADS=$1*6-1 21 | NTHREADS=`expr $1 \* 6 - 1` 22 | 23 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 24 | if test ${PNETCDF_DEBUG} = 1 ; then 25 | safe_modes="0 1" 26 | else 27 | safe_modes="0" 28 | fi 29 | 30 | # prevent user environment setting of PNETCDF_HINTS to interfere 31 | unset PNETCDF_HINTS 32 | 33 | for i in ${check_PROGRAMS} ; do 34 | # echo "---- exec=$i" 35 | for j in ${safe_modes} ; do 36 | for intra_aggr in 0 1 ; do 37 | if test "$j" = 1 ; then # test only in safe mode 38 | export PNETCDF_HINTS="romio_no_indep_rw=true" 39 | else 40 | export PNETCDF_HINTS= 41 | fi 42 | if test "$intra_aggr" = 1 ; then 43 | export PNETCDF_HINTS="${PNETCDF_HINTS};nc_num_aggrs_per_node=2" 44 | fi 45 | export PNETCDF_SAFE_MODE=$j 46 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 47 | 48 | # echo "${MPIRUN} ./$i -q -b ${TESTOUTDIR} ${TESTOUTDIR}/$i.nc" 49 | ${MPIRUN} ./$i -q -b ${TESTOUTDIR} ${TESTOUTDIR}/$i.nc 50 | if test $? = 0 ; then 51 | echo "PASS: C parallel run on $1 processes --------------- $i" 52 | fi 53 | 54 | # echo "--- validating file ${TESTOUTDIR}/$i.nc" 55 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.nc 56 | # echo "" 57 | done 58 | done 59 | # delete output files 60 | rm -f ${OUTDIR}/$i.nc 61 | done 62 | 63 | -------------------------------------------------------------------------------- /m4/foreach.m4: -------------------------------------------------------------------------------- 1 | divert(`-1') 2 | # foreach(x, (item_1, item_2, ..., item_n), stmt) 3 | # parenthesized list, simple version 4 | define(`foreach', `pushdef(`$1')_foreach($@)popdef(`$1')') 5 | define(`_arg1', `$1') 6 | define(`_foreach', `ifelse(`$2', `()', `', 7 | `define(`$1', _arg1$2)$3`'$0(`$1', (shift$2), `$3')')') 8 | divert`'dnl 9 | -------------------------------------------------------------------------------- /m4/foreachq.m4: -------------------------------------------------------------------------------- 1 | include(`quote.m4')dnl 2 | divert(`-1') 3 | # foreachq(x, `item_1, item_2, ..., item_n', stmt) 4 | # quoted list, simple version 5 | define(`foreachq', `pushdef(`$1')_foreachq($@)popdef(`$1')') 6 | define(`_arg1', `$1') 7 | define(`_foreachq', `ifelse(quote($2), `', `', 8 | `define(`$1', `_arg1($2)')$3`'$0(`$1', `shift($2)', `$3')')') 9 | divert`'dnl 10 | -------------------------------------------------------------------------------- /m4/quote.m4: -------------------------------------------------------------------------------- 1 | divert(`-1') 2 | # quote(args) - convert args to single-quoted string 3 | define(`quote', `ifelse(`$#', `0', `', ``$*'')') 4 | # dquote(args) - convert args to quoted list of quoted strings 5 | define(`dquote', ``$@'') 6 | # dquote_elt(args) - convert args to list of double-quoted strings 7 | define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''', 8 | ```$1'',$0(shift($@))')') 9 | divert`'dnl 10 | -------------------------------------------------------------------------------- /man/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | man_MANS = pnetcdf.3 10 | if HAS_FORTRAN 11 | man_MANS += pnetcdf_f77.3 pnetcdf_f90.3 12 | endif 13 | 14 | CLEANFILES = $(man_MANS) 15 | 16 | EXTRA_DIST = pnetcdf.m4 pnetcdf_f90.m4 17 | 18 | pnetcdf.3: pnetcdf.m4 19 | $(M4) $(M4FLAGS) -DAPI=C -DPNETCDF_VERSION=$(PNETCDF_VERSION) $? > $@ || rm -f $@ 20 | 21 | pnetcdf_f77.3: pnetcdf.m4 22 | $(M4) $(M4FLAGS) -DAPI=F -DPNETCDF_VERSION=$(PNETCDF_VERSION) $? > $@ || rm -f $@ 23 | 24 | pnetcdf_f90.3: pnetcdf_f90.m4 25 | $(M4) $(M4FLAGS) -DPNETCDF_VERSION=$(PNETCDF_VERSION) $? > $@ || rm -f $@ 26 | 27 | dist-hook: 28 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE_FULL|@PNETCDF_RELEASE_DATE_FULL@|g" $(distdir)/pnetcdf.m4 29 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/pnetcdf.m4 30 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE_FULL|@PNETCDF_RELEASE_DATE_FULL@|g" $(distdir)/pnetcdf_f90.m4 31 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/pnetcdf_f90.m4 32 | 33 | -------------------------------------------------------------------------------- /scripts/patch.ltmain-2.5.4.sh.txt: -------------------------------------------------------------------------------- 1 | 8327a8328,8334 2 | > 3 | > # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor 4 | > func_cc_basename $CC 5 | > case $func_cc_basename_result in 6 | > nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;; 7 | > esac 8 | > 9 | 9363c9370,9371 10 | < case $CC in 11 | --- 12 | > func_cc_basename $CC 13 | > case $func_cc_basename_result in 14 | 9867a9876,9882 15 | > esac 16 | > 17 | > # Time to revert the changes made for nagfor. 18 | > func_cc_basename $CC 19 | > case $func_cc_basename_result in 20 | > nagfor*) 21 | > new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;; 22 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | # adding . to the list of SUBDIRS causes the directories built before . 10 | # This is useful for "make -j" option, as libs should be built after all 11 | # sub-libraries 12 | SUBDIRS = include dispatchers drivers binding packaging . libs utils 13 | DIST_SUBDIRS = include dispatchers drivers binding packaging libs utils 14 | 15 | # For VPATH build (parallel build), try delete all sub-directories 16 | distclean-local: 17 | @for d in $(DIST_SUBDIRS) ; do \ 18 | if [ "$$d" = "." ] ; then continue ; fi ; \ 19 | if [ -d $$d/.deps ] ; then rmdir $$d/.deps || true ; fi ; \ 20 | done ; \ 21 | if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 22 | for d in $(DIST_SUBDIRS) ; do \ 23 | if [ "$$d" = "." ] ; then \ 24 | continue ; \ 25 | fi ; \ 26 | rmdir $$d || true ; \ 27 | done ; \ 28 | fi 29 | -------------------------------------------------------------------------------- /src/binding/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 2749 2016-12-28 17:51:37Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | SUBDIRS = 10 | if HAS_MPICXX 11 | SUBDIRS += cxx 12 | endif 13 | if HAS_FORTRAN 14 | SUBDIRS += f77 f90 15 | endif 16 | 17 | DIST_SUBDIRS = cxx f77 f90 18 | 19 | # For VPATH build (parallel build), try delete all sub-directories 20 | distclean-local: 21 | @for d in $(DIST_SUBDIRS) ; do \ 22 | if [ -d $$d/.deps ] ; then rmdir $$d/.deps || true ; fi ; \ 23 | done ; \ 24 | if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 25 | for d in $(DIST_SUBDIRS) ; do \ 26 | rmdir $$d || true ; \ 27 | done ; \ 28 | fi 29 | -------------------------------------------------------------------------------- /src/binding/cxx/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .o .cpp .hpp 10 | 11 | AM_CPPFLAGS = -I$(top_builddir)/src/include 12 | 13 | if SEEK_SET_REDEFINED 14 | AM_CPPFLAGS += -DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX 15 | endif 16 | 17 | if REPLACE_CXX_FUNC_MACRO 18 | AM_CPPFLAGS += -D__func__=__FUNCTION__ 19 | endif 20 | 21 | CXX_HEADER = pnetcdf 22 | 23 | nodist_include_HEADERS = $(CXX_HEADER) 24 | 25 | noinst_LTLIBRARIES = libcxx.la 26 | 27 | # Note the file order is important 28 | HPP_FILES = ncmpi_notyet.h \ 29 | ncmpiCheck.h \ 30 | ncmpiType.h \ 31 | ncmpiAtt.h \ 32 | ncmpiEnumType.h \ 33 | ncmpiGroupAtt.h \ 34 | ncmpiGroup.h \ 35 | ncmpiByte.h \ 36 | ncmpiChar.h \ 37 | ncmpiCompoundType.h \ 38 | ncmpiDouble.h \ 39 | ncmpiFloat.h \ 40 | ncmpiInt.h \ 41 | ncmpiInt64.h \ 42 | ncmpiOpaqueType.h \ 43 | ncmpiShort.h \ 44 | ncmpiUbyte.h \ 45 | ncmpiUint.h \ 46 | ncmpiUint64.h \ 47 | ncmpiUshort.h \ 48 | ncmpiException.h \ 49 | ncmpiDim.h \ 50 | ncmpiFile.h \ 51 | ncmpiVarAtt.h \ 52 | ncmpiVar.h \ 53 | ncmpiVlenType.h 54 | 55 | LIB_SRCS = $(HPP_FILES:.h=.cpp) 56 | libcxx_la_SOURCES = $(LIB_SRCS) $(HPP_FILES) 57 | nodist_libcxx_la_SOURCES = $(CXX_HEADER) 58 | BUILT_SOURCES = $(CXX_HEADER) 59 | 60 | EXTRA_DIST = pnetcdf.in 61 | 62 | CLEANFILES = core core.* *.gcda *.gcno *.gcov gmon.out \ 63 | $(CXX_HEADER) a.out 64 | 65 | $(CXX_HEADER): $(HPP_FILES) Makefile 66 | cat $(srcdir)/pnetcdf.in >$@ 67 | set -e; for i in $(HPP_FILES); do ( \ 68 | $(SED) -e '/#ifndef/d' -e '/#define/d' -e '/#endif/d' -e '/#include/d' $(srcdir)/$$i >> $@ ; \ 69 | ) ; done 70 | 71 | tests-local: all 72 | 73 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiByte.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiByte.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiByte called PnetCDF::ncmpiByte 6 | namespace PnetCDF { 7 | NcmpiByte ncmpiByte; 8 | } 9 | 10 | // constructor 11 | NcmpiByte::NcmpiByte() : NcmpiType(NC_BYTE){ 12 | } 13 | 14 | NcmpiByte::~NcmpiByte() { 15 | } 16 | 17 | int NcmpiByte::sizeoff(){char a;return sizeof(a);}; 18 | 19 | 20 | // equivalence operator 21 | bool NcmpiByte::operator==(const NcmpiByte & rhs) { 22 | // simply check the netCDF id. 23 | return myId == rhs.myId; 24 | } 25 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiByte.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiByteClass 4 | #define NcmpiByteClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Byte type. */ 10 | class NcmpiByte : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiByte & rhs); 16 | 17 | /*! storage size */ 18 | int sizeoff(); 19 | 20 | ~NcmpiByte(); 21 | 22 | /*! Constructor */ 23 | NcmpiByte(); 24 | }; 25 | 26 | /*! A global instance of the NcmpiByte class within the netCDF namespace. */ 27 | extern NcmpiByte ncmpiByte; 28 | 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiChar.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiChar.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiChar called PnetCDF::ncmpiChar 6 | namespace PnetCDF { 7 | NcmpiChar ncmpiChar; 8 | } 9 | 10 | // constructor 11 | NcmpiChar::NcmpiChar() : NcmpiType(NC_CHAR){ 12 | } 13 | 14 | NcmpiChar::~NcmpiChar() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiChar::operator==(const NcmpiChar & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiChar.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiCharClass 4 | #define NcmpiCharClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Char type. */ 10 | class NcmpiChar : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiChar & rhs); 16 | 17 | ~NcmpiChar(); 18 | 19 | /*! Constructor */ 20 | NcmpiChar(); 21 | }; 22 | 23 | /*! A global instance of the NcmpiChar class within the netCDF namespace. */ 24 | extern NcmpiChar ncmpiChar; 25 | 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiCheck.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifndef NcmpiCheckFunction 5 | #define NcmpiCheckFunction 6 | 7 | namespace PnetCDF 8 | { 9 | /*! 10 | Function checks error code and if necessary throws an exception. 11 | \param retCode Integer value returned by %netCDF C-routines. 12 | \param file The name of the file from which this call originates. 13 | \param line The line number in the file from which this call originates. 14 | */ 15 | void ncmpiCheck(int retCode, const char* file, int line); 16 | 17 | /*! 18 | Function checks if the file (group) is in define mode. 19 | If not, it places it in the define mode. 20 | While this is automatically done by the underlying C API 21 | for netCDF-4 files, the netCDF-3 files still need this call. 22 | */ 23 | void ncmpiCheckDefineMode(int ncid); 24 | 25 | /*! 26 | Function checks if the file (group) is in data mode. 27 | If not, it places it in the data mode. 28 | While this is automatically done by the underlying C API 29 | for netCDF-4 files, the netCDF-3 files still need this call. 30 | */ 31 | void ncmpiCheckDataMode(int ncid); 32 | 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiDouble.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiDouble.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiDouble called PnetCDF::ncmpiDouble 6 | namespace PnetCDF { 7 | NcmpiDouble ncmpiDouble; 8 | } 9 | 10 | // constructor 11 | NcmpiDouble::NcmpiDouble() : NcmpiType(NC_DOUBLE){ 12 | } 13 | 14 | NcmpiDouble::~NcmpiDouble() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiDouble::operator==(const NcmpiDouble & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiDouble.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiDoubleClass 4 | #define NcmpiDoubleClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Double type. */ 10 | class NcmpiDouble : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiDouble & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiDouble(); 19 | 20 | /*! Constructor */ 21 | NcmpiDouble(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiDouble class within the netCDF namespace. */ 25 | extern NcmpiDouble ncmpiDouble; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiFloat.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiFloat.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiFloat called PnetCDF::ncmpiFloat 6 | namespace PnetCDF { 7 | NcmpiFloat ncmpiFloat; 8 | } 9 | 10 | // constructor 11 | NcmpiFloat::NcmpiFloat() : NcmpiType(NC_FLOAT){ 12 | } 13 | 14 | NcmpiFloat::~NcmpiFloat() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiFloat::operator==(const NcmpiFloat & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiFloat.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiFloatClass 4 | #define NcmpiFloatClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Float type. */ 10 | class NcmpiFloat : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiFloat & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiFloat(); 19 | 20 | /*! Constructor */ 21 | NcmpiFloat(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiFloat class within the netCDF namespace. */ 25 | extern NcmpiFloat ncmpiFloat; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiGroupAtt.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiGroupAtt.h" 2 | #include "ncmpiGroup.h" 3 | #include "ncmpiCheck.h" 4 | #include 5 | using namespace std; 6 | 7 | 8 | namespace PnetCDF { 9 | // Global comparator operator ============== 10 | // comparator operator 11 | bool operator<(const NcmpiGroupAtt& lhs,const NcmpiGroupAtt& rhs) 12 | { 13 | return false; 14 | } 15 | 16 | // comparator operator 17 | bool operator>(const NcmpiGroupAtt& lhs,const NcmpiGroupAtt& rhs) 18 | { 19 | return true; 20 | } 21 | } 22 | 23 | 24 | using namespace PnetCDF; 25 | 26 | // assignment operator 27 | NcmpiGroupAtt& NcmpiGroupAtt::operator=(const NcmpiGroupAtt & rhs) 28 | { 29 | NcmpiAtt::operator=(rhs); // assign base class parts 30 | return *this; 31 | } 32 | 33 | //! The copy constructor. 34 | NcmpiGroupAtt::NcmpiGroupAtt(const NcmpiGroupAtt& rhs): 35 | NcmpiAtt(rhs) // invoke base class copy constructor 36 | {} 37 | 38 | 39 | // Constructor generates a null object. 40 | NcmpiGroupAtt::NcmpiGroupAtt() : 41 | NcmpiAtt() // invoke base class constructor 42 | {} 43 | 44 | // equivalence operator (doesn't bother compaing varid's of each object). 45 | bool NcmpiGroupAtt::operator==(const NcmpiGroupAtt & rhs) 46 | { 47 | if(nullObject) 48 | return nullObject == rhs.isNull(); 49 | else 50 | return myName == rhs.myName && groupId == rhs.groupId; 51 | } 52 | 53 | // Constructor for an existing global attribute. 54 | NcmpiGroupAtt::NcmpiGroupAtt(const NcmpiGroup& grp, const int index): 55 | NcmpiAtt(false) 56 | { 57 | groupId = grp.getId(); 58 | varId = NC_GLOBAL; 59 | // get the name of this attribute 60 | char attName[NC_MAX_NAME+1]; 61 | ncmpiCheck(ncmpi_inq_attname(groupId,varId, index, attName),__FILE__,__LINE__); 62 | ncmpiCheck(ncmpi_inq_attname(groupId,varId,index,attName),__FILE__,__LINE__); 63 | myName = attName; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiGroupAtt.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiAtt.h" 2 | 3 | #ifndef NcmpiGroupAttClass 4 | #define NcmpiGroupAttClass 5 | 6 | namespace PnetCDF 7 | { 8 | class NcmpiGroup; // forward declaration. 9 | 10 | /*! Class represents a netCDF group attribute */ 11 | class NcmpiGroupAtt : public NcmpiAtt 12 | { 13 | public: 14 | 15 | /*! assignment operator */ 16 | NcmpiGroupAtt& operator= (const NcmpiGroupAtt& rhs); 17 | 18 | /*! Constructor generates a \ref isNull "null object". */ 19 | NcmpiGroupAtt (); 20 | 21 | /*! The copy constructor. */ 22 | NcmpiGroupAtt(const NcmpiGroupAtt& rhs) ; 23 | 24 | /*! 25 | Constructor for an existing global attribute. 26 | \param grp Parent Group object. 27 | \param index The index (id) of the attribute. 28 | */ 29 | NcmpiGroupAtt(const NcmpiGroup& grp, const int index); 30 | 31 | /*! equivalence operator */ 32 | bool operator== (const NcmpiGroupAtt& rhs); 33 | 34 | /*! comparator operator */ 35 | friend bool operator<(const NcmpiGroupAtt& lhs,const NcmpiGroupAtt& rhs); 36 | 37 | /*! comparator operator */ 38 | friend bool operator>(const NcmpiGroupAtt& lhs,const NcmpiGroupAtt& rhs); 39 | 40 | }; 41 | 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiInt.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiInt.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiInt called PnetCDF::ncmpiInt 6 | namespace PnetCDF { 7 | NcmpiInt ncmpiInt; 8 | } 9 | 10 | // constructor 11 | NcmpiInt::NcmpiInt() : NcmpiType(NC_INT){ 12 | } 13 | 14 | NcmpiInt::~NcmpiInt() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiInt::operator==(const NcmpiInt & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiInt.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiIntClass 4 | #define NcmpiIntClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Int type. */ 10 | class NcmpiInt : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiInt & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiInt(); 19 | 20 | /*! Constructor */ 21 | NcmpiInt(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiInt class within the netCDF namespace. */ 25 | extern NcmpiInt ncmpiInt; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiInt64.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiInt64.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiInt64 called PnetCDF::ncmpiInt64 6 | namespace PnetCDF { 7 | NcmpiInt64 ncmpiInt64; 8 | } 9 | 10 | // constructor 11 | NcmpiInt64::NcmpiInt64() : NcmpiType(NC_INT64){ 12 | } 13 | 14 | NcmpiInt64::~NcmpiInt64() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiInt64::operator==(const NcmpiInt64 & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiInt64.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiInt64Class 4 | #define NcmpiInt64Class 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Int64 type. */ 10 | class NcmpiInt64 : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiInt64 & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiInt64(); 19 | 20 | /*! Constructor */ 21 | NcmpiInt64(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiInt64 class within the netCDF namespace. */ 25 | extern NcmpiInt64 ncmpiInt64; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiOpaqueType.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiOpaqueType.h" 2 | #include "ncmpiGroup.h" 3 | #include "ncmpiCheck.h" 4 | #include "ncmpiException.h" 5 | #include 6 | using namespace std; 7 | using namespace PnetCDF; 8 | using namespace PnetCDF::exceptions; 9 | 10 | // Class represents a netCDF variable. 11 | using namespace PnetCDF; 12 | 13 | // assignment operator 14 | NcmpiOpaqueType& NcmpiOpaqueType::operator=(const NcmpiOpaqueType& rhs) 15 | { 16 | // assign base class parts 17 | NcmpiType::operator=(rhs); 18 | return *this; 19 | } 20 | 21 | // assignment operator 22 | NcmpiOpaqueType& NcmpiOpaqueType::operator=(const NcmpiType& rhs) 23 | { 24 | if (&rhs != this) { 25 | // check the rhs is the base of an Opaque type 26 | if(getTypeClass() != NC_OPAQUE) throw NcmpiException("The NcmpiType object must be the base of an Opaque type.",__FILE__,__LINE__); 27 | // assign base class parts 28 | NcmpiType::operator=(rhs); 29 | } 30 | return *this; 31 | } 32 | 33 | // The copy constructor. 34 | NcmpiOpaqueType::NcmpiOpaqueType(const NcmpiOpaqueType& rhs): 35 | NcmpiType(rhs) 36 | { 37 | } 38 | 39 | 40 | // Constructor generates a null object. 41 | NcmpiOpaqueType::NcmpiOpaqueType() : 42 | NcmpiType() // invoke base class constructor 43 | {} 44 | 45 | 46 | // constructor 47 | NcmpiOpaqueType::NcmpiOpaqueType(const NcmpiGroup& grp, const string& name) : 48 | NcmpiType(grp,name) 49 | {} 50 | 51 | 52 | // constructor 53 | NcmpiOpaqueType::NcmpiOpaqueType(const NcmpiType& ncmpiType) : 54 | NcmpiType(ncmpiType) 55 | { 56 | // check the nctype object is the base of a Opaque type 57 | if(getTypeClass() != NC_OPAQUE) throw NcmpiException("The NcmpiType object must be the base of an Opaque type.",__FILE__,__LINE__); 58 | } 59 | 60 | // Returns the size of the opaque type in bytes. 61 | MPI_Offset NcmpiOpaqueType::getTypeSize() const 62 | { 63 | char* charName; 64 | charName=NULL; 65 | MPI_Offset sizep; 66 | ncmpiCheck(ncmpi_inq_opaque(groupId,myId,charName,&sizep),__FILE__,__LINE__); 67 | return sizep; 68 | } 69 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiOpaqueType.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ncmpiType.h" 3 | 4 | #ifndef NcmpiOpaqueTypeClass 5 | #define NcmpiOpaqueTypeClass 6 | 7 | 8 | namespace PnetCDF 9 | { 10 | class NcmpiGroup; // forward declaration. 11 | 12 | /*! Class represents a netCDF opaque type */ 13 | class NcmpiOpaqueType : public NcmpiType 14 | { 15 | public: 16 | 17 | /*! Constructor generates a \ref isNull "null object". */ 18 | NcmpiOpaqueType(); 19 | 20 | /*! 21 | Constructor. 22 | The opaque Type must already exist in the netCDF file. New netCDF opaque types # 23 | can be added using NcmpiGroup::addNcmpiOpaqueType(); 24 | \param grp The parent group where this type is defined. 25 | \param name Name of new type. 26 | */ 27 | NcmpiOpaqueType(const NcmpiGroup& grp, const std::string& name); 28 | 29 | /*! 30 | Constructor. 31 | Constructs from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Opaque type. 32 | \param ncmpiType A Nctype object. 33 | */ 34 | NcmpiOpaqueType(const NcmpiType& ncmpiType); 35 | 36 | /*! assignment operator */ 37 | NcmpiOpaqueType& operator=(const NcmpiOpaqueType& rhs); 38 | 39 | /*! 40 | Assignment operator. 41 | This assigns from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of an Opaque type. 42 | */ 43 | NcmpiOpaqueType& operator=(const NcmpiType& rhs); 44 | 45 | /*! The copy constructor.*/ 46 | NcmpiOpaqueType(const NcmpiOpaqueType& rhs); 47 | 48 | /*! destructor */ 49 | ~NcmpiOpaqueType(){;} 50 | 51 | /*! Returns the size of the opaque type in bytes. */ 52 | MPI_Offset getTypeSize() const; 53 | 54 | }; 55 | 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiShort.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiShort.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiShort called PnetCDF::ncmpiShort 6 | namespace PnetCDF { 7 | NcmpiShort ncmpiShort; 8 | } 9 | 10 | // constructor 11 | NcmpiShort::NcmpiShort() : NcmpiType(NC_SHORT){ 12 | } 13 | 14 | NcmpiShort::~NcmpiShort() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiShort::operator==(const NcmpiShort & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiShort.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiShortClass 4 | #define NcmpiShortClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Short type. */ 10 | class NcmpiShort : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiShort & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiShort(); 19 | 20 | /*! Constructor */ 21 | NcmpiShort(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiShort class within the netCDF namespace. */ 25 | extern NcmpiShort ncmpiShort; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUbyte.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiUbyte.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiUbyte called PnetCDF::ncmpiUbyte 6 | namespace PnetCDF { 7 | NcmpiUbyte ncmpiUbyte; 8 | } 9 | 10 | // constructor 11 | NcmpiUbyte::NcmpiUbyte() : NcmpiType(NC_UBYTE){ 12 | } 13 | 14 | NcmpiUbyte::~NcmpiUbyte() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiUbyte::operator==(const NcmpiUbyte & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUbyte.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiUbyteClass 4 | #define NcmpiUbyteClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Ubyte type. */ 10 | class NcmpiUbyte : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiUbyte & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiUbyte(); 19 | 20 | /*! Constructor */ 21 | NcmpiUbyte(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiUbyte class within the netCDF namespace. */ 25 | extern NcmpiUbyte ncmpiUbyte; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUint.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiUint.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiUint called PnetCDF::ncmpiUint 6 | namespace PnetCDF { 7 | NcmpiUint ncmpiUint; 8 | } 9 | 10 | // constructor 11 | NcmpiUint::NcmpiUint() : NcmpiType(NC_UINT){ 12 | } 13 | 14 | NcmpiUint::~NcmpiUint() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiUint::operator==(const NcmpiUint & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUint.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiUintClass 4 | #define NcmpiUintClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Uint type. */ 10 | class NcmpiUint : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiUint & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiUint(); 19 | 20 | /*! Constructor */ 21 | NcmpiUint(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiUint class within the netCDF namespace. */ 25 | extern NcmpiUint ncmpiUint; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUint64.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiUint64.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiUint64 called PnetCDF::ncmpiUint64 6 | namespace PnetCDF { 7 | NcmpiUint64 ncmpiUint64; 8 | } 9 | 10 | // constructor 11 | NcmpiUint64::NcmpiUint64() : NcmpiType(NC_UINT64){ 12 | } 13 | 14 | NcmpiUint64::~NcmpiUint64() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiUint64::operator==(const NcmpiUint64 & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUint64.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiUint64Class 4 | #define NcmpiUint64Class 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Uint64 type.*/ 10 | class NcmpiUint64 : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiUint64 & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiUint64(); 19 | 20 | /*! Constructor */ 21 | NcmpiUint64(); 22 | }; 23 | 24 | /*! A global instance of the NcmpiUint64 class within the netCDF namespace. */ 25 | extern NcmpiUint64 ncmpiUint64; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUshort.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiUshort.h" 2 | #include 3 | using namespace PnetCDF; 4 | 5 | // create an instance of NcmpiUshort called PnetCDF::ncmpiUshort 6 | namespace PnetCDF { 7 | NcmpiUshort ncmpiUshort; 8 | } 9 | 10 | // constructor 11 | NcmpiUshort::NcmpiUshort() : NcmpiType(NC_USHORT){ 12 | } 13 | 14 | NcmpiUshort::~NcmpiUshort() { 15 | } 16 | 17 | 18 | // equivalence operator 19 | bool NcmpiUshort::operator==(const NcmpiUshort & rhs) { 20 | // simply check the netCDF id. 21 | return myId == rhs.myId; 22 | } 23 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiUshort.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiType.h" 2 | 3 | #ifndef NcmpiUshortClass 4 | #define NcmpiUshortClass 5 | 6 | namespace PnetCDF 7 | { 8 | 9 | /*! Class represents a netCDF atomic Ushort type. */ 10 | class NcmpiUshort : public NcmpiType 11 | { 12 | public: 13 | 14 | /*! equivalence operator */ 15 | bool operator==(const NcmpiUshort & rhs); 16 | 17 | /*! destructor */ 18 | ~NcmpiUshort(); 19 | 20 | /*! Constructor */ 21 | NcmpiUshort(); 22 | }; 23 | 24 | // declare that the class instance ncmpiUshort is known by all.... 25 | extern NcmpiUshort ncmpiUshort; 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiVarAtt.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmpiVar.h" 2 | #include "ncmpiVarAtt.h" 3 | #include "ncmpiGroup.h" 4 | #include "ncmpiCheck.h" 5 | #include 6 | using namespace std; 7 | 8 | 9 | namespace PnetCDF { 10 | // Global comparator operator ============== 11 | // comparator operator 12 | bool operator<(const NcmpiVarAtt& lhs,const NcmpiVarAtt& rhs) 13 | { 14 | return false; 15 | } 16 | 17 | // comparator operator 18 | bool operator>(const NcmpiVarAtt& lhs,const NcmpiVarAtt& rhs) 19 | { 20 | return true; 21 | } 22 | } 23 | 24 | 25 | using namespace PnetCDF; 26 | 27 | 28 | // assignment operator 29 | NcmpiVarAtt& NcmpiVarAtt::operator=(const NcmpiVarAtt & rhs) 30 | { 31 | NcmpiAtt::operator=(rhs); // assign base class parts 32 | return *this; 33 | } 34 | 35 | //! The copy constructor. 36 | NcmpiVarAtt::NcmpiVarAtt(const NcmpiVarAtt& rhs): 37 | NcmpiAtt(rhs) // invoke base class copy constructor 38 | {} 39 | 40 | 41 | // Constructor generates a null object. 42 | NcmpiVarAtt::NcmpiVarAtt() : 43 | NcmpiAtt() // invoke base class constructor 44 | {} 45 | 46 | 47 | // Constructor for an existing local attribute. 48 | NcmpiVarAtt::NcmpiVarAtt(const NcmpiGroup& grp, const NcmpiVar& ncmpiVar, const int index): 49 | NcmpiAtt(false) 50 | { 51 | groupId = grp.getId(); 52 | varId = ncmpiVar.getId(); 53 | // get the name of this attribute 54 | char attName[NC_MAX_NAME+1]; 55 | ncmpiCheck(ncmpi_inq_attname(groupId,varId,index,attName),__FILE__,__LINE__); 56 | myName = std::string(attName); 57 | } 58 | 59 | // Returns the NcmpiVar parent object. 60 | NcmpiVar NcmpiVarAtt::getParentVar() const { 61 | return NcmpiVar(groupId,varId); 62 | } 63 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiVarAtt.h: -------------------------------------------------------------------------------- 1 | #include "ncmpiAtt.h" 2 | 3 | #ifndef NcmpiVarAttClass 4 | #define NcmpiVarAttClass 5 | 6 | namespace PnetCDF 7 | { 8 | class NcmpiGroup; // forward declaration. 9 | class NcmpiVar; // forward declaration. 10 | 11 | /*! Class represents a netCDF attribute local to a netCDF variable. */ 12 | class NcmpiVarAtt : public NcmpiAtt 13 | { 14 | public: 15 | 16 | /*! assignment operator */ 17 | NcmpiVarAtt& operator= (const NcmpiVarAtt& rhs); 18 | 19 | /*! Constructor generates a \ref isNull "null object". */ 20 | NcmpiVarAtt (); 21 | 22 | /*! The copy constructor. */ 23 | NcmpiVarAtt(const NcmpiVarAtt& rhs) ; 24 | 25 | /*! 26 | Constructor for an existing local attribute. 27 | \param grp Parent Group object. 28 | \param NcmpiVar Parent NcmpiVar object. 29 | \param index The index (id) of the attribute. 30 | */ 31 | NcmpiVarAtt(const NcmpiGroup& grp, const NcmpiVar& ncmpiVar, const int index); 32 | 33 | /*! Returns the NcmpiVar parent object. */ 34 | NcmpiVar getParentVar() const; 35 | 36 | /*! comparator operator */ 37 | friend bool operator<(const NcmpiVarAtt& lhs,const NcmpiVarAtt& rhs); 38 | 39 | /*! comparator operator */ 40 | friend bool operator>(const NcmpiVarAtt& lhs,const NcmpiVarAtt& rhs); 41 | 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/binding/cxx/ncmpiVlenType.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ncmpiType.h" 3 | 4 | #ifndef NcmpiVlenTypeClass 5 | #define NcmpiVlenTypeClass 6 | 7 | 8 | namespace PnetCDF 9 | { 10 | class NcmpiGroup; // forward declaration. 11 | 12 | /*! Class represents a netCDF VLEN type */ 13 | class NcmpiVlenType : public NcmpiType 14 | { 15 | public: 16 | 17 | /*! Constructor generates a \ref isNull "null object". */ 18 | NcmpiVlenType(); 19 | 20 | /*! 21 | Constructor. 22 | The vlen Type must already exist in the netCDF file. New netCDF vlen types can be added 23 | using NcmpiGroup::addNcmpiVlenType(); 24 | \param grp The parent group where this type is defined. 25 | \param name Name of new type. 26 | */ 27 | NcmpiVlenType(const NcmpiGroup& grp, const std::string& name); 28 | 29 | /*! 30 | Constructor. 31 | Constructs from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Vlen type. 32 | \param ncmpiType A Nctype object. 33 | */ 34 | NcmpiVlenType(const NcmpiType& ncmpiType); 35 | 36 | /*! assignment operator */ 37 | NcmpiVlenType& operator=(const NcmpiVlenType& rhs); 38 | 39 | /*! 40 | Assignment operator. 41 | This assigns from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Vlen type. 42 | */ 43 | NcmpiVlenType& operator=(const NcmpiType& rhs); 44 | 45 | /*! The copy constructor. */ 46 | NcmpiVlenType(const NcmpiVlenType& rhs); 47 | 48 | ~NcmpiVlenType(){;} 49 | 50 | /*! Returns the base type. */ 51 | NcmpiType getBaseType() const; 52 | 53 | }; 54 | 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/binding/cxx/pnetcdf.in: -------------------------------------------------------------------------------- 1 | // 2 | // generic include file for the PnetCDF C++ API 3 | // 4 | using namespace std; 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | -------------------------------------------------------------------------------- /src/binding/f77/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .a .o .c .h .f .inc 10 | 11 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 12 | AM_CPPFLAGS += -I$(top_builddir)/src/include 13 | 14 | nodist_include_HEADERS = pnetcdf.inc 15 | 16 | C2F_SRCS = issyserrf.c \ 17 | xstrerrorf.c \ 18 | xstrerrnof.c \ 19 | xinq_libversf.c \ 20 | allf.c 21 | 22 | LIB_FSRCS = strerrorf.f \ 23 | strerrnof.f \ 24 | inq_libversf.f 25 | 26 | noinst_LTLIBRARIES = libf77.la 27 | libf77_la_SOURCES = $(LIB_FSRCS) mpinetcdf_impl.h 28 | nodist_libf77_la_SOURCES = $(C2F_SRCS) mpifnetcdf.h 29 | 30 | EXTRA_DIST = buildiface \ 31 | defs \ 32 | createffiles 33 | 34 | CLEANFILES = mpifnetcdf.h $(C2F_SRCS) *.gcda *.gcno *.gcov gmon.out 35 | 36 | $(C2F_SRCS): mpifnetcdf.h 37 | 38 | PNETCDF_HEADER = $(top_builddir)/src/include/pnetcdf.h 39 | 40 | mpifnetcdf.h: defs buildiface $(PNETCDF_HEADER) 41 | -rm -f $@ $(C2F_SRCS) 42 | $(srcdir)/buildiface -infile=$(PNETCDF_HEADER) -deffile=$(srcdir)/defs > allf.c 43 | @touch $(C2F_SRCS) 44 | 45 | tests-local: all 46 | 47 | -------------------------------------------------------------------------------- /src/binding/f77/README: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | f2c files are now automatically generated in Makefile. 4 | 5 | 6 | The fortran bindings are automatically generated from the C header file. 7 | The script file, createffiles, that can be run to generate the C interface 8 | files is borrowed from MPICH. It reads the input file, defs, that defines 9 | the translation of Fortran arguments to C. 10 | 11 | This is nifty, but not flawless. Compilation under 'gcc -Wall' may produce 12 | some warning messages. 13 | 14 | To regenerate all C files, run command below: 15 | ./createffiles 16 | 17 | -------------------------------------------------------------------------------- /src/binding/f77/createffiles: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # -*- Mode: shell-script-mode; -*- 3 | # 4 | # $Id$ 5 | 6 | # This is a simple script that creates the Fortran interface files. 7 | # Usually, it is MPICH_DISTRIBUTION/src/binding/f77/buildiface 8 | # It makes use of an interface builder developed for MPICH2 and a set of 9 | # NetCDF-specific descriptions in the file "defs". 10 | 11 | if [ -z "$BUILDIFACE" ] ; then 12 | BUILDIFACE=./buildiface 13 | fi 14 | 15 | # Build the files 16 | $BUILDIFACE -infile=../lib/pnetcdf.h -deffile=defs $@ 17 | # Update to the old name 18 | for file in *f.c mpifnetcdf.h ; do 19 | if grep FORT_DLL_SPEC $file >/dev/null 2>&1 ; then 20 | rm -f .tmp 21 | sed -e 's/FORT_DLL_SPEC/FORTRAN_API/g' $file > .tmp 22 | mv .tmp $file 23 | fi 24 | done 25 | -------------------------------------------------------------------------------- /src/binding/f77/inq_libversf.f: -------------------------------------------------------------------------------- 1 | character *80 function nfmpi_inq_libvers() 2 | character *(80) tmpstr 3 | 4 | call nfmpi_xinq_libvers(tmpstr) 5 | nfmpi_inq_libvers = tmpstr 6 | end 7 | -------------------------------------------------------------------------------- /src/binding/f77/strerrnof.f: -------------------------------------------------------------------------------- 1 | character *80 function nfmpi_strerrno( err ) 2 | integer err 3 | character *(80) tmpstr 4 | 5 | call nfmpi_xstrerrno( err, tmpstr ) 6 | if (tmpstr(1:2) .EQ. 'NC') then 7 | tmpstr(2:2) = 'F' 8 | end if 9 | nfmpi_strerrno = tmpstr 10 | end 11 | -------------------------------------------------------------------------------- /src/binding/f77/strerrorf.f: -------------------------------------------------------------------------------- 1 | character *80 function nfmpi_strerror( err ) 2 | integer err 3 | character *(80) tmpstr 4 | 5 | call nfmpi_xstrerror( err, tmpstr ) 6 | nfmpi_strerror = tmpstr 7 | end 8 | -------------------------------------------------------------------------------- /src/binding/f90/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .a .o .mod .f90 .m4 .fh 10 | 11 | AM_DEFAULT_SOURCE_EXT = .f90 12 | 13 | AM_FCFLAGS = -I. -I$(srcdir) 14 | 15 | if UPPER_CASE_MOD 16 | PNETCDF_MOD = PNETCDF.$(FC_MODEXT) 17 | else 18 | PNETCDF_MOD = pnetcdf.$(FC_MODEXT) 19 | endif 20 | 21 | M4FFLAGS += -DINTENTV=$(INTENTV) 22 | 23 | M4_SRCS = getput_text.m4 \ 24 | getput_var.m4 \ 25 | getput_varn.m4 \ 26 | getput_vard.m4 27 | 28 | F90_SRCS = nf90_constants.fh \ 29 | overloads.fh \ 30 | visibility.fh \ 31 | file.fh \ 32 | dims.fh \ 33 | attributes.fh \ 34 | variables.fh 35 | 36 | SRCS = $(F90_SRCS) \ 37 | $(M4_SRCS:.m4=.fh) \ 38 | api.fh \ 39 | nfmpi_constants.fh 40 | 41 | BUILT_SOURCES = $(M4_SRCS:.m4=.fh) 42 | 43 | nodist_include_HEADERS = $(PNETCDF_MOD) 44 | noinst_LTLIBRARIES = libf90.la 45 | libf90_la_SOURCES = $(F90_SRCS) 46 | nodist_libf90_la_SOURCES = pnetcdf.f90 api.fh nfmpi_constants.fh $(M4_SRCS:.m4=.fh) 47 | 48 | .m4.fh: 49 | $(M4) $(AM_M4FLAGS) $(M4FFLAGS) $< >$@ 50 | 51 | pnetcdf.lo $(PNETCDF_MOD): pnetcdf.f90 $(SRCS) 52 | 53 | EXTRA_DIST = $(M4_SRCS) 54 | 55 | CLEANFILES = $(PNETCDF_MOD) $(M4_SRCS:.m4=.fh) *.gcda *.gcno *.gcov gmon.out 56 | 57 | tests-local: all 58 | 59 | -------------------------------------------------------------------------------- /src/binding/f90/pnetcdf.f90.in: -------------------------------------------------------------------------------- 1 | ! 2 | ! Copyright (C) 2013, Northwestern University and Argonne National Laboratory 3 | ! See COPYRIGHT notice in top-level directory. 4 | ! 5 | ! $Id: pnetcdf.f90 1816 2014-10-11 04:19:56Z wkliao $ 6 | ! 7 | ! This file is taken from netcdf.f90 with changes for PnetCDF use 8 | ! 9 | ! 10 | module pnetcdf 11 | @USE_MPIF_HEADER@ 12 | 13 | private 14 | 15 | integer, parameter :: OneByteInt = selected_int_kind(2), & 16 | TwoByteInt = selected_int_kind(4), & 17 | FourByteInt = selected_int_kind(9), & 18 | EightByteInt = selected_int_kind(18) 19 | 20 | integer, parameter :: FourByteReal = selected_real_kind(P = 6, R = 37), & 21 | EightByteReal = selected_real_kind(P = 13, R = 307) 22 | 23 | include "nfmpi_constants.fh" 24 | include "nf90_constants.fh" 25 | include "api.fh" 26 | include "overloads.fh" 27 | include "visibility.fh" 28 | 29 | contains 30 | include "file.fh" 31 | include "dims.fh" 32 | include "attributes.fh" 33 | include "variables.fh" 34 | include "getput_text.fh" 35 | include "getput_var.fh" 36 | include "getput_varn.fh" 37 | include "getput_vard.fh" 38 | end module pnetcdf 39 | -------------------------------------------------------------------------------- /src/dispatchers/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 2847 2017-01-17 07:40:16Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .o .c .h .m4 10 | 11 | AM_CPPFLAGS = -I${top_srcdir}/src/include 12 | AM_CPPFLAGS += -I${top_builddir}/src/include 13 | AM_CPPFLAGS += -I${top_srcdir}/src/drivers/include 14 | AM_CPPFLAGS += @NETCDF4_INC@ @ADIOS_INC@ 15 | 16 | if PNETCDF_DEBUG 17 | AM_CPPFLAGS += -DPNETCDF_DEBUG 18 | endif 19 | 20 | noinst_LTLIBRARIES = libdispatchers.la 21 | 22 | M4FLAGS += -I${top_srcdir}/m4 23 | 24 | M4_SRCS = attr_getput.m4 \ 25 | var_getput.m4 26 | 27 | C_SRCS = lib_version.c \ 28 | file.c \ 29 | dimension.c \ 30 | variable.c \ 31 | attribute.c \ 32 | error_codes.c \ 33 | cdl_header_parser.c 34 | 35 | libdispatchers_la_SOURCES = $(C_SRCS) 36 | 37 | nodist_libdispatchers_la_SOURCES = $(M4_SRCS:.m4=.c) 38 | 39 | BUILT_SOURCES = $(M4_SRCS:.m4=.c) 40 | 41 | CLEANFILES = $(M4_SRCS:.m4=.c) *.gcda *.gcno *.gcov gmon.out 42 | 43 | EXTRA_DIST = $(M4_SRCS) 44 | 45 | $(M4_SRCS:.m4=.c): Makefile 46 | 47 | .m4.c: 48 | $(M4) $(AM_M4FLAGS) $(M4FLAGS) $< >$@ 49 | 50 | tests-local: all 51 | 52 | -------------------------------------------------------------------------------- /src/drivers/DEVELOPER_README.md: -------------------------------------------------------------------------------- 1 | ## PnetCDF source code naming conventions 2 | 3 | PnetCDF uses the following naming conventions for folders, files, and functions 4 | under this directory, `src/drivers`. 5 | 6 | * Folder `common/` 7 | * Functions implemented in this folder are shared by all drivers, and 8 | dispatchers. 9 | * Files should use names easily recognized for the subroutines contained. 10 | * All non-static functions should use prefix name "ncmpii_". 11 | 12 | * Folder `include/` 13 | * Header files stored in this folder are shared by all drivers and 14 | dispatchers. 15 | * Files should use prefix name "ncmpii_". 16 | * Definition of variables, constants, and struct should also use prefix name 17 | "ncmpii_" 18 | 19 | * Folder `ncmpio/` 20 | * Files in this folder are the implementation of PnetCDF using MPI-IO. 21 | * Files should use prefix name "ncmpio_". 22 | * Non-static functions should also use prefix name "ncmpio_". 23 | 24 | * If a new driver, say "foo", is added, please do the followings. 25 | 1. Create a new folder with name "ncfoo" 26 | 2. Store all files implementing this driver under `ncfoo/` 27 | 3. All files stored under `ncfoo/` should use prefix name "ncfoo_". 28 | 4. Non-static functions should use prefix name "ncfoo_". 29 | 30 | -------------------------------------------------------------------------------- /src/drivers/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 2749 2016-12-28 17:51:37Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | SUBDIRS = include common ncmpio 10 | 11 | if BUILD_DRIVER_FOO 12 | SUBDIRS += ncfoo 13 | endif 14 | 15 | if ENABLE_NETCDF4 16 | SUBDIRS += nc4io 17 | endif 18 | 19 | if ENABLE_BURST_BUFFER 20 | SUBDIRS += ncbbio 21 | endif 22 | 23 | if ENABLE_ADIOS 24 | SUBDIRS += ncadios 25 | endif 26 | 27 | DIST_SUBDIRS = include common ncmpio ncfoo ncbbio nc4io ncadios 28 | 29 | # For VPATH build (parallel build), try delete all sub-directories 30 | distclean-local: 31 | @for d in $(DIST_SUBDIRS) ; do \ 32 | if [ -d $$d/.deps ] ; then rmdir $$d/.deps || true ; fi ; \ 33 | done ; \ 34 | if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 35 | for d in $(DIST_SUBDIRS) ; do \ 36 | rmdir $$d || true ; \ 37 | done ; \ 38 | fi 39 | -------------------------------------------------------------------------------- /src/drivers/common/error_posix2nc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | 6 | #ifdef HAVE_CONFIG_H 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | /*----< ncmpii_error_posix2nc() ------------------------------------------------*/ 17 | /* translate posix io error codes to PnetCDF/netCDF error codes */ 18 | int ncmpii_error_posix2nc(char *err_msg) /* extra error message */ 19 | { 20 | #if defined(HAVE_STRERROR) && (HAVE_STRERROR == 1) 21 | char *errorString= strerror(errno); 22 | #else 23 | char *errorString="Other I/O error"; 24 | #endif 25 | 26 | /* check for specific error codes understood by PnetCDF */ 27 | switch (errno){ 28 | case ENOSPC : 29 | return NC_ENO_SPACE; 30 | case ENAMETOOLONG: 31 | case ENOTDIR : 32 | case EISDIR: 33 | return NC_EBAD_FILE; 34 | case EDQUOT: 35 | return NC_EQUOTA; 36 | case ENOENT: 37 | return NC_ENOENT; 38 | case EEXIST: 39 | return NC_EEXIST; 40 | } 41 | 42 | /* other errors that currently have no corresponding PnetCDF error codes */ 43 | if (err_msg == NULL) err_msg = ""; 44 | #ifdef PNETCDF_DEBUG 45 | /* report the world rank */ 46 | int rank; 47 | MPI_Comm_rank(MPI_COMM_WORLD, &rank); 48 | printf("rank %d: IO error (%s) : %s\n", rank, err_msg, errorString); 49 | #else 50 | printf("IO error (%s) : %s\n", err_msg, errorString); 51 | #endif 52 | 53 | return NC_EFILE; /* other unknown file I/O error */ 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/drivers/include/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 2815 2017-01-01 23:06:33Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | M4_HFILES = ncx_h.m4 10 | 11 | M4FLAGS += -I${top_srcdir}/m4 12 | 13 | ncx.h: ncx_h.m4 Makefile 14 | $(M4) $(AM_M4FLAGS) $(M4FLAGS) $< >$@ 15 | 16 | # automake says "... BUILT_SOURCES is honored only by 'make all', 'make check', 17 | # and 'make install'. This means you cannot build a specific target (e.g., 18 | # 'make foo') in a clean tree if it depends on a built source." 19 | BUILT_SOURCES = ncx.h 20 | 21 | EXTRA_DIST = common.h $(M4_HFILES) 22 | 23 | CLEANFILES = ncx.h 24 | 25 | tests-local: all 26 | 27 | -------------------------------------------------------------------------------- /src/drivers/nc4io/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 3283 2017-07-30 21:10:11Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .a .o .c .m4 .h 10 | 11 | AM_CPPFLAGS = -I${top_srcdir}/src/include 12 | AM_CPPFLAGS += -I${top_builddir}/src/include 13 | AM_CPPFLAGS += -I${top_srcdir}/src/drivers/include 14 | AM_CPPFLAGS += -I${top_builddir}/src/drivers/include 15 | AM_CPPFLAGS += @NETCDF4_INC@ 16 | 17 | if PNETCDF_DEBUG 18 | AM_CPPFLAGS += -DPNETCDF_DEBUG 19 | endif 20 | 21 | noinst_LTLIBRARIES = libnc4io.la 22 | 23 | M4FLAGS += -I${top_srcdir}/m4 24 | if ENABLE_ERANGE_FILL 25 | M4FLAGS += -DERANGE_FILL 26 | endif 27 | 28 | M4_SRCS = nc4io_get_put.m4 29 | 30 | H_SRCS = nc4io_driver.h 31 | 32 | C_SRCS = nc4io_attr.c \ 33 | nc4io_dim.c \ 34 | nc4io_driver.c \ 35 | nc4io_file.c \ 36 | nc4io_var.c 37 | 38 | $(M4_SRCS:.m4=.c): Makefile 39 | 40 | .m4.c: 41 | $(M4) $(AM_M4FLAGS) $(M4FLAGS) $< >$@ 42 | 43 | libnc4io_la_SOURCES = $(C_SRCS) $(H_SRCS) 44 | nodist_libnc4io_la_SOURCES = $(M4_SRCS:.m4=.c) 45 | 46 | # automake says "... BUILT_SOURCES is honored only by 'make all', 'make check', 47 | # and 'make install'. This means you cannot build a specific target (e.g., 48 | # 'make target') in a clean tree if it depends on a built source." 49 | BUILT_SOURCES = $(M4_SRCS:.m4=.c) 50 | 51 | CLEANFILES = $(M4_SRCS:.m4=.c) *.gcno 52 | 53 | EXTRA_DIST = $(M4_HFILES) $(M4_SRCS) 54 | 55 | tests-local: all 56 | 57 | -------------------------------------------------------------------------------- /src/drivers/nc4io/nc4io_driver.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | 7 | #ifdef HAVE_CONFIG_H 8 | # include 9 | #endif 10 | 11 | #include 12 | #include 13 | 14 | static PNC_driver nc4io_driver = { 15 | /* FILE APIs */ 16 | nc4io_create, 17 | nc4io_open, 18 | nc4io_close, 19 | nc4io_enddef, 20 | nc4io__enddef, 21 | nc4io_redef, 22 | nc4io_sync, 23 | nc4io_flush, 24 | nc4io_abort, 25 | nc4io_set_fill, 26 | nc4io_inq, 27 | nc4io_inq_misc, 28 | nc4io_sync_numrecs, 29 | nc4io_begin_indep_data, 30 | nc4io_end_indep_data, 31 | 32 | /* DIMENSION APIs */ 33 | nc4io_def_dim, 34 | nc4io_inq_dimid, 35 | nc4io_inq_dim, 36 | nc4io_rename_dim, 37 | 38 | /* ATTRIBUTE APIs */ 39 | nc4io_inq_att, 40 | nc4io_inq_attid, 41 | nc4io_inq_attname, 42 | nc4io_copy_att, 43 | nc4io_rename_att, 44 | nc4io_del_att, 45 | nc4io_get_att, 46 | nc4io_put_att, 47 | 48 | /* VARIABLE APIs */ 49 | nc4io_def_var, 50 | nc4io_def_var_fill, 51 | nc4io_fill_var_rec, 52 | nc4io_inq_var, 53 | nc4io_inq_varid, 54 | nc4io_rename_var, 55 | nc4io_get_var, 56 | nc4io_put_var, 57 | nc4io_get_varn, 58 | nc4io_put_varn, 59 | nc4io_get_vard, 60 | nc4io_put_vard, 61 | nc4io_iget_var, 62 | nc4io_iput_var, 63 | nc4io_bput_var, 64 | nc4io_iget_varn, 65 | nc4io_iput_varn, 66 | nc4io_bput_varn, 67 | 68 | nc4io_buffer_attach, 69 | nc4io_buffer_detach, 70 | nc4io_wait, 71 | nc4io_cancel 72 | }; 73 | 74 | PNC_driver* nc4io_inq_driver(void) { 75 | return &nc4io_driver; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/drivers/ncadios/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2019, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # @configure_input@ 6 | 7 | SUFFIXES = .a .o .c .m4 .h 8 | 9 | AM_CPPFLAGS = -I${top_srcdir}/src/include 10 | AM_CPPFLAGS += -I${top_builddir}/src/include 11 | AM_CPPFLAGS += -I${top_srcdir}/src/drivers/include 12 | AM_CPPFLAGS += -I${top_builddir}/src/drivers/include 13 | AM_CPPFLAGS += -I${srcdir}/adios_headers 14 | AM_CPPFLAGS += -I${srcdir}/adios_headers/core 15 | AM_CPPFLAGS += -I${srcdir}/adios_headers/core/transforms 16 | AM_CPPFLAGS += -I${srcdir}/adios_headers/transforms 17 | AM_CPPFLAGS += @ADIOS_INC@ 18 | 19 | if PNETCDF_DEBUG 20 | AM_CPPFLAGS += -DPNETCDF_DEBUG 21 | endif 22 | 23 | noinst_LTLIBRARIES = libncadios.la 24 | 25 | M4FLAGS += -I${top_srcdir}/m4 26 | if ENABLE_ERANGE_FILL 27 | M4FLAGS += -DERANGE_FILL 28 | endif 29 | 30 | M4_SRCS = ncadios_convert.m4 31 | 32 | H_SRCS = ncadios_driver.h \ 33 | ncadios_internal.h 34 | 35 | C_SRCS = ncadios_attr.c \ 36 | ncadios_dim.c \ 37 | ncadios_driver.c \ 38 | ncadios_file.c \ 39 | ncadios_var.c \ 40 | ncadios_misc.c \ 41 | ncadios_internal.c \ 42 | ncadios_lists.c \ 43 | ncadios_bp2ncd.c \ 44 | ncadios_sync.c \ 45 | ncadios_nonblocking.c 46 | 47 | $(M4_SRCS:.m4=.c): Makefile 48 | 49 | .m4.c: 50 | $(M4) $(AM_M4FLAGS) $(M4FLAGS) $< >$@ 51 | 52 | libncadios_la_SOURCES = $(C_SRCS) $(H_SRCS) 53 | nodist_libncadios_la_SOURCES = $(M4_SRCS:.m4=.c) 54 | 55 | # automake says "... BUILT_SOURCES is honored only by 'make all', 'make check', 56 | # and 'make install'. This means you cannot build a specific target (e.g., 57 | # 'make target') in a clean tree if it depends on a built source." 58 | BUILT_SOURCES = $(M4_SRCS:.m4=.c) 59 | 60 | CLEANFILES = $(M4_SRCS:.m4=.c) core core.* *.gcda *.gcno *.gcov gmon.out 61 | 62 | EXTRA_DIST = $(M4_SRCS) adios_headers 63 | 64 | tests-local: all 65 | 66 | -------------------------------------------------------------------------------- /src/drivers/ncadios/adios_headers/core/adios_timing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADIOS is freely available under the terms of the BSD license described 3 | * in the COPYING file in the top level directory of this source distribution. 4 | * 5 | * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. 6 | */ 7 | 8 | #ifndef H_ADIOS_TIMING 9 | #define H_ADIOS_TIMING 10 | 11 | 12 | #include 13 | 14 | 15 | #define ADIOS_TIMING_MAX_USER_TIMERS 16 16 | #define ADIOS_TIMING_MAX_EVENTS 1024 17 | 18 | 19 | struct adios_timing_event_struct 20 | { 21 | int type; // index of event type, reference timing_struct->names[type] for name of event type 22 | int is_start; 23 | double time; // time that the event occurred 24 | 25 | }; 26 | 27 | 28 | struct adios_timing_struct 29 | { 30 | int64_t internal_count; 31 | int64_t user_count; 32 | char ** names; 33 | double *times; 34 | 35 | // keep the last MAX_EVENTS events, older events 36 | // are overwritten in a circular fashion 37 | int64_t event_count; 38 | struct adios_timing_event_struct events[ADIOS_TIMING_MAX_EVENTS]; 39 | 40 | }; 41 | 42 | //int adios_get_timing_count (int64_t fd_p, int64_t * tc); 43 | //int adios_get_timing_name (int64_t fd_p, int64_t index, char* name); 44 | //int adios_get_timing_value (int64_t fd_p, int64_t index, double* value); 45 | 46 | 47 | struct adios_timing_struct * adios_timing_create (int timer_count, char** timer_names); 48 | void adios_clear_timers (struct adios_timing_struct * ts); 49 | void adios_timing_destroy (struct adios_timing_struct * timing_obj); 50 | 51 | int adios_add_timing_variables (struct adios_file_struct * fd); 52 | 53 | void adios_timing_go (struct adios_timing_struct * ts, int64_t index); 54 | void adios_timing_stop (struct adios_timing_struct * ts, int64_t index); 55 | 56 | void adios_timing_declare_user_timers (int64_t fd_p, int user_timer_count, char** user_timer_names); 57 | 58 | void adios_write_timing_variables (struct adios_file_struct * fd); 59 | 60 | /* Print out all gathered info */ 61 | void adios_timing_write_xml_common (int64_t fd_p, const char* filename); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/drivers/ncadios/adios_headers/core/strutil.h: -------------------------------------------------------------------------------- 1 | #ifndef STRUTIL_H_ 2 | #define STRUTIL_H_ 3 | 4 | // copy an array of strings with allocation, return pointer 5 | // also return the sum of string lengths in 'total_length' 6 | char ** a2s_dup_string_array (const char ** v, int nelems, int * total_length); 7 | void a2s_free_string_array (char ** v, int nelems); 8 | 9 | void a2s_alloc_namelist (char ***namelist, int length); 10 | void a2s_free_namelist (char **namelist, int length); 11 | 12 | /* Remove leading and trailing white spaces. 13 | * They return a pointer inside str, they do not allocate new memory. 14 | */ 15 | char * a2s_trimL (char * str); 16 | char * a2s_trimR (char * str); 17 | char * a2s_trimLR (char * str); 18 | 19 | /* Create a char** array of elements from a "n,m,z" type string used as dimension 20 | * specification in adios. It trims all elements for easy processing later 21 | */ 22 | void a2s_tokenize_dimensions (const char * str, char *** tokens, int * count); 23 | 24 | /* Free the dimension char ** array which was created by tokenize_dimensions. 25 | * It expects the pointers to array and counter, so it can set them to NULL / 0. 26 | */ 27 | void a2s_cleanup_dimensions (char ** tokens, int count); 28 | 29 | char * a2s_trim_spaces (const char * str); 30 | 31 | /******************************************************* 32 | Processing parameter lists 33 | **********************************************************/ 34 | /* 35 | Process a ;-separated and possibly multi-line text and 36 | create a list of name=value pairs from each 37 | item which has a "name=value" pattern. Whitespaces are removed. 38 | Input is not modified. Space is allocated; 39 | Also, simple "name" or "name=" patterns are processed and 40 | returned with value=NULL. 41 | */ 42 | struct PairStruct { 43 | char * name; 44 | char * value; 45 | struct PairStruct * next; 46 | }; 47 | typedef struct PairStruct PairStruct; 48 | 49 | PairStruct * a2s_text_to_name_value_pairs (const char * text); 50 | void a2s_free_name_value_pairs (PairStruct * pairs); 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/drivers/ncadios/adios_headers/core/transforms/plugindetect/detect_plugin_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * detect_plugin_types.h 3 | * 4 | * Using the plugin registry, (src/transforms/transform_plugins.h), builds the 5 | * ADIOS_TRANSFORM_TYPE enum, including the standard "unknown", "none", and 6 | * "num_transform_types" entries. 7 | * 8 | * Created on: Feb 15, 2013 9 | * Author: David A. Boyuka II 10 | */ 11 | 12 | #ifndef DETECT_PLUGIN_TYPES_H_ 13 | #define DETECT_PLUGIN_TYPES_H_ 14 | 15 | // Set up detection macro 16 | #define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ 17 | adios_transform_##TYPEID, 18 | 19 | // Build the enum table 20 | enum ADIOS_TRANSFORM_TYPE { 21 | adios_transform_unknown = -1, 22 | adios_transform_none = 0, 23 | 24 | #include "transforms/transform_plugins.h" // Translate plugin register entries into enum entries 25 | 26 | num_adios_transform_types // Not counting unknown 27 | }; 28 | 29 | // Clean up macro 30 | #undef REGISTER_TRANSFORM_PLUGIN 31 | 32 | #endif /* DETECT_PLUGIN_TYPES_H_ */ 33 | -------------------------------------------------------------------------------- /src/drivers/ncadios/adios_headers/core/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADIOS is freely available under the terms of the BSD license described 3 | * in the COPYING file in the top level directory of this source distribution. 4 | * 5 | * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. 6 | */ 7 | 8 | #ifndef TYPES_H 9 | #define TYPES_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | enum BUFFERING_STATE { 16 | buffering_stopped = 0, /* Buffering stopped after overflow */ 17 | buffering_ongoing = 1, /* Buffering is going on (default value at start) */ 18 | }; 19 | 20 | enum BUFFERING_STRATEGY { 21 | no_buffering = 0, /* No buffering by common layer */ 22 | stop_on_overflow = 1, /* Buffering stopped after overflow. Does not demolish existing buffer until close()*/ 23 | continue_with_new_pg = 2 /* Buffering is going on with new PG starting after overflow */ 24 | //contiguous_buffering = 3 /* NOT SUPPORTED: Buffering is going on (default value at start) */ 25 | }; 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/drivers/ncadios/adios_headers/transforms/transform_plugins.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file contains a registry of all transform plugins to be compiled into ADIOS. 3 | * If you wish to add a new transform plugin, you must add a line here. 4 | */ 5 | 6 | // Arguments: type ID (C identifier), in-XML name, method UID, human-readable description 7 | REGISTER_TRANSFORM_PLUGIN(identity, "identity", "identity", "Identity transform") 8 | REGISTER_TRANSFORM_PLUGIN(zlib, "zlib", "zlib", "zlib compression") 9 | REGISTER_TRANSFORM_PLUGIN(bzip2, "bzip2", "bzip2", "bzip2 compression") 10 | REGISTER_TRANSFORM_PLUGIN(szip, "szip", "szip", "szip compression") 11 | REGISTER_TRANSFORM_PLUGIN(isobar, "isobar", "ncsu-isobar", "ISOBAR compression") 12 | REGISTER_TRANSFORM_PLUGIN(aplod, "aplod", "ncsu-aplod", "APLOD byte-columnar precision-level-of-detail access format") 13 | REGISTER_TRANSFORM_PLUGIN(alacrity, "alacrity", "ncsu-alacrity", "ALACRITY indexing") 14 | REGISTER_TRANSFORM_PLUGIN(zfp, "zfp", "zfp", "zfp compression") 15 | REGISTER_TRANSFORM_PLUGIN(sz, "sz", "sz", "sz compression") 16 | REGISTER_TRANSFORM_PLUGIN(lz4, "lz4", "lz4", "lz4 compression") 17 | REGISTER_TRANSFORM_PLUGIN(blosc, "blosc", "blosc", "blosc compression") 18 | REGISTER_TRANSFORM_PLUGIN(mgard, "mgard", "mgard", "mgard compression") 19 | -------------------------------------------------------------------------------- /src/drivers/ncadios/ncadios_dim.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | 6 | /* 7 | * This file implements the following PnetCDF APIs. 8 | * 9 | * ncmpi_def_dim() : dispatcher->def_dim() 10 | * ncmpi_inq_dimid() : dispatcher->inq_dimid() 11 | * ncmpi_inq_dim() : dispatcher->inq_dim() 12 | * ncmpi_rename_dim() : dispatcher->rename_dim() 13 | */ 14 | 15 | #ifdef HAVE_CONFIG_H 16 | # include 17 | #endif 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | int 31 | ncadios_def_dim(void *ncdp, 32 | const char *name, 33 | MPI_Offset size, 34 | int *dimidp) 35 | { 36 | /* Read only driver */ 37 | DEBUG_RETURN_ERROR(NC_ENOTSUPPORT); 38 | } 39 | 40 | int 41 | ncadios_inq_dimid(void *ncdp, 42 | const char *name, 43 | int *dimid) 44 | { 45 | NC_ad *ncadp = (NC_ad*)ncdp; 46 | 47 | return ncadiosi_inq_dimid(ncadp, (char*)name, dimid); 48 | } 49 | 50 | int 51 | ncadios_inq_dim(void *ncdp, 52 | int dimid, 53 | char *name, 54 | MPI_Offset *sizep) 55 | { 56 | NC_ad *ncadp = (NC_ad*)ncdp; 57 | 58 | /* ADIOS read API does not expose dimension information. 59 | * We rely on a modified bp2ncd utility to build up our 60 | * own dimensional list. 61 | */ 62 | if (name != NULL){ 63 | strcpy(name, ncadp->dims.data[dimid].name); 64 | } 65 | 66 | if (sizep != NULL){ 67 | *sizep = ncadp->dims.data[dimid].len; 68 | } 69 | 70 | return NC_NOERR; 71 | } 72 | 73 | int 74 | ncadios_rename_dim(void *ncdp, 75 | int dimid, 76 | const char *newname) 77 | { 78 | /* Read only driver */ 79 | DEBUG_RETURN_ERROR(NC_ENOTSUPPORT); 80 | } 81 | -------------------------------------------------------------------------------- /src/drivers/ncadios/ncadios_driver.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | 6 | #ifdef HAVE_CONFIG_H 7 | # include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | static PNC_driver ncadios_driver = { 14 | /* FILE APIs */ 15 | ncadios_create, 16 | ncadios_open, 17 | ncadios_close, 18 | ncadios_enddef, 19 | ncadios__enddef, 20 | ncadios_redef, 21 | ncadios_sync, 22 | ncadios_flush, 23 | ncadios_abort, 24 | ncadios_set_fill, 25 | ncadios_inq, 26 | ncadios_inq_misc, 27 | ncadios_sync_numrecs, 28 | ncadios_begin_indep_data, 29 | ncadios_end_indep_data, 30 | 31 | /* DIMENSION APIs */ 32 | ncadios_def_dim, 33 | ncadios_inq_dimid, 34 | ncadios_inq_dim, 35 | ncadios_rename_dim, 36 | 37 | /* ATTRIBUTE APIs */ 38 | ncadios_inq_att, 39 | ncadios_inq_attid, 40 | ncadios_inq_attname, 41 | ncadios_copy_att, 42 | ncadios_rename_att, 43 | ncadios_del_att, 44 | ncadios_get_att, 45 | ncadios_put_att, 46 | 47 | /* VARIABLE APIs */ 48 | ncadios_def_var, 49 | ncadios_def_var_fill, 50 | ncadios_fill_var_rec, 51 | ncadios_inq_var, 52 | ncadios_inq_varid, 53 | ncadios_rename_var, 54 | ncadios_get_var, 55 | ncadios_put_var, 56 | ncadios_get_varn, 57 | ncadios_put_varn, 58 | ncadios_get_vard, 59 | ncadios_put_vard, 60 | ncadios_iget_var, 61 | ncadios_iput_var, 62 | ncadios_bput_var, 63 | ncadios_iget_varn, 64 | ncadios_iput_varn, 65 | ncadios_bput_varn, 66 | 67 | ncadios_buffer_attach, 68 | ncadios_buffer_detach, 69 | ncadios_wait, 70 | ncadios_cancel 71 | }; 72 | 73 | PNC_driver* ncadios_inq_driver(void) { 74 | return &ncadios_driver; 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/drivers/ncbbio/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2018, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 3283 2017-07-30 21:10:11Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .a .o .c .m4 .h 10 | 11 | AM_CPPFLAGS = -I${top_srcdir}/src/include 12 | AM_CPPFLAGS += -I${top_builddir}/src/include 13 | AM_CPPFLAGS += -I${top_srcdir}/src/drivers/include 14 | AM_CPPFLAGS += -I${top_builddir}/src/drivers/include 15 | 16 | if PNETCDF_DEBUG 17 | AM_CPPFLAGS += -DPNETCDF_DEBUG 18 | endif 19 | 20 | noinst_LTLIBRARIES = libncbbio.la 21 | 22 | M4FLAGS += -I${top_srcdir}/m4 23 | if ENABLE_ERANGE_FILL 24 | M4FLAGS += -DERANGE_FILL 25 | endif 26 | 27 | M4_SRCS = #ncbbio_log_flush.m4 28 | 29 | H_SRCS = ncbbio_driver.h 30 | 31 | C_SRCS = ncbbio_attr.c \ 32 | ncbbio_dim.c \ 33 | ncbbio_driver.c \ 34 | ncbbio_file.c \ 35 | ncbbio_var.c \ 36 | ncbbio_log.c \ 37 | ncbbio_mem.c \ 38 | ncbbio_nonblocking.c \ 39 | ncbbio_util.c \ 40 | ncbbio_log_flush.c \ 41 | ncbbio_log_put.c \ 42 | ncbbio_sharedfile.c \ 43 | ncbbio_misc.c 44 | 45 | $(M4_SRCS:.m4=.c): Makefile 46 | 47 | .m4.c: 48 | $(M4) $(AM_M4FLAGS) $(M4FLAGS) $< >$@ 49 | 50 | libncbbio_la_SOURCES = $(C_SRCS) $(H_SRCS) 51 | nodist_libncbbio_la_SOURCES = $(M4_SRCS:.m4=.c) 52 | 53 | # automake says "... BUILT_SOURCES is honored only by 'make all', 'make check', 54 | # and 'make install'. This means you cannot build a specific target (e.g., 55 | # 'make target') in a clean tree if it depends on a built source." 56 | BUILT_SOURCES = $(M4_SRCS:.m4=.c) 57 | 58 | CLEANFILES = $(M4_SRCS:.m4=.c) *.gcno 59 | 60 | EXTRA_DIST = $(M4_HFILES) $(M4_SRCS) 61 | 62 | tests-local: all 63 | 64 | -------------------------------------------------------------------------------- /src/drivers/ncbbio/ncbbio_driver.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | 7 | #ifdef HAVE_CONFIG_H 8 | # include 9 | #endif 10 | 11 | #include 12 | 13 | static PNC_driver ncbbio_driver = { 14 | /* FILE APIs */ 15 | ncbbio_create, 16 | ncbbio_open, 17 | ncbbio_close, 18 | ncbbio_enddef, 19 | ncbbio__enddef, 20 | ncbbio_redef, 21 | ncbbio_sync, 22 | ncbbio_flush, 23 | ncbbio_abort, 24 | ncbbio_set_fill, 25 | ncbbio_inq, 26 | ncbbio_inq_misc, 27 | ncbbio_sync_numrecs, 28 | ncbbio_begin_indep_data, 29 | ncbbio_end_indep_data, 30 | 31 | /* DIMENSION APIs */ 32 | ncbbio_def_dim, 33 | ncbbio_inq_dimid, 34 | ncbbio_inq_dim, 35 | ncbbio_rename_dim, 36 | 37 | /* ATTRIBUTE APIs */ 38 | ncbbio_inq_att, 39 | ncbbio_inq_attid, 40 | ncbbio_inq_attname, 41 | ncbbio_copy_att, 42 | ncbbio_rename_att, 43 | ncbbio_del_att, 44 | ncbbio_get_att, 45 | ncbbio_put_att, 46 | 47 | /* VARIABLE APIs */ 48 | ncbbio_def_var, 49 | ncbbio_def_var_fill, 50 | ncbbio_fill_var_rec, 51 | ncbbio_inq_var, 52 | ncbbio_inq_varid, 53 | ncbbio_rename_var, 54 | ncbbio_get_var, 55 | ncbbio_put_var, 56 | ncbbio_get_varn, 57 | ncbbio_put_varn, 58 | ncbbio_get_vard, 59 | ncbbio_put_vard, 60 | ncbbio_iget_var, 61 | ncbbio_iput_var, 62 | ncbbio_bput_var, 63 | ncbbio_iget_varn, 64 | ncbbio_iput_varn, 65 | ncbbio_bput_varn, 66 | 67 | ncbbio_buffer_attach, 68 | ncbbio_buffer_detach, 69 | ncbbio_wait, 70 | ncbbio_cancel 71 | }; 72 | 73 | PNC_driver* ncbbio_inq_driver(void) { 74 | return &ncbbio_driver; 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/drivers/ncfoo/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 3283 2017-07-30 21:10:11Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .a .o .c .m4 .h 10 | 11 | AM_CPPFLAGS = -I${top_srcdir}/src/include 12 | AM_CPPFLAGS += -I${top_builddir}/src/include 13 | AM_CPPFLAGS += -I${top_srcdir}/src/drivers/include 14 | AM_CPPFLAGS += -I${top_builddir}/src/drivers/include 15 | 16 | if PNETCDF_DEBUG 17 | AM_CPPFLAGS += -DPNETCDF_DEBUG 18 | endif 19 | 20 | noinst_LTLIBRARIES = libncfoo.la 21 | 22 | M4FLAGS += -I${top_srcdir}/m4 23 | if ENABLE_ERANGE_FILL 24 | M4FLAGS += -DERANGE_FILL 25 | endif 26 | 27 | M4_SRCS = 28 | 29 | H_SRCS = ncfoo_driver.h 30 | 31 | C_SRCS = ncfoo_attr.c \ 32 | ncfoo_dim.c \ 33 | ncfoo_driver.c \ 34 | ncfoo_file.c \ 35 | ncfoo_var.c 36 | 37 | $(M4_SRCS:.m4=.c): Makefile 38 | 39 | .m4.c: 40 | $(M4) $(AM_M4FLAGS) $(M4FLAGS) $< >$@ 41 | 42 | libncfoo_la_SOURCES = $(C_SRCS) $(H_SRCS) 43 | nodist_libncfoo_la_SOURCES = $(M4_SRCS:.m4=.c) 44 | 45 | # automake says "... BUILT_SOURCES is honored only by 'make all', 'make check', 46 | # and 'make install'. This means you cannot build a specific target (e.g., 47 | # 'make target') in a clean tree if it depends on a built source." 48 | BUILT_SOURCES = $(M4_SRCS:.m4=.c) 49 | 50 | CLEANFILES = $(M4_SRCS:.m4=.c) core core.* *.gcda *.gcno *.gcov gmon.out 51 | 52 | EXTRA_DIST = $(M4_HFILES) $(M4_SRCS) 53 | 54 | tests-local: all 55 | 56 | -------------------------------------------------------------------------------- /src/drivers/ncfoo/ncfoo_dim.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | 7 | /* 8 | * This file implements the following PnetCDF APIs. 9 | * 10 | * ncmpi_def_dim() : dispatcher->def_dim() 11 | * ncmpi_inq_dimid() : dispatcher->inq_dimid() 12 | * ncmpi_inq_dim() : dispatcher->inq_dim() 13 | * ncmpi_rename_dim() : dispatcher->rename_dim() 14 | */ 15 | 16 | #ifdef HAVE_CONFIG_H 17 | # include 18 | #endif 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | int 30 | ncfoo_def_dim(void *ncdp, 31 | const char *name, 32 | MPI_Offset size, 33 | int *dimidp) 34 | { 35 | int err; 36 | NC_foo *foo = (NC_foo*)ncdp; 37 | 38 | err = foo->driver->def_dim(foo->ncp, name, size, dimidp); 39 | if (err != NC_NOERR) return err; 40 | 41 | return NC_NOERR; 42 | } 43 | 44 | int 45 | ncfoo_inq_dimid(void *ncdp, 46 | const char *name, 47 | int *dimid) 48 | { 49 | int err; 50 | NC_foo *foo = (NC_foo*)ncdp; 51 | 52 | err = foo->driver->inq_dimid(foo->ncp, name, dimid); 53 | if (err != NC_NOERR) return err; 54 | 55 | return NC_NOERR; 56 | } 57 | 58 | int 59 | ncfoo_inq_dim(void *ncdp, 60 | int dimid, 61 | char *name, 62 | MPI_Offset *sizep) 63 | { 64 | int err; 65 | NC_foo *foo = (NC_foo*)ncdp; 66 | 67 | err = foo->driver->inq_dim(foo->ncp, dimid, name, sizep); 68 | if (err != NC_NOERR) return err; 69 | 70 | return NC_NOERR; 71 | } 72 | 73 | int 74 | ncfoo_rename_dim(void *ncdp, 75 | int dimid, 76 | const char *newname) 77 | { 78 | int err; 79 | NC_foo *foo = (NC_foo*)ncdp; 80 | 81 | err = foo->driver->rename_dim(foo->ncp, dimid, newname); 82 | if (err != NC_NOERR) return err; 83 | 84 | return NC_NOERR; 85 | } 86 | -------------------------------------------------------------------------------- /src/drivers/ncfoo/ncfoo_driver.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | 7 | #ifdef HAVE_CONFIG_H 8 | # include 9 | #endif 10 | 11 | #include 12 | #include 13 | 14 | static PNC_driver ncfoo_driver = { 15 | /* FILE APIs */ 16 | ncfoo_create, 17 | ncfoo_open, 18 | ncfoo_close, 19 | ncfoo_enddef, 20 | ncfoo__enddef, 21 | ncfoo_redef, 22 | ncfoo_sync, 23 | ncfoo_flush, 24 | ncfoo_abort, 25 | ncfoo_set_fill, 26 | ncfoo_inq, 27 | ncfoo_inq_misc, 28 | ncfoo_sync_numrecs, 29 | ncfoo_begin_indep_data, 30 | ncfoo_end_indep_data, 31 | 32 | /* DIMENSION APIs */ 33 | ncfoo_def_dim, 34 | ncfoo_inq_dimid, 35 | ncfoo_inq_dim, 36 | ncfoo_rename_dim, 37 | 38 | /* ATTRIBUTE APIs */ 39 | ncfoo_inq_att, 40 | ncfoo_inq_attid, 41 | ncfoo_inq_attname, 42 | ncfoo_copy_att, 43 | ncfoo_rename_att, 44 | ncfoo_del_att, 45 | ncfoo_get_att, 46 | ncfoo_put_att, 47 | 48 | /* VARIABLE APIs */ 49 | ncfoo_def_var, 50 | ncfoo_def_var_fill, 51 | ncfoo_fill_var_rec, 52 | ncfoo_inq_var, 53 | ncfoo_inq_varid, 54 | ncfoo_rename_var, 55 | ncfoo_get_var, 56 | ncfoo_put_var, 57 | ncfoo_get_varn, 58 | ncfoo_put_varn, 59 | ncfoo_get_vard, 60 | ncfoo_put_vard, 61 | ncfoo_iget_var, 62 | ncfoo_iput_var, 63 | ncfoo_bput_var, 64 | ncfoo_iget_varn, 65 | ncfoo_iput_varn, 66 | ncfoo_bput_varn, 67 | 68 | ncfoo_buffer_attach, 69 | ncfoo_buffer_detach, 70 | ncfoo_wait, 71 | ncfoo_cancel 72 | }; 73 | 74 | PNC_driver* ncfoo_inq_driver(void) { 75 | return &ncfoo_driver; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/drivers/ncmpio/ncmpio_driver.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | 7 | #ifdef HAVE_CONFIG_H 8 | # include 9 | #endif 10 | 11 | #include 12 | #include 13 | #include "ncmpio_NC.h" 14 | 15 | static PNC_driver ncmpio_driver = { 16 | /* FILE APIs */ 17 | ncmpio_create, 18 | ncmpio_open, 19 | ncmpio_close, 20 | ncmpio_enddef, 21 | ncmpio__enddef, 22 | ncmpio_redef, 23 | ncmpio_sync, 24 | ncmpio_flush, 25 | ncmpio_abort, 26 | ncmpio_set_fill, 27 | ncmpio_inq, 28 | ncmpio_inq_misc, 29 | ncmpio_sync_numrecs, 30 | ncmpio_begin_indep_data, 31 | ncmpio_end_indep_data, 32 | 33 | /* DIMENSION APIs */ 34 | ncmpio_def_dim, 35 | ncmpio_inq_dimid, 36 | ncmpio_inq_dim, 37 | ncmpio_rename_dim, 38 | 39 | /* ATTRIBUTE APIs */ 40 | ncmpio_inq_att, 41 | ncmpio_inq_attid, 42 | ncmpio_inq_attname, 43 | ncmpio_copy_att, 44 | ncmpio_rename_att, 45 | ncmpio_del_att, 46 | ncmpio_get_att, 47 | ncmpio_put_att, 48 | 49 | /* VARIABLE APIs */ 50 | ncmpio_def_var, 51 | ncmpio_def_var_fill, 52 | ncmpio_fill_var_rec, 53 | ncmpio_inq_var, 54 | ncmpio_inq_varid, 55 | ncmpio_rename_var, 56 | ncmpio_get_var, 57 | ncmpio_put_var, 58 | ncmpio_get_varn, 59 | ncmpio_put_varn, 60 | ncmpio_get_vard, 61 | ncmpio_put_vard, 62 | ncmpio_iget_var, 63 | ncmpio_iput_var, 64 | ncmpio_bput_var, 65 | ncmpio_iget_varn, 66 | ncmpio_iput_varn, 67 | ncmpio_bput_varn, 68 | 69 | ncmpio_buffer_attach, 70 | ncmpio_buffer_detach, 71 | ncmpio_wait, 72 | ncmpio_cancel 73 | }; 74 | 75 | PNC_driver* ncmpio_inq_driver(void) { 76 | return &ncmpio_driver; 77 | } 78 | 79 | -------------------------------------------------------------------------------- /src/drivers/ncmpio/ncmpio_subfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | #ifndef H_SUBFILE 7 | #define H_SUBFILE 8 | 9 | #include "ncmpio_NC.h" 10 | 11 | /* structure for storing access info of this process's request 12 | to the subfiles on all other processes, and vice-versa. used 13 | as array of structures indexed by subfile index. */ 14 | typedef struct { 15 | MPI_Offset *start; 16 | MPI_Offset *count; 17 | MPI_Offset *start_org; 18 | } NC_subfile_access; 19 | 20 | #define CEIL(x) ( (x - (int)x)==0 ? (int)x : (int)x+1 ) 21 | #define FLOOR(x) ( (x - (int)x)==0 ? (int)x : (int)x-1 ) 22 | #define ROUND(x) ( x >= 0 ? (int)(x+0.5) : (int)(x-0.5) ) 23 | #define ABS(a) (((a) < 0) ? -(a) : (a)) 24 | 25 | extern int ncmpio_subfile_open(NC *ncp); 26 | 27 | extern int ncmpio_subfile_close(NC *ncp); 28 | 29 | extern int ncmpio_subfile_partition(NC *ncp); 30 | 31 | extern int ncmpio_subfile_getput_vars(NC *ncp, NC_var *varp, 32 | const MPI_Offset start[], const MPI_Offset count[], 33 | const MPI_Offset stride[], void *buf, MPI_Offset bufcount, 34 | MPI_Datatype buftype, int reqMode); 35 | 36 | #endif /* H_SUBFILE */ 37 | -------------------------------------------------------------------------------- /src/drivers/ncmpio/ncmpio_varn.m4: -------------------------------------------------------------------------------- 1 | dnl Process this m4 file to produce 'C' language file. 2 | dnl 3 | dnl If you see this line, you can ignore the next one. 4 | /* Do not edit this file. It is produced from the corresponding .m4 source */ 5 | dnl 6 | /* 7 | * Copyright (C) 2014, Northwestern University and Argonne National Laboratory 8 | * See COPYRIGHT notice in top-level directory. 9 | */ 10 | /* $Id$ */ 11 | 12 | /* 13 | * This file implements the corresponding APIs defined in 14 | * src/dispatchers/var_getput.m4 15 | * 16 | * ncmpi_get_varn_() : dispatcher->get_varn() 17 | * ncmpi_put_varn_() : dispatcher->put_varn() 18 | */ 19 | 20 | 21 | #ifdef HAVE_CONFIG_H 22 | # include 23 | #endif 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | #include "ncmpio_NC.h" 30 | 31 | include(`utils.m4') 32 | 33 | dnl 34 | define(`VARN',dnl 35 | `dnl 36 | /*----< ncmpio_$1_varn() >--------------------------------------------------*/ 37 | int 38 | ncmpio_$1_varn(void *ncdp, 39 | int varid, 40 | int num, 41 | MPI_Offset* const *starts, 42 | MPI_Offset* const *counts, 43 | ifelse(`$1',`put',`const') void *buf, 44 | MPI_Offset bufcount, 45 | MPI_Datatype buftype, 46 | int reqMode) 47 | { 48 | int reqid=NC_REQ_NULL, err=NC_NOERR, status; 49 | 50 | if (!fIsSet(reqMode, NC_REQ_ZERO)) { 51 | err = ncmpio_i`$1'_varn(ncdp, varid, num, starts, counts, buf, 52 | bufcount, buftype, &reqid, reqMode); 53 | if (err != NC_NOERR && fIsSet(reqMode, NC_REQ_INDEP)) 54 | return err; 55 | } 56 | 57 | status = ncmpio_wait(ncdp, 1, &reqid, NULL, reqMode); 58 | 59 | return (err != NC_NOERR) ? err : status; 60 | } 61 | ')dnl 62 | 63 | VARN(put) 64 | VARN(get) 65 | 66 | -------------------------------------------------------------------------------- /src/include/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id: Makefile.am 2815 2017-01-01 23:06:33Z wkliao $ 6 | # 7 | # @configure_input@ 8 | 9 | nodist_include_HEADERS = pnetcdf.h 10 | 11 | EXTRA_DIST = nctypes.h dispatch.h pnc_debug.h 12 | 13 | dist-hook: 14 | $(SED_I) -e "s|DIST_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/pnetcdf.h.in 15 | 16 | -------------------------------------------------------------------------------- /src/include/nctypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | 7 | #ifdef HAVE_SYS_TYPES_H 8 | #include 9 | #endif 10 | 11 | #ifndef HAVE_PTRDIFF_T 12 | typedef long int ptrdiff_t; 13 | #endif 14 | 15 | #ifndef HAVE_SCHAR 16 | typedef signed char schar; 17 | #endif 18 | 19 | #ifndef HAVE_UCHAR 20 | typedef unsigned char uchar; 21 | #endif 22 | 23 | #ifndef HAVE_USHORT 24 | typedef unsigned short int ushort; 25 | #endif 26 | 27 | #ifndef HAVE_UINT 28 | typedef unsigned int uint; 29 | #endif 30 | 31 | #ifndef HAVE_LONGLONG 32 | typedef long long longlong; 33 | #endif 34 | 35 | #ifndef HAVE_ULONGLONG 36 | typedef unsigned long long ulonglong; 37 | #endif 38 | 39 | #ifndef HAVE_INT64 40 | typedef long long int64; 41 | #endif 42 | 43 | #ifndef HAVE_UINT64 44 | typedef unsigned long long uint64; 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /src/libs/strcasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int strcasecmp(const char *s1, const char *s2) 4 | { 5 | int c1, c2; 6 | do { 7 | c1 = tolower( (unsigned char) *s1++ ); 8 | c2 = tolower( (unsigned char) *s2++ ); 9 | } while (c1 == c2 && c1 != 0); 10 | return c1 - c2; 11 | } 12 | -------------------------------------------------------------------------------- /src/libs/strdup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* strdup() is a POSIX function, not a standard C function */ 5 | char *strdup(const char *str) 6 | { 7 | char *ptr; 8 | if (str == NULL) return NULL; 9 | 10 | ptr = (char*) malloc(strlen(str) + 1); 11 | if (ptr != NULL) 12 | strcpy(ptr, str); 13 | 14 | return ptr; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/packaging/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | pkgconfigdir = $(libdir)/pkgconfig 10 | pkgconfig_DATA = pnetcdf.pc 11 | 12 | # GNU autoconf allows DESTDIR variable when running 'make install' which will 13 | # prepend it before all installation names. 14 | install-data-hook: 15 | $(SED_I) -e 's|INSTALL_PREFIX|$(DESTDIR)$(prefix)|g ; s|INSTALL_EXEC_PREFIX|$(DESTDIR)$(exec_prefix)|g' $(DESTDIR)$(libdir)/pkgconfig/pnetcdf.pc 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUBDIRS = ncmpigen ncmpidump ncmpidiff ncvalidator pnetcdf_version ncoffsets 10 | DIST_SUBDIRS = ncmpigen ncmpidump ncmpidiff ncvalidator pnetcdf_version ncoffsets ncmpilogdump 11 | 12 | if ENABLE_BURST_BUFFER 13 | SUBDIRS += ncmpilogdump 14 | endif 15 | 16 | # The script shows the end users how pnetcdf is built 17 | bin_SCRIPTS = pnetcdf-config 18 | 19 | EXTRA_DIST = pnetcdf-config.in README.md 20 | 21 | # For VPATH build (parallel build), try delete all sub-directories 22 | distclean-local: 23 | @for d in $(DIST_SUBDIRS) ; do \ 24 | if [ -d $$d/.deps ] ; then rmdir $$d/.deps || true ; fi ; \ 25 | done ; \ 26 | if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 27 | for d in $(DIST_SUBDIRS) ; do \ 28 | rmdir $$d || true ; \ 29 | done ; \ 30 | fi 31 | 32 | # Note sed option -i for in-place substitution is not portable 33 | dist-hook: 34 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/pnetcdf-config.in 35 | 36 | # GNU autoconf allows DESTDIR variable when running 'make install' which will 37 | # prepend it before all installation names. 38 | install-exec-hook: 39 | $(SED_I) -e 's|INSTALL_PREFIX|$(DESTDIR)$(prefix)|g ; s|INSTALL_EXEC_PREFIX|$(DESTDIR)$(exec_prefix)|g' $(DESTDIR)$(bindir)/pnetcdf-config 40 | chmod +x $(DESTDIR)$(bindir)/pnetcdf-config 41 | 42 | -------------------------------------------------------------------------------- /src/utils/ncmpidiff/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 10 | AM_CPPFLAGS += -I$(top_builddir)/src/include 11 | 12 | bin_PROGRAMS = ncmpidiff cdfdiff 13 | 14 | ncmpidiff_SOURCES = ncmpidiff.c 15 | ncmpidiff_LDADD = $(top_builddir)/src/libs/libpnetcdf.la 16 | ncmpidiff_LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ 17 | 18 | cdfdiff_SOURCES = cdfdiff.c 19 | 20 | cdfdiff$(EXEEXT): cdfdiff.c Makefile 21 | $(SEQ_CC) $(SEQ_CFLAGS) -I$(top_srcdir)/src/utils/ncvalidator -o $@ $< $(SEQ_LDFLAGS) $(SEQ_LIBS) 22 | 23 | $(top_builddir)/src/libs/libpnetcdf.la: 24 | set -e; cd $(top_builddir)/src/libs && $(MAKE) $(MFLAGS) 25 | 26 | dist_man_MANS = ncmpidiff.1 cdfdiff.1 27 | 28 | CLEANFILES = core core.* *.gcda *.gcno *.gcov gmon.out 29 | 30 | dist-hook: 31 | $(SED_I) -e "s|PNETCDF_RELEASE_VERSION|$(PNETCDF_VERSION)|g" $(distdir)/ncmpidiff.1 32 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE_FULL|@PNETCDF_RELEASE_DATE_FULL@|g" $(distdir)/ncmpidiff.1 33 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/ncmpidiff.1 34 | $(SED_I) -e "s|PNETCDF_RELEASE_VERSION|$(PNETCDF_VERSION)|g" $(distdir)/cdfdiff.1 35 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE_FULL|@PNETCDF_RELEASE_DATE_FULL@|g" $(distdir)/cdfdiff.1 36 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/cdfdiff.1 37 | $(SED_I) -e "s|PNETCDF_RELEASE_VERSION|$(PNETCDF_VERSION)|g" $(distdir)/cdfdiff.c 38 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/cdfdiff.c 39 | 40 | 41 | tests-local: all 42 | 43 | -------------------------------------------------------------------------------- /src/utils/ncmpidump/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 10 | AM_CPPFLAGS += -I$(top_builddir)/src/include 11 | AM_CPPFLAGS += @ADIOS_INC@ 12 | 13 | NCGEN = ../ncmpigen/ncmpigen 14 | 15 | bin_PROGRAMS = ncmpidump 16 | ncmpidump_SOURCES = ncmpidump.c vardata.c dumplib.c 17 | ncmpidump_LDADD = $(top_builddir)/src/libs/libpnetcdf.la 18 | ncmpidump_LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ 19 | 20 | $(top_builddir)/src/libs/libpnetcdf.la: 21 | set -e; cd $(top_builddir)/src/libs && $(MAKE) $(MFLAGS) 22 | 23 | dist_man_MANS = ncmpidump.1 24 | 25 | HFILES = ncmpidump.h vardata.h dumplib.h 26 | 27 | EXTRA_DIST = $(HFILES) $(MANUAL) test0.cdl 28 | 29 | CLEANFILES = test0.nc test1.nc test1.cdl test2.cdl \ 30 | core core.* *.gcda *.gcno *.gcov gmon.out 31 | 32 | test: $(bin_PROGRAMS) 33 | $(NCGEN) -b -o `pwd`/test0.nc $(srcdir)/test0.cdl 34 | ./$(bin_PROGRAMS) -n test1 test0.nc > test1.cdl 35 | $(NCGEN) -b -o `pwd`/test1.nc `pwd`/test1.cdl 36 | ./$(bin_PROGRAMS) test1.nc > test2.cdl 37 | @cmp test1.cdl test2.cdl && \ 38 | echo "*** $(bin_PROGRAMS) test successful ***" 39 | 40 | tests-local: all 41 | 42 | dist-hook: 43 | $(SED_I) -e "s|PNETCDF_RELEASE_VERSION|$(PNETCDF_VERSION)|g" $(distdir)/ncmpidump.1 44 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE_FULL|@PNETCDF_RELEASE_DATE_FULL@|g" $(distdir)/ncmpidump.1 45 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/ncmpidump.1 46 | 47 | -------------------------------------------------------------------------------- /src/utils/ncmpidump/test0.cdl: -------------------------------------------------------------------------------- 1 | netcdf test0 { 2 | 3 | dimensions: 4 | i = 2; 5 | j = 3; 6 | k = unlimited; 7 | l = 3 ; 8 | 9 | variables: 10 | char broiled(i,j,l); 11 | broiled:act = "text string\n\t123"; 12 | broiled:acb = 10b; 13 | broiled:acs = -200s ; 14 | broiled:acl = 17000 ; 15 | broiled:acf = -2.0f, 1.f, 0.0f ; 16 | broiled:acd = -1.0, 2.7182818284590455; 17 | short order(i,j); 18 | int rigue(i,j); 19 | float a_loan(i,j); 20 | double entendre(i,j); 21 | char cscalar; 22 | double dscalar; 23 | char cnodata(i); 24 | short snodata(i); 25 | int inodata(i); 26 | float fnodata(i); 27 | double dnodata(i); 28 | int i(i); 29 | float j(j); 30 | 31 | :glob = "Global attribute" ; 32 | 33 | data: 34 | broiled = "indistinguishable" ; 35 | order = 1s, 2s, 3s, 4s, 5s, 6s; 36 | rigue = 2, 3, 4, 5, 6, 7 ; 37 | a_loan = 3.f, 4.f, 5.f, 6.f, 7.f, 1.0e12f ; 38 | entendre = '\4', 5s, 6, 7.0f, 8.0, 1.0e30 ; 39 | i = 10, 20; 40 | j = 2, 4, 6; 41 | } 42 | -------------------------------------------------------------------------------- /src/utils/ncmpidump/vardata.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * Copyright 1993, University Corporation for Atmospheric Research 3 | * See netcdf/COPYRIGHT file for copying and redistribution conditions. 4 | * $Header$ 5 | *********************************************************************/ 6 | /* $Id$ */ 7 | 8 | extern char *progname; /* for error messages */ 9 | 10 | /* Display for user-defined fill values and default floating-point fill 11 | values; should match what ncgen looks for in ../ncgen/ncgen.l */ 12 | #define FILL_STRING "_" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* Output the data for a single variable, in CDL syntax. */ 19 | extern int vardata ( const struct ncvar*, /* variable */ 20 | size_t [], /* variable dimension lengths */ 21 | int, /* netcdf id */ 22 | int, /* variable id */ 23 | const struct fspec* /* formatting specs */ 24 | ); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /src/utils/ncmpigen/generic.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * Copyright 1993, UCAR/Unidata 3 | * See netcdf/COPYRIGHT file for copying and redistribution conditions. 4 | * $Header$ 5 | *********************************************************************/ 6 | 7 | #ifndef UD_GENERIC_H 8 | #define UD_GENERIC_H 9 | 10 | union generic { /* used to hold any kind of fill_value */ 11 | float floatv; 12 | double doublev; 13 | int intv; 14 | short shortv; 15 | char charv; 16 | unsigned char ubytev; 17 | unsigned short ushortv; 18 | unsigned int uintv; 19 | long long int64v; 20 | unsigned long long uint64v; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/utils/ncmpigen/init.c: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * Copyright 1993, UCAR/Unidata 3 | * See netcdf/COPYRIGHT file for copying and redistribution conditions. 4 | * $Header$ 5 | *********************************************************************/ 6 | 7 | #include 8 | #include 9 | #include "generic.h" 10 | #include "ncmpigen.h" 11 | #include "genlib.h" 12 | 13 | extern int netcdf_flag; 14 | extern int c_flag; 15 | extern int fortran_flag; 16 | 17 | struct dims *dims; /* table of netcdf dimensions */ 18 | 19 | int ncid; /* handle for netCDF */ 20 | int ndims; /* number of dimensions declared for netcdf */ 21 | int nvars; /* number of variables declared for netcdf */ 22 | int natts; /* number of attributes */ 23 | int nvdims; /* number of dimensions for variables */ 24 | int dimnum; /* dimension number index for variables */ 25 | int varnum; /* variable number index for attributes */ 26 | MPI_Offset valnum; /* value number index for attributes */ 27 | MPI_Offset rec_dim; /* number of the unlimited dimension, if any */ 28 | MPI_Offset var_len; /* variable length (product of dimensions) */ 29 | MPI_Offset rec_len; /* number of elements for a record of data */ 30 | MPI_Offset var_size; /* size of each element of variable */ 31 | 32 | struct vars *vars; /* a malloc'ed list */ 33 | 34 | struct atts *atts; /* table of variable and global attributes */ 35 | 36 | void 37 | init_netcdf(void) { /* initialize global counts, flags */ 38 | 39 | clearout(); /* reset symbol table to empty */ 40 | ndims = 0; 41 | nvars = 0; 42 | rec_dim = -1; /* means no unlimited dimension (yet) */ 43 | } 44 | -------------------------------------------------------------------------------- /src/utils/ncmpigen/ncmpigentab.h: -------------------------------------------------------------------------------- 1 | #define NC_UNLIMITED_K 257 2 | #define BYTE_K 258 3 | #define CHAR_K 259 4 | #define SHORT_K 260 5 | #define INT_K 261 6 | #define FLOAT_K 262 7 | #define DOUBLE_K 263 8 | #define UBYTE_K 264 9 | #define USHORT_K 265 10 | #define UINT_K 266 11 | #define INT64_K 267 12 | #define UINT64_K 268 13 | #define IDENT 269 14 | #define TERMSTRING 270 15 | #define BYTE_CONST 271 16 | #define CHAR_CONST 272 17 | #define SHORT_CONST 273 18 | #define INT_CONST 274 19 | #define FLOAT_CONST 275 20 | #define DOUBLE_CONST 276 21 | #define UBYTE_CONST 277 22 | #define USHORT_CONST 278 23 | #define UINT_CONST 279 24 | #define INT64_CONST 280 25 | #define UINT64_CONST 281 26 | #define DIMENSIONS 282 27 | #define VARIABLES 283 28 | #define NETCDF 284 29 | #define DATA 285 30 | #define FILLVALUE 286 31 | -------------------------------------------------------------------------------- /src/utils/ncmpilogdump/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2018, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # @configure_input@ 6 | 7 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 8 | AM_CPPFLAGS += -I$(top_builddir)/src/include 9 | noinst_bindir = 10 | noinst_bin_PROGRAMS = ncmpilogdump 11 | nodist_ncmpilogdump_SOURCES = ncmpilogdump.c 12 | ncmpilogdump_LDADD = $(top_builddir)/src/libs/libpnetcdf.la 13 | ncmpilogdump_LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ 14 | 15 | M4_SRCS = ncmpilogdump.m4 16 | 17 | M4FLAGS += -I${top_srcdir}/m4 18 | 19 | $(M4_SRCS:.m4=.c): Makefile 20 | 21 | BUILT_SOURCES = $(M4_SRCS:.m4=.c) 22 | 23 | .m4.c: 24 | $(M4) $(AM_M4FLAGS) $(M4FLAGS) $< >$@ 25 | 26 | $(top_builddir)/src/libs/libpnetcdf.la: 27 | set -e; cd $(top_builddir)/src/libs && $(MAKE) $(MFLAGS) 28 | 29 | EXTRA_DIST = $(M4_SRCS) 30 | 31 | CLEANFILES = $(M4_SRCS:.m4=.c) core core.* *.gcda *.gcno *.gcov gmon.out 32 | 33 | tests-local: all 34 | 35 | -------------------------------------------------------------------------------- /src/utils/ncoffsets/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | bin_PROGRAMS = ncoffsets 10 | EXTRA_DIST = ncoffsets.c 11 | 12 | ncoffsets$(EXEEXT): ncoffsets.c 13 | $(SEQ_CC) $(SEQ_CFLAGS) -o $@ $< $(SEQ_LDFLAGS) $(SEQ_LIBS) 14 | 15 | dist_man_MANS = ncoffsets.1 16 | 17 | tests-local: all 18 | 19 | dist-hook: 20 | $(SED_I) -e "s|PNETCDF_RELEASE_VERSION|$(PNETCDF_VERSION)|g" $(distdir)/ncoffsets.c 21 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/ncoffsets.c 22 | $(SED_I) -e "s|PNETCDF_RELEASE_VERSION|$(PNETCDF_VERSION)|g" $(distdir)/ncoffsets.1 23 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE_FULL|@PNETCDF_RELEASE_DATE_FULL@|g" $(distdir)/ncoffsets.1 24 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/ncoffsets.1 25 | 26 | -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_large_fixed_var.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_large_fixed_var.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_large_rec_2_vars.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_large_rec_2_vars.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_large_rec_var.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_large_rec_var.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_magic.nc: -------------------------------------------------------------------------------- 1 | 0CDF -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_nvars.nc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_nvars.nc1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_nvars.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_nvars.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_nvars.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_nvars.nc5 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_dim.nc1: -------------------------------------------------------------------------------- 1 | CDF 2 | rec_dim0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_dim.nc2: -------------------------------------------------------------------------------- 1 | CDF 2 | rec_dim0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_dim.nc5: -------------------------------------------------------------------------------- 1 | CDF 2 | rec_dim0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_gattr.nc1: -------------------------------------------------------------------------------- 1 | CDF  gattr_short0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_gattr.nc2: -------------------------------------------------------------------------------- 1 | CDF  gattr_short0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_gattr.nc5: -------------------------------------------------------------------------------- 1 | CDF  gattr_short0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_var.nc1: -------------------------------------------------------------------------------- 1 | CDF fix_var0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_var.nc2: -------------------------------------------------------------------------------- 1 | CDF fix_var0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_var.nc5: -------------------------------------------------------------------------------- 1 | CDF fix_var0 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_vattr.nc1: -------------------------------------------------------------------------------- 1 | CDF temp  2 | attr_short00 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_vattr.nc2: -------------------------------------------------------------------------------- 1 | CDF temp  2 | attr_short00 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_name_vattr.nc5: -------------------------------------------------------------------------------- 1 | CDF temp  2 | attr_short00 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_value_gattr.nc1: -------------------------------------------------------------------------------- 1 | CDF gattr_0000 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_value_gattr.nc2: -------------------------------------------------------------------------------- 1 | CDF gattr_0000 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_value_gattr.nc5: -------------------------------------------------------------------------------- 1 | CDF gattr_0000 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_value_vattr.nc1: -------------------------------------------------------------------------------- 1 | CDF temp gattr_0000 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_value_vattr.nc2: -------------------------------------------------------------------------------- 1 | CDF temp gattr_0000 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_padding_value_vattr.nc5: -------------------------------------------------------------------------------- 1 | CDF temp gattr_0000 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_dimension.nc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_dimension.nc1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_dimension.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_dimension.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_dimension.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_dimension.nc5 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_gattr.nc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_gattr.nc1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_gattr.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_gattr.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_gattr.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_gattr.nc5 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_variable.nc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_variable.nc1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_variable.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_variable.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_variable.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_variable.nc5 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_vattr.nc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_vattr.nc1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_vattr.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_vattr.nc2 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_tag_vattr.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/bad_tag_vattr.nc5 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_unlimited.nc1: -------------------------------------------------------------------------------- 1 | CDF 2 |  unlimited_0 unlimited_1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_unlimited.nc2: -------------------------------------------------------------------------------- 1 | CDF 2 |  unlimited_0 unlimited_1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/bad_unlimited.nc5: -------------------------------------------------------------------------------- 1 | CDF 2 |  unlimited_0 unlimited_1 -------------------------------------------------------------------------------- /src/utils/ncvalidator/pad_superblock.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/src/utils/ncvalidator/pad_superblock.h5 -------------------------------------------------------------------------------- /src/utils/ncvalidator/seq_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | # set -e 9 | # Cannot use "set -e" here, as the tests here all return errors. 10 | 11 | VALIDATOR=ncvalidator 12 | if [ -z "${VALIDATOR}" ]; then 13 | echo "Failed: variable VALIDATOR id not defined" 14 | exit 1 15 | fi 16 | if [ ! -f ${VALIDATOR} ]; then 17 | echo "Failed: file ${VALIDATOR} does not exit" 18 | exit 1 19 | fi 20 | 21 | # prevent user environment setting of PNETCDF_HINTS to interfere 22 | unset PNETCDF_HINTS 23 | 24 | for i in ${BAD_FILES} ; do 25 | if [ ! -f ${srcdir}/$i ]; then 26 | echo "Failed: input test file ${srcdir}/$i does not exit" 27 | exit 1 28 | fi 29 | ${TESTSEQRUN} ./${VALIDATOR} ${srcdir}/$i 30 | ret=$? 31 | # capture exit status of VALIDATOR command 32 | if [ ${ret} -ne 1 ]; then 33 | echo "Failed: ${VALIDATOR} ${srcdir}/$i" 34 | exit 1 35 | fi 36 | done 37 | echo "SUCCESS: ${VALIDATOR} to detect files fail to conform CDF formats" 38 | 39 | -------------------------------------------------------------------------------- /src/utils/ncvalidator/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2017, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | # prevent user environment setting of PNETCDF_HINTS to interfere 11 | unset PNETCDF_HINTS 12 | 13 | for i in ${ENULLPAD_FILES} ; do 14 | for j in 0 1 ; do 15 | export PNETCDF_SAFE_MODE=$j 16 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 17 | ${TESTSEQRUN} ./tst_open ${srcdir}/$i NC_ENULLPAD 18 | done 19 | done 20 | 21 | for i in ${EMAXVARS_FILES} ; do 22 | for j in 0 1 ; do 23 | export PNETCDF_SAFE_MODE=$j 24 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 25 | ${TESTSEQRUN} ./tst_open ${srcdir}/$i NC_EMAXVARS 26 | done 27 | done 28 | 29 | for i in ${EUNLIMIT_FILES} ; do 30 | for j in 0 1 ; do 31 | export PNETCDF_SAFE_MODE=$j 32 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 33 | ${TESTSEQRUN} ./tst_open ${srcdir}/$i NC_EUNLIMIT 34 | done 35 | done 36 | 37 | for i in ${ENOTNC_FILES} ; do 38 | for j in 0 1 ; do 39 | export PNETCDF_SAFE_MODE=$j 40 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 41 | ${TESTSEQRUN} ./tst_open ${srcdir}/$i NC_ENOTNC 42 | done 43 | done 44 | 45 | for i in ${EVARSIZE_FILES} ; do 46 | for j in 0 1 ; do 47 | export PNETCDF_SAFE_MODE=$j 48 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 49 | ${TESTSEQRUN} ./tst_open ${srcdir}/$i NC_EVARSIZE 50 | done 51 | done 52 | 53 | -------------------------------------------------------------------------------- /src/utils/ncvalidator/xfail_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | # set -e 9 | # Cannot use "set -e" here, as the tests here all return errors. 10 | 11 | VALIDATOR=ncvalidator 12 | 13 | BAD_FILES="${ENULLPAD_FILES} ${EMAXVARS_FILES} ${EUNLIMIT_FILES} ${ENOTNC_FILES} ${EVARSIZE_FILES} ${TST_HDF5_FILES}" 14 | for i in ${BAD_FILES} ; do 15 | # echo "${TESTSEQRUN} ./${VALIDATOR} ${srcdir}/$i" 16 | ${TESTSEQRUN} ./${VALIDATOR} ${srcdir}/$i 17 | done 18 | 19 | -------------------------------------------------------------------------------- /src/utils/pnetcdf_version/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | bin_PROGRAMS = pnetcdf_version 10 | 11 | XDEFS = -DMPICC="\"$(MPICC)\"" -DCFLAGS="\"$(CFLAGS)\"" 12 | XDEFS += -DCONFIGURE_ARGS_CLEAN="\"$(CONFIGURE_ARGS_CLEAN)\"" 13 | XDEFS += -DPNETCDF_VERSION="\"$(PNETCDF_VERSION)\"" 14 | 15 | if HAS_MPICXX 16 | XDEFS += -DMPICXX="\"$(MPICXX)\"" -DCXXFLAGS="\"$(CXXFLAGS)\"" 17 | endif 18 | 19 | if HAS_FORTRAN 20 | XDEFS += -DMPIF77="\"$(MPIF77)\"" -DFFLAGS="\"$(FFLAGS)\"" 21 | XDEFS += -DMPIF90="\"$(MPIF90)\"" -DFCFLAGS="\"$(FCFLAGS)\"" 22 | endif 23 | 24 | pnetcdf_version$(EXEEXT): pnetcdf_version.c 25 | $(SEQ_CC) $(SEQ_CFLAGS) $(XDEFS) -o $@ $< $(SEQ_LDFLAGS) $(SEQ_LIBS) 26 | 27 | dist_man_MANS = pnetcdf_version.1 28 | 29 | tests-local: all 30 | 31 | dist-hook: 32 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/pnetcdf_version.c 33 | $(SED_I) -e "s|PNETCDF_RELEASE_VERSION|$(PNETCDF_VERSION)|g" $(distdir)/pnetcdf_version.1 34 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE_FULL|@PNETCDF_RELEASE_DATE_FULL@|g" $(distdir)/pnetcdf_version.1 35 | $(SED_I) -e "s|PNETCDF_RELEASE_DATE|@PNETCDF_RELEASE_DATE@|g" $(distdir)/pnetcdf_version.1 36 | 37 | -------------------------------------------------------------------------------- /src/utils/pnetcdf_version/pnetcdf_version.1: -------------------------------------------------------------------------------- 1 | .\" $Header$ 2 | .nr yr \n(yr+1900 3 | .af mo 01 4 | .af dy 01 5 | .TH pnetcdf_version 1 "PnetCDF PNETCDF_RELEASE_VERSION" "Printed: \n(yr-\n(mo-\n(dy" "PnetCDF utilities" 6 | .SH NAME 7 | pnetcdf_version \- print the version information of PnetCDF library 8 | .SH SYNOPSIS 9 | .ft B 10 | .HP 11 | pnetcdf_version 12 | .nh 13 | \%[-v] 14 | \%[-d] 15 | \%[-c] 16 | \%[-b] 17 | \%[-h] 18 | .hy 19 | .ft 20 | .SH DESCRIPTION 21 | \fBpnetcdf_version\fP prints the version information of PnetCDF library and 22 | the configure command line used to build the library 23 | 24 | If no argument is given, all information is printed. 25 | .SH OPTIONS 26 | .IP "\fB-v\fP" 27 | Version number of this PnetCDF release. 28 | .IP "\fB-d\fP" 29 | Release date. 30 | .IP "\fB-c\fP" 31 | Configure command-line arguments used to build this PnetCDF 32 | .IP "\fB-b\fP" 33 | MPI compilers used to build this PnetCDF library 34 | .IP "\fB-h\fP" 35 | Print the available command-line options of pnetcdf_version 36 | 37 | .SH EXAMPLES 38 | .LP 39 | Print all information about the PnetCDF library by running the command with no options. 40 | 41 | % pnetcdf_version 42 | .sp 43 | .nf 44 | PnetCDF Version: PNETCDF_RELEASE_VERSION 45 | PnetCDF Release date: PNETCDF_RELEASE_DATE 46 | PnetCDF configure: --with-mpi=/usr/local/bin 47 | MPICC: /usr/local/bin/mpicc -g -O2 48 | MPICXX: /usr/local/bin/mpicxx -g -O2 49 | MPIF77: /usr/local/bin/mpif77 -g -O2 50 | MPIF90: /usr/local/bin/mpif90 -g -O2 51 | .fi 52 | 53 | .SH "SEE ALSO" 54 | .LP 55 | .BR pnetcdf (3) 56 | .SH DATE 57 | PNETCDF_RELEASE_DATE 58 | .LP 59 | 60 | 61 | -------------------------------------------------------------------------------- /test/CXX/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | # remove file system type prefix if there is any 16 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 17 | 18 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 19 | if test ${PNETCDF_DEBUG} = 1 ; then 20 | safe_modes="0 1" 21 | else 22 | safe_modes="0" 23 | fi 24 | 25 | # prevent user environment setting of PNETCDF_HINTS to interfere 26 | unset PNETCDF_HINTS 27 | 28 | for j in ${safe_modes} ; do 29 | export PNETCDF_SAFE_MODE=$j 30 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 31 | ${TESTSEQRUN} ./$1 ${TESTOUTDIR}/$outfile.nc 32 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 33 | # echo "" 34 | 35 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 36 | echo "" 37 | echo "---- testing burst buffering" 38 | 39 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 40 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.bb.nc 41 | unset PNETCDF_HINTS 42 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.bb.nc 43 | 44 | # echo "--- ncmpidiff $outfile.nc $outfile.bb.nc ---" 45 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$outfile.nc ${TESTOUTDIR}/$outfile.bb.nc 46 | fi 47 | done 48 | rm -f ${OUTDIR}/$outfile.nc 49 | rm -f ${OUTDIR}/$outfile.bb.nc 50 | 51 | -------------------------------------------------------------------------------- /test/F90/seq_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | # prevent user environment setting of PNETCDF_HINTS to interfere 14 | unset PNETCDF_HINTS 15 | 16 | ${TESTSEQRUN} ./tst_io ${TESTOUTDIR} 17 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/tst_io1.nc 18 | # remove file system type prefix if there is any 19 | OUTDIR=$(echo $TESTOUTDIR | cut -d: -f2) 20 | mv ${OUTDIR}/tst_io1.nc ${OUTDIR}/tst_io1.nc0 21 | 22 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 23 | echo "" 24 | echo "---- testing burst buffering" 25 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 26 | ${TESTSEQRUN} ./tst_io ${TESTOUTDIR} 27 | unset PNETCDF_HINTS 28 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/tst_io1.nc 29 | 30 | # echo "--- ncmpidiff tst_io1.nc0 tst_io1.nc ---" 31 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/tst_io1.nc0 ${TESTOUTDIR}/tst_io1.nc 32 | fi 33 | rm -f ${OUTDIR}/tst_io1.nc0 34 | rm -f ${OUTDIR}/tst_io1.nc 35 | 36 | -------------------------------------------------------------------------------- /test/F90/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | # remove file system type prefix if there is any 16 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 17 | 18 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 19 | if test ${PNETCDF_DEBUG} = 1 ; then 20 | safe_modes="0 1" 21 | else 22 | safe_modes="0" 23 | fi 24 | 25 | # prevent user environment setting of PNETCDF_HINTS to interfere 26 | unset PNETCDF_HINTS 27 | 28 | for j in ${safe_modes} ; do 29 | export PNETCDF_SAFE_MODE=$j 30 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 31 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 32 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 33 | # echo "" 34 | 35 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 36 | echo "" 37 | echo "---- testing burst buffering" 38 | 39 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 40 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.bb.nc 41 | unset PNETCDF_HINTS 42 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.bb.nc 43 | 44 | # running ncmpidiff on dim_cdf12 on one process requires more than 2 GB 45 | # memory. Use more processes to check. Disable the check for now. 46 | if test "$1" != "./tst_flarge" ; then 47 | # echo "--- ncmpidiff $outfile.nc $outfile.bb.nc ---" 48 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$outfile.nc ${TESTOUTDIR}/$outfile.bb.nc 49 | fi 50 | fi 51 | done 52 | rm -f ${OUTDIR}/$outfile.nc 53 | rm -f ${OUTDIR}/$outfile.bb.nc 54 | 55 | -------------------------------------------------------------------------------- /test/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | C_SUBDIRS = common \ 10 | C \ 11 | fandc \ 12 | nc_test \ 13 | cdf_format \ 14 | header \ 15 | testcases \ 16 | nonblocking \ 17 | cdl 18 | 19 | DIST_SUBDIRS = $(C_SUBDIRS) CXX nf_test nf90_test F90 subfile \ 20 | largefile burst_buffer nc4 adios 21 | 22 | SUBDIRS = $(C_SUBDIRS) 23 | 24 | if HAS_MPICXX 25 | SUBDIRS += CXX 26 | endif 27 | 28 | if HAS_FORTRAN 29 | SUBDIRS += nf_test 30 | if HAVE_MPI_MOD 31 | SUBDIRS += nf90_test F90 32 | endif 33 | endif 34 | 35 | if ENABLE_SUBFILING 36 | SUBDIRS += subfile 37 | endif 38 | 39 | if ENABLE_NETCDF4 40 | SUBDIRS += nc4 41 | endif 42 | 43 | if ENABLE_ADIOS 44 | SUBDIRS += adios 45 | endif 46 | 47 | if ENABLE_BURST_BUFFER 48 | SUBDIRS += burst_buffer 49 | endif 50 | 51 | if RUN_LARGE_FILE_TEST 52 | SUBDIRS += largefile 53 | endif 54 | 55 | # below is the alternative when AM_EXTRA_RECURSIVE_TARGETS is not defined 56 | # TESTS_DIRS = $(SUBDIRS:%=tests-%) 57 | # tests: $(TESTS_DIRS) 58 | # $(TESTS_DIRS): 59 | # $(MAKE) $(MFLAGS) -C $(@:tests-%=%) tests 60 | 61 | if BUILD_COVERAGE 62 | PTEST_SUBDIRS = 63 | else 64 | PTEST_SUBDIRS = $(SUBDIRS) 65 | endif 66 | 67 | ptest: 68 | @for d in $(PTEST_SUBDIRS) ; do \ 69 | $(MAKE) $(MFLAGS) -C $$d ptest $$* || exit 1 ; \ 70 | done 71 | 72 | ptests: 73 | @for d in $(PTEST_SUBDIRS) ; do \ 74 | $(MAKE) $(MFLAGS) -C $$d ptests $$* || exit 1 ; \ 75 | done 76 | 77 | # For VPATH build (parallel build), try delete all sub-directories 78 | distclean-local: 79 | @for d in $(DIST_SUBDIRS) ; do \ 80 | if [ -d $$d/.deps ] ; then rmdir $$d/.deps || true ; fi ; \ 81 | done ; \ 82 | if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ 83 | for d in $(DIST_SUBDIRS) ; do \ 84 | rmdir $$d || true ; \ 85 | done ; \ 86 | fi 87 | 88 | .PHONY: ptest ptests 89 | 90 | .NOTPARALLEL: 91 | 92 | -------------------------------------------------------------------------------- /test/adios/arrays.bp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/adios/arrays.bp -------------------------------------------------------------------------------- /test/adios/arrays_big.bp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/adios/arrays_big.bp -------------------------------------------------------------------------------- /test/adios/attributes.bp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/adios/attributes.bp -------------------------------------------------------------------------------- /test/adios/attributes_big.bp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/adios/attributes_big.bp -------------------------------------------------------------------------------- /test/adios/parallel_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2019, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"` 14 | # echo "MPIRUN = ${MPIRUN}" 15 | # echo "check_PROGRAMS=${check_PROGRAMS}" 16 | 17 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 18 | if test ${PNETCDF_DEBUG} = 1 ; then 19 | safe_modes="0 1" 20 | else 21 | safe_modes="0" 22 | fi 23 | 24 | # prevent user environment setting of PNETCDF_HINTS to interfere 25 | unset PNETCDF_HINTS 26 | 27 | for i in ${check_PROGRAMS} ; do 28 | for j in ${safe_modes} ; do 29 | for intra_aggr in 0 1 ; do 30 | if test "$j" = 1 ; then # test only in safe mode 31 | export PNETCDF_HINTS="romio_no_indep_rw=true" 32 | else 33 | export PNETCDF_HINTS= 34 | fi 35 | if test "$intra_aggr" = 1 ; then 36 | export PNETCDF_HINTS="${PNETCDF_HINTS};nc_num_aggrs_per_node=2" 37 | fi 38 | export PNETCDF_SAFE_MODE=$j 39 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 40 | if test "$i" = open ; then 41 | ${MPIRUN} ./$i ${srcdir}/arrays.bp 42 | ${MPIRUN} ./$i ${srcdir}/attributes.bp 43 | ${MPIRUN} ./$i ${srcdir}/arrays_big.bp 44 | if test ${ADIOS_VER_GE_1132} = 1 ; then 45 | ${MPIRUN} ./$i ${srcdir}/attributes_big.bp 46 | fi 47 | elif test "$i" = att ; then 48 | ${MPIRUN} ./$i ${srcdir}/attributes.bp 49 | else 50 | ${MPIRUN} ./$i ${srcdir}/arrays.bp 51 | fi 52 | done 53 | done 54 | done 55 | 56 | -------------------------------------------------------------------------------- /test/adios/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2019, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | 14 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 15 | if test ${PNETCDF_DEBUG} = 1 ; then 16 | safe_modes="0 1" 17 | else 18 | safe_modes="0" 19 | fi 20 | 21 | # prevent user environment setting of PNETCDF_HINTS to interfere 22 | unset PNETCDF_HINTS 23 | 24 | for j in ${safe_modes} ; do 25 | export PNETCDF_SAFE_MODE=$j 26 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 27 | if test "$1" = ./open ; then 28 | ${TESTSEQRUN} $1 ${srcdir}/arrays.bp 29 | ${TESTSEQRUN} $1 ${srcdir}/attributes.bp 30 | ${TESTSEQRUN} $1 ${srcdir}/arrays_big.bp 31 | echo ${ADIOS_VER_GE_1132} 32 | if test ${ADIOS_VER_GE_1132} = 1 ; then 33 | ${TESTSEQRUN} $1 ${srcdir}/attributes_big.bp 34 | fi 35 | elif test "$1" = ./att ; then 36 | ${TESTSEQRUN} $1 ${srcdir}/attributes.bp 37 | else 38 | ${TESTSEQRUN} $1 ${srcdir}/arrays.bp 39 | fi 40 | done 41 | 42 | -------------------------------------------------------------------------------- /test/burst_buffer/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | outfile=`basename $1` 12 | 13 | # remove file system type prefix if there is any 14 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 15 | 16 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 17 | if test ${PNETCDF_DEBUG} = 1 ; then 18 | safe_modes="0 1" 19 | else 20 | safe_modes="0" 21 | fi 22 | 23 | # prevent user environment setting of PNETCDF_HINTS to interfere 24 | unset PNETCDF_HINTS 25 | 26 | for j in ${safe_modes} ; do 27 | export PNETCDF_SAFE_MODE=$j 28 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 29 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 30 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 31 | unset PNETCDF_HINTS 32 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 33 | done 34 | 35 | rm -f ${OUTDIR}/$outfile.nc 36 | rm -f ${OUTDIR}/$outfile.nc_0_0.data 37 | rm -f ${OUTDIR}/$outfile.nc_0_0.meta 38 | 39 | -------------------------------------------------------------------------------- /test/cdf_format/bad_begin.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/bad_begin.nc5 -------------------------------------------------------------------------------- /test/cdf_format/bad_dimid.nc1: -------------------------------------------------------------------------------- 1 | CDF 2 | rec_dimdim_1dim_2 var0Pvar1 -------------------------------------------------------------------------------- /test/cdf_format/bad_dimid.nc2: -------------------------------------------------------------------------------- 1 | CDF 2 | rec_dimdim_1dim_2 var0Pvar1 -------------------------------------------------------------------------------- /test/cdf_format/bad_dimid.nc5: -------------------------------------------------------------------------------- 1 | CDF 2 | rec_dimdim_1dim_2 var0Pvar1 -------------------------------------------------------------------------------- /test/cdf_format/bad_nattrs.nc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/bad_nattrs.nc1 -------------------------------------------------------------------------------- /test/cdf_format/bad_nattrs.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/bad_nattrs.nc2 -------------------------------------------------------------------------------- /test/cdf_format/bad_nattrs.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/bad_nattrs.nc5 -------------------------------------------------------------------------------- /test/cdf_format/bad_ndims.nc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/bad_ndims.nc1 -------------------------------------------------------------------------------- /test/cdf_format/bad_ndims.nc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/bad_ndims.nc2 -------------------------------------------------------------------------------- /test/cdf_format/bad_ndims.nc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/bad_ndims.nc5 -------------------------------------------------------------------------------- /test/cdf_format/bad_xtype.nc1: -------------------------------------------------------------------------------- 1 | CDF var -------------------------------------------------------------------------------- /test/cdf_format/bad_xtype.nc2: -------------------------------------------------------------------------------- 1 | CDF var -------------------------------------------------------------------------------- /test/cdf_format/bad_xtype.nc5: -------------------------------------------------------------------------------- 1 | CDF var  -------------------------------------------------------------------------------- /test/cdf_format/seq_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | # prevent user environment setting of PNETCDF_HINTS to interfere 11 | unset PNETCDF_HINTS 12 | 13 | ${TESTSEQRUN} ./test_inq_format ${srcdir} 14 | 15 | # the followings check files with corrupted header 16 | ${TESTSEQRUN} ./tst_open_cdf5 ${srcdir}/bad_begin.nc5 17 | ${TESTSEQRUN} ./tst_corrupt ${srcdir} 18 | 19 | # echo "" 20 | 21 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 22 | echo "" 23 | echo "---- testing burst buffering" 24 | 25 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 26 | 27 | ${TESTSEQRUN} ./test_inq_format ${srcdir} 28 | 29 | # the followings check files with corrupted header 30 | ${TESTSEQRUN} ./tst_open_cdf5 ${srcdir}/bad_begin.nc5 31 | ${TESTSEQRUN} ./tst_corrupt ${srcdir} 32 | fi 33 | -------------------------------------------------------------------------------- /test/cdf_format/test_cdf1.nc: -------------------------------------------------------------------------------- 1 | CDF -------------------------------------------------------------------------------- /test/cdf_format/test_cdf2.nc: -------------------------------------------------------------------------------- 1 | CDF -------------------------------------------------------------------------------- /test/cdf_format/test_cdf5.nc: -------------------------------------------------------------------------------- 1 | CDF -------------------------------------------------------------------------------- /test/cdf_format/test_netcdf4.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parallel-NetCDF/PnetCDF/2b48c9bbc4644cb3ec41731ae938ea0cb5351b73/test/cdf_format/test_netcdf4.nc -------------------------------------------------------------------------------- /test/cdf_format/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | # remove file system type prefix if there is any 16 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 17 | 18 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 19 | if test ${PNETCDF_DEBUG} = 1 ; then 20 | safe_modes="0 1" 21 | else 22 | safe_modes="0" 23 | fi 24 | 25 | # prevent user environment setting of PNETCDF_HINTS to interfere 26 | unset PNETCDF_HINTS 27 | 28 | for j in ${safe_modes} ; do 29 | export PNETCDF_SAFE_MODE=$j 30 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 31 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 32 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 33 | 34 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 35 | echo "" 36 | echo "---- testing burst buffering" 37 | 38 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 39 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.bb.nc 40 | unset PNETCDF_HINTS 41 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.bb.nc 42 | 43 | # running ncmpidiff on dim_cdf12 on one process requires more than 2 GB 44 | # memory. Use more processes to check. Disable the check for now. 45 | if test "$1" != "./dim_cdf12" ; then 46 | # echo "--- ncmpidiff $outfile.nc $outfile.bb.nc ---" 47 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$outfile.nc ${TESTOUTDIR}/$outfile.bb.nc 48 | fi 49 | fi 50 | done 51 | rm -f ${OUTDIR}/$outfile.nc 52 | rm -f ${OUTDIR}/$outfile.bb.nc 53 | -------------------------------------------------------------------------------- /test/cdf_format/xfail_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 8 | 9 | for i in ${BAD_FILES} ; do 10 | ${TESTSEQRUN} ./${VALIDATOR} -q ${srcdir}/$i 11 | done 12 | 13 | -------------------------------------------------------------------------------- /test/cdl/cdl_header.txt: -------------------------------------------------------------------------------- 1 | netcdf testfile { 2 | 3 | // file format: CDF-5 (big variables) 4 | // 5 | 6 | // 7 | 8 | dimensions: 9 | 10 | // 11 | 12 | Y = 4 ; 13 | time = UNLIMITED ; // (1 currently) 14 | 15 | X = 10 ; 16 | // 17 | chars = 101 ; 18 | 19 | variables: 20 | int var_int(Y, X) ; 21 | var_int:FieldType = 104 ; 22 | var_int:MemoryOrder = "XY " ; 23 | 24 | 25 | float scalar_var ; 26 | scalar_var:units = "K" ; 27 | 28 | double time(time) ; 29 | time:long_name = "time" ; 30 | time:units = "days since 0001-01-01 00:00:00" ; 31 | time:calendar = "noleap" ; 32 | time:bounds = "time_bnds" ; 33 | 34 | char date_written(time, chars) ; 35 | 36 | // 37 | 38 | // global attributes: 39 | 40 | // 41 | 42 | :TITLE = " OUTPUT FROM A CLIMATE MODEL Va.b.c " ; 43 | :EMPTY_STR = "" ; 44 | // 45 | 46 | :SOME_INT = 0 ; 47 | // 48 | 49 | :SOME_FLOAT = 1.f, 2.f ; 50 | 51 | // 52 | data: 53 | 54 | scalar_var = 0 ; 55 | 56 | } 57 | -------------------------------------------------------------------------------- /test/cdl/parallel_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2025, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | # remove file system type prefix if there is any 14 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 15 | 16 | MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"` 17 | # echo "MPIRUN = ${MPIRUN}" 18 | # echo "check_PROGRAMS=${check_PROGRAMS}" 19 | 20 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 21 | if test ${PNETCDF_DEBUG} = 1 ; then 22 | safe_modes="0 1" 23 | else 24 | safe_modes="0" 25 | fi 26 | 27 | # prevent user environment setting of PNETCDF_HINTS to interfere 28 | unset PNETCDF_HINTS 29 | 30 | for i in ${check_PROGRAMS} ; do 31 | 32 | CMD_OPTS=${TESTOUTDIR}/$i.nc 33 | if test $i = "tst_cdl_hdr_parser" ; then 34 | CMD_OPTS="-q -o ${TESTOUTDIR}/$i.nc ${srcdir}/cdl_header.txt" 35 | fi 36 | 37 | for j in ${safe_modes} ; do 38 | if test "$j" = 1 ; then # test only in safe mode 39 | export PNETCDF_HINTS="romio_no_indep_rw=true" 40 | else 41 | export PNETCDF_HINTS= 42 | fi 43 | export PNETCDF_SAFE_MODE=$j 44 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 45 | ${MPIRUN} ./$i ${CMD_OPTS} 46 | 47 | done 48 | rm -f ${OUTDIR}/$i.nc 49 | done 50 | 51 | -------------------------------------------------------------------------------- /test/cdl/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2025, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | CMD_OPTS= 16 | if test $outfile = "tst_cdl_hdr_parser" ; then 17 | CMD_OPTS="-q -o ${TESTOUTDIR}/$outfile.nc ${srcdir}/cdl_header.txt" 18 | fi 19 | 20 | # remove file system type prefix if there is any 21 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 22 | 23 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 24 | if test ${PNETCDF_DEBUG} = 1 ; then 25 | safe_modes="0 1" 26 | else 27 | safe_modes="0" 28 | fi 29 | 30 | # prevent user environment setting of PNETCDF_HINTS to interfere 31 | unset PNETCDF_HINTS 32 | 33 | for j in ${safe_modes} ; do 34 | export PNETCDF_SAFE_MODE=$j 35 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 36 | ${TESTSEQRUN} $1 $CMD_OPTS 37 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 38 | 39 | done 40 | rm -f ${OUTDIR}/$outfile.nc 41 | 42 | -------------------------------------------------------------------------------- /test/common/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | # See COPYRIGHT notice in top-level directory. 4 | # 5 | # $Id$ 6 | # 7 | # @configure_input@ 8 | 9 | SUFFIXES = .a .o .c .F90 .h 10 | 11 | AM_DEFAULT_SOURCE_EXT = .c 12 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 13 | AM_CPPFLAGS += -I$(top_builddir)/src/include 14 | 15 | check_LTLIBRARIES = libtestutils.la 16 | 17 | libtestutils_la_SOURCES = testutils.c testutils.h 18 | 19 | CLEANFILES = core.* *.gcda *.gcno *.gcov gmon.out 20 | 21 | # Must build the Fortran library separately, otherwise libtools will keep 22 | # using FCLINK to build C library even when --disable-fortran is used 23 | if HAS_FORTRAN 24 | check_LTLIBRARIES += libtestutilsf.la 25 | libtestutilsf_la_SOURCES = testutilsf.F90 26 | libtestutils_la_LIBADD = libtestutilsf.la 27 | CLEANFILES += testutilsf.mod 28 | endif 29 | 30 | AM_FFLAGS = 31 | AM_FCFLAGS = 32 | 33 | if DECL_GET_ENVIRONMENT_VARIABLE 34 | AM_FCFLAGS += $(FC_DEFINE)HAS_GET_ENVIRONMENT_VARIABLE 35 | endif 36 | 37 | if DECL_MPI_OFFSET 38 | # Do not add to AM_CPPFLAGS, as it will be used by both C and Fortran programs 39 | # AM_CPPFLAGS += -DHAVE_DECL_MPI_OFFSET 40 | # AM_CFLAGS = -DHAVE_DECL_MPI_OFFSET 41 | AM_FFLAGS += $(FC_DEFINE)HAVE_DECL_MPI_OFFSET 42 | AM_FCFLAGS += $(FC_DEFINE)HAVE_DECL_MPI_OFFSET 43 | endif 44 | 45 | # overwrite PPFCCOMPILE and LTPPFCCOMPILE to avoid using DEFS 46 | # IBM xlf compiler uses -WF,-D not -D 47 | # FCDEFS=`echo $(DEFS) | $(SED) 's/-D/-WF,-D/g'` 48 | # PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 49 | # $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) 50 | # LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ 51 | # $(LIBTOOLFLAGS) --mode=compile $(FC) $(FCDEFS) \ 52 | # $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ 53 | # $(AM_FCFLAGS) $(FCFLAGS) 54 | 55 | # build check targets but not invoke 56 | tests-local: all $(check_LTLIBRARIES) 57 | 58 | .PHONY: ptest ptests ptest2 ptest4 ptest6 ptest8 ptest10 59 | 60 | -------------------------------------------------------------------------------- /test/fandc/README: -------------------------------------------------------------------------------- 1 | # programs in this folder are just for testing compile error/warning messages, 2 | # not for running 3 | 4 | -------------------------------------------------------------------------------- /test/fandc/fixedform.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! Copyright (C) 2013, Northwestern University and Argonne National Laboratory 3 | ! See COPYRIGHT notice in top-level directory. 4 | ! 5 | ! $Id$ 6 | 7 | ! 8 | ! This program tests whether header file pnetcdf.inc conforms Fortran fixed 9 | ! form. Hence this test is for compilation only. 10 | ! 11 | 12 | program main 13 | implicit none 14 | include "mpif.h" 15 | include "pnetcdf.inc" 16 | 17 | character(LEN=80) pnetcdf_version 18 | integer err 19 | 20 | call MPI_Init(err) 21 | 22 | pnetcdf_version = nfmpi_inq_libvers() 23 | 24 | call MPI_Finalize(err) 25 | 26 | end program main 27 | 28 | -------------------------------------------------------------------------------- /test/fandc/freeform.f: -------------------------------------------------------------------------------- 1 | ! 2 | ! Copyright (C) 2013, Northwestern University and Argonne National Laboratory 3 | ! See COPYRIGHT notice in top-level directory. 4 | ! 5 | ! $Id$ 6 | 7 | ! 8 | ! This program tests whether header file pnetcdf.inc conforms Fortran free form 9 | ! for compilation only, not execution 10 | ! 11 | 12 | program main 13 | implicit none 14 | include "mpif.h" 15 | include "pnetcdf.inc" 16 | 17 | character(LEN=80) pnetcdf_version 18 | integer err 19 | 20 | call MPI_Init(err) 21 | 22 | pnetcdf_version = nfmpi_inq_libvers() 23 | 24 | call MPI_Finalize(err) 25 | 26 | end program main 27 | 28 | -------------------------------------------------------------------------------- /test/fandc/pnctestf.f: -------------------------------------------------------------------------------- 1 | ! 2 | ! Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | ! See COPYRIGHT notice in top-level directory. 4 | ! 5 | ! $Id$ 6 | ! 7 | program Pnf_Test 8 | ! Test program thanks to From: John Tannahill 9 | 10 | implicit none 11 | include "mpif.h" 12 | include "pnetcdf.inc" 13 | 14 | integer*8 TOTSIZ_3D(3) 15 | 16 | logical reorder 17 | 18 | logical isperiodic(3) 19 | 20 | integer comm_cart 21 | integer ierr 22 | integer lat_id, lev_id, lon_id 23 | integer ncid 24 | integer totpes 25 | integer tt_id 26 | 27 | integer dim_id(3) 28 | 29 | integer numpes(3) 30 | ! number of PEs along axes; 31 | ! determined by MPI where a zero is specified 32 | 33 | data totsiz_3d/10,20,30/ 34 | data reorder /.false./ 35 | data isperiodic /.false., .false., .false./ 36 | data numpes/1,1,0/ 37 | 38 | call MPI_Init(ierr) 39 | 40 | call MPI_Comm_Size(MPI_COMM_WORLD, totpes, ierr) 41 | 42 | call MPI_Dims_Create(totpes, 3, numpes, ierr) 43 | 44 | call MPI_Cart_Create(MPI_COMM_WORLD, 3, numpes, isperiodic, 45 | + reorder, comm_cart, ierr) 46 | 47 | ierr = nfmpi_create(comm_cart, "pnf_test.nc", NF_CLOBBER, 48 | + MPI_INFO_NULL, ncid) 49 | 50 | ierr = nfmpi_def_dim(ncid, "level", totsiz_3d(1), lev_id) 51 | ierr = nfmpi_def_dim(ncid, "latitude", totsiz_3d(2), lat_id) 52 | ierr = nfmpi_def_dim(ncid, "longitude", totsiz_3d(3), lon_id) 53 | 54 | dim_id(1) = lev_id 55 | dim_id(2) = lat_id 56 | dim_id(3) = lon_id 57 | 58 | ierr = nfmpi_def_var(ncid, "tt", NF_FLOAT, 3, dim_id, tt_id) 59 | 60 | ierr = nfmpi_enddef(ncid) 61 | 62 | ierr = nfmpi_close(ncid) 63 | 64 | call MPI_Comm_Free(comm_cart, ierr) 65 | 66 | call MPI_Finalize (ierr) 67 | 68 | Write (6,10) 69 | 70 | 10 format(" No Errors") 71 | 72 | end ! program Pnf_Test 73 | -------------------------------------------------------------------------------- /test/header/README: -------------------------------------------------------------------------------- 1 | header check 2 | 1. fatal error: 3 | mpiexec -n 4 test_check_header test.nc 4 | 2. warning: 5 | mpiexec -n 4 test_check_header1 test.nc 6 | -------------------------------------------------------------------------------- /test/header/seq_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 16 | if test ${PNETCDF_DEBUG} = 1 ; then 17 | safe_modes="0 1" 18 | else 19 | safe_modes="0" 20 | fi 21 | 22 | # prevent user environment setting of PNETCDF_HINTS to interfere 23 | unset PNETCDF_HINTS 24 | 25 | # header consistency tests are designed to run on more than one MPI process 26 | for j in ${safe_modes} ; do 27 | export PNETCDF_SAFE_MODE=$j 28 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 29 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 30 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 31 | 32 | 33 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 34 | echo "" 35 | echo "---- testing burst buffering" 36 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 37 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.bb.nc 38 | unset PNETCDF_HINTS 39 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.bb.nc 40 | 41 | # echo "--- ncmpidiff $outfile.nc $outfile.bb.nc ---" 42 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$outfile.nc ${TESTOUTDIR}/$outfile.bb.nc 43 | fi 44 | done 45 | -------------------------------------------------------------------------------- /test/jenkins.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # MCS hosts a jenkins server (a continuous-integration build bot) at 4 | # https://jenkins-ci.mcs.anl.gov/job/Parallel-NetCDF/ 5 | 6 | # this is just a beginning. 7 | # - Would like to integrate coverity into the reports 8 | # - our tests should report something Jenkins understands so that we get back 9 | # a finer-grained "N of M tests failed" instead of a single "pass/fail" for 10 | # all tests 11 | 12 | # 13 | # the MCS environment uses the uncommon 'softenv' environment. It's not 14 | # helpful to us 15 | 16 | export PATH=/soft/apps/packages/gcc/gcc-6.2.0/bin/:/soft/apps/packages/climate/mpich/3.2/gcc-6.2.0/bin:${PATH} 17 | 18 | # presumes the presence of the autotools and an mpi compiler. The jenkins 19 | # build slaves use the MCS workstation environment, which today is 20 | # autoconf-2.68 and mpich-1.4.1 21 | autoreconf -fi 22 | 23 | 24 | # We are using the following Jenkins environment variables: 25 | # WORKSPACE 26 | # The absolute path of the directory assigned to the build as a workspace. 27 | # BUILD_TAG 28 | # String of "jenkins-${JOB_NAME}-${BUILD_NUMBER}". Convenient to put into a 29 | # resource file, a jar file, etc for easier identification. 30 | 31 | ./configure --prefix=${WORKSPACE:-`pwd`}/install-${BUILD_TAG:-`date +"Y%m%d-%H%M%S"`} \ 32 | TESTSEQRUN="valgrind --quiet --leak-check=full" \ 33 | TESTMPIRUN="mpiexec -n NP valgrind --quiet --leak-check=full" 34 | 35 | make -s clean && make -s && make -s check && make -s ptest && make -s distclean 36 | -------------------------------------------------------------------------------- /test/largefile/parallel_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2018, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | # remove file system type prefix if there is any 14 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 15 | 16 | MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"` 17 | # echo "MPIRUN = ${MPIRUN}" 18 | # echo "check_PROGRAMS=${check_PROGRAMS}" 19 | 20 | # turn off safe mode for large tests 21 | export PNETCDF_SAFE_MODE=0 22 | 23 | # prevent user environment setting of PNETCDF_HINTS to interfere 24 | unset PNETCDF_HINTS 25 | 26 | for i in ${check_PROGRAMS} ; do 27 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 28 | ${MPIRUN} ./$i ${TESTOUTDIR}/$i.nc 29 | 30 | # echo "--- validating file ${TESTOUTDIR}/$i.nc" 31 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.nc 32 | rm -f ${OUTDIR}/$i.nc 33 | # echo "" 34 | 35 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 36 | # echo "---- test burst buffering feature" 37 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 38 | ${MPIRUN} ./$i ${TESTOUTDIR}/$i.bb.nc 39 | unset PNETCDF_HINTS 40 | 41 | # echo "--- validating file ${TESTOUTDIR}/$i.bb.nc" 42 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.bb.nc 43 | fi 44 | 45 | rm -f ${OUTDIR}/$i.bb.nc 46 | done 47 | 48 | -------------------------------------------------------------------------------- /test/largefile/seq_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | 12 | # remove file system type prefix if there is any 13 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 14 | 15 | # disable safe mode, as large tests already run slow 16 | export PNETCDF_SAFE_MODE=0 17 | 18 | # prevent user environment setting of PNETCDF_HINTS to interfere 19 | unset PNETCDF_HINTS 20 | 21 | for i in ${TESTPROGRAMS}; do 22 | ${TESTSEQRUN} ./$i ${TESTOUTDIR}/$i.nc 23 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$i.nc 24 | rm -f ${OUTDIR}/$i.nc 25 | done 26 | -------------------------------------------------------------------------------- /test/largefile/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | outfile=`basename $1` 12 | 13 | # remove file system type prefix if there is any 14 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 15 | 16 | # disable safe mode, as large tests already run slow 17 | export PNETCDF_SAFE_MODE=0 18 | 19 | # prevent user environment setting of PNETCDF_HINTS to interfere 20 | unset PNETCDF_HINTS 21 | 22 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 23 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 24 | rm -f ${OUTDIR}/$outfile.nc 25 | 26 | # echo "" 27 | 28 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 29 | echo "" 30 | echo "---- testing burst buffering" 31 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 32 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 33 | unset PNETCDF_HINTS 34 | 35 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 36 | 37 | rm -f ${OUTDIR}/$outfile.nc 38 | fi 39 | -------------------------------------------------------------------------------- /test/mcs-environment.soft: -------------------------------------------------------------------------------- 1 | +mpich-3.2-gcc-6.2.0 2 | +gcc-6.2.0 3 | -------------------------------------------------------------------------------- /test/nc4/parallel_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2018, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | # remove file system type prefix if there is any 11 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 12 | 13 | MPIRUN=`echo ${TESTMPIRUN} | ${SED} -e "s/NP/$1/g"` 14 | # echo "MPIRUN = ${MPIRUN}" 15 | # echo "check_PROGRAMS=${check_PROGRAMS}" 16 | 17 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 18 | if test ${PNETCDF_DEBUG} = 1 ; then 19 | safe_modes="0 1" 20 | else 21 | safe_modes="0" 22 | fi 23 | 24 | # prevent user environment setting of PNETCDF_HINTS to interfere 25 | unset PNETCDF_HINTS 26 | 27 | for i in ${check_PROGRAMS} ; do 28 | for j in ${safe_modes} ; do 29 | for intra_aggr in 0 1 ; do 30 | if test "$j" = 1 ; then # test only in safe mode 31 | export PNETCDF_HINTS="romio_no_indep_rw=true" 32 | else 33 | export PNETCDF_HINTS= 34 | fi 35 | if test "$intra_aggr" = 1 ; then 36 | export PNETCDF_HINTS="${PNETCDF_HINTS};nc_num_aggrs_per_node=2" 37 | fi 38 | export PNETCDF_SAFE_MODE=$j 39 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 40 | ${MPIRUN} ./$i ${TESTOUTDIR}/$i.nc 41 | done 42 | done 43 | rm -f ${OUTDIR}/$i.nc 44 | rm -f ${OUTDIR}/$i.nc.cdf4 45 | done 46 | 47 | -------------------------------------------------------------------------------- /test/nc4/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | outfile=`basename $1` 11 | 12 | # remove file system type prefix if there is any 13 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 14 | 15 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 16 | if test ${PNETCDF_DEBUG} = 1 ; then 17 | safe_modes="0 1" 18 | else 19 | safe_modes="0" 20 | fi 21 | 22 | # prevent user environment setting of PNETCDF_HINTS to interfere 23 | unset PNETCDF_HINTS 24 | 25 | for j in ${safe_modes} ; do 26 | export PNETCDF_SAFE_MODE=$j 27 | # echo "set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 28 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 29 | done 30 | 31 | rm -f ${OUTDIR}/$outfile.nc 32 | rm -f ${OUTDIR}/$outfile.nc.cdf4 33 | 34 | -------------------------------------------------------------------------------- /test/nc_test/README: -------------------------------------------------------------------------------- 1 | This test is ported from Unidata netCDF-3.5 to test the functionality 2 | of the PnetCDF API C interface particularly on a single processor. 3 | 4 | The test programs have been modified and the typical way to run the test is: 5 | (1) " ./nc_test -d output_folder" 6 | This command test files in CDF-1 format 7 | (2) " ./nc_test -2 -d output_folder" 8 | This command test files in CDF-2 format 9 | (3) " ./nc_test -5 -d output_folder" 10 | This command test files in CDF-5 format 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/nc_test/error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | * 5 | * $Id$ 6 | */ 7 | 8 | #include /* because gcc 2.7.2.2 doesn't define size_t */ 9 | /* in and it cannot hurt */ 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | extern int nfails; /* number of failures in specific test */ 16 | extern int max_nmpt; /* max. number of messages per test */ 17 | 18 | /* Prototypes */ 19 | void error(const char *fmt, ...); 20 | void print(const char *fmt, ...); 21 | int ifFail(const int expr, const int line, const char *file, const char *func); 22 | void print_n_size_t(int nelems, const MPI_Offset *array); 23 | 24 | /* 25 | * Use for logging error conditions 26 | */ 27 | void 28 | error(const char *fmt, ...) 29 | { 30 | va_list args ; 31 | 32 | va_start(args, fmt) ; 33 | if (nfails <= max_nmpt) 34 | (void) vfprintf(stderr,fmt,args) ; 35 | va_end(args) ; 36 | } 37 | 38 | /* 39 | * Use for general printing (other than error conditions) 40 | * This also currently goes to stderr, but this could change 41 | */ 42 | void 43 | print(const char *fmt, ...) 44 | { 45 | va_list args ; 46 | 47 | va_start(args, fmt) ; 48 | (void) vfprintf(stderr,fmt,args) ; 49 | va_end(args) ; 50 | } 51 | 52 | /* 53 | * Called by macro IF 54 | */ 55 | int 56 | ifFail(const int expr, const int line, const char *file, const char *func) 57 | { 58 | if (expr) { 59 | ++nfails; 60 | error("\n\tFAILURE at line %d of %s in %s: ", line, func, file); 61 | } 62 | return expr; 63 | } 64 | 65 | /* TODO: 66 | * This diagnostic doesn't fit very well with the diagnostic message 67 | * "architecture" of this program. 68 | */ 69 | void 70 | print_n_size_t(int nelems, const MPI_Offset *array) 71 | { 72 | fprintf(stderr, "["); 73 | while(nelems-- > 0) 74 | { 75 | fprintf(stderr, "%ld", (long)*array++); 76 | if(nelems > 0) 77 | fprintf(stderr, " "); 78 | } 79 | fprintf(stderr, "]"); 80 | } 81 | -------------------------------------------------------------------------------- /test/nc_test/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003, Northwestern University and Argonne National Laboratory 3 | * See COPYRIGHT notice in top-level directory. 4 | */ 5 | /* $Id$ */ 6 | 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* Print error message to stderr, don't exit */ 13 | extern void error (const char *fmt, ...) 14 | #ifdef _GNUC_ 15 | __attribute__ ((format (printf, 1, 2))) 16 | #endif 17 | ; 18 | 19 | 20 | void print(const char *fmt, ...) 21 | #ifdef _GNUC_ 22 | __attribute__ ((format (printf, 1, 2))) 23 | #endif 24 | ; 25 | 26 | 27 | extern int ifFail(const int expr, const int line, const char *file, const char *func); 28 | 29 | extern void 30 | print_n_size_t(int nelems, const MPI_Offset *array); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #define IF(EXPR) if (ifFail(EXPR, __LINE__, __FILE__, __func__)) 37 | #define ELSE_NOK else {nok++;} 38 | -------------------------------------------------------------------------------- /test/nc_test/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | # remove file system type prefix if there is any 16 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 17 | 18 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 19 | if test ${PNETCDF_DEBUG} = 1 ; then 20 | safe_modes="0 1" 21 | else 22 | safe_modes="0" 23 | fi 24 | 25 | # prevent user environment setting of PNETCDF_HINTS to interfere 26 | unset PNETCDF_HINTS 27 | 28 | for j in ${safe_modes} ; do 29 | export PNETCDF_SAFE_MODE=$j 30 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 31 | 32 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 33 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 34 | # echo "" 35 | 36 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 37 | echo "" 38 | echo "---- testing burst buffering" 39 | 40 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 41 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.bb.nc 42 | unset PNETCDF_HINTS 43 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.bb.nc 44 | 45 | # echo "--- ncmpidiff $outfile.nc $outfile.bb.nc ---" 46 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$outfile.nc ${TESTOUTDIR}/$outfile.bb.nc 47 | fi 48 | rm -f ${OUTDIR}/$outfile.nc 49 | rm -f ${OUTDIR}/$outfile.bb.nc 50 | rm -f ${OUTDIR}/$outfile.nc.2 51 | rm -f ${OUTDIR}/$outfile.bb.nc.2 52 | done 53 | 54 | -------------------------------------------------------------------------------- /test/nf90_test/README: -------------------------------------------------------------------------------- 1 | This test is ported from ../nf_test to test the functionality 2 | of the PnetCDF API Fortran 90 interface particularly on a single processor. 3 | 4 | -------------------------------------------------------------------------------- /test/nf90_test/nf90_error.F90: -------------------------------------------------------------------------------- 1 | ! 2 | ! Copyright (C) 2013, Northwestern University and Argonne National Laboratory 3 | ! See COPYRIGHT notice in top-level directory. 4 | ! 5 | ! $Id$ 6 | ! 7 | 8 | ! 9 | ! Use for logging error messages 10 | ! 11 | subroutine error(msg) 12 | use pnetcdf 13 | implicit none 14 | character*(*) msg 15 | #include "tests.inc" 16 | 17 | nfails = nfails + 1 18 | if (nfails .le. max_nmpt) print *, msg 19 | end 20 | 21 | 22 | ! 23 | ! Use for logging error conditions 24 | ! 25 | subroutine errori(msg, i) 26 | use pnetcdf 27 | implicit none 28 | character*(*) msg 29 | integer i 30 | #include "tests.inc" 31 | 32 | nfails = nfails + 1 33 | if (nfails .le. max_nmpt) print *, msg, i 34 | end 35 | 36 | 37 | ! 38 | ! Use for logging error conditions 39 | ! 40 | subroutine errord(msg, d) 41 | use pnetcdf 42 | implicit none 43 | character*(*) msg 44 | doubleprecision d 45 | #include "tests.inc" 46 | 47 | nfails = nfails + 1 48 | if (nfails .le. max_nmpt) print *, msg, d 49 | end 50 | 51 | 52 | ! 53 | ! Use for logging error conditions 54 | ! 55 | subroutine errorc(msg, string) 56 | use pnetcdf 57 | implicit none 58 | character*(*) msg 59 | character*(*) string 60 | #include "tests.inc" 61 | 62 | nfails = nfails + 1 63 | if (nfails .le. max_nmpt) print *, msg, & 64 | trim(string) 65 | end 66 | 67 | 68 | ! 69 | ! Use for logging error conditions 70 | ! 71 | subroutine errore(msg, err) 72 | use pnetcdf 73 | implicit none 74 | character*(*) msg 75 | integer err 76 | #include "tests.inc" 77 | 78 | nfails = nfails + 1 79 | call errorc(msg, nf90mpi_strerrno(err)) 80 | end 81 | -------------------------------------------------------------------------------- /test/nf_test/README: -------------------------------------------------------------------------------- 1 | This test is ported from Unidata netCDF-3.5 to test the functionality 2 | of the PnetCDF API Fortran interface particularly on a single processor. 3 | 4 | The typical way to run the test includes two steps: 5 | 6 | (1) create test.nc by " ./nf_test -c" 7 | (2) run the test by " ./nf_test -v" 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/nf_test/nf_error.F: -------------------------------------------------------------------------------- 1 | #if 0 2 | Copyright 1996, UCAR/Unidata 3 | See netcdf/COPYRIGHT file for copying and redistribution conditions. 4 | $Id$ 5 | #endif 6 | 7 | 8 | C 9 | C Use for logging error messages 10 | C 11 | subroutine error(msg) 12 | implicit none 13 | character*(*) msg 14 | include "pnetcdf.inc" 15 | #include "tests.inc" 16 | 17 | nfails = nfails + 1 18 | if (nfails .le. max_nmpt) print *, msg 19 | end 20 | 21 | 22 | C 23 | C Use for logging error conditions 24 | C 25 | subroutine errori(msg, i) 26 | implicit none 27 | character*(*) msg 28 | integer i 29 | include "pnetcdf.inc" 30 | #include "tests.inc" 31 | 32 | nfails = nfails + 1 33 | if (nfails .le. max_nmpt) print *, msg, i 34 | end 35 | 36 | 37 | C 38 | C Use for logging error conditions 39 | C 40 | subroutine errord(msg, d) 41 | implicit none 42 | character*(*) msg 43 | doubleprecision d 44 | include "pnetcdf.inc" 45 | #include "tests.inc" 46 | 47 | nfails = nfails + 1 48 | if (nfails .le. max_nmpt) print *, msg, d 49 | end 50 | 51 | 52 | C 53 | C Use for logging error conditions 54 | C 55 | subroutine errorc(msg, string) 56 | implicit none 57 | character*(*) msg 58 | character*(*) string 59 | include "pnetcdf.inc" 60 | #include "tests.inc" 61 | 62 | integer MY_LEN_TRIM 63 | nfails = nfails + 1 64 | if (nfails .le. max_nmpt) print *, msg, 65 | + TRIM(string) ! string(1:len_trim(string)) 66 | end 67 | 68 | 69 | C 70 | C Use for logging error conditions 71 | C 72 | subroutine errore(msg, err) 73 | implicit none 74 | character*(*) msg 75 | integer err 76 | include "pnetcdf.inc" 77 | #include "tests.inc" 78 | 79 | nfails = nfails + 1 80 | call errorc(msg, nfmpi_strerrno(err)) 81 | end 82 | -------------------------------------------------------------------------------- /test/nonblocking/README: -------------------------------------------------------------------------------- 1 | There are two test cases in this directory. 2 | (1) C test case 3 | This test case test non-blocking functions. 4 | mpiexec -n 4 mcoll_perf //test the blocking I/O and non-blocking I/O 5 | 6 | The default path to write output is "./". 7 | 8 | You can change the path and output path: 9 | mpiexec -n 4 mcoll_perf -f testfile.nc 10 | 11 | (2) Fortran test case 12 | mpiexec -n 4 mcoll_testf 13 | -------------------------------------------------------------------------------- /test/nonblocking/seq_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # "set -x" expands variables and prints a little + sign before the line 8 | 9 | # Exit immediately if a command exits with a non-zero status. 10 | set -e 11 | 12 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 13 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 14 | 15 | # remove file system type prefix if there is any 16 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 17 | 18 | # prevent user environment setting of PNETCDF_HINTS to interfere 19 | unset PNETCDF_HINTS 20 | 21 | ${TESTSEQRUN} ./mcoll_perf ${TESTOUTDIR}/testfile 22 | # seq is not available on FreeBSD otherwise we can use: for j in `seq 0 9` 23 | for j in 0 1 2 3 4 5 6 7 8 9 ; do 24 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/testfile.2.4.$j.nc 25 | done 26 | 27 | # echo "" 28 | 29 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 30 | echo "" 31 | echo "---- testing burst buffering" 32 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 33 | ${TESTSEQRUN} ./mcoll_perf ${TESTOUTDIR}/testfile_bb 34 | unset PNETCDF_HINTS 35 | for j in 0 1 2 3 4 5 6 7 8 9 ; do 36 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/testfile_bb.2.4.$j.nc 37 | 38 | # echo "--- ncmpidiff testfile.2.4.$j.nc testfile_bb.2.4.$j.nc ---" 39 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/testfile.2.4.$j.nc ${TESTOUTDIR}/testfile_bb.2.4.$j.nc 40 | done 41 | fi 42 | 43 | for j in 0 1 2 3 4 5 6 7 8 9 ; do 44 | rm -f ${OUTDIR}/testfile.2.4.$j.nc 45 | rm -f ${OUTDIR}/testfile_bb.2.4.$j.nc 46 | done 47 | 48 | -------------------------------------------------------------------------------- /test/nonblocking/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | # remove file system type prefix if there is any 16 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 17 | 18 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 19 | if test ${PNETCDF_DEBUG} = 1 ; then 20 | safe_modes="0 1" 21 | else 22 | safe_modes="0" 23 | fi 24 | 25 | # prevent user environment setting of PNETCDF_HINTS to interfere 26 | unset PNETCDF_HINTS 27 | 28 | for j in ${safe_modes} ; do 29 | export PNETCDF_SAFE_MODE=$j 30 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 31 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 32 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 33 | # echo "" 34 | 35 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 36 | echo "" 37 | echo "---- testing burst buffering" 38 | 39 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 40 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.bb.nc 41 | unset PNETCDF_HINTS 42 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.bb.nc 43 | 44 | # burst buffering does not support nonblocking requests in define mode 45 | if test $1 != "./i_varn_indef" ; then 46 | # echo "--- ncmpidiff $outfile.nc $outfile.bb.nc ---" 47 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$outfile.nc ${TESTOUTDIR}/$outfile.bb.nc 48 | fi 49 | fi 50 | done 51 | rm -f ${OUTDIR}/$outfile.nc 52 | rm -f ${OUTDIR}/$outfile.bb.nc 53 | 54 | 55 | -------------------------------------------------------------------------------- /test/test_installed/batch.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | #SBATCH --job-name=pnetcdf_test 4 | #SBATCH --qos=debug 5 | #SBATCH -t 00:05:00 6 | #SBATCH --nodes=1 7 | #SBATCH -o out.%j 8 | #SBATCH -e out.%j 9 | #SBATCH --constraint=cpu 10 | #SBATCH --tasks-per-node=4 11 | 12 | cd $PWD 13 | 14 | # exit immediately when any of the runs failed 15 | set -e 16 | 17 | export LD_LIBRARY_PATH=__PNETCDF_DIR__/lib:$LD_LIBRARY_PATH 18 | 19 | OUT_DIR=__OUT_DIR__ 20 | 21 | NP=4 22 | num_pass=0 23 | 24 | for exec in __TEST_PROGS__ ; do 25 | OUTFILE="$OUT_DIR/$exec.nc" 26 | CMD_OPTS= 27 | if test "x$exec" = xpres_temp_4D_rd ; then 28 | OUTFILE="$OUT_DIR/pres_temp_4D_wr.nc" 29 | elif test "x$exec" = xtst_cdl_hdr_parser ; then 30 | CMD_OPTS="-q ../cdl/cdl_header.txt -o" 31 | fi 32 | CMD="__RUN_CMD__ -n $NP $exec $CMD_OPTS $OUTFILE" 33 | eval "$CMD" 34 | num_pass=$(expr $num_pass + 1) 35 | done 36 | 37 | for exec in __EXAMPLE_PROGS__ ; do 38 | OUTFILE="$OUT_DIR/$exec.nc" 39 | CMD_OPTS= 40 | if test "x$exec" = xget_vara ; then 41 | OUTFILE="$OUT_DIR/put_vara.nc" 42 | elif test "x$exec" = xcreate_from_cdl ; then 43 | CMD_OPTS="../../examples/C/cdl_header.txt -o" 44 | fi 45 | CMD="__RUN_CMD__ -n $NP $exec -q $CMD_OPTS $OUTFILE" 46 | eval "$CMD" 47 | extension="${exec##*.}" 48 | if test "x$extension" = xexe90 ; then 49 | printf '*** TESTING F90 %-50s ------ pass\n' "examples/F90/$exec" 50 | elif test "x$extension" = xexe77 ; then 51 | printf '*** TESTING F77 %-50s ------ pass\n' "examples/F77/$exec" 52 | else 53 | printf '*** TESTING C %-50s ------ pass\n' "examples/C/$exec" 54 | fi 55 | num_pass=$(expr $num_pass + 1) 56 | done 57 | 58 | printf '\nTotal number of tested programs: %d\n\n' "$num_pass" 59 | 60 | 61 | -------------------------------------------------------------------------------- /test/test_installed/interactive.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | # exit immediately when any of the runs failed 4 | set -e 5 | 6 | export LD_LIBRARY_PATH=__PNETCDF_DIR__/lib:$LD_LIBRARY_PATH 7 | 8 | OUT_DIR=__OUT_DIR__ 9 | 10 | NP=4 11 | num_pass=0 12 | 13 | for exec in __TEST_PROGS__ ; do 14 | OUTFILE="$OUT_DIR/$exec.nc" 15 | CMD_OPTS= 16 | if test "x$exec" = xpres_temp_4D_rd ; then 17 | OUTFILE="$OUT_DIR/pres_temp_4D_wr.nc" 18 | elif test "x$exec" = xtst_cdl_hdr_parser ; then 19 | CMD_OPTS="-q ../cdl/cdl_header.txt -o" 20 | fi 21 | CMD="__RUN_CMD__ -n $NP $exec $CMD_OPTS $OUTFILE" 22 | eval "$CMD" 23 | num_pass=$(expr $num_pass + 1) 24 | done 25 | 26 | for exec in __EXAMPLE_PROGS__ ; do 27 | OUTFILE="$OUT_DIR/$exec.nc" 28 | CMD_OPTS= 29 | if test "x$exec" = xget_vara ; then 30 | OUTFILE="$OUT_DIR/put_vara.nc" 31 | elif test "x$exec" = xcreate_from_cdl ; then 32 | CMD_OPTS="../../examples/C/cdl_header.txt -o" 33 | fi 34 | CMD="__RUN_CMD__ -n $NP $exec -q $CMD_OPTS $OUTFILE" 35 | eval "$CMD" 36 | extension="${exec##*.}" 37 | if test "x$extension" = xexe90 ; then 38 | printf '*** TESTING F90 %-50s ------ pass\n' "examples/F90/$exec" 39 | elif test "x$extension" = xexe77 ; then 40 | printf '*** TESTING F77 %-50s ------ pass\n' "examples/F77/$exec" 41 | else 42 | printf '*** TESTING C %-50s ------ pass\n' "examples/C/$exec" 43 | fi 44 | num_pass=$(expr $num_pass + 1) 45 | done 46 | 47 | printf '\nTotal number of tested programs: %d\n\n' "$num_pass" 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/testcases/redef-good.ncdump: -------------------------------------------------------------------------------- 1 | netcdf test { 2 | // file format: CDF-2 (large file) 3 | dimensions: 4 | dim0 = 10 ; 5 | dim1 = 3 ; 6 | dim5 = 5 ; 7 | dim9 = 9 ; 8 | dim2 = 10 ; 9 | variables: 10 | int xyz(dim0, dim1) ; 11 | int connect(dim0, dim5) ; 12 | int connect_exterior(dim0, dim9) ; 13 | double xyz_r(dim0, dim2) ; 14 | data: 15 | 16 | xyz = 17 | 0, 1, 2, 18 | 3, 4, 5, 19 | 6, 7, 8, 20 | 9, 10, 11, 21 | 12, 13, 14, 22 | 15, 16, 17, 23 | 18, 19, 20, 24 | 21, 22, 23, 25 | 24, 25, 26, 26 | 27, 28, 29 ; 27 | 28 | connect = 29 | 0, 1, 2, 3, 4, 30 | 5, 6, 7, 8, 9, 31 | 10, 11, 12, 13, 14, 32 | 15, 16, 17, 18, 19, 33 | 20, 21, 22, 23, 24, 34 | 25, 26, 27, 28, 29, 35 | 30, 31, 32, 33, 34, 36 | 35, 36, 37, 38, 39, 37 | 40, 41, 42, 43, 44, 38 | 45, 46, 47, 48, 49; 39 | 40 | connect_exterior = 41 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 42 | 9, 10, 11, 12, 13, 14, 15, 16, 17, 43 | 18, 19, 20, 21, 22, 23, 24, 25, 26, 44 | 27, 28, 29, 30, 31, 32, 33, 34, 35, 45 | 36, 37, 38, 39, 40, 41, 42, 43, 44, 46 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 47 | 54, 55, 56, 57, 58, 59, 60, 61, 62, 48 | 63, 64, 65, 66, 67, 68, 69, 70, 71, 49 | 72, 73, 74, 75, 76, 77, 78, 79, 80, 50 | 81, 82, 83, 84, 85, 86, 87, 88, 89 ; 51 | 52 | xyz_r = 53 | 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 54 | 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 55 | 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 56 | 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 57 | 1600, 1681, 1764, 1849, 1936, 2025, 2116, 2209, 2304, 2401, 58 | 2500, 2601, 2704, 2809, 2916, 3025, 3136, 3249, 3364, 3481, 59 | 3600, 3721, 3844, 3969, 4096, 4225, 4356, 4489, 4624, 4761, 60 | 4900, 5041, 5184, 5329, 5476, 5625, 5776, 5929, 6084, 6241, 61 | 6400, 6561, 6724, 6889, 7056, 7225, 7396, 7569, 7744, 7921, 62 | 8100, 8281, 8464, 8649, 8836, 9025, 9216, 9409, 9604, 9801 ; 63 | } 64 | -------------------------------------------------------------------------------- /test/testcases/wrap_runs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2003, Northwestern University and Argonne National Laboratory 4 | # See COPYRIGHT notice in top-level directory. 5 | # 6 | 7 | # Exit immediately if a command exits with a non-zero status. 8 | set -e 9 | 10 | VALIDATOR=../../src/utils/ncvalidator/ncvalidator 11 | NCMPIDIFF=../../src/utils/ncmpidiff/ncmpidiff 12 | 13 | outfile=`basename $1` 14 | 15 | # remove file system type prefix if there is any 16 | OUTDIR=`echo "$TESTOUTDIR" | cut -d: -f2-` 17 | 18 | # echo "PNETCDF_DEBUG = ${PNETCDF_DEBUG}" 19 | if test ${PNETCDF_DEBUG} = 1 ; then 20 | safe_modes="0 1" 21 | else 22 | safe_modes="0" 23 | fi 24 | 25 | # prevent user environment setting of PNETCDF_HINTS to interfere 26 | unset PNETCDF_HINTS 27 | 28 | for j in ${safe_modes} ; do 29 | export PNETCDF_SAFE_MODE=$j 30 | # echo "---- set PNETCDF_SAFE_MODE ${PNETCDF_SAFE_MODE}" 31 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.nc 32 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.nc 33 | # echo "" 34 | 35 | if test "x${ENABLE_BURST_BUFFER}" = x1 ; then 36 | echo "" 37 | echo "---- testing burst buffering" 38 | 39 | export PNETCDF_HINTS="nc_burst_buf=enable;nc_burst_buf_dirname=${TESTOUTDIR};nc_burst_buf_overwrite=enable" 40 | ${TESTSEQRUN} $1 ${TESTOUTDIR}/$outfile.bb.nc 41 | unset PNETCDF_HINTS 42 | ${TESTSEQRUN} ${VALIDATOR} -q ${TESTOUTDIR}/$outfile.bb.nc 43 | 44 | # running ncmpidiff on last_large_var on one process requires more than 45 | # 2 GB memory. Use more processes to check. Disable the check for now. 46 | if test "$1" != "./last_large_var" ; then 47 | # echo "--- ncmpidiff $outfile.nc $outfile.bb.nc ---" 48 | ${TESTSEQRUN} ${NCMPIDIFF} -q ${TESTOUTDIR}/$outfile.nc ${TESTOUTDIR}/$outfile.bb.nc 49 | fi 50 | fi 51 | done 52 | 53 | rm -f ${OUTDIR}/$outfile.nc* 54 | rm -f ${OUTDIR}/$outfile.bb.nc* 55 | 56 | -------------------------------------------------------------------------------- /travis-run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | # Coverity Scan addons build_command_prepend already runs configure 5 | # ./configure 6 | 7 | # Coverity Scan addons build_command already runs make distcheck 8 | # make distcheck -s V=1 LIBTOOLFLAGS=--silent DISTCHECK_CONFIGURE_FLAGS="--silent" 9 | 10 | # make -s V=1 LIBTOOLFLAGS=--silent ptest 11 | 12 | # make distcheck -s V=1 LIBTOOLFLAGS=--silent DISTCHECK_CONFIGURE_FLAGS="--silent --enable-subfiling --enable-thread-safe --enable-burst_buffering --enable-shared --enable-debug" 13 | 14 | make -s distclean 15 | --------------------------------------------------------------------------------