Skip to content

Commit

Permalink
more work on netcdf integration layer
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 3, 2019
1 parent 36e51e7 commit 0734bad
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 131 deletions.
5 changes: 5 additions & 0 deletions src/clib/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,11 @@ extern "C" {
const long long *op);
int PIOc_put_vard_ulonglong(int ncid, int varid, int decompid, const PIO_Offset recnum,
const unsigned long long *op);


int nc_init_intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, int rearr,
int *iosysidp);

#if defined(__cplusplus)
}
#endif
Expand Down
5 changes: 4 additions & 1 deletion src/ncint/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
## layer.
# Ed Hartnett 7/3/19

# Find pio.h.
AM_CPPFLAGS = -I$(top_srcdir)/src/clib

# This is our output. The ncint convenience library.
noinst_LTLIBRARIES = libncint.la

# The source files.
libncint_la_SOURCES = ncintdispatch.c ncintdispatch.h
libncint_la_SOURCES = ncintdispatch.c ncintdispatch.h ncint_pio.c
23 changes: 23 additions & 0 deletions src/ncint/ncint_pio.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @file
* @internal Additional nc_* functions to support netCDF integration.
*
* @author Ed Hartnett
*/

#include "config.h"
#include <stdlib.h>
#include <pio_internal.h>
#include "ncintdispatch.h"

/**
* Same as PIOc_Init_Intracomm().
*
* @author Ed Hartnett
*/
int
nc_init_intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, int rearr,
int *iosysidp)
{
return PIO_NOERR;
}
134 changes: 4 additions & 130 deletions tests/ncint/tst_pio_udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,149 +13,23 @@

extern NC_Dispatch NCINT_dispatcher;

/* int */
/* tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp, */
/* void *parameters, const NC_Dispatch *dispatch, NC *nc_file) */
/* { */
/* return NC_NOERR; */
/* } */

/* int */
/* tst_abort(int ncid) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* int */
/* tst_close(int ncid, void *v) */
/* { */
/* return NC_NOERR; */
/* } */

/* int */
/* tst_inq_format(int ncid, int *formatp) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* int */
/* tst_inq_format_extended(int ncid, int *formatp, int *modep) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* int */
/* tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count, */
/* void *value, nc_type t) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* This is the dispatch object that holds pointers to all the
* functions that make up the HDF4 dispatch interface. */
/* static NC_Dispatch tst_dispatcher = { */

/* NC_FORMATX_UDF0, */

/* NC_RO_create, */
/* tst_open, */

/* NC_RO_redef, */
/* NC_RO__enddef, */
/* NC_RO_sync, */
/* tst_abort, */
/* tst_close, */
/* NC_RO_set_fill, */
/* NC_NOTNC3_inq_base_pe, */
/* NC_NOTNC3_set_base_pe, */
/* tst_inq_format, */
/* tst_inq_format_extended, */

/* NC4_inq, */
/* NC4_inq_type, */

/* NC_RO_def_dim, */
/* NC4_inq_dimid, */
/* NC4_inq_dim, */
/* NC4_inq_unlimdim, */
/* NC_RO_rename_dim, */

/* NC4_inq_att, */
/* NC4_inq_attid, */
/* NC4_inq_attname, */
/* NC_RO_rename_att, */
/* NC_RO_del_att, */
/* NC4_get_att, */
/* NC_RO_put_att, */

/* NC_RO_def_var, */
/* NC4_inq_varid, */
/* NC_RO_rename_var, */
/* tst_get_vara, */
/* NC_RO_put_vara, */
/* NCDEFAULT_get_vars, */
/* NCDEFAULT_put_vars, */
/* NCDEFAULT_get_varm, */
/* NCDEFAULT_put_varm, */

/* NC4_inq_var_all, */

/* NC_NOTNC4_var_par_access, */
/* NC_RO_def_var_fill, */

/* NC4_show_metadata, */
/* NC4_inq_unlimdims, */

/* NC4_inq_ncid, */
/* NC4_inq_grps, */
/* NC4_inq_grpname, */
/* NC4_inq_grpname_full, */
/* NC4_inq_grp_parent, */
/* NC4_inq_grp_full_ncid, */
/* NC4_inq_varids, */
/* NC4_inq_dimids, */
/* NC4_inq_typeids, */
/* NC4_inq_type_equal, */
/* NC_NOTNC4_def_grp, */
/* NC_NOTNC4_rename_grp, */
/* NC4_inq_user_type, */
/* NC4_inq_typeid, */

/* NC_NOTNC4_def_compound, */
/* NC_NOTNC4_insert_compound, */
/* NC_NOTNC4_insert_array_compound, */
/* NC_NOTNC4_inq_compound_field, */
/* NC_NOTNC4_inq_compound_fieldindex, */
/* NC_NOTNC4_def_vlen, */
/* NC_NOTNC4_put_vlen_element, */
/* NC_NOTNC4_get_vlen_element, */
/* NC_NOTNC4_def_enum, */
/* NC_NOTNC4_insert_enum, */
/* NC_NOTNC4_inq_enum_member, */
/* NC_NOTNC4_inq_enum_ident, */
/* NC_NOTNC4_def_opaque, */
/* NC_NOTNC4_def_var_deflate, */
/* NC_NOTNC4_def_var_fletcher32, */
/* NC_NOTNC4_def_var_chunking, */
/* NC_NOTNC4_def_var_endian, */
/* NC_NOTNC4_def_var_filter, */
/* NC_NOTNC4_set_var_chunk_cache, */
/* NC_NOTNC4_get_var_chunk_cache */
/* }; */

int
main(int argc, char **argv)
{
printf("\n*** Testing netCDF integration layer.\n");
printf("*** testing simple use of netCDF integration layer format...");
{
int ncid;
int iosysid;
NC_Dispatch *disp_in;

/* Create an empty file to play with. */
if (nc_create(FILE_NAME, 0, &ncid)) ERR;
if (nc_close(ncid)) ERR;

/* Initialize the intracomm. */
if (nc_init_intracomm(NULL, 1, 1, 0, 0, &iosysid)) ERR;

/* Add our user defined format. */
if (nc_def_user_format(NC_UDF0, &NCINT_dispatcher, NULL)) ERR;

Expand Down

0 comments on commit 0734bad

Please sign in to comment.