parallel NetCDF: One or more variable sizes violate format constraints

Felicity Graham f.s.graham at utas.edu.au
Mon Nov 9 20:47:22 CST 2015


Hello,

I'd like to use parallel netcdf in C to read the only variable from a 16GB netcdf file and perform some operations.

The file format is classic, and was created with netcdf 3.6.3. I'm using openmpi 1.6.3 and pnetcdf 1.4.1.

I've tested on a separate netcdf-4 formatted file, and the reading works fine, but on the classic file, I get the error  NetCDF: One or more variable sizes violate format constraints when I try to open the file (ncmpi_open).

A stripped down version of the C code is below.

Your help is much appreciated.

Cheers,
Felicity



#include <stdio.h>

#include <mpi.h>

#include <pnetcdf.h>


#define FILE_NAME "<path_to_file>/hf_topog.nc"

#define VAR_NAME "hf_topog"


#define CHECK_ERR {\

    if (err!=NC_NOERR) {\

        printf("Error at line=%d: %s\n", __LINE__, ncmpi_strerror(err));\

        goto fn_exit;\

    }}


int main(int argc, char **argv)

{

  int err, varid, ncid;

  float * topog_in;


  MPI_Init(&argc,&argv);


  err = ncmpi_open(MPI_COMM_WORLD, FILE_NAME, NC_NOWRITE, MPI_INFO_NULL, &ncid);

  CHECK_ERR;


  err = ncmpi_close(ncid);

  CHECK_ERR;


fn_exit:

  MPI_Finalize();


  return 0;

}




University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/parallel-netcdf/attachments/20151110/a94f9045/attachment.html>


More information about the parallel-netcdf mailing list