Skip to content

Commit

Permalink
Merge pull request #1212 from NCAR/ejh_openfile_fix_2
Browse files Browse the repository at this point in the history
Fix problem with openfile and variable metadata
  • Loading branch information
edhartnett authored Sep 21, 2017
2 parents 5298f08 + fd63eaa commit 4b8af28
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 144 deletions.
6 changes: 3 additions & 3 deletions src/clib/pio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int PIOc_openfile(int iosysid, int *ncidp, int *iotype, const char *filename,
{
LOG((1, "PIOc_openfile iosysid %d *iotype %d filename %s mode %d", iosysid,
iotype ? *iotype: 0, filename, mode));
return openfile_int(iosysid, ncidp, iotype, filename, mode, 1);
return PIOc_openfile_retry(iosysid, ncidp, iotype, filename, mode, 1);
}

/**
Expand All @@ -62,7 +62,7 @@ int PIOc_openfile2(int iosysid, int *ncidp, int *iotype, const char *filename,
{
LOG((1, "PIOc_openfile2 iosysid %d *iotype %d filename %s mode %d", iosysid,
iotype ? *iotype : 0, filename, mode));
return openfile_int(iosysid, ncidp, iotype, filename, mode, 0);
return PIOc_openfile_retry(iosysid, ncidp, iotype, filename, mode, 0);
}

/**
Expand Down Expand Up @@ -102,7 +102,7 @@ int PIOc_open(int iosysid, const char *path, int mode, int *ncidp)

/* Open the file. If the open fails, do not retry as serial
* netCDF. Just return the error code. */
return openfile_int(iosysid, ncidp, &iotype, path, mode, 0);
return PIOc_openfile_retry(iosysid, ncidp, &iotype, path, mode, 0);
}

/**
Expand Down
12 changes: 4 additions & 8 deletions src/clib/pio_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ extern "C" {
int pio_delete_file_from_list(int ncid);
void pio_add_to_file_list(file_desc_t *file);
/* Add a var_desc_t to a varlist. */
int add_to_varlist(int varid, int rec_var, int pio_type, int pio_type_size, MPI_Datatype mpi_type,
int mpi_type_size, var_desc_t **varlist);
int add_to_varlist(int varid, int rec_var, int pio_type, int pio_type_size,
MPI_Datatype mpi_type, int mpi_type_size, var_desc_t **varlist);

/* Find a var_desc_t in a varlist. */
int get_var_desc(int varid, var_desc_t **varlist, var_desc_t **var_desc);
Expand All @@ -128,14 +128,10 @@ extern "C" {
/* Create a file (internal function). */
int PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename, int mode);

/* Open a file and learn about metadata. */
int openfile_int(int iosysid, int *ncidp, int *iotype, const char *filename,
int mode, int retry);

/* Open a file with optional retry as netCDF-classic if first
* iotype does not work. */
int PIOc_openfile_retry(int iosysid, int *ncidp, int *iotype,
const char *filename, int mode, int retry);
int PIOc_openfile_retry(int iosysid, int *ncidp, int *iotype, const char *filename, int mode,
int retry);

iosystem_desc_t *pio_get_iosystem_from_id(int iosysid);
int pio_add_to_iosystem_list(iosystem_desc_t *ios);
Expand Down
Loading

0 comments on commit 4b8af28

Please sign in to comment.